Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Misc > Re: QBASIC colo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 1374 of 1466
Post > Topic >>

Re: QBASIC color numbers

by david.williams@[EMAIL PROTECTED] (David Williams) Nov 11, 2007 at 08:52 PM

-> You're right, that is a useful thing sometimes. The discussion was
started 
-> when someone (forget who now :-) suggested or implied that subroutine 
-> arguments might should be passed by reference as a default, and
function 
-> arguments be passed by value as default. I responded with a speculative

-> "off the top of my head" message about "would it be a good idea?",
while 
-> several others responded to the original message and mine in various
ways, 
-> and that's how we got here. :-) 
 
-> I don't think anyone here has suggested that arguments should always be

-> passed in only one way. 
  
I guess I am content with BASIC's habit of passing variables by 
reference since, as far as I can recall, it has never caused me any 
trouble. Sure, it is theoretically possible to write code that 
misbehaves when an altered value of a SUB argument gets passed back to 
a calling routine, but in practice I have never seen this happen. On 
the other hand, I have many times written code in which this feature of 
BASIC is put to good use. So its advantages (many) outweigh its 
disadvantages (none). 
  
Of course, it is easy to make BASIC pass parameters by value by writing 
them as arithmetic expressions, rather than single variables: 
  
CALL Routine (X + 0) 
  
Even if Routine changes the value of its input parameter, the value of 
X in the calling routine is unaltered. I don't think I have ever done 
this in practice, but I can see that it might sometimes be useful. 
  
                         dow




 7 Posts in Topic:
Re: QBASIC color numbers
david.williams@[EMAIL PRO  2007-11-11 20:52:10 
Re: QBASIC color numbers
ArarghMail711NOSPAM@[EMAI  2007-11-11 22:15:09 
Re: QBASIC color numbers
"news@[EMAIL PROTECT  2007-11-12 01:35:15 
Re: QBASIC color numbers
Adam <no@[EMAIL PROTEC  2007-11-12 19:48:58 
Re: QBASIC color numbers
"Judson McClendon&qu  2007-11-12 07:45:01 
Re: QBASIC color numbers
Derek <derekrss@[EMAIL  2007-11-12 20:46:03 
Re: QBASIC color numbers
"Judson McClendon&qu  2007-11-13 02:05:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 8:08:25 CDT 2008.