Author |
Topic |
|
cdrozdowski111
USA
247 Posts |
Posted - 12/04/2012 : 07:02:50 AM
|
OriginPro 9.0.0 (Student Version), Win7 64-bit, running in VMware Fusion 5.0.2
1) Start a new, virgin worksheet, no data, just A & B columns.
Why does the following code output "it doesn't exist" when run in the Command Window but not in the Script Panel for the worksheet (when entered manually and Execute button clicked)?
if (exist(col(C)) > 0) {type -b "it exists";} else {type -b "it doesn't exist";}
|
|
cpyang
USA
1406 Posts |
Posted - 12/05/2012 : 12:39:43 PM
|
I don't really know why but you will be better off by using a button to run your script in the worksheet.
Maybe this is useful?
http://wiki.originlab.com/~originla/wiki/index.php?title=Script:From_Graphical_Objects
You can also place the button on the top of the worksheet, above the heading area, so that if your sheet has more columns(thus no empty space on the right), you can still see your buttons,
1. From main menu Format:Worksheet 2. Choose Size tab and find Worksheet Measurement:Gap From Top 3. enter 20, this is in pixel units.
You can now add a button in this region and not having to worry about having many columns. You can further set the color of this region by the following Labtalk code:
page.BASECOLOR=color(224,224,224)
CP
|
|
|
cdrozdowski111
USA
247 Posts |
Posted - 12/05/2012 : 1:06:56 PM
|
My point, and I mean this positively, is why does one method to run LabTalk choke on a very basic conditional statement that others methods don't.
If I run the following code in the workbook script panel, the conditional works correctly:
if (exist(col(A)) > 0) {type -b "it exists";} else {type -b "it doesn't exist";}
So why doesn't:
if (exist(col(C)) > 0) {type -b "it exists";} else {type -b "it doesn't exist";}
I am not aware of how to access any sort of online bug database to search in case such things might be a bug. |
|
|
|
Topic |
|
|
|