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
 All Forums
 Origin Forum
 Origin Forum
 Script is too long and other peculiarities....

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
a_user Posted - 08/13/1998 : 4:14:00 PM
Hello, during the course of my work (with versions 4.0 and 4.1/16bit on Windows 3.1.1.) I found some

strange things

about the scripts...

• the first of these is a message The Script is too long ... which occurs within a if .. then {} loop. The commands within the brackets are not executed, but after the closing bracket, there is business as usual. How many command are allowed within such brackets and why is there a limitation ? ?
• getnumber-commands with an input of 5 or 6 parameters work only if I write the whole command into one line .If there is any carriage return in this line it will miss anything which comes afterwards. This forces lines with more than 200 characters. It only occurs in Worksheet scripts which are executed upon loading of ASCII data. If I use buttons in a graph window everything is fine with carriage returns. getnumber
(bla1) par1
(bla2) par2
(bigblabla); <- by the way you cannot put much text in that. Surely not enough

for the most stupid user who will work with these scripts.
• If ..then sequences sometimes seem to work only if the opening bracket is in the same line as the if, sometimes not. What's the reason for this ?
• If I want to exit a script before the whole sequence is run through, e.g. for a test purpose, how to stop it ? break without options does not seem to work. Deliberately set errors now do not terminate program execution.
• getyesno(blabla)variable(window title) worked well in V4.0, version 4.1 prefers to get (blabla) variable (window ..) with spaces in between. Why this ?

Such things are a frequent reason of failure in my scripts and it took me a lot of time to realize them because I really wasn't prepared for these. Has anyone similar problems ?

1   L A T E S T    R E P L I E S    (Newest First)
a_user Posted - 08/13/1998 : 4:16:00 PM
LabTalk script and the Script Window

There is some confusion about the Script Window and how it works.

Basically it is a text window that can act as input to the LabTalk
command interpreter. This capability can be turned on and off with
the Edit:Script Execution menu option. When on, and you type a line
of text and then press Enter, the line is interpreted as LabTalk
script. At that point, a semicolon gets appended to the line to
indicate it has been interpreted. If you type the semicolon at the
end of the line and then press Enter, it does not get interpreted.
If you highlight a block of text (including those semicolons) and
press Enter, the whole block is sent to the interpreter. If you
need a script command to spread out over multiple lines, just turn
execution off, type the lines, then turn it back on and do a
highlight&Enter.
Try to think of the Script Window as a handy tool rather than a
full-blown IDE environment.

The LabTalk interpreter has a limited internal buffer that can hold
about 1000 tokens - which means about 1000 characters. This size
limit applies to script between brackets { } or a highlighted block
of script in the Script Window. This can certainly be a 'hassle'
when you get on a coding roll, but has a side benefit of making you
code in manageable blocks.

Interrupting a script depends heavily on what your script is doing.
Sometimes simply pressing the escape key stops a script. Sometimes
you can make a button that executes a BREAK 1 command, and sometimes
you can execute a BREAK 1 command in the Script Window. At other
times there is nothing you can do but wait.

The LabTalk script language is always undergoing improvements
which sometimes produces unintended side effects. Hopefully the
scripts we write now will work correctly with future versions of the
software, but some change is necessary (the switch to object.property
notation led to the prohibition against variable names with periods).
In general, all LabTalk commands that take arguments should have those
arguments separated by a space or a single argument that contains a
space protected with parentheses. As such, your:
getyesno(blabla)variable(window title)
shouldn't work in any version - and in fact doesn't set 'variable'.
However,
getyesno (blabla) variable (window title)
works in all versions.


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000