|Newbie questions about Pliant
The "select" function
What data types are compatible with this function?
|Message posted by maybe Bryan on 2002/06/02 18:28:39
|The following basic select function works:
select "" (var Str choice)
option "hot dogs" "1"
option "wooly mamoths" "2"
However if we change the return type to integer then it fails:
select "" (var Int choice)
option "hot dogs" 1
option "wooly mamoths" 2
Does select only accept strings as return arguments? Would a string to integer conversion do the trick?
select "" integer:(var Str choice)
Actually I don't know if such a conversion function exists, i'm just guessing.
|Message posted by maybe Hubert Tonneau on 2002/06/02 18:34:25
|> Does select only accept strings as return arguments?
> Would a string to integer conversion do the trick?
var Str choice
choice parse (var Int i)
will try to convert the string to an integer. 'parse' method returns
'true' (a boolean) if the string was coding a valid integer.