dbTalk Databases Forums  

Unassigned variable

comp.databases.pick comp.databases.pick


Discuss Unassigned variable in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Kevin Powick
 
Posts: n/a

Default Re: Unassigned variable - 11-12-2010 , 02:36 PM






On 2010-11-12 14:13:49 -0500, x <lucian_pata (AT) yahoo (DOT) com> said:

Quote:
No, I was thinking along these lines.
Either:
1) making BASIC even more lax by ignoring the unassigned variable
altogether because of its limited benefits
This solves no real problem and introduces potentially serious ones as
already described. All you do here is perhaps reduce the minimal
amount of work sometimes required by the programmer to assign a value
to a varialbe.

Quote:
2) making BASIC more precise (not restrictive) by generating error
messages when you have something like:
A = 22 <--- numeric assignment
A = A:"0" <--- string assignment
Instead you would have to write:
A = "22" <--- string assignment
A = A:"0"
Now this just makes MV BASIC unnecessarily cumbersome. Again, what
terrible real world problem does this solve?

Also, consider that much MV processing is reading record values from
files. So, if the record TEMP.CELSIUS contains 22 in attribute # 1, how
would your system work considering the following:

READV TEMPERATURE FROM MYFILE,'TEMP.CELSIUS',1 THEN
CRT "The temperature is ":TEMPERATURE:" degrees Celsius"
TEMPERATURE = (1.8 * TEMPERATURE) + 32
CRT "The temperature is ":TEMPERATURE:" degrees Fahrenheit"
END

--
Kevin Powick

Reply With Quote
  #12  
Old   
x
 
Posts: n/a

Default Re: Unassigned variable - 11-12-2010 , 03:34 PM






Thank you all, your input is very much appreciated.
Lucian

Reply With Quote
  #13  
Old   
Douglas Tatelman
 
Posts: n/a

Default Re: Unassigned variable - 11-14-2010 , 10:16 PM



I think some of us are mixing up compiler messages and runtime errors.

To prevent misspellings of variables, I use the (x feature at compile
and either examine the resulting file, or have a little program review
it.

During runtime, which is not where you want to catch your errors, you
will only get this message if the variable is being used.

For example you can have x = y and y can be unassigned. x will just
sit there happily until it is referenced.

Of course I once saw a system where all Pick programs were run with
the option to suppress runtime errors. I believe it is (S, but of
course I don't do this. Problem solved! But only if you were an
immoral pig of a programmer and never wanted to be bothered after you
finished a program.


On Nov 12, 1:34*pm, x <lucian_p... (AT) yahoo (DOT) com> wrote:
Quote:
Thank you all, your input is very much appreciated.
Lucian

Reply With Quote
  #14  
Old   
x
 
Posts: n/a

Default Re: Unassigned variable - 11-16-2010 , 10:49 AM



Douglas,
Each vendor has its own compiler features.
When you wrote "Pick" you meant "Tiger Logic" ?
The (x option gives you a dictionary of variables ?
Lucian

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.