Sign in to follow this  
Followers 0
boltc

if not.. help needed

5 posts in this topic

jep i know.. i am the biggest noob i ever saw:)

i still cant get this work..

Func _plusminfunc($input, $knop)

if (GUICtrlRead( $knop ) <<<<<<<<<< IS NOT >>>>>>>>>> "=") Then

Local $read = GUICtrlRead( $input )

Local $plusmin = StringLeft( $read, 1 )

Switch $plusmin

Case "-"

GUICtrlSetData( $input, StringTrimLeft( $read, 1 ) )

Case Else

GUICtrlSetData( $input, "-" & $read )

EndSwitch

EndIf

endfunc

i want to run this func only when $knop is not "= "

but dont know what to put there

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

i want to run this func only when $knop is not "= "

but dont know what to put there

Something like this maybe?

If (GUICtrlRead( $knop )) <> "=" Then _plusminfunc($input, $knop)

Func _plusminfunc($input, $knop)
if  (GUICtrlRead( $knop )) <> 0 Then
    Local $read = GUICtrlRead( $input )
    Local $plusmin = StringLeft( $read, 1 )
    Switch $plusmin 
        Case "-"
            GUICtrlSetData( $input, StringTrimLeft( $read, 1 ) )
        Case Else
            GUICtrlSetData( $input, "-" & $read )
    EndSwitch
    EndIf
endfunc

Edit: Sorry, you ment the literal "=". Edited.

Edited by Snarg

A little reading goes a long way. Post count means nothing.

Share this post


Link to post
Share on other sites

Something like this maybe?

If (GUICtrlRead( $knop )) <> "=" Then _plusminfunc($input, $knop)

Func _plusminfunc($input, $knop)
if  (GUICtrlRead( $knop )) <> 0 Then
    Local $read = GUICtrlRead( $input )
    Local $plusmin = StringLeft( $read, 1 )
    Switch $plusmin 
        Case "-"
            GUICtrlSetData( $input, StringTrimLeft( $read, 1 ) )
        Case Else
            GUICtrlSetData( $input, "-" & $read )
    EndSwitch
    EndIf
endfunc

Edit: Sorry, you ment the literal "=". Edited.

(GUICtrlRead( $knop )) shouldn't have () that it should be more like GUICtrlRead( $knop )

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

thankyou guys..

i didnt know what the operators are for is not:)

greets

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0