Newbie question - how to check for a varible
Stephen Cox
stephen at networkxfla.com
Fri May 8 02:53:42 EDT 2009
I did search for "empty" in the Online Dictionary. But all I got were
property keywords. I also read the docs on put and answer and saw nothing
about empty.
Anyway know now, thanks.
As for checking for existence of variables.. Just a habit I formed over
years writing dbase and c. "Always check the existence of a variable before
you take any action on it". The compilers of today are more sophisticated so
I'll probably wean my way off it.
On 5/8/09 2:40 AM, "Mark Schonewille" <m.schonewille at economy-x-talk.com>
wrote:
> Hi Stephen,
>
>
> Search the docs for "empty". It will show you things like
>
> put empty into x
> set the cProp to empty
>
> So, you will also want to read up on "put" and "set".
>
> There is also a function "variableNames", which will probably be very
> useful to you. Why do you want to check for the existence of a
> variable? I do this very, very rarely and only in really advanced
> projects.
>
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> http://economy-x-talk.com
> http://www.salery.biz
> Dutch forum: http://runrev.info/rrforum
>
> New: Snapper Screen Recorder 2.0.1
> Download at http://snapper.economy-x-talk.com
>
> On 8 mei 2009, at 08:25, Stephen Cox wrote:
>
>> Really two questions:
>>
>> How do I check if a variable is empty? Sort of like;
>>
>> If !empty(tUsername)
>> // process here
>> Endif
>>
>> Empty() is a Foxpro function that pops if what you are checking is
>> empty. I
>> can¹t seem to find it¹s equivalent in revolution. Am I approaching
>> this the
>> wrong way? And can I check fields the same way?
>>
>> I suppose I could create an empty variable and just compare the 2?
>> But is
>> there an easier way?
>>
>> Next question; checking the existence of a variable? Now I know I
>> can turn
>> on Strict Compilation (and I have) but I¹d rather have the assurance
>> of
>> checking to see if a variable exist? Is this a non-issue in
>> Revolution?
>>
>> Thanks
>>
>> -Stephen Cox
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list