InStr space question Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

InStr space question

13 Dec 2018, 06:26

If I type in ahk it works as it shoud'
But if I type in ahk and then a space it shows as not found

How do I go about finding any word even if I entered a space?

Code: Select all


#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%

Gui Add, Edit, hWndhEdit1 x60 y44 w120 h21 vTeststring
DllCall("SendMessage", "Ptr", hEdit1, "UInt", 0x1501, "Ptr", 1, "WStr", "Search for") ; Hint text
Gui Add, Button, x183 y43 w80 h23 gTestsearch, Test
testing = ahk
Gui Show, w423 h133, Window
Return


Testsearch:
gui, submit, nohide
if instr(testing, Teststring)
	MsgBox, There
else
	MsgBox, Not There
return

GuiEscape:
GuiClose:
    ExitApp
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: InStr space question  Topic is solved

13 Dec 2018, 06:46

disable AutoTrim or use expression assignment(:=)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Panaku, Rohwedder, roysubs and 315 guests