RE: if statement not working

new topic     » goto parent     » topic index » view thread      » older message » newer message

Sorry, I misunderstood the question. :P

I like the fact that = only works for numeric comparison.
I'd like to see == for object comparisons though, instead of equal()

Chris

xxmyt at yahoo.com wrote:
> hello everyone. 
> 
> the code i pasted down works properly. however, it doesnt work in the 
> second way.
> 
> my code:
> include dos32lib.e
> without warning
> 
> constant
>     Win     = create( Window, "PASSWORD REQUIRED", 0, Default, Default, 
> 400, 200, 0 ),
> 
>     Sle1    = create( EditText, "", Win, 10, 40, 120, 20, 0 ),
>     Button1 = create( PushButton, "OK", Win, 180, 40, 120, 20, 0 )
> 
> 
> procedure onClick_Button1()
> 
>      if  equal(getText(Sle1),"YES") then
>          closeWindow(Win)
>      end if
> 
> end procedure
> 
> onClick[Button1] = routine_id("onClick_Button1")
> 
> WinMain( Win )
> 
>   but if i change the if statement this way, i get an error message:
> 
>      if  getText(Sle1) = "YES" then
>          closeWindow(Win)
>      end if
> 
> error message says, the result of the if statemnt should be an atom. 
> 
> so whats it all about?
> 
> 
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu