In order to make the AutoText definition easier, I wrote the following code. There are four pieces of code. I don't understand how to write it. I hope someone can provide some suggestions. Thanks in advance.
_________________________________________________________
Because the private function TO_Text inside QM cannot be used, most of the code uses simulation operations, I think there should be a simpler method.
The following code is usable, you need to open the AutoText file first, then position the cursor behind the last acronym field. Operation is not convenientÂ
Macro Add AutoText
Trigger CSAa
When I enter an abbreviation, there may be some circumstances that need to be judged. For example, if the entered abbreviation already exists, the user is prompted to change it. If the user confirms, the selected row is inserted in the next line where the abbreviation already exists
_________________________________________________________
Because the private function TO_Text inside QM cannot be used, most of the code uses simulation operations, I think there should be a simpler method.
The following code is usable, you need to open the AutoText file first, then position the cursor behind the last acronym field. Operation is not convenientÂ
Macro Add AutoText
Trigger CSAa
str s.getsel
str s1 ;;string variable. If need numeric, replace str with int or double.
if(!inp(s1 "Enter AutoText Abbreviation" "" "text")) ret
str s2 ;;string variable. If need numeric, replace str with int or double.
if(!inp(s2 "Enter a phrase description" "" "description")) ret
;
;1.code:Get a list of all AutoText files, The code below is an example, Suppose there are four AutoText files.
sel(ListDialog("Autotext1[]Autotext2[]Autotext3[]Autotext4"))
,case 1
,goto insert
,case 2
,goto insert
,case 3
,goto insert
,case 4
,goto insert
,case else ret
;insert
;2.code:Open selected Autotext??? file
;3.code:The cursor is positioned at the end of the last AutoText field
int w=win("QM TOOLBAR" "QM_toolbar")
act w
lef 12 9 id(9999 w) 1 ;;toolbar, press button 'Text'
paste s
int w1=win("Text" "#32770")
lef 9 7 id(6 w1) 1 ;;Check box 'Multiline'
lef 48 4 id(5 w1) 1 ;;List, list item 'Paste (use clipboard)'
;4.code:Replace the default Abbreviation with the variable s1, Add a description with the variable s2
When I enter an abbreviation, there may be some circumstances that need to be judged. For example, if the entered abbreviation already exists, the user is prompted to change it. If the user confirms, the selected row is inserted in the next line where the abbreviation already exists