| T O P I C R E V I E W |
| AtiLaw |
Posted - 01/06/2004 : 11:40:36 AM Hello Again People,
Yet again Im a little stuck! Basically I need to pull data from the stats sheet I have and I am using the command: A = %(wksname, col, row) to assign a cells value to a variable. Now I need to grab things like nvalue, SD, mean, range etc, and its working fine, except for the S.D column. On my worksheet it is column 4, but using %(wksname, 4,1) brings me the contents of the previous column, and if I increment the number to 5 it brings me the result of the following column, so it completely skips the S.D column.
Looking at it all I can see is different is that the columns I am getting data from are all Y, where as S.D is different, but not being a mathematician or an origin boffin I havent got a clue whether it is the problem or not.
Any ideas of how I can get the value of this cell and give me some info on why the problem occured??
Thanks for any help... again! :) |
| 7 L A T E S T R E P L I E S (Newest First) |
| St-Ranger |
Posted - 02/01/2004 : 1:21:29 PM quote:
The %(%H,,,) notation was never meant for serious programmers, as it was merely a string substitution notation. Better use functions like Cell(nRow, nCol).
CP
It would be great if the manual and the help included a special sign "Not for serious programmers", next to some topics and descriptions. This way naive users who are not serious programmers (at least not in LabTalk) would be aware of that.  Did I miss such a sign on the front cover of the LabTalk manual? 
|
| cpyang |
Posted - 01/11/2004 : 5:44:18 PM %(%H,column,row) notation reads wrong cell value if column is Numeric AND Err (tracker 5825) is fixed now for 7.5 SR2. This is difficult to track down, and has not been found for years, but easy to fix.
The %(%H,,,) notation was never meant for serious programmers, as it was merely a string substitution notation. Better use functions like Cell(nRow, nCol).
CP
|
| Mike Buess |
Posted - 01/11/2004 : 4:11:52 PM Hi Greg,
If you're going to make the programmers change the format of the SD column you might as well have them change that of Mean and SE as well. Those columns are also Numeric rather than Text & Numeric.
Mike Buess Origin WebRing Member |
| greg |
Posted - 01/09/2004 : 11:39:56 AM I'm always amazed what someone can stumble across after years of remaining hidden. The problem AtiLaw found has been around for quite a while. The problem actually occurs due to the column Format (Numeric), not due to the column Type (Error), but that combination proved deadly in this case. Some history:
Version 4 : Text and Numeric introduced as a column Format Version 5 : Text and Numeric allowed as a Format for Error column Types Version 6 : Text and Numeric becomes the default column Format
The Template for 'Statistics on Columns' has only had some minor changes since Origin began, and even though other columns in the worksheet are now 'Text & Numeric', the SD column is still Numeric (even though other 'Numeric' columns are set to 'Text and Numeric'). This makes sense, since they are always numbers, but I recognized this as the source of user AtiLaw's problem.
Of course, you could change your script (as Mike Buess suggests), or I could wake up the programmers and put them to work (they hate that, but I think I'll do it anyway), or, after calculating some Statistics on Columns, you could change the column Format of the SD and SE columns to 'Text & Numeric' and then save the COLSTAT template : problem solved since all future Statistics on Columns will use the new Template that works with %(%H,4,1). (Curiously, the ROWSTAT Template used by Statistics on Rows already has this change.)
|
| AtiLaw |
Posted - 01/07/2004 : 05:16:14 AM Will probably use one of your methods to avoid this problem again. Thanks for your help. |
| Mike Buess |
Posted - 01/06/2004 : 3:34:42 PM wksname_colname[rownum] will always work regardless of column type. Append $ if you need to fetch a string...
sd=%H_sd[1]; sd=; SD=sd value;
%A=%H_Col[1]$; %A=; dataset name
cell(rownum,colnum) will also work...
cell(1,4)=; CELL(1,4)=sd value
%A=cell(1,1)$; %A=; dataset name
Actually, I wasn't even aware of the problem with %(wksname,colnum,rownum) but it seems you're right.
Mike Buess Origin WebRing Member |
| AtiLaw |
Posted - 01/06/2004 : 11:50:00 AM OK, never mind, I have changed the SD column from YError to Y and it works. But just out of interest if anyone has any information on this so I know the difference feel free to share!! :)
|
|
|