Recent Posts

Pages: « 1 2 3 4 5 6 7 8 9 10 »
51
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Theo Gottwald on September 14, 2022, 09:28:28 PM »
I think a standard BASIC should definitely include gosub and goto. They are most valuable for occasional use, o2 won't be dropping them any time soon.

I've now coded both static and redimable multidimensional arrays but it will need a period of careful testing. We can set the index-base and select column-major order as in PowerBasic, or row-major order (default) as in C and FreeBasic.

Generally a GOSUB will just compile into a JSR and a RET ... means single ASM-Mnemonics.
This is the base for efficient programming. I am using GOSUB very often.
One of the reasons, why i avoid Purebasic is, that due to the malformed Compiler Constructions,
there is no real GOSUB and RETURN that can compile into a single Instruction.
Must say that I am also from a Time where any CPU Cycle was worth counting.
Let me add that i registered today a new user from Mexico, name "Attila" and he also writes that he likes to count CPU Cycles and therefore wants to join the O2 Userbase. He writes:

". I still program sometimes for fun, I want to test ideas and algorithms in a few lines of code w/o having to use a RAD environment and all the bloatware associated whit it. Hence I'm researching alternatives, interpreted languages doesn't interest me too much, having worked with stuff where every byte and CPU cycle counts, it's hard to change habits...lol."

Lets see if we can welcome him here soon.

52
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Eduardo Jorge on September 14, 2022, 06:21:14 PM »
Charles
sorry i found it now
OxygenBasic\inf
oxyLog.txt
but a description and an example of use would be good
53
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Eduardo Jorge on September 14, 2022, 06:06:56 PM »
Charles
wouldn't you be able to put a "TXT" with the changes you make?
or already have it, where ?
so it should be easier since you would be documenting each modification,
and you wouldn't need to explain the changes, because it would already be in the file we downloaded.
  and someone else could help with the O2 documentation later by following this text file.
well, I don't know if it's easier or not, you have to decide what's best
54
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Karen Zibowski on September 14, 2022, 06:35:21 AM »
 Hi
 With all due respect, I do believe that GOTO and GOSUB are intrinsic statements of BASIC,  ever since
 BASIC was invented,  I do appreciate that these statements be retained in O2  ( OxygenBasic)
 Hope Charles is understanding on this aspect and Thank you so much

Karen
55
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Theo Gottwald on September 14, 2022, 06:14:11 AM »
Memory Allocation and Datatypes are - besides Constructs like Loops and If/else/endif (and such), are the key-features of a programming language.

While at "Loops and IF/ENDIF" Constructs, the programming Languages can not make much of a difference,
Powerbasic tried with CHOOSE$ which was not often used, the available Datatypes, - and what you can do with these
- make the difference.

Based on these features, all other things can be implemented later in a Wrapper Style.
Or in short: The language should deliver all the stuff that can not be added later "as Includes".
This is mostly not so much: IF, ENDIF, PROCEDURE, MACRO etc.

Anything that can easily be added later "as a module" or "as a include" must not not be hardcoded but can be added as a Include.
From whoever.

Besides that its important that the user is able to build up own Libraries with his most used Subprogramms.
In Powerbasic it was possible to build Libraries.

But when a Procedure needed an Entry in the "Sub Main()" or in "GLOBAL" it could not easily be done.
Also you could not put Stuff that will create a GUI into a Library because you could not "pre-formulate" the Code for the
Message-Que. In a way that you could build it up using Components from a Library".
 
I don't know if this could have been solved using Jose's GUI Library, but generally this is where Powerbasic failed.
So lets see if we can find way to make it better in the future.
56
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Eduardo Jorge on September 13, 2022, 11:37:33 PM »
I thought "EndFor" was just that basic thing from ms, I even thought "why put that?", but I searched here and saw other places that use it
but charles, in his personal, really personal view...
which would be the best way to go, because if you keep adding all possible variants, there will be no end.
in my humble opinion, you should just work on the base of the O2, to stay fixed, just change the speed issue and eliminate errors,
on that basis, there would be no more changes, neither in the type of variables nor in the functions, and from then on, just add things that you think can be useful
so whoever gets the O2 won't be afraid of you changing something, and the changes would only be to put new features, although I think you're already doing that
57
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Eduardo Jorge on September 13, 2022, 10:55:23 PM »
I had already downloaded P7, but I downloaded it again.
nice, O2 at least in the basic structure is compatible with most existing "basic" dialects
at least it's easier to write a keyword that changes the base of an array than to rewrite all the code in those arrays.
I wonder how difficult this is to implement to the point that other developers don't include it for better standardization.
of course the best would be just a pattern to not have messy codes, but as it is already like this the best would be to include all variants in all basic
58
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Charles Pegge on September 13, 2022, 09:07:50 PM »
Hi Eduardo,

This version supports static &  dynamic multidimensional arrays, and endfor/end for endselect for consistency :)

I am also trying  overlay, which is like redim, but without memory allocation. You supply the base address instead.

row-major order is the default but can be set using #majorminor
column-major order is set with #minormajor
These are global switches, and modules have to be aware of them, as well as the indexbase

There is some more testing to be done using the arrays but I have just refreshed P7

https://github.com/Charles-Pegge/OxygenBasic/blob/master/OxygenBasic050P7.zip
59
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Eduardo Jorge on September 13, 2022, 05:13:43 PM »
Charles,
first... good morning, good afternoon, good night
I saw that you posted a new version of O2.
Can you tell what's different about this version?
60
OxygenBasic / Re: O2 Arrays / BASIC Standardization
« Last post by Eduardo Jorge on September 13, 2022, 05:11:00 PM »
Johan Klassen

"goto" and "gosub" created spaghetti code when they were the only ways to structure routines.
"gosub" nowadays is just to avoid creating functions for small routines.
already "goto" I use a lot, "IF" condition "Then" "Goto"
and nowadays the numbers of lines are not used anymore, the labels can be very descriptive, much more than the names of functions.
Pages: « 1 2 3 4 5 6 7 8 9 10 »