Skipping a line with ControlSetText Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
magicinmath
Posts: 162
Joined: 12 Apr 2017, 23:03

Skipping a line with ControlSetText

21 May 2017, 17:35

Tried but doesn't work:

Code: Select all

array:=["3279","23897","23897"]
n:=0
while(n<array.Length()){
	++n
	controlsettext,  edit1, % array[n]`n`r, Untitled - Notepad
	
}
Would like it to paste to notepad like:

Code: Select all

3279
23897
23897
Xeno234
Posts: 71
Joined: 24 Mar 2017, 18:14

Re: Skipping a line with ControlSetText

21 May 2017, 18:03

Code: Select all

array:=["3279","23897","23897"]
n:=0, s:=""
while(n<array.Length())
	++n, s.=array[n] "`r`n"
controlsettext,  edit1, % s, Untitled - Notepad
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Skipping a line with ControlSetText  Topic is solved

22 May 2017, 09:36

Another way:

Code: Select all

q:: ;array to variable
oArray := ["3279","23897","23897"]
vOutput := ""
Loop, % oArray.MaxIndex()
;Loop, % oArray.Length() ;this will also work
	vOutput .= oArray[A_Index] "`r`n"
;Clipboard := vOutput
;MsgBox, % vOutput
;ControlSetText, Edit1, % vOutput, Untitled - Notepad ;set all of control's text
Control, EditPaste, % vOutput, Edit1, Untitled - Notepad ;insert text at cursor
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ht55cd3 and 266 guests