Jim,
If you you think about it, you either _need_ to have the var defined,
or not... knowing if it is defined should really be irrelevant.
So, for example, let's say you have a cmd file that is called by
other command files, and further, let's say that the fact that a
particular var is null determines flow in the cmd file being called.
It would be most "proper" to define that var several thousand lines
in advance, but, pragmatically speaking, you could define it as
needed... even if it already exists.
Set var vTestVar Text -- Notice I didn't set it to null
If vTstVar is not null Then
--do stuff
else
--do other stuff
endif
If vTstVar existed prior to this "as needed" definition, no harm done
(it would still retain its values), and easier than testing for its
existence and then defining if needed.
Ben Petersen
On 18 Feb 2002, at 5:08, Jim Limburg wrote:
> Albert
>
> Interesting way do doing this, and of course it works. I was just
> wishing for an easier way... although this would be farely fast.
> Hmmm.. have to think about this. You and Tom's methods are two
> ways that will work. I know that there are several places, and I
> think this is where Manuel is coming from as well, that I have a
> button/or eep or ?? that will define a variable within it's body
> of code, but I don't test for this variable until the user has
> done some other actions and I get into the module of code that
> tests for all the users responces so far. Then when they preform
> a certain action the action the code takes depends on this or
> even several other actions they have taken..
> I guess I could and probably should predefine the variable
> farther upstream you might say in this sequence of events, but I
> thought it would be a lot better to be able to query a function or
> ??? to tell if the user has done some present actions before-hand.
> In most of the languages I have used to date, they have some way to
> test for objects by a boolean method or similar ways. I know Rbase
> doesn't have a boolean datatype although I wish it had at times.
> I guess I'm just for the most part a lazy coder... ha,ha.
>
> I did put in an request to the RDCC for this:
>
> SET VAR vm_vexists = (CVAL('variable','varname')) and this would return a text
> value of '1' for true and '0' for false. Then a second part for the datatype if
> possible like ... 'INTEGER' or 'TEXT' so the return would look like ...
> 1,TEXT or 1,CURRENCY or 0,UNDEFINED
>
> Thanks
> Jim
>
> --- Albert Berry <[EMAIL PROTECTED]> wrote:
> > Here is one way to get a list of variables:
> >
> > OUTPUT TempFile.$$$
> > SHOW VAR
> > OUTPUT SCREEN
> > CREATE TEMP TABLE VarList (VarName TEXT (18))
> > LOAD VarList FROM TempFile.$$$ AS ASCII
> > SELECT VarName FROM VarList
> >
> >
> >
> >
> > Jim Limburg <[EMAIL PROTECTED]> wrote:
> >
> > >JM
> > >
> > >I don't know of a way either so I put in a request to the RDCC [1976]
> > >Maybe If you and OTHERS do the same we can get our wish/dream
> > >added before the next inline patch...
> > >
> > >hopefully
> > >Jim Limburg
> > >
> > >--- "J.M. GRATIAS" <[EMAIL PROTECTED]> wrote:
> > >>
> > >> Hi all,
> > >>
> > >>
> > >> I am looking for a way to check if a variable has been already defined.
> > >>
> > >> A way that don't display an error.
> > >>
> > >> Is there a function for that ?
> > >>
> > >> Or may be a tip ....
> > >>
> > >> TIA
> > >>
> > >>
> > >> J.M. GRATIAS, Logimatique
> > >> ================================================
> > >> TO SEE MESSAGE POSTING GUIDELINES:
> > >> Send a plain text email to [EMAIL PROTECTED]
> > >> In the message body, put just two words: INTRO rbase-l
> > >> ================================================
> > >> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > >> In the message body, put just two words: UNSUBSCRIBE rbase-l
> > >> ================================================
> > >> TO SEARCH ARCHIVES:
> > >> http://www.mail-archive.com/rbase-l%40sonetmail.com/
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Send FREE Valentine eCards with Yahoo! Greetings!
> > >http://greetings.yahoo.com
> > >================================================
> > >TO SEE MESSAGE POSTING GUIDELINES:
> > >Send a plain text email to [EMAIL PROTECTED]
> > >In the message body, put just two words: INTRO rbase-l
> > >================================================
> > >TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > >In the message body, put just two words: UNSUBSCRIBE rbase-l
> > >================================================
> > >TO SEARCH ARCHIVES:
> > >http://www.mail-archive.com/rbase-l%40sonetmail.com/
> > >
> > --
> >
> >
> >
> >
> > __________________________________________________________________
> > Your favorite stores, helpful shopping tools and great gift ideas. Experience
> > the convenience of buying online with Shop@Netscape!
> > http://shopnow.netscape.com/
> >
> > Get your own FREE, personal Netscape Mail account today at
> > http://webmail.netscape.com/
> >
> > ================================================
> > TO SEE MESSAGE POSTING GUIDELINES:
> > Send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: INTRO rbase-l
> > ================================================
> > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > ================================================
> > TO SEARCH ARCHIVES:
> > http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
>
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/