From: Ian Hobson Date: 2003-11-28T04:02:39+09:00 Subject: Defining variables - optionally required. Hi all, Forgive the suggestion if it has been done to death before I joined in. I would like some facility to change the behaviour so that variables have to be declared before use. It would catch many of (my) typos. VB has set declare. I always use it if I can when forced to use that language. I recognise that it would have to be set on a per module or per class basis, if for no better reason than the existing libraries would otherwise be broken. The state of this switch would have to be maintained in the class or module record for testing at run time. It is therefore a language issue for Rite, not a flag for the interpreter. Two ideas..... Class Sample < Object declare var @foo var @bar def bodgit() @oops = "Error" # error @oops not declared end end Class Sample #pragma declare var @foo etc Comments. Ways to get the same effect now? Regards Ian -- Ian - posting to a Newsgroup. Please remove everything to reply.