Hello all, I'd like to start by saying this is a great program that has potential to change the world :sign0098:
Anyways, I've been working on trying to get a code working for ~2 hours now and no hope. The original (VB-verified and working) code is:
and the one I have in B4A is:
Whenever I try to compile and run my program I get a syntax error on the top line,
Sub gcd (Byval a As Long, Byval b As Long) As Long.
I can't seem to get this working. In the end it's supposed to reduce my fractions.. Any tips?
Anyways, I've been working on trying to get a code working for ~2 hours now and no hope. The original (VB-verified and working) code is:
B4X:
Function gcd(ByVal a As Long, ByVal b As Long)
Dim temp As Long
Do While b > 0
temp = b
b = a Mod b
a = temp
Loop
gcd = a
End Function
and the one I have in B4A is:
B4X:
Sub gcd (Byval a As Long, Byval b As Long) As Long
Dim temp As Long
Do While b > 0
temp = b
b = a Mod b
a = temp
Loop
gcd = a
End Sub
Whenever I try to compile and run my program I get a syntax error on the top line,
Sub gcd (Byval a As Long, Byval b As Long) As Long.
I can't seem to get this working. In the end it's supposed to reduce my fractions.. Any tips?