Re: Does Euphoria have a null statement?

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

On Fri, May 04, 2001 at 06:00:57AM -0400, freeplay at mailandnews.com wrote:
> 
> 
> All,
> 
> Does Euphoria have a null statement?  That is a statement which just does 
> nothing but is occasionally useful as a place holder during program 
> development?
> 
> As an example in C I might write something like:
> 
>     if (mode == MODE_TEXT)
>       ;
>     else if (mode == MODE_HTML)
>       process_html();
>     else
>       invalid_mode(mode);
> 
> The ; on it's own is C's null statement (well the ; is actually a statement 
> terminator and there is no statement but lets not get bogged down in this 
> stuff smile  Later while writing the code I might get round to updating it to:
> 
>     if (mode == MODE_TEXT)
>       process_text;
>     else if (mode == MODE_HTML)
>       process_html();
>     else
>       invalid_mode(mode);
> 
> In Euphoria I could write a procdure called donothing as follows:
> 
>   procedure donothing()
> 
>   end procedure
> 
> and then convert the above C code to the following Euphoria code:
> 
>   if MODE = MODE_TEXT
>     donothing()
>   elsif MODE = MODE_HTML
>     process_html()
>   else
>     invalid_mode(mode)
>   end if
> 
> but this seems a little "odd".  Is there something I could use instead of the:
> 
>   donothing()
> 
> I wonder - any ideas?
Try this:
   if MODE = MODE_TEXT
     --nothing here
   elsif MODE = MODE_HTML
     process_html()
   else
     invalid_mode(mode)
   end if
Eu doesn't care if you have a statment or not, also long as the structure is
properly terminated.
> 
> Regards,
> 
> FP.
jbrown
> 
> 
>  Create a new mailbox, or access your existing IMAP4 or
>  POP3 mailbox from anywhere with just a web browser.
How?
> 
> 
> 
> 

-- 
Linux User:190064
Linux Machine:84163
http://jbrown105.1avenue.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu