PDA

View Full Version : OxygenBasic



primo
03-10-2022, 14:16
new and nice version here
https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenBasic050P10.zip

click on the "..." besides 5.27 MB then download

many nice OpenGl examples from simple to complex
many other demos
the forum is here:
http://www.jose.it-berater.org/smfforum/index.php?board=154.0

Charles Pegge
06-10-2022, 11:37
I've just updated thinBasic_Oxygen :)
https://github.com/Charles-Pegge/OxygenBasic/blob/master/thinBasic_Oxygen.zip


@Eros
The included examples folder has a selection of scripts which belong in /thinBasic/SampleScripts/Oxygen/ . Unfortunately the scripts in this folder are nearly all broken and obsolete. I think they should be removed entirely and replaced by the current examples.

Charles Pegge
07-10-2022, 15:47
O2 now supports multidimensional arrays. To be compatible with thinBasic and PowerBasic it must use Column-major order for which there is a switch: #minormajor. Otherwise, the default is row-major as in C and FreeBasic: #majorminor





uses "oxygen"


'SHARED VARIABLES
'================


dim as string src
dim as single v(4,4)
'
'OXYGENBASIC SECTION
'===================
src="
#minormajor 'thinBasic and Powerbasic mode
indexbase 1
overlay single v(4,4)
@v=#v 'link to host variable v
dim as long w,x,y
for y=1 to 4
for x=1 to 4
w++
v(x,y)=w 'fill 1 to 16
next
next
"


'COMPILE
'=======


o2_basic src
if o2_errno then
msgbox 0,o2_error
stop
else
o2_exec
'msgbox 0,"ok"
end if




'MAIN THINBASIC SECTION
'======================


'array Order: 1, 2, 3, 4
msgbox 0,"Order: "+v(1,1)+", "+v(2,1)+", "+v(3,1)+", "+v(4,1)

Charles Pegge
15-10-2022, 13:29
I've introduced a new command: o2_run, which is a combination of o2_basic and o2_exec. It simplifies the script and reports any compile errors directly.

OxygenBasic/thinBasic_Oxygen.zip at master · Charles-Pegge/OxygenBasic (github.com) (https://github.com/Charles-Pegge/OxygenBasic/blob/master/thinBasic_Oxygen.zip)

This is the above code using o2_run



'02:01 15/10/2022


uses "oxygen"

'SHARED VARIABLES
'================

dim as single v(4,4)
'
'OXYGENBASIC SECTION
'===================


o2_run " 'combined o2_basic and o2_exec
#minormajor 'thinBasic and Powerbasic mode
indexbase 1 'lbound
overlay single v(4,4) 'map for the array
@v=#v 'link to host variable v location
dim as long w,x,y
for y=1 to 4
for x=1 to 4
w++
v(x,y)=w 'fill 1 to 16
next
next
"


'MAIN THINBASIC SECTION
'======================

'array Order: 1, 2, 3, 4
msgbox 0,"Order: "+v(1,1)+", "+v(2,1)+", "+v(3,1)+", "+v(4,1)

ErosOlmi
18-10-2022, 17:42
Ciao Charles,

next week-end I will release a new thinBasic update.
I will insert your latest Oxygen Basic release.

Is it correct to take thinBasic_Oxygen.zip content for distribution for thinBasic?

Thanks
Eros

Charles Pegge
19-10-2022, 07:00
Yes Eros,

I include key examples. I've also included RTL32.inc and also RTL64.inc so you can create 32 and 64 bit binaries.

oxygen.dll has been brutally UPXed to 122kb

I've just posted another update, so use the latest :)