Author Topic: My bug or O2?  (Read 1255 times)

0 Members and 1 Guest are viewing this topic.

Alex_Longard

  • Guest
My bug or O2?
« 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?

Charles Pegge

  • Guest
Re: My bug or O2?
« Reply #1 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

Alex_Longard

  • Guest
Re: My bug or O2?
« Reply #2 on: July 07, 2018, 09:40:34 AM »
Hi Charles,
big thanks, all code work!