• Welcome to Jose's Read Only Forum 2023.
 

O2 Arrays / BASIC Standardization

Started by Eduardo Jorge, September 03, 2022, 11:14:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eduardo Jorge

oxygen relies on macros to work with multidimensional arrays.
macro a(x,y) av(y*1024+x)
  dim int av[1024*1024]

  a(100,200)=42
  print a(100,200) ;42

for many this is difficult to deal with, and for projects with many arrays it is boring to create macros for each one, of course it is a tool that makes more complex things easier.
on ide they could combine to put them already distributed with oxygenbasic as easily as oxide to start.
oxygen is quite easy, so making these questions more accessible to those who are just curious but can't even make a little program work because to make the compilers work is another puzzle.

Charles Pegge

#1
Hi Eduardo,

You can also use a Type to define the second dimension for an array. It's an extra line of code, but no macros:


'array dims using udt
type yy int x[100]
yy y[1000]
int a
int i=10
int j=20
y[i].x[j]=123
a=y[i].x[j]
print a '123
print y[10].x[20] '123


You can also create arrays with mixed member types


'array dims using udt
'with mixed elements
type sy
  char c[16]
  int x[100]
end type
'
sy y[1000]
string t
int a
int i=10
int j=20
y[i].c="Hello"
y[i].x[j]=123
a=y[i].x[j]
'
'Hello  123
print y[i].c "  " y[i].x[j]
print y[10].c "  " y[10].x[20]


Zlatko Vid

well that is about arrays
and what a heck is so problematic to use single arrays or UDT members for
multi-dimensions ?

Charles

I really don't know why you still keeping old AsciEdit in Scintilla folder?

PLEASE feel free and add latest release of AurelEdit to this folder.
i compiled it with SC 040 and work well !

PS..If someone need it i can try build 64bit version?

Eduardo Jorge

#3
Lol Charles, I think I'd rather stick with the macros.

Zlatko Vid, no problem using single arrays, not even with utd.
but when you think of tables, you think of a multidimensional array, and the standard usage you find is not that, mainly in Basic and in C, which are the bases of Oxygen.

the ease of executing a command line, creating a dll with oxygem can be a big draw for those who want simple things and are faced with the complications of making existing ide´s and compilers work.
if you attract the curious, you can attract people with more professional use and even people able to contribute.

there are several types of markets that, despite being small, if they have certain functions incorporated, could attract a lot of attention since in other platforms there are certain difficulties in implementing them.

Zlatko Vid

Eduardo

QuoteZlatko Vid, no problem using single arrays, not even with utd.
but when you think of tables, you think of a multidimensional array, and the standard usage you find is not that, mainly in Basic and in C, which are the bases of Oxygen.

the ease of executing a command line, creating a dll with oxygem can be a big draw for those who want simple things and are faced with the complications of making existing ide´s and compilers work.
if you attract the curious, you can attract people with more professional use and even people able to contribute.

there are several types of markets that, despite being small, if they have certain functions incorporated, could attract a lot of attention since in other platforms there are certain difficulties in implementing them.

how many BASIC users need or use tables or multi-dimensional arrays?
i all current activity around BASIC dialects ..there are just graphic progies and similar mumbo-jumbo

creating .dll with Oxygen basic cannot be simplier ..much simplier in many other compilers like FB or PB
another thing is ..if someone is soo lazy and can't write
$ filename "MyDLL.dll" ....i am asking you ..is that really hard to type ???

if you attract the curious, you can attract people with more professional use and even people able to contribute.

curious...but who ?
where are former users of Powerbasic ? ..why they don't contribute in o2..
some of them go to FB ...that are just few enthusiast
where are young programmers ...beginners ..i don't see them around any BASIC dialect
and etc..etc ...

Eduardo Jorge

sorry i use google translator and it might not translate to the context of what i want.
I didn't say that it's hard to create dll on O2, it was just the opposite, it's very easy to create an executable and dll on O2.

Just because you don't use it doesn't mean others don't.

I'm talking about curious people in general, I was curious, I bet you were also curious and ended up liking the O2.

yes, it has many dialects basic, power basic, purebasic,...
of course, many may find the free O2 the most attractive part, others may be afraid of the fact that O2 has a single developer and what happened with power basic , or even because it is not commercial, the developer changes everything from one hour to another.

It lacks advertising, it also lacks some tools and facilities as I said a competent ide, of course that's not the main thing, I think most of it goes by the existence of "Form", and even being able to use the windows tools directly in a native way.

the big issue with basic is the lack of standardization, I went to look at purebasic and it doesn't have "Then" in the "if", it uses "EndIf" instead of "End If",
Then you're going to tell me that it doesn't matter, that looking at these things is just because I'm lazy?
migrating from one to another is a very difficult task. so people switch to the ones that have as many tools as possible, or they just give up on basic and try to learn another syntax even though they don't like it.

Theo Gottwald

Thats why i prefer to stick - where possible - with the original Powerbasic-Syntax.
Just a minor change, for Labels i would prefer to have the ":" at the left side, because it makes the Parsing easier.

Eduardo Jorge

#7
Just because you don't use it doesn't mean others don't.
> whoever told you that, I made some dll.s in o2 and one for new lang called Dragon written in Java to test the GUI API
on windows 64bit

I'm talking about multidimensional arrays

> this single developer story is mantra I see few people out there complaining in loop all the time
which is pure speculation

yes, but there are people who are afraid to start using it and suddenly have to change

> migrating from FreeBasic or QB64 to Oxygen Basic is easy...as I know..I use them a lot, casual basic programmer will find out the difference in a day

to start using it can be easy, but to migrate internal projects it is not
imagine you with a project of thousands of lines, and out of nowhere having to remove all the Goto you put, or having to change the "If", or create macros for the matrices to work.
and even simple changes go through an adaptation process, when the person is used to a syntax they write without thinking much about it,
if they change syntax they take a long time to get to the same writing stage just thinking about the logic of what you want to do

Eduardo Jorge

one thing I think would be interesting would be syntax blocks.
being able to create blocks of specific syntax for each language, not being able to leave the specific syntax, so there would be no writing vices, you could easily use lines written for other languages without mixing and confusing the whole project.
it would be a point of reference for programmers of many other languages who want to migrate.
but unfortunately Charles already said that it is complicated to do that
syntax C
...
syntax end
syntax O2
...
syntax end
syntax powerB
...
syntax end

Theo Gottwald

SYNTAX PB
....
END SYNTAX PB


;D

Would make it easy to migrate Projects.


Zlatko Vid

Heh ..sure Theo ..sure  ;D

Eduardo ...which other compiler support another syntax ???
as far as i know ..NO-ONE

is Powerbasic that one which have multidimensional arrays up to 64 dimensions  ;D

it is easiest to complain..as usual

tranlate large programs from one to another is always problematic

Zlatko Vid

for Eduardo...if he not tried yet and bacause is easy to use AurelEdit06

Eduardo Jorge

I'm not complaining, well yes I am lol
I'm exposing a problem of existing basic languages.
there is simply no standard, each developer does what he wants even if he sells the project.
of course whoever got powerB first will find it better, whoever got VB6 first will find it the most comfortable.
I exposed the case of the multidimensional arrays of o2, of the "if" of purebasic, of goto, there are many other points, but the worst are variable declarations.

that makes basic not interesting for professional use, how many out there for the love of basic built their own basic interpreter or compiler but ended up dropping it?
you even have a website with some of them, and some very complete, even the QB64 that has "Inform", I don't know, but the developer seems to be Brazilian "not that it makes any difference"
with so many in love with Basic, if there was a primordial standard that facilitated the migration of projects, don't you think Basic wouldn't be much bigger?

Eduardo Jorge

could create a world agreement of Basic syntax, mainly in what refers to the declaration of variables, and basic functions.
so it would focus more on speed, implementations and tools, being able to migrate to the one that offers more tools, or cost benefit.
currently if you choose a basic compiler there is no way to migrate to another one that you think is better, simply because there are many different things in the syntax

Zlatko Vid

you complain like a kid ...
my toy is not what is on picture   ;D

that is why we called them DIALECTS...but BASE  is same or similar