Home   Archive   Permalink

Discover if a word exists

I feel like I have asked this before. I did look in the archives but did not see anything.
If I have a text file with some REBOL-readable items in it, like
%filename.txt contains:
and I load that file with
do load %filename.txt
Then the word DATA-NAME-1 will exist in my program and I can refer to its value.
BUT, if, in the text file, I mis-spell a word, like
DATE-NAME-1: "TEST VALUE" (note DATE instead of DATA)
then after I load the file an try to refer to DATA-NAME-1, I will get an error that DATA-NAME-1 has no value. The file will load, but because I spelled the above word in the file as DATE and tried to refer to DATA, I get that run-time error.    
I would like to catch this situation by checking, in my program, after I "load" the file, whether or not the word DATA-NAME-1 exists. If it does not exist (because it was spelled wrong in the file I loaded), then I could provide my own error message.
Is there a way I can check to see if a word in my program exists?
Thank you.

posted by:   Steven White       8-Feb-2018/13:34:05-8:00

value? 'data-name-1

posted by:   ange       8-Feb-2018/14:26:56-8:00



Type the reverse of this captcha text: "k c e h c - a"