fn() in qb64

Coding and scripting with FreeBasic, C++, JavaScript etc.

Moderators:Administrator, Global Moderator

Post Reply
digamma
Newbie
Posts:1
Joined:Sun Jul 28, 2019 3:16 pm
fn() in qb64

Post by digamma » Sun Jul 28, 2019 3:42 pm

My former Quickbasic list works well in QB64 but old easy fn() functions are not accepted
DECLARE FUNCTION are needed.

So, I need to transform:
'-------------------------------------------------
declare fny(l)=360*(l/360-int(l/360))

then many times e.g
l0=fny(l0) : v1=fny(v1) etc.

-------------------------------------------------
into equivalent with DECLRE FUNCTION or some easier equivalent
Please enlist...
Grateful!
digamma

User avatar
crossroads
Administrator
Posts:34
Joined:Wed Feb 13, 2002 10:15 pm
Location:Germany
Contact:

Re: fn() in qb64

Post by crossroads » Thu Aug 01, 2019 2:42 pm

Try this one:

Code: Select all

DECLARE FUNCTION fy! (value AS SINGLE)

CLS
a! = 420.75
a! = fy(a!)
PRINT a!

FUNCTION fy (value AS SINGLE)
  fy = 360 * (value / 360 - INT(value / 360))
END FUNCTION
crossroads (QBCafe Forum Admin)

Post Reply