Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Incrementing A Number In Loop?
#2
Macro Macro33
Code:
Copy      Help
int w=win("Untitled - Notepad" "Notepad")
act id(15 w) ;;editable text 'Text Editor'
str sBlock
for _i 1 10000
,_s.format("%04i" _i)
,key F"word{_s}[]";;[] adds new line; remove if you don't want

above slow and dangerous unless you block key and mouse input which could change focus - see BlockInput2, though this can also be tricky and sometimes dangerous to use.

This better:
 
Code:
Copy      Help
str sColl
for _i 1 10000
,_s.format("%04i" _i)
,sColl.addline(F"word{_s}")    
int w=win("Untitled - Notepad" "Notepad")
sColl.setwintext(id(15 w)) ;;editable text 'Text Editor'

tip: learn QM faster and more easily by using the 'wizards' in the toolbar, especially useful are the ones that put arrows on (though all eventually become lifesavers! thanks Gintaras!!!!)

   


Messages In This Thread
Incrementing A Number In Loop? - by mku - 04-07-2022, 11:44 AM
RE: Incrementing A Number In Loop? - by stupomer - 04-07-2022, 12:53 PM
RE: Incrementing A Number In Loop? - by ScottF - 04-28-2022, 11:37 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)