Comparsion operators help

11/17/2014 10:43 mlukac89#1
Hi

How do i check if field is filled width text then send something.

Like in php
Code:
if (!empty($var1)) { // if not empty
	// do stuff
}
Code:
If GUICtrlRead($input1) = "" Then ; how to check here if not empty
                Send("{ENTER}")
		Sleep(1000)
		Send(GUICtrlRead($input1))
		Send("{ENTER}")
		Sleep(500)
	EndIf
11/17/2014 11:50 Requi#2
Code:
If GUICtrlRead($input1) <> "" Then ; how to check here if not empty
                Send("{ENTER}")
		Sleep(1000)
		Send(GUICtrlRead($input1))
		Send("{ENTER}")
		Sleep(500)
	EndIf
11/17/2014 14:07 YatoDev#3
If Not GUICtrlRead($input1) = "" Then
11/17/2014 22:35 Lawliet#4
Oder einfach
Code:
If GUICtrlRead($input1) Then
11/17/2014 23:55 YatoDev#5
Quote:
Originally Posted by Lawliet! View Post
Oder einfach
Code:
If Not GUICtrlRead($input1) Then
er wollte es ja eben umgekehrt
11/18/2014 12:30 Lawliet#6
Quote:
Originally Posted by »FlutterShy™ View Post
er wollte es ja eben umgekehrt
Hast du meinen Post im Zitat geändert? ^^

Quote:
If a string is used as a boolean and it is an empty string "" , it will be assumed to equal False (see below).
Sprich "" is False und alles andere True ;)

Code:
If GUICtrlRead($input1) Then
ist also True, wenn etwas in der Textbox steht.
11/18/2014 13:54 YatoDev#7
Quote:
Originally Posted by Lawliet! View Post
Hast du meinen Post im Zitat geändert? ^^



Sprich "" is False und alles andere True ;)

Code:
If GUICtrlRead($input1) Then
ist also True, wenn etwas in der Textbox steht.
ja ist das schlimm?

Ok hast recht hab mich vertan xD
11/18/2014 14:25 alpines#8
Im Endeffekt spielt es eigentlich keine Rolle was man nimmt. Alles funktioniert.