07-07-2017, 08:33 PM
Macro Macro22
It is confusing in beginning, keep re-studying the examples (in this forum thread and the help file). You will get it.
str s="$desktop$\1.txt"
str get_text.getfile(s)
str getline
int line_pos=getline.getl(get_text 0) ;; CHANGE THE NUMBER HERE TO THE LINE YOU WANT TO GET, '0'= first line, '1' = second line...etc...
get_text.remove(line_pos getline.len)
get_text.trim ;; trim removes leading and trailing spaces, (put cursor on "trim" in QM editor then press [F1])
out get_text
;; At line 4 you see '0' this means GET the line at line '0' (FIRST LINE!), we store it in 'getline'
;; At line 5 you remove the exact length (amount of characters) of 'getline', we remove starting at 'line_pos' which should be '0'
;; line_pos will be '0' at 'A' and this will be put into variable 'line_pos' at line 4, do NOT confuse this with the zero in .=> getl(get_text 0)
It is confusing in beginning, keep re-studying the examples (in this forum thread and the help file). You will get it.