Page 1 of 1

Advanced search with quoted string

Posted: 29 Dec 2017, 08:28
by MrMajorThorburn
Since raising a question and it being 'suggested' I do some 'research' and include some forum searches I would like some guidance on how I can get the forum results for a search for a specific string in quotes.
In this case it "GUI, New,"
I am asking as I tried that and got 88 pages and of the first 20 or so pages I checked none of them had that particular sequence of GUI and New.
I wanted to get some assurance that I might actually find an example of someone using GUI, New so I can compare what has been used before.
I am using variables for the X, Y, Width and Height and although I can get a variable to contain all the values and the indicators X,Y,H,W and send it to the console viw FileAppend I still get an invalid option error when using the same syntax in the actual GUI command.

Re: Advanced search with quoted string

Posted: 29 Dec 2017, 09:50
by gregster
Best would be to show your script.

Apart from that: https://cse.google.com/cse?cx=010629462 ... gsc.page=1
Google Search of the forum is available here: https://autohotkey.com/search/

Re: Advanced search with quoted string

Posted: 29 Dec 2017, 10:26
by MrMajorThorburn
my test snippet. My original had all the calculations in the GUI, New, line itself. I Would prefer them to be there instead of before.

; GUI New
X1 := 100
Y1 := 100
X2 := 400
Y2 := 400
GUIwidth := X2-X1
FileAppend, %GUIwidth%`n,*
GUIheight := Y2-Y1
FileAppend, %GUIheight%`n,*
dX := 242
dY := 98
GUIx := X1+dX
GUIy := Y1+dY
Options := "W" GUIwidth "H" GUIheight "X" GUIx "Y" GUIy
FileAppend, %Options%`n,*
; next line gives GUI syntax error
GUI, New, Options, "GUI Title"
; And this
GUI, New, % Options, "GUI Title"
; And this
GUI, New, % "W" GUIwidth "H" GUIheight "X" GUIx "Y" GUIy, "GUI Title"

Re: Advanced search with quoted string

Posted: 29 Dec 2017, 10:41
by gregster
As far as I know, Gui, new doesn't support these options like w, h, x and y. You are probably confusing it with the options for Gui, Show.

The available options for new: https://autohotkey.com/docs/commands/Gui.htm#Options

Re: Advanced search with quoted string

Posted: 29 Dec 2017, 10:48
by gregster
Another problem is your options string: it doesn't contain spaces: W300H300X342Y198 won't work, I guess.
Try it with Options := "W" GUIwidth " H" GUIheight " X" GUIx " Y" GUIy and Gui, Show, % options