RE Variables 
Author Message
 RE Variables

Uninitialized variables don't always have their own value; it's safer to use
the SYMBOL function.

Shmuel (Seymour J.) Metz

Quote:
> -----Original Message-----

> Sent: Friday, August 21, 1998 3:08 PM

> Subject:      Re: RE Varaibles

> > ...To check
> > whether a variable
> > has been assigned a value, you can use the SYMBOL built-in function:
> >    If symbol('Myvariable') = 'VAR' then
> >       say "MyVariable is" Myvariable
> >    else
> >       say "Myvariable does not have a value"

> Since uninitialized variables have their own value, you can simply check:

> if MyVariable <> "MYVARIABLE" then say "MyVariable is" Myvariable
> else say "No value yet"

> --I would expect this to be quicker than the function call, and it seems
> to
> be.  However, it looks as though if you do it 200000 times you would save
> a
> second, so it's probably moot.



Tue, 06 Feb 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Class variables / global variables / Init variables

2. J and variable variables

3. awk variables --> shell variables

4. Variable "Variables"

5. concatenate two variables in a variable

6. Processing variable length/variable data files

7. variable contents to variable name

8. Variable Variables???

9. local variable and local variable in block behave differently

10. Variable variables in Ruby?

11. variable variables

12. Shared Variable Requirements The Shared Variable Working Group of the IEEE DASC is developing a

 

 
Powered by phpBB® Forum Software