Interactive PowerBasic Forum

IT-Consultant: Charles Pegge => OxygenBasic => Topic started by: Frank Brübach on October 04, 2023, 04:19:02 AM

Title: Latest oxygen package
Post by: Frank Brübach on October 04, 2023, 04:19:02 AM
Hi all I have downloaded latest oxygen package of 3 month ago.
There are some Problems with OpenGL folder Grafide grafide1.o2bas (works) and grafide2.o2bas (doesnt Work) and objectviewer.o2bas File and Procedure "skiplspace" causes some Errors even in all Inc Files Same folder.. and lambo.stl (3d model) missing too.. would be Glad to fix IT thanks a Lot Bye Frank
Title: Re: Latest oxygen package
Post by: Charles Pegge on October 04, 2023, 02:34:05 PM
Hi Frank,

I've fixed the problem. It was in the compiler, caused by macro definitions inside class definitions within objinterp.inc.

https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenBasic07P6.zip
Title: Re: Latest oxygen package
Post by: Frank Brübach on October 04, 2023, 02:40:05 PM
Oh so fast many thanks! :)

PS I have No sheep Farm for my boarder Collies only our Family lol
Title: Re: Latest oxygen package
Post by: Frank Brübach on October 08, 2023, 01:23:44 PM
Hi charles, I have noticed that you have changed Last Time oxygen package building by Freebasic to self compiling.. whats the benefit of all? 
I was absent for some years. I have used for a Long Time Powerbasic and liked IT very. But oxygen I love now since I have done a closer deeper Look in programming structure. Respect because I have No Idea of Assembler Code.

My Intention was to create a 3d modeller but was Always unsatisfied of Other compilers they we're Handling too complicated or failed Support...

I am only asking what disadvantage you can observe of a self compiling oxygen Basic language... Thx

Bye Frank
Title: Re: Latest oxygen package
Post by: Charles Pegge on October 09, 2023, 02:51:47 PM
Self-compiling has many advantages, for instance having subroutines, and large strings. o2 has no dependencies apart from the Windows API. So o2 and all its tools are written in one language.

The main disadvantage is not being able to move to another non-MS platform. I see that most compilers/interpreters ride on the back of GCC. They are written in C or C++ and take advantage of GCC linkage to a host of different platforms and processors.
Title: Re: Latest oxygen package
Post by: Frank Brübach on October 09, 2023, 05:54:26 PM
Thanks Charles for Infos. The gnu Compiler collection is an interesting stuff indeed. I have visited joined an IT Course some years ago with c++ and Java python language beside economic Lessons and knowledge. Most of These languages are pre defined unflexible not Open and thats a Point I dont Like and too big..

My knowledge about Linux Unix etcpp are however Zero.

So its Not possible to Convert oxygen for example to Linux because of necessary
and depending Windows API?

Best regards
Title: Re: Latest oxygen package
Post by: Charles Pegge on October 10, 2023, 10:59:52 PM
Time is the problem. In anticipation, I have a Raspberry Pi 4, which uses ARM processors and runs Linux. But for graphical apps, I think MS/PCs will always have the lead.
Title: Re: Latest oxygen package
Post by: Theo Gottwald on October 11, 2023, 09:02:18 PM
A self compiling package has the advantage of automated Testing.
As a Compiler is a complex tool itself, by compiling itself you already tested large parts of it.
Testing and debugging is often the largest part of programming.
How do you see that Charles?
Title: Re: Latest oxygen package
Post by: Charles Pegge on October 11, 2023, 09:50:03 PM
Yes, Self compiling is very sensitive to deeply hidden errors. It's a good test of integrity, though it won't include all the language features. For instance it does not use floating-point maths or OOP.
Title: Re: Latest oxygen package
Post by: Pierre Bellisle on October 15, 2023, 08:08:45 AM
For the 07P7 version,  thank you Charles !
Title: Re: Latest oxygen package
Post by: Nicola on October 18, 2023, 02:06:19 PM
Hi Charles.
I renew my greetings to you and all the readers of the forum.
It's been a while since I was able to do anything because of so many family commitments.
Anyway thank you so much for everything you do... It's really excellent. Just as I really appreciate the various interventions of the dear friends of forum who actively intervene.
I downloaded version 7P7, but I was surprised that window defender finds a virus....
Cheers
Title: Re: Latest oxygen package
Post by: Charles Pegge on October 18, 2023, 07:07:44 PM
Thanks Pierre and Nicola.

Sometimes, I also get problems from Windows security with a new build. I have to get it to override the quarantine and restore oxygen dll. But it does not happen very often.
Title: Re: Latest oxygen package
Post by: Theo Gottwald on October 18, 2023, 09:28:16 PM
You can download the Setup-Version, which contains files that are digitally signed.
These files will not make you problems, even in an company environment.
Title: Re: Latest oxygen package
Post by: Nicola on October 18, 2023, 11:23:51 PM
Ok Charles,
I took the liberty of sending the files they considered infected to the Window Defender team...: The answer is that THEY ARE NOT MALWARE!
I enclose their response.

It looks like they'll also remove control over the files in question.

Cheers



Title: Re: Latest oxygen package
Post by: Charles Pegge on October 19, 2023, 12:26:55 PM
Thanks Theo and Nicola. I don't anticipate further changes to the core binary, but Windows Security may change its detection algorithms occasionally, and cause problems.
Title: Re: Latest oxygen package
Post by: Frank Brübach on December 18, 2023, 10:57:35 AM
Good morning Charles hi all

Any News about next oxygen Update?

Good Luck and Progress

Regards Frank
Title: Re: Latest oxygen package
Post by: Charles Pegge on December 21, 2023, 09:20:05 AM
I've just released 07P9

https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenBasic07P9.zip

https://sourceforge.net/projects/oxygenbasic/postdownload

mostly technical but improved redim

QuoteRELEASE 0.7.0P9  21/12/2023

20:52 19/12/2023 Support C-style multidim x[..][..].. (rarray fixsqbr)
09:06 19/12/2023 Support C-style if(..) / While(..) for(...) single statement (tran.inc captsr)
22:26 09/12/2023 Restore Remap (lang.inc)
21:39 08/12/2022 Fix sub-array indexing (expr.inc arcc=0)
17:48 02/12/2023 New Instrp pattrn search '*' '?' (parseutil.inc)
17:45 02/12/2023 Rework Inkey and Get. Make KeyRecord available (console.inc)
18:51 30/11/2023 Create Ogl.inc to contain Opengl Headers
22:44 23/11/2023 Fix operator finding (meta.inc findop)
22:27 16/11/2023 Redesign redim and array_mep
22:27 16/11/2023 Revoke overlay
22:27 16/11/2023 Redesign dim attributes table (ubound)
02:46 14/11/2023 Fix ubound() and elements() for 1d arrays (decl.inc lang.inc)
Title: Re: Latest oxygen package
Post by: Nicola on December 21, 2023, 10:54:57 PM
Thank you Charles :)
Title: Re: Latest oxygen package
Post by: Charles Pegge on December 22, 2023, 08:31:47 AM
Here is a demo of a redim array being passed to a function:

'PASSING A REDIM ARRAY
'CP 22 Dec 2023

uses console

def show
  print "%1" tab %1 cr
end def
'
function f(int *rr[redim])
==========================
print "carried param dimensions" cr cr
show (ubound(rr))
show (ubound(rr,1))
show (ubound(rr,2))
show (ubound(rr,3))
print cr
redim int rr(4,3,4) 'expand array
end function
'
'
redim int r[2,3,4]
print "initial dimensions" cr cr
show (ubound(r))
show (ubound(r,1))
show (ubound(r,2))
show (ubound(r,3))
print cr
f(r)
print "altered dimensions after call" cr cr
show (ubound(r))
show (ubound(r,1))
show (ubound(r,2))
show (ubound(r,3))
print cr
'
print "ok" cr
wait
Title: Re: Latest oxygen package
Post by: Charles Pegge on December 22, 2023, 08:31:00 PM
This version also supports C-style multidimensional arrays:

dim int a[1][2][3]
'19/12/2023
dim int a[1][2][3]
int b
'print dims(a)+"  "+ubound(a)
a[1,1,2]=34
print a[1,1,2]
b=a[1][1][2]
print b
Title: Re: Latest oxygen package
Post by: Pierre Bellisle on December 24, 2023, 08:55:06 AM
Thank Charles! :-)
Title: Re: Latest oxygen package
Post by: Theo Gottwald on December 26, 2023, 11:43:15 AM
@Charles, does it support redimension without destroying the content?
Which will need you to internally move the data to a temporary array and then copy them back.
This would be an interesting feature.
Title: Re: Latest oxygen package
Post by: Charles Pegge on December 26, 2023, 12:44:25 PM
Yes Theo,

The content is preserved by default. The dynamic array content is held in an OleString, so it can be manipulated like a string.

To clear the content:
redim int v[n] clear
Title: Re: Latest oxygen package
Post by: Nicola on December 26, 2023, 06:10:08 PM
wow Charles, this is new. 
Very good!
Title: Re: Latest oxygen package
Post by: Eduardo Jorge on December 27, 2023, 01:44:43 PM
hello everyone, with a stone age computer here,
Charles Pegge would it be possible to use the oxygen dll from within vba and have values returned?
Title: Re: Latest oxygen package
Post by: Nicola on December 27, 2023, 04:32:16 PM
Hi Charles.
Is Reindex still supported? If so, could you explain its use?

Cheers
Title: Re: Latest oxygen package
Post by: Charles Pegge on December 27, 2023, 10:14:05 PM
Hi Eduardo,

It's probably best to use Oxygen to develop DLLs that interface with VBA for your data processing.
Title: Re: Latest oxygen package
Post by: Charles Pegge on December 27, 2023, 10:20:47 PM
Hi Nicola,

Reindex takes a a filter macro and a sort macro, and data count. It does not touch your primary data, but produces index arrays for the data. It is primarily designed for database work.

Here is a test example:
'09/12/2022
'REINDEX TESTS
uses console
'indexbase 0
'int d={9,8,7,6,5,4,3,2,1,0}
'int d={8,9,6,7,4,5,2,3,0,1}
redim int d(100)
d={8,9,6,7,4,5,2,3,0,1} 'raw data
redim int d(10)
int m=10
'
macro filter(r,i)
=================
if d[i]>=5
  r=1
endif
end macro
'
macro compare(r,i,j)
====================
'if d[i]>d[j] 'ascending
if d[i]<d[j] 'descending
  r=1
endif
end macro
'
reindex idx,m,n,filter,compare
'
'  idx     index to be created
'  m       count of data elements
'  n       count of resulting index
'  filter  filter macro
'  compare comparison macro
'
'PARTIAL USE OF REINDEX
'reindex idx,m,n,filter
'reindex idx,m,n,,compare
'reindex idx,m,n
'reindex idx,m : int n=m
'
'RESULTS
'=======
print "total " n cr cr
print "#"  tab "INDEX" tab "DATA" cr
int i,j
for i=indexbase to n+indexbase-1
  j=idx[i]
  print i tab j tab d[j] cr
next
print cr cr
del idx
wait
Title: Re: Latest oxygen package
Post by: Nicola on December 27, 2023, 11:42:59 PM
Thanks Charles.

Another clarification: how is the behavior of "clear" with string arrays? In a previous note you wrote "to flush an array's contents, redim it with 0 elements first. But avoid doing this with arrays of strings; the orphaned strings are not garbage-collected until the end of the program, and will accumulate on each iteration where the redim reduces the number of elements."


Title: Re: Latest oxygen package
Post by: Charles Pegge on December 28, 2023, 12:16:05 AM
This has been improved. The old strings are now flushed from memory, and replaced with new null strings. Similarly, the destructors of objects are invoked, and each object is initialized by its constructor, wherever these procedures are defined.

redim reindex new and del are all macros defined in inc\self\lang.inc as outer core commands.
Title: Re: Latest oxygen package
Post by: Nicola on December 28, 2023, 02:51:23 PM
Redim in the new help file
Title: Re: Latest oxygen package
Post by: Theo Gottwald on December 29, 2023, 12:02:39 PM
@Charles Pegge, does it mean i can redim a multidimensional array on any dimension and the internal content is moved in memory as it should to fit the new size?
Title: Re: Latest oxygen package
Post by: Charles Pegge on December 29, 2023, 01:24:58 PM
Redim uses a simple block copy to preserve the data, so you have to be careful when redefining dimensions.

You can also use another closely related construct remap, which allows you to access any buffer or block of data in terms of new dimensions

for instance:

redim int d(10000)
remap byte b(10000,4)
@b=@d
d[7]=0x103
print b[7,1] '3
print b[7,2] '1