Re: Another Error

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

Rich Klender wrote:
> 
>         Correct = prompt_string("Is this correct? y/n")
> 
>         if Correct = 'y' or Correct = 'Y' then
>             return ReturnCode = 1   
>         end if
> The problem is in the last if/then statement, if the user inputs 'y' then it
> returns to the main program, if not I want it to fall thru and the user
> re-inputs
> the correct data.  I get the following error:
> 
> H:\test1.ex:24 in function AddFactions() 
> true/false condition must be an ATOM 
>     C = 1
>     FactionName = "asdf"
>     FactionPassword = "asdf"
>     Correct = "n"

You're trying to compare an atom (the 'y' and 'Y') and a sequence
(Correct, which is "n"); that is a no-no in Euphoria. Use either:

    if find(Correct,"Yy") then

or

    if Correct[1] = 'Y' or Correct[1] = 'y' then

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

Search



Quick Links

User menu

Not signed in.

Misc Menu