This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Question regarding variables?


Question regarding variables?

Postby kornalius » Oct 18, 2004 @ 7:46pm

I would like to have your opinions regarding variable names that don't need to be defined to be used.

On small projects it is fine but when you start building bigger projects it might be a problem. Let's say you have a variable named (ThisVar$) and that later on in the program you use it but mispell it (ThsVar$). It would probably take a long time to figure out where the problem is.

I would like to know if I shouldn't allow variables to be used unless being defined within a LOCAL, GLOBAL, PRIVATE or PUBLIC statement.
Regards,
Kornalius
President
ArianeSoft Inc.
http://www.arianesoft.ca
User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby PointOfLight » Oct 18, 2004 @ 8:11pm

I think you should treat this like Visual Basic does with Option Expicit. Have some sort of flag that if set to 1, you validate variables otherwise you don't. This leaves it in the developer's hands and then it's their responsibility to track down the errors if they don't use it.
Eric Pankoke
Programmer
Point Of Light Software
http://www.polsoftware.com/
PointOfLight
pm Member
 
Posts: 525
Joined: Nov 2, 2003 @ 8:39pm


Postby kornalius » Oct 18, 2004 @ 8:30pm

So, a compiler directive like #EXPLICIT should solve the problem? I think it's a great way to handle it also.
Regards,
Kornalius
President
ArianeSoft Inc.
http://www.arianesoft.ca
User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby PointOfLight » Oct 18, 2004 @ 8:35pm

Sounds good to me.
Eric Pankoke
Programmer
Point Of Light Software
http://www.polsoftware.com/
PointOfLight
pm Member
 
Posts: 525
Joined: Nov 2, 2003 @ 8:39pm


Return to Pocket Programming Language (PPL)


Sort


Forum Description

Discuss this new development tool.

Moderator:

kornalius

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum