Jump to content

Recommended Posts

Posted

$newkey = GUICtrlCreateInput("78787", 130, 286, 250, 20)

If $msg = $key_yes Then

MsgBox(0, "Test",$newkey) - Returns "25" ????

$len = StringLen($newkey)

MsgBox(0, "String length is:", $len) - Returns "2" - bacause 25 have to char

EndIf

Why the F*** is my msgbox returning 25?

Note that im doing this betweek two GUI's in the same script, can this have an effect on it? can't it read the $newkey, and then returns the error "25"? or what

Posted (edited)

I guess you didn't read the help file.

My help file says:

Return Value

    Success: Returns the identifier (controlID) of the new control.

    Failure: Returns 0.

Remarks

To obtain the value of the control see GUICtrlRead.

To set or change information in the control see GUICtrlSet....

I updated your code:

$newkey = GUICtrlCreateInput("78787", 130, 286, 250, 20)

If $msg = $key_yes Then
   $input_value = GUICtrlRead($newkey)
   MsgBox(0, "Test", $input_value)
   
   $len = StringLen($input_value)
   MsgBox(0, "String length is:", $len)
EndIf
Edited by SlimShady
Posted

I guess you didn't read the help file.

My help file says:

I updated your code:

$newkey = GUICtrlCreateInput("78787", 130, 286, 250, 20)

If $msg = $key_yes Then
   $input_value = GUICtrlRead($newkey)
   MsgBox(0, "Test", $input_value)
   
   $len = StringLen($input_value)
   MsgBox(0, "String length is:", $len)
EndIf

<{POST_SNAPBACK}>

Ahh, sry i didnt read it, were out to lunch :idiot:

I thought about the GUIRead (as it was in the old beta) just thought it didnt existed anymore!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...