by "Tom Lake" <tlake@[EMAIL PROTECTED]
>
Apr 3, 2008 at 01:08 PM
"Tom Lake" <tlake@[EMAIL PROTECTED]
> wrote in message
news:ft32dh$evf$1@[EMAIL PROTECTED]
>
> "Geeza" <a@[EMAIL PROTECTED]
> wrote in message
news:AO6Jj.3945$8p4.2810@[EMAIL PROTECTED]
>>I tried it, but Freebasic wasn't having anything to do with it.
>
> I had -lang qb on the command line
>
> Try this:
>
> declare function gcd(x as single,y as single) as single
> print gcd(112,144)
> sleep
>
> function gcd(x as single,y as single) as single
> dim q as single, r as single
> do
> q=int(x/y)
> r=x-q*y
> x=y
> y=r
> loop until r<=0
> gcd=x
> end function
<rant> While I'm at it, the above requirement to declare all variables
goes against
the
entire intention of BASIC. Find a copy of Back to BASIC by John Kemeny
and
Tom Kurtz (the authors of BASIC) and you'll get a good feeling for what
BASIC
is really supposed to be. </rant>
Tom Lake