Real ByRef for string variables - AddressOf(stringvar.s)
Posted: Wed Jan 19, 2011 6:51 pm
I would like to have a way to get the address of string variables,
to be ably to pass any string variable by reference
(like many other programming languages support),
so that string variables can be out parameters of procedures.
I suggest: to return the address of the string variable Stringvar.s.
(As opposed to @Stringvar.s, that returns the address of the string data (byte array))
This can then be used like:
or like:
I have started to discuss this topic here
and came to the conclusion, that it should be a feature request.
to be ably to pass any string variable by reference
(like many other programming languages support),
so that string variables can be out parameters of procedures.
I suggest:
Code: Select all
AddressOf(Stringvar.s)
(As opposed to @Stringvar.s, that returns the address of the string data (byte array))
This can then be used like:
Code: Select all
...
Define OutString1.s
Define OutString2.s
...
Procedure MyProcedure(<inParameters>, pOutString1.String, pOutString2.String, ...)
...
pOutString1\s = outresult1
pOutString2\s = outresult2
...
EndProcedure
...
MyProcedure(<inParmeters>, AddressOf(OutString1), AddressOf(OutString2), ...)
...
Code: Select all
...
Define StringA.s
...
*StringVarRefA = AddressOf(StringA)
...
and came to the conclusion, that it should be a feature request.