Re: field size

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

Euphoria uses a single statement for single conditional and multiple =
conditionals:

if some_var =3D 'a' then

elsif some_var =3D 'b' then

elsif some_var =3D 'c' then

else

end if

Assuming this is a menu, and I want multiple choices to call the same =
routine, I can use the find() function if 'menu' is an atom:

if menu=3D'a' then

elsif find(menu,"QqXx9") > 0 then
  close_program()
  abort(0)
else

end if

As for goto, there are several pros and cons which have been discussed at =
length on this forum.  Goto can be programmed around by using subroutines =
and routine_id(), which doesn't always make the cleanest solution.  Yet, =
if your Basic program were written properly, goto would only be used in =
if/elsif, while, or routine() situation (Disclaimer: this is my own =
opinion as a BBx programmer, and does not reflect the opinions of most =
others on this list).

HTH,
Michael J. Sabal


>>> gwalters at sc.rr.com 07/27/01 08:28AM >>>
So far I like EU, but it has some limitations that I would like to see =
improved. My (and Lucy's) programming style heavily uses  select/case/cend.=
..and EU being so structured i'm supprised that it doesen't have it.

    select some.var
        case 'a"
            do something
        case 'b'
            do something
        case 'c'
            do something
        otherwise
            catch all here
    cend .....or ala EU end select

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

Search



Quick Links

User menu

Not signed in.

Misc Menu