17.11.2014 Views

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

ChemOffice.Com - CambridgeSoft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Administrator<br />

You may concatenate variables, and variables and<br />

literals together in CAL commands. You must add<br />

both a leading and trailing dollar sign to the variable<br />

name.<br />

For example:<br />

MSG$V2$$V1$<br />

Displays a message box with the value of V2<br />

immediately followed by the value of V1.<br />

Most commands for manipulating variables take an<br />

optional variable number as the first argument. If<br />

the number is omitted, it is assumed to be 1.<br />

SETVAL puts the specified text into a variable.<br />

READVAL reads the contents of a text file into a<br />

variable. WRITEVAL copies the contents of a<br />

variable to a file.<br />

INPUT displays a text input dialog, accepts data<br />

from the user and stores it in a variable. An optional<br />

prompt string is displayed in the box when it<br />

appears.<br />

PASSWORD is the same as INPUT, but displays all<br />

characters as asterisks.<br />

GETDATA retrieves the contents of a form box (as<br />

long as it is not a structure) into a variable; see<br />

above for how to identify a box. PUTDATA copies<br />

specified text into a form box. Form names are<br />

case-sensitive. Be sure to use the same case as the<br />

form box name into which you want to store data.<br />

APPEND determines whether data in a storage<br />

location is kept if other data is being moved there.<br />

This setting is now also consulted when you do a<br />

File Export to SD or delimited text file.<br />

APPEND ON causes any subsequent data<br />

movements to append new data to old; APPEND<br />

OFF causes old data to be overwritten. This applies<br />

to all variable commands except PUTDATA. The<br />

default at program startup is APPEND OFF.<br />

APPENDVAL is a shortcut designed to make it<br />

easier to build string values. It is the same as setting<br />

APPEND ON, doing a SETVAL, and then restoring<br />

APPEND to its original state.<br />

TIP: The difference between APPEND ON and<br />

APPENDVAL is that APPENDVAL does not add a<br />

carriage return to the string being appended, whereas<br />

APPEND ON does. If you want to insert a carriage return<br />

at the end of the string, use APPEND ON.<br />

INCREMENT adds 1 to the value of a variable. Use<br />

INCREMENT in loops.<br />

DECREMENT subtracts 1 from the value of a<br />

variable. Use DECREMENT in loops.<br />

LET allows you to perform mathematical<br />

operations on variables that contain integer or realnumber<br />

values. Only one operator per line is<br />

supported. It recognizes the following operators:<br />

• + for addition<br />

• - for subtraction<br />

• * for multiplication<br />

• / for division<br />

SUBSTR extracts a substring from a variable. The<br />

extracted substring extends from a specified<br />

character to the end of the string, or from one<br />

specified character to another.<br />

The table below shows examples of Variable<br />

<strong>Com</strong>mands:<br />

<strong>Com</strong>mand<br />

SETVAL "some<br />

text"<br />

SETVAL 2 "other<br />

text"<br />

READVAL 9<br />

tmpdata.txt<br />

Action<br />

store text in V1<br />

store text in V2<br />

read text from file into V9<br />

698• CAL <strong>Com</strong>mands <strong>CambridgeSoft</strong><br />

Variable <strong>Com</strong>mands

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!