>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)? Well, each individual byte (or var) is not being _set_ to a random char. It is simply picking up whatever was left in that section of memory from its last use or initialization, unchanged. Length byte included. > >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? I'm pretty sure you're correct about setting up the two strings to compare. I'm certain string compares don't go all the way to 255 (unless necessary). My bet is that they jump out if the length bytes don't match. The extra time probably comes from setting up both the strings and a loop to compare them--before ever checking the length bytes. Another factor might be that one of your compile options is to put strings embedded in code into resources, in which case before comparing the "" string, it has to do all the overhead associated with getting a resource and pulling a string (even an empty one) from it. I'm just making (educated) guesses. If I'm way off, I trust someone more knowledgeable will set us straight. I've often wondered whether there is a speed difference between LEN(given$) and PEEK(@given$) ? Guessing again, I would think the former would call a FB subroutine to do the latter, while the latter would compile directly, avoiding the subroutine overhead. Easy to check in Macsbug, but who has time? 0"0 =J= a y "