The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Col(colNum)[rowNum] change
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

CStorey

Canada
137 Posts

Posted - 01/05/2001 :  1:39:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Comments on Patch #1 Origin 6.1

Comment #1
The function wksName!col(colNum)[rowNum] has changed to wksName!cell(rowNum, colNum).

I would like to know why such a major change was made.
I like the fact that the notation is significantly better, but now I must upgrade all my scripts to reflect this change if I use Patch #1.

Comment #2
I would also like to know why the Help files are not update with each consecutive patch!!
It is not to much to ask for that the Help files reflect the script language.
Please in the future include the udates in the Patches.

Craig Storey

greg

USA
1380 Posts

Posted - 01/05/2001 :  6:14:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think you are confusing two issues.

The col( ) function never supported the use of WindowName! as a prefix. That notation was reserved for object properties, however the cell( ) function was written to allow that notation. If you have written scripts using
wksName!col(colNum)[rowNum] then they only worked correctly (by accident) when the worksheet named wksName was the active window. For example, if you had Data1 and Data2 windows and Data2 was the active window, then
nn=Data1!col(2)[1]

would actually return the value from column 2 of row 1 of Data2 (the active window) - not from Data1.

There are changes in the behavior of the cell( ) function between 6.1 and 6.1 SR1. Although I know it's of no comfort to you now, I argued against this change. What changed was the order of the arguments:
VersionSyntax
6.1[wksName!]cell(colNum, rowNum)
6.1 SR1[wksName!]cell(rowNum, colNum)

If you really have been using wksName!col(colNum)[rowNum] then a re-write of your code is necessary no matter what version you use. If you are using wksName!cell(colNum, rowNum) in 6.1, then you will (unfortunately) have to re-write the code to be compatible with 6.1 SR1 (and later). For example:


if(system.version<6.1073) nn=wksName!cell(myCol, myRow); else nn=wksName!cell(myRow, myCol);



Your suggestion that we re-compile the Help files is a good one. I will pass it along to Documentation. We have been relying on release notes and our web site to provide the latest information.




Edited by - greg on 01/05/2001 18:15:29
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 01/08/2001 :  11:52:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the quick answer Greg. I was a little annoyed to learn that my scripts where all in need of upgrade if I installed the patch to take advantage of the improvements.

In my first post I refered to wksName!col()[] and wksName!cell(,). In the release notes titled "Patch 1 for English Origin 6.1", under the LabTalk section please see entry #2. Is it in error? I copied the two commands directly from that release note.

I have never actually used wksName!col()[], only col()[], but simply assumed that it worked given that it was documented in the release notes. Now I'm confused.

Does col()[] still work if referencing the active worksheet or should I begin making changes to wksName!cell(,)?? Has the col()[] function changed at all??

Your answer will be greatly appreciated.
Craig

Go to Top of Page

greg

USA
1380 Posts

Posted - 01/08/2001 :  3:08:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The release note for 6.1 Patch 1 was correct in saying

Instead of referencing a cell using the wksName!col(colNum)[rowNum] notation, use the wksName!cell(rowNum,colNum) notation.
but should have been clearer by saying that the first notation is wrong. It is not documented as working - only as an example of what not to do. Sorry for the confusion.
The col( ) and wcol( ) functions have not changed at all and both are restricted to the active worksheet.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000