Posted: 31st Oct 2003 17:56
i didn't find such modulo dividison in DBPro or a DLL what is written in C like this

0 % 4 = 0
1 % 4 = 1
2 % 4 = 1
3 % 4 = 1
4 % 4 = 0
5 % 4 = 1
6 % 4 = 1
7 % 4 = 1
8 % 4 = 0
9 % 4 = 1
10 % 4 = 1
11 % 4 = 1
12 % 4 = 0
13 % 4 = 1
14 % 4 = 1
Posted: 31st Oct 2003 17:58
+ Code Snippet
x = mdiv(0,4)  :  set cursor 0,20  :  print x
x = mdiv(1,4)  :  set cursor 0,40  :  print x
x = mdiv(2,4)  :  set cursor 0,60  :  print x
x = mdiv(3,4)  :  set cursor 0,80  :  print x
x = mdiv(4,4)  :  set cursor 0,100 :  print x
x = mdiv(5,4)  :  set cursor 0,120 :  print x
x = mdiv(6,4)  :  set cursor 0,140 :  print x
x = mdiv(7,4)  :  set cursor 0,160 :  print x
x = mdiv(8,4)  :  set cursor 0,180 :  print x
x = mdiv(9,4)  :  set cursor 0,200 :  print x
x = mdiv(10,4) :  set cursor 0,220 :  print x
x = mdiv(11,4) :  set cursor 0,220 :  print x
x = mdiv(12,4) :  set cursor 0,220 :  print x
x = mdiv(13,4) :  set cursor 0,220 :  print x
x = mdiv(14,4) :  set cursor 0,220 :  print x
wait key





Function mdiv(p1#,p2#)
a# = p1# / p2#
if a# - int( a# ) > 0
   Result =1
else
   Result =0
endif
EndFunction Result
Posted: 31st Oct 2003 18:10
Although not keyword highlighted in the editor,
try this program:

Print 23 Mod 7
Wait Key

DBP does indeed have the modulo function.
Posted: 31st Oct 2003 22:39
I am no longer current on C but

14 mod 4 = 2 not 1
Posted: 31st Oct 2003 22:58
@heartbone cool thx i was seeking so long for this it's surley a faster thing

@codger on the real mod it should be 5 from 3.5
the routine i wrote was only to check for example every 4th number and so, so the result of 0 or 1 is the mostly important point