Brian,
Actually, I felt the same way for a long time (about Borland compilers) but once I gave in to the bullying, I developed a new set of habits in coding variables which I then carried back into mv. I'm not sure I can articulate the difference, but it has been a good decision.


- Charles "I ASSIGNED IT, STOP COMPLAINING" Barouch

Brian Leach wrote:

Marco,

The problem is that all it can do is warn that there *might* be a route
through that would not assign a variable, depending on conditional logic.


The Borland compilers do this - and boy is it annoying. For example, you
might have a case statement that handles each potential and predictable
input to a routine. Depending on the logic this migh lead to a variable
referenced later on, based on the result of that case statement, being seen
as potentiall unassigned (since the compiler doesn't know the possible
incoming values). So it warns you that the variable might not be assigned.


So you then pre-assign the variable to remove that warning, and the compiler
then complains that this assigned value may not be used!


Duh!

The real problem is that over a large Delphi project (some of our components
run into hundreds of thousands of lines of code) you can get so many
unnecessary warnings like this that you might lose a legitimate warning
amongst them.

Less of a problem on U2 where you are not linking so much code into a single
routine, but potentially annoying all the same.


Brian Leach




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco Manyevere
Sent: 03 March 2004 06:32
To: [EMAIL PROTECTED]
Subject: [UV] Variable never assigned a value warning


Hi All,

Is it technically or theoretically possible for the BASIC compiler (or any other compiler for that matter) to catch (during compilation) all the situations that might result in the use of unassigned variable at runtime within the scope of the subroutine being compiled? Under what circumstances does the compiler catch or fail to catch such situations?

Regards, Marco




---------------------------------
Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now
--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users


______________________________________________________________
__________
This email was checked by MessageLabs SkyScan before entering Microgen.




________________________________________________________________________
This email was checked on leaving Microgen for viruses, similar
malicious code and inappropriate content by MessageLabs SkyScan.

DISCLAIMER

This email and any attachments are confidential and may also be
privileged.

If you are not the named recipient, please notify the sender
immediately and do not disclose the contents to any other
person, use it for any purpose, or store or copy the information.

In the event of any technical difficulty with this email, please
contact the sender or [EMAIL PROTECTED]

Microgen Information Management Solutions
http://www.microgen.co.uk


--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to