Oxygen Basic

Programming => Problems & Solutions => Topic started by: Alex_Longard on July 07, 2018, 06:04:32 AM

Title: My bug or O2?
Post by: Alex_Longard on July 07, 2018, 06:04:32 AM
Hi Charles and all others!
I write small test, and this not work in latest Oxygen release.

Code: [Select]
#compact
' $ filename "test.exe"
' include "inc\rtl64.inc"
include "inc\kernel.inc"

int a, b

function test(int a1, int b1)
return a1+b1
end function

a = GetTickCount()

for i = 0 to 1000000000
test(2, 5)
next

b = GetTickCount() - a

print b


This show bug:
Code: [Select]
ERROR: Iteratator must be defined
WORD: i
LINE:  14
FILE:  main source

How to change this?
Title: Re: My bug or O2?
Post by: Charles Pegge on July 07, 2018, 09:14:13 AM
Hi Alex,

In the most recent releases, o2 requires that all variables are explicitly dimensioned. So you will need:

int a, b, i

But you can still revert to the original behaviour with:

#autodim on
Title: Re: My bug or O2?
Post by: Alex_Longard on July 07, 2018, 09:40:34 AM
Hi Charles,
big thanks, all code work!