Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Augmenting a Number
#3
To perform various operations with text and numbers, store the text in a variable. You can use the Text dialog (the first button in the floating toolbar) to create code to copy and paste using a variable.

If it is an arithmetic operation, the variable type must be int, or double, or long. Use function val() to convert string variable to number.

Example
Macro
Code:
Copy      Help
;select all text
key Ca
;variables
str s
int i
;store selected text into variable s
s.getsel
;convert to integer
i=val(s)
;add 1
i=i+1
;assign to a str variable (a conversion function like val() here is not needed)
s=i
;paste
s.setsel


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)