Jump to content
Sign in to follow this  
boltc

if not.. help needed

Recommended Posts

boltc

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
Snarg

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
Somerset

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

 

Share this post


Link to post
Share on other sites
boltc

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  

×