Hi All, given the code below, I have a generic routine to read parameters that are of varying lengths and all form part of a UDT. Because they are of varying length, the Get_Code function parameter is defined without a length and so the last character in this example corrupts my period.
Is there any way without using an interim assign or extra parameter that the function can determine the size of the passed parameter? I suspect not but ask anyway...
Thanks - Carlo
Is there any way without using an interim assign or extra parameter that the function can determine the size of the passed parameter? I suspect not but ask anyway...
Code:
#COMPILE EXE #DIM ALL TYPE TabDataType Office_Code AS ASCIIZ * 9 Currency_Code AS ASCIIZ * 5 Period AS LONG END TYPE FUNCTION Get_Code(zCode AS ASCIIZ) AS LONG zCode = "<ANY>" END FUNCTION FUNCTION PBMAIN () AS LONG STATIC TabData AS TabDataType STATIC AnyString AS STRING TabData.Period = 200910 TabData.Office_Code = "1234567890" TabData.Currency_Code = "<ANY>" AnyString = "Pass 1:Currency = "+ TabData.Currency_Code+" Period="+FORMAT$(TabData.Period) Get_Code(TabData.Currency_Code) AnyString = AnyString+$CRLF+"Pass 2:Currency = "+ TabData.Currency_Code+" Period="+FORMAT$(TabData.Period) MSGBOX AnyString,,"Content of AnyString" END FUNCTION
Comment