Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Compiler > Re: Tom Lake
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 147 of 151
Post > Topic >>

Re: Tom Lake

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
 




 3 Posts in Topic:
ATTN: Tom Lake
"Geeza" <a@[  2008-04-03 17:07:07 
Re: Tom Lake
"Tom Lake" <  2008-04-03 13:01:17 
Re: Tom Lake
"Tom Lake" <  2008-04-03 13:08:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 19:44:52 CDT 2008.