[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[sqr-users] RE: Fetching value from 2-Dim. Array



I agree on the use of underscores instead of hyphens in variable names.  I 
haven't seen this as much as a problem from PeopleSoft, though, but in SQR 
itself.  Note that the reserved variable names have hyphens instead of 
underscores.  I think that a lot of people, used to using underscores, do that 
accidentally when using a reserved variable and then wonder why it doesn't 
work.  Of course, when I stated this point of view once before, I received an 
off-list email from someone at Brio, blasting me and telling me that just 
because I think so doesn't mean anyone else thinks so!  I see that he was 
wrong, and there ARE other people who think like I do in this regard.

Denise M. White
Sr. Software Engineer
Vicor 
--__--__--

Message: 2
Date: Sun, 30 Nov 2003 19:56:27 -0500
From: "Larry Roux" <lroux@syr.edu>
To: <sqr-users@sqrug.org>
Subject: Re: [sqr-users] Fetching value from 2-Dim. Array
Reply-To: sqr-users@sqrug.org

Agreed, as a set of programmers we should certainly avoid using a hyphen in 
variable names, but the language should not allow it.  OR at the very least 
give warnings if the value following the hyphen is numeric.  After all, if I 
say this in c++:

char x;
int y;

x = y;

It will let you do it but you will get a warning that significant digits may be 
lost.  That at least gives you something to go back to if the program operates 
oddly.

At this point there are other bugs in SQR that I would push to get resolved 
first, however - such as the phantom digits in the far reaches of floating 
point variables.  




******************************
Larry Roux
Syracuse University
lroux@syr.edu
*******************************
>>> ceprn@hotmail.com 11/30/03 11:54 AM >>>
Ray,

I agree, but if everyone understood this (hint, hint losers at PEOPLESOFT), 
and used only underscores in their variable names (good coding practice for 
exactly this reason), then it wouldn't be as much of an issue.

clark


PSA: Salary <> Slavery.  If you earn a salary, your employer is renting your 
services for 40 hours a week, not purchasing your soul.  Your time is the 
only real finite asset that you have, and once used it can never be 
recovered, so don't waste it by giving it away.

"Time is the coin of your life. It is the only coin you have, and only you 
can determine how it will be spent.  Be careful lest you let other people 
spend it for you."

Carl Sandburg
(1878 - 1967)

----Original Message Follows----

Sudeep,

"#count-1" is the name of a variable, not the value of an
expression.  In the while loop where you reference the array
element you refer to:

   WeekEndingArray.WeekEnding(0,#count-1)

You should change this to:

   WeekEndingArray.WeekEnding(0,#count - 1)

Since the variable "#count-1" was never given a value, it has
the value of zero.

One of my few complaints about SQR is that it allows a "-" in
variable names.

Ray

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users