Welcome! Log In Create A New Profile

Advanced

Checking existence of a global noun

Posted by Frans 
Frans
Checking existence of a global noun
April 13, 2008 06:10PM
Hello to you all,

How can I check the existence off a global noun?
I want to know if the global noun exist before I use it and get an error like:
"GnName" element unknown.

Regards and thanks in advance,

Frans
Leo Voet
Re: Checking existence of a global noun
April 14, 2008 01:10PM
There is nothing like EnumVariable() or VariableExists() or something like that.
I guess the only way is to

WHEN EXCEPTION IN
{"NotExistingVariable",indVariable} = "test"
DO
pr_DoSomeThing()
END

Leo.
Fabrice Harari
Re: Checking existence of a global noun
April 14, 2008 01:38PM
Hi Frans...

Quote
Frans
Hello to you all,

How can I check the existence off a global noun?
I want to know if the global noun exist before I use it and get an error like:
"GnName" element unknown.

Regards and thanks in advance,

Frans

I'm trying to imagine a case where I would need to check that, and I just can't find one... If it's a global noun, it has been declared in the project or not, and you will get an error in the editor as soon as you type it if not...

Perhaps if you explain what you want to do we'll be able to help...

best regards

Fabrice Harari
WinDev, WebDev, WinDev Mobile Video Courses
Frans
Re: Checking existence of a global noun
April 15, 2008 10:05AM
Hello to you all,

Thank you for your reaction.
I save all the settings off my application in a file called F_Settings.
When I start it it fills automaticly all the values in a noun.
So far so good but when a user restores an older version off the program then it is possible that there are new nouns in the F_Settings file that are not declared in the program.
Then they get an error that the global noun is not declared.

Hopefully I explained it well and that you have an answer.

Regards,

Frans
Glenn Rathke
Re: Checking existence of a global noun
April 15, 2008 03:44PM
Hi,

Take a look at the compile statement. Perhaps you can build an expression, plug in the new nouns and see what code it returns, successfull or not.

HTH
Glenn Rathke
Piet van Zanten
Re: Checking existence of a global noun
April 15, 2008 03:44PM
Hi Frans,

Why don't you add the version to the ini file. If the program version does not match the ini version, or the version info is not present, then you can inform the user and end the program. This also prevents other version conflicts, such as data modification.
BTW, I don't think any developper can or will support restoring an older version by the enduser.

Best reagrds,
Piet
Frans
Re: Checking existence of a global noun
April 16, 2008 10:34PM
Hi Glenn and Piet,

Thanks for the advices,

If I want to use the idea off Glenn then I have to remake a lot off code so I give the idea off Piet a go. This also prevents from using programms that differ from the database.
But that isn't a big issue because a wdmodic solves it in most cases.

I will try it but I am still looking for a better solution.

Regards,

Frans
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: