Author Topic: Bug after a simple print in a sub  (Read 1550 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Guest
Bug after a simple print in a sub
« on: May 23, 2018, 03:16:21 PM »
Testing O2debugger found a bug (last progress version)
With this code the 2 last print are not executed. But if you change "print vshort" by "print str(vshort)" it works.
However in more complex cases it's not enough : more code add to be added.

Code: [Select]
% FileName "test.exe"

sub testsub(vshort as short)
 print vshort
end sub

testsub(12)

print "after sub "

print "pgm exit"

Arnold

  • Guest
Re: Bug after a simple print in a sub
« Reply #1 on: May 24, 2018, 12:24:23 AM »
There are some situations where print does not work quite correctly. This special case can be overcome by using:
 print vshort ""

but I am not sure if this behaviour can be incorporated in Oxygen without producing side effects?

Charles Pegge

  • Guest
Re: Bug after a simple print in a sub
« Reply #2 on: May 24, 2018, 01:41:13 AM »
Hi Laurent,

Thanks. I've found the bug. It is an over-optimisation of procedures without locals. The quick fix is to include a local variable, but I will fix this behaviour ASAP.

PS:

Now fixed. The problem only applied to function calls (within the minimalist sub) with params which are auto-converted from a number to a string.

https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenProgress.zip
« Last Edit: May 24, 2018, 04:08:51 AM by Charles Pegge »