Page 1 of 1

fn() in qb64

Posted: Sun Jul 28, 2019 3:42 pm
by digamma
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

Re: fn() in qb64

Posted: Thu Aug 01, 2019 2:42 pm
by crossroads
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