[Gambas-user] casting or changing datatype.
Benoit Minisini
gambas at ...1...
Sat Jan 14 08:23:28 CET 2006
On Saturday 14 January 2006 03:10, johnf wrote:
> Hi,
> I wonder if it is possible to pass a string to a method and have the string
> used to for the name of a different datatype.
>
> dim passStr As String
>
> passStr = "custData"
> myresult(passStr)
>
> public sub myResult( thestr as String) as Result
>
> dim thestr as Result
>
> return Result
> end
>
> John
>
This is a nonsense, as the name of the variables disappear once the program is
compiled.
I think you mix the syntax (what ou write) and the semantic (what is
executed).
If you compile this code:
public sub myResult(...) as Result
dim XXXXX as Result
return Result
end
Whatever you use as name for 'XXXXX', you will get the same code.
Regards,
--
Benoit Minisini
More information about the User
mailing list