[futurebasic] random strings

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1998 : Group Archive : Group : All Groups

From: Lucy24@...
Date: Tue, 27 Oct 1998 11:17:11 EST
Another of those just-wondering questions:

If I create a local var and then neglect to assign it a value, whether by
accident or by design (I _meant_ for it to be +/-32767, honest I did), it
comes out with a random value. Similarly with a string var. But in the latter
case... what, exactly, is happening in the variable? Is each individual byte
in the string being set to a random 0-255 character? What about the length
byte (assuming I didn't DIM it with a specified length)?

Related and even more straightforward question: I'm told that
IF LEN(given$)
is much faster than
IF given$ <> ""
Is this because, in the first case, the app just takes a quick look at the
length byte, while in the second case it sets up two strings, given$ and "",
and compares them? If their respective length bytes are different, does it
stop right there, or does it do 255 successive comparisons?

Oh yes and...

>>  Not looking the gift horse in the mouth, just deciding which end I'd
rather be facing when I do get on it.  :) <<

>why, yes, that is a good thing to know...    :+) <
You are both doomed to ignominious failure; the only difference is what you
will fall into or onto when you fall off. If you attempt to mount a horse from
either _end_ you will probably come to regret it; the _side_ is the preferred
access route. Except, possibly, in Texas.