Checking existence of a variable

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Checking existence of a variable

Post by bjb007 » Wed Jul 09, 2008 8:41 am

Know I can check "if there is no..."
for image, graphic, field etc. etc. but
can I check for a global or local variable?
Life is just a bowl of cherries.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Jul 09, 2008 9:34 am

Hi BJB,

Please check out the documantion on the variablenames function. You probamly want something like:

Code: Select all

if not "variable" is among the items of line x of the variableNames then
  do "put something into" && variable
end if
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

rozek
Posts: 151
Joined: Mon Jun 19, 2006 2:29 pm
Contact:

Post by rozek » Wed Jul 09, 2008 1:05 pm

Oops,

trying to learn how to use RR properly, I also checked the docs for "variablenames" myself - then I checked the other ...names as well - and ran across a bug in the docs:

according to the docs, "the localnames" shall to contain 3 lines - but only two of them are mentioned and explained.

What does the first line contain?

[edit]I just filed a bug report
Kind regards,

Andreas Rozek

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Jul 10, 2008 12:25 am

Hi Andreas,

I have no idea what should be on the first line of the localnames. I'm sure it is something obvious, but I can't discover it. Sorry...

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

rozek
Posts: 151
Joined: Mon Jun 19, 2006 2:29 pm
Contact:

Post by rozek » Thu Jul 10, 2008 6:04 am

Hello Mark,

thanks for your effort anyway - I already filed a bug report (and this one should be easy to fix - in contrast to the others which are often "not reproducable" ;-) )
Kind regards,

Andreas Rozek

Post Reply