I am using a macro to format text in a base document and have come across a strange occurrance using
Version: 6.4.7.2
Build ID: 1:6.4.7-0ubuntu0.20.04.1
The intent is to format a number of 4 digit length with trailing text that might also include numbers. The critical part is the first four characters. If they are numbers less than 100 I add leading zeros. So far, so good. If the number is greater than 1000, then no processing need be done, also if there is an alpha-numeric the first four characters need to be numeric unless the field starts with an alpha character, the code works for all of the above UNTIL I enter a number greater than 32767 when I get an
Inadmissible data type
Overflow
message. I extract data from a field using the following code
iSG is set as Integer and fails when I attempt to store sSG value in it (a String) - as I said, it works up to 32767 , I can even enter 32767fsdfwrgghtrhth and it works, but any number above this value falls over
Sub fmtSG
Dim lSG, vSG , oForm, tSG, leftSG
Dim sSG$ , iSG as integer, SGno, z,SGlen, p, j, counteroForm = ThisComponent.DrawPage.Forms.getByIndex(0) ' Main Form
’ oSubForm = oForm.GetByName(“FRM_STAMPS”) ’ SubForm Name
lSG = oForm.findColumn(“SM_SG_REF”) ’ determine location of field
sSG = oForm.getString(lSG) ’ get data from field
SGlen=len(sSG) ’ determine length of the data
iSG = sSG ’ extract numeric info from field
Am I missing something or should I use another method to extract the numbers from the leading edge of the string?