Jump to content

if not.. help needed


boltc
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
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 )
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...