Blitz (55/218)

From:Richard Brooklyn
Date:2 Aug 2001 at 11:08:05
Subject:Re: How do I:

> However, I am confused at how to define one.

This depends on what you want to do.

There are two types of "functions" in Blitz; statements and functions. Both
do exactly the same job, except that functions can return a value.

> My piece of code doesn't really do much appart from print, so I guess it
> could be left in the main piece of the code, but for the sake of the
> excercise, how is it done?
>
> .printtime
> ????????? <---- What goes here?

Statement statementnamehere{}

> h = Hours
> m = Mins
> s = Secs
>
> Print "Logging data at time ",h, ":", m, ":", s
> Print " with time interval of ",tdelay.l," Seconds"
>
> End ??????? <----- and here?

End Statement

If you want to use functions. Then use Function and End Function. To make a
function return a value, use "function return <value>"

Is relly is that simple. To call the statement, use "statementname{}".
Functions will require you to give a varible for the return value. Something
like "b=functionname{}" will do.

Hope this helps.

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie