[TF] Rand()
Brought to you by:
kenkeys
|
From: drake at libcom.c. (D. Wilson) - 2003-02-09 06:02:28
|
Quoth James West <ja...@ze...>, on Sun 09 Feb 2003:
> I'm trying to assign the result of rand() to a variable and failing
> horribly, I assumed that:
>
> /def getrandom = /let var1=rand(0,9)%;/echo %(var1}
This sets var1 to the string "rand(0,9)". To evaluate it as an
expression, you need to put $[...] around it, like so:
/def getrandom =/let var1=$[rand(0,9)]%;/echo %{var1}
---> Drake Wilson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://tcp.com/pipermail/tinyfugue/attachments/20030209/4df77ce5/attachment.bin
|