01-18-2008, 05:54 PM
;variables
str s ;;create variable of str type. Variables of str type are used to hold strings (text) and perform string operations (formatting, getting selected text or window text, etc).
int i ;;create variable of type int. Variables of type int are used to hold integer numbers and perform numeric operations (adding, multiplying, etc). Alternatively can be used variables of type double. They support noninteger numbers.
s.getsel ;;copy selected text to s
i=val(s) ;;get numeric value of s and assign to i. If the string does not begin with a number, i will be 0.
i=i-1
;...
s=i ;;convert to string for pasting. Or you can use just outp i.
s.setsel ;;paste s
