home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.robelle3000.ai 2014
/
2014.06.ftp.robelle3000.ai.tar
/
ftp.robelle3000.ai
/
faq
/
s6.txt
< prev
next >
Wrap
Text File
|
1995-12-13
|
2KB
|
56 lines
How can I enter a long If command in Suprtool?
A Suprtool command line cannot exceed 256 characters. You can reach this limit
if you try to stack all your task commands into a single entity.
base ...;get ...;sort ...; &
extract ...; duplicate ...; if ...; &
output ...;xeq
The only solution in this situation is to put individual commands on separate
lines. Then you can control the length of each command. If you are not
stacking commands, you may also run into this problem if you use a long and
complex If command. In that case, there are different ways to get around the
problem.
If your command is complex and you are using long item names, you can assign
shorter names by using Define statements. Then you can refer to the same item
by using the short or long form.
define low,re-order-quantity
define curqty,on-hand-quantity
At the expense of readability, you can also remove unnecessary spaces. For
example, you can use if curqty<low instead of if on-hand-qty <
re-order-quantity.
If your If command is too long because your list contains numerous values, you
can load these values into a table.
table itemtbl,item-no,item,"111111"
table itemtbl,item-no,item,"222222"
table itemtbl,item-no,item,"333333"
if $lookup(itemtbl,item-no)
This table can replace the following If command,
if item-no="111111","222222","333333"
If you cannot apply these suggestions to your situation, you can also use the
$READ function. The maximum length of the If command is then based on the
complexity of the expression and not its length.
The $READ function reads the If expression from $STDINX, or from the use-file
when it contains the If command. $READ continues to prompt for input lines
until you press Return or enter "//". You must remember to enter all the
necessary parts of the If expression including connectors like "and", "or" and
commas. With $READ, you do not need an ampersand (&) to continue from one line
to the next.
>get m-supplier
>if $read {prompt for the expression}
-cust-status = "20" and {$READ prompts with "-"}
-state = "AZ", {the comma is still needed}
- "OR" {no comma on the last line}
- {blank line to terminate $READ}