April 27, 2024, 04:03:46 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Need help or explanation

Started by efgee, July 18, 2007, 12:25:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

efgee

This works:

/*
Simple minimalistic code showing the
usage of the CWindow Class for Aurora
*/

class myWin:CWindow
{
declare myWin();
declare OnCreate(),int;
declare OnClose(),int;
declare Run(),int;
}

int run;

global sub main()

        myWin win; // this works
        int style = AWS_SIZE | AWS_SYSMENU | AWS_MAXIMIZEBOX | AWS_MINIMIZEBOX | AWS_VISIBLE;
win.Create(0, 0, 350, 350, style, 0, "Minimal", NULL);
win.Run();
}

myWin::myWin()
{
  run = true;
}

myWin::OnCreate(),int
{
CenterWindow();
return true;
}

myWin::OnClose(),int
{
run = false;
return true;
}

myWin::Run(),int
{   
do{ wait(); }until run = false;
}


This compiles without errors but crashes when executed.

/*
Simple minimalistic code showing the
usage of the CWindow Class for Aurora
*/

class myWin:CWindow
{
declare myWin();
declare OnCreate(),int;
declare OnClose(),int;
declare Run(),int;
}

int run;
myWin win; // this doesn't work

global sub main()

int style = AWS_SIZE | AWS_SYSMENU | AWS_MAXIMIZEBOX | AWS_MINIMIZEBOX | AWS_VISIBLE;
win.Create(0, 0, 350, 350, style, 0, "Minimal", NULL);
win.Run();
}

myWin::myWin()
{
  run = true;
}

myWin::OnCreate(),int
{
CenterWindow();
return true;
}

myWin::OnClose(),int
{
run = false;
return true;
}

myWin::Run(),int
{   
do{ wait(); }until run = false;
}


IMHO if there is something wrong with the code the compiler should at least tell me that.

Ionic Wind Support Team

There is nothing the compiler could have told you.  However I have to say it one more time....Global classes are not supported by Aurora as the constructors won't be called.  I have stated such many times ;)

Ionic Wind Support Team

efgee

Paul thanks for your answer.

But this:
Quote from: Paul Turley on July 18, 2007, 02:08:31 PM
There is nothing the compiler could have told you.

Is bad, actually very bad.

If a compiler compiles a program without errors or warnings the program should work.

The parser of the compiler should take care of things like spitting out a error message saying:
Quote from: Paul Turley on July 18, 2007, 02:08:31 PM
Error on line 15: Global classes are not supported by Aurora.


And this:
Quote from: Paul Turley on July 18, 2007, 02:08:31 PM
However I have to say it one more time.... Global classes are not supported by Aurora as the constructors won't be called.  I have stated such many times ;)
would not be necessary if it would be mentioned in the documentation.

Thanks for your help though.

Ionic Wind Support Team

Documentations not done.  That's why it's still an RC version and not a release version.  Give me a break will ya, only one guy here trying to do it all.

Quote
If a compiler compiles a program without errors or warnings the program should work.

LOL.  What planet are you from anyway?.  It's a compiler, not an interpreter.  You can write really bad code and not get an error, it is not the compilers fault.  Hell even this will compile in just about every language on the planet:

a = 0
b = 1/a

Without warnings or errors, yet it will still crash when executed.  A compiler only creates assembly code based on your input files, it has no idea what the contents of your variables will be at runtime.

Here is another famous one from C++

RECT *myRect = NULL;
myRect->left = 5;

Compiles without errors, but still crashes due to the dereferencing of a NULL pointer.

Paul.

Ionic Wind Support Team

efgee

July 18, 2007, 03:49:23 PM #4 Last Edit: July 18, 2007, 03:51:23 PM by efgee
Quote from: Paul Turley on July 18, 2007, 03:37:11 PM
What planet are you from anyway?
Paul, I didn't insult you so please don't try to insult me.

Quote from: Paul Turley on July 18, 2007, 03:37:11 PM
.  It's a compiler, not an interpreter.  You can write really bad code and not get an error, it is not the compilers fault.  Hell even this will compile in just about every language on the planet:

a = 0
b = 1/a

Without warnings or errors, yet it will still crash when executed.  A compiler only creates assembly code based on your input files, it has no idea what the contents of your variables will be at runtime.

Here is another famous one from C++

RECT *myRect = NULL;
myRect->left = 5;

Compiles without errors, but still crashes due to the dereferencing of a NULL pointer.

Paul.


Paul, I'm not talking about a division by zero error that every compiler let's go through.

I'm talking about having a compiler (the parser of it) that is able to see if a class is initialized as global, and if so gives an error.

If you are not interested in improving your parser, that's fine.
But trying to insult me doesn't make this compiler better.

BTW:
Please tell me if such discussions about the compiler are forbidden on this forum and I will shut up.
I'm new here so I don't know.
Please advise.
Thanks.

Ionic Wind Support Team

It wasn't an insult. You made a generalized statement that deserved a response like that. :-*

The Aurora compiler doesn't give an error or warning about global classes because I haven't finished the thing yet.  I have every intention of working out how the parser would construct a global class, and even have it working partially in Emergence BASIC.  It, however, does represents hundreds of hours of work that I just don't have time for at the moment.   

Besides the fact you shouldn't use global classes anyway, use NEW and a global pointer if you want file/project wide access to a particular instance of an object.  Which would be more in line with OOP methodology. 

Paul.


Ionic Wind Support Team

efgee

Quote from: Paul Turley on July 18, 2007, 04:35:21 PM
The Aurora compiler doesn't give an error or warning about global classes because I haven't finished the thing yet. 
I have every intention of working out how the parser would construct a global class.... it however, does represents hundreds of hours of work that I just don't have time for at the moment.

Well at least you planned to do it.

Brice Manuel

July 18, 2007, 09:33:03 PM #7 Last Edit: July 19, 2007, 01:47:52 AM by Brice Manuel
Quote from: efgee on July 18, 2007, 03:49:23 PMPaul, I didn't insult you so please don't try to insult me.
You have done nothing but insult the products, and hence, Paul and the community in general since you started posting here.  First the languages aren't good enough and need to be more like D and other languages if Paul expects them to make it, now the compiler supposedly sucks because you haven't learned how to code in Aurora properly.

Quote from: efgee on July 18, 2007, 03:49:23 PMIf you are not interested in improving your parser, that's fine.
Improving the parser will not have any effect on your shoddy coding.


Quote from: efgee on July 18, 2007, 03:49:23 PMBut trying to insult me doesn't make this compiler better
Relax, drop the attitude, drop the arrogance and if you get stuck on something, ask for help.  Quit insulting the products and their author as that isn't going to win you any friends.

Your "perceived" problems are just that, your perception.  So far the problems are clearly you not knowing how to use the language properly.  The fact that YOU are the only one having such great issues with the language should tell you where the problems truly are.

Relax, take your time, ask for help if you need it.  Aurora is built like a rock, chances are >99.99% if you run into an issue that the problem is with your coding, not the language.  Paul knows his s*** ;)

efgee

July 19, 2007, 10:28:39 AM #8 Last Edit: July 19, 2007, 10:31:35 AM by efgee
Brice,
after reading your response, I would like to thank you very much for your input.
It was the best welcome I had in a forum ever.
Actually your response made me realize what kind of old moron I am.

Especially I want to thank you for your help regarding global classes and how
to utilize the NEW keyword to make classes global and such.
It shows me you mastered Aurora already and now you really are a pillar in this forum.
Thank you for the offer to ask for help, I'm surely in need of that.
Again, thank you for your great help.

Warm Regards
efgee

BTW: the posts you are referring to are under the topic " thoughts and ideas".
This means that there can be a discussion about thoughts and ideas.
What I wrote was meant as a basic for a discussion. and not as an insult of this
language or this community.

Brice Manuel

QuoteIt shows me you mastered Aurora already
Not even close, I bought Aurora two and a half weeks ago.

efgee

Quote from: Brice Manuel on July 19, 2007, 10:56:22 AM
QuoteIt shows me you mastered Aurora already
Not even close, I bought Aurora two and a half weeks ago.

And in this short period of time you already realized:

Quote from: Brice Manuel on July 18, 2007, 09:33:03 PM...Aurora is built like a rock, chances are >99.99% if you run into an issue that the problem is with your coding, not the language....

Am I that slow..


Brice Manuel

Quote from: efgee on July 19, 2007, 11:06:30 AM
Quote from: Brice Manuel on July 19, 2007, 10:56:22 AM
QuoteIt shows me you mastered Aurora already
Not even close, I bought Aurora two and a half weeks ago.

And in this short period of time you already realized:

Quote from: Brice Manuel on July 18, 2007, 09:33:03 PM...Aurora is built like a rock, chances are >99.99% if you run into an issue that the problem is with your coding, not the language....

Am I that slow..


I have been using Paul's various languages since early 2002 (I even wrote two tools for users of one of the older languages).  I know the man, the morals, and the work ethic behind Paul's languages.  Paul doesn't do things half-assed.  I've been programming since '79.  I own the majority of competing indie languages.  I know from direct experience how well Paul's languages stack up against the competition.