ims_lenor
15th August 2003, 16:05
I need to give out a Message like this:
message("hy")
but with a variable in it, but this variable is a long and not a String which the message-function want.
how can i convert a long to a string???
gguymer
15th August 2003, 16:10
string STR$( num_expr )
The STR$ function converts integer and floating point expressions to a string.
mark_h
15th August 2003, 16:19
Or you could do message("%d",longvariable).
Mark
ims_lenor
15th August 2003, 16:19
thx a lot!
ims_lenor
15th August 2003, 16:56
a further question:
i wanted to get a random number
i read that i need to take
srand(200)
my_var = random()
but that gives me all the time the same random number!!!!
how can i get a real random number???
KDrysch
15th August 2003, 18:29
As long as you are using the same seed (in your example, 200), you will always get the same random number. You need to use something that keeps changing, like the current time, as the seed for generating the random number.