Depending on the arguments passed to the function, I want the result to be either of String or Binary type.
I declared the functions as
Code: Select all
FUNCTION StrConv (Expression AS String, ConversionSetting AS Int, RegionalIdentifier AS Int, RegionalIDType AS Int) AS USUAL
...
FUNCTION StrConv (Expression AS Binary, ConversionSetting AS Int, RegionalIdentifier AS Int, RegionalIDType AS Int) AS USUAL
When the result is a Binary, as in Base64 to Single Byte conversion, there is not much I can do with the result except displaying it. If i try to use what's returned in some other context, an assignment into a Binary variable, for instance, a runtime error System.InvalidCastException pops up.
Code: Select all
? StrConv("Abcd", STRCNV_SB_BASE64) && displays QWJjZA==, which is good
? StrConv("QWJjZA==", STRCNV_BASE64_SB) && displays 0h41626364, which is also good
* but it seems that there is nothing else besides displaying that this returned value can do