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 >
Text File  |  1995-12-13  |  2KB  |  56 lines

  1. How can I enter a long If command in Suprtool?
  2.  
  3. A Suprtool command line cannot exceed 256 characters. You can reach this limit
  4. if you try to stack all your task commands into a single entity.
  5.  
  6.      base ...;get ...;sort ...; &
  7.      extract ...; duplicate ...; if ...; &
  8.      output ...;xeq
  9.  
  10. The only solution in this situation is to put individual commands on separate
  11. lines.  Then you can control the length of each command.  If you are not
  12. stacking commands, you may also run into this problem if you use a long and
  13. complex If command.  In that case, there are different ways to get around the
  14. problem.
  15.  
  16. If your command is complex and you are using long item names, you can assign
  17. shorter names by using Define statements.  Then you can refer to the same item
  18. by using the short or long form.
  19.  
  20.      define low,re-order-quantity
  21.      define curqty,on-hand-quantity
  22.  
  23. At the expense of readability, you can also remove unnecessary spaces. For
  24. example, you can use if curqty<low instead of if on-hand-qty <
  25. re-order-quantity.
  26.  
  27. If your If command is too long because your list contains numerous values, you
  28. can load these values into a table.
  29.  
  30.      table itemtbl,item-no,item,"111111"
  31.      table itemtbl,item-no,item,"222222"
  32.      table itemtbl,item-no,item,"333333"
  33.      if $lookup(itemtbl,item-no)
  34.  
  35. This table can replace the following If command,
  36.  
  37.      if item-no="111111","222222","333333"
  38.  
  39. If you cannot apply these suggestions to your situation, you can also use the
  40. $READ function.  The maximum length of the If command is then based on the
  41. complexity of the expression and not its length.
  42.  
  43. The $READ function reads the If expression from $STDINX, or from the use-file
  44. when it contains the If command.  $READ continues to prompt for input lines
  45. until you press Return or enter "//".  You must remember to enter all the
  46. necessary parts of the If expression including connectors like "and", "or" and
  47. commas. With $READ, you do not need an ampersand (&) to continue from one line
  48. to the next.
  49.  
  50.      >get m-supplier
  51.      >if $read                  {prompt for the expression}
  52.      -cust-status = "20" and    {$READ prompts with "-"}
  53.      -state = "AZ",             {the comma is still needed}
  54.      -        "OR"              {no comma on the last line}
  55.      -                          {blank line to terminate $READ}
  56.