IonicWind Software

Aurora Compiler => Update Announcements => Topic started by: Ionic Wind Support Team on February 02, 2006, 11:08:43 PM

Title: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 02, 2006, 11:08:43 PM
The Aurora Alpha2 version has been updated.  Download from the link provided when purchasing.

Changes:
-------------
-The BASELEN keyword now works.
- A few of Parker's suggested changes to the parser were incorporated.
- CTabCtrl class added.
- CTreeView class added.
- OnEraseBkgnd virtual message handler added.
- SetFont now works in derived controls.  So you can do: mybutton.SetFont("arial",12,200,0); 
- The long awaited database class is ready ;)
- CList, CStringList and CIntList classes added.
- Function pointers now work.
- The syntax 'c' will return the integer ASCII value of a character.

For the database class see "database_test.src" and "database_enumdrivers.src".  Working on another example that I will post when I finish.  The class reference is in "odbc.inc" in your bin directory.  Also included are the converted SQL include files, located in the include directory.

Two simple demo programs, "treeview.src" and "tabctrl.src" added to show usage of the new control classes.  tabctrl.src shows how to use the OnEraseBkgnd handler to prevent the background of a window from drawing.  This removes all flicker when a control completely covers the client area.

Function pointers are quite different than they were in my other languages.  No more oddball templates or typecasting.  As an example this is how it is used to load a dll dynamically and call a function:


DECLARE *SQLConfigDataSource(UINT hwndParent,word fRequest, string lpszDriver,string lpszAttributes),INT;
....

hlib = LoadLibraryA("odbccp32.dll");
if hlib
{
SQLConfigDataSource = GetProcAddress(hlib,"SQLConfigDataSource");
if SQLConfigDataSource
rc = SQLConfigDataSource(NULL,ODBC_ADD_DSN,szDriver,szAttrib);
FreeLibrary(hlib);
}
....


The '*' tells the compiler that the function is referenced by an address and not an import or external.  You can also use the '&' symbol to assign an address of a function.

delclare *indirect(int a);
indirect = &function1;
indirect(1);
indirect = &function2;
indirect(2);

The most common use is DLL functions that are linked dynamically instead of statically.

Let me know if everything installs and compiles OK.

Have fun!
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 02, 2006, 11:09:55 PM
Oh...for an example of CStringList see the database examples.
Title: Re: Alpha 2 update 2/03/2006
Post by: Bruce Peaslee on February 02, 2006, 11:10:39 PM
I can say "wow" before downloading (hope that's not bad luck ÂÃ, ;) ÂÃ, ).

Edit:  I'll have to check it out tomorrow - it's bed time here in California.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 02, 2006, 11:22:48 PM
The demo version has been updated to this release.

Quote
Edit:  I'll have to check it out tomorrow - it's bed time here in California.

lol.  Don't you know programmers never sleep ;)
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 02, 2006, 11:31:09 PM
The source archive has been updated to this release.  Download from the link provided.
Title: Re: Alpha 2 update 2/03/2006
Post by: Doc on February 03, 2006, 03:40:52 AM
Tab control *and* databse stuff added at the same time?

...feels just like Christmas around here. :)

-Doc-
Title: Re: Alpha 2 update 2/03/2006
Post by: Parker on February 03, 2006, 08:21:37 AM
I'm having a bunch of trouble installing. I even deleted the old parser, but it reinstalled that one again. I get errors like " invalid character '0x23' - ' " when I try to compile a file that uses single quotes.

I've redownloaded about 3 times and keep getting the same thing.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 08:25:09 AM
Are you downloading the full install?  I haven't updated the parser source in the partner developer forum yet.

Try compiling the database demos.  If they work you have the correct parser.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 08:28:31 AM
OK I see the problem.  The single quotes only work for the characters A-F right now ;).   It's one of those 2AM coding mistakes.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 08:35:52 AM
OK, the install was just updated.  Single quotes will work for any character now.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 08:53:58 AM
Intalll and demo updated again.  ' ' works for any character, not just letters ;)

The whole point, in case no one was following, was to be able to do:

c = 'z';

instead of

c = ASC("z");

Just a convenience thing and follows along with other languages.
Title: Re: Alpha 2 update 2/03/2006
Post by: Bruce Peaslee on February 03, 2006, 08:59:06 AM
Quote from: Ionic Wizard on February 02, 2006, 11:22:48 PM
The demo version has been updated to this release.

Quote
Edit:ÂÃ,  I'll have to check it out tomorrow - it's bed time here in California.

lol.ÂÃ,  Don't you know programmers never sleep ;)
Quote
It's one of those 2AM coding mistakes.

Am I missing something or is there a basic contradiction here?ÂÃ,  ÂÃ, ;D
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 09:03:02 AM
Never said we write good code at 2AM ;)  Just that we don't sleep.
Title: Re: Alpha 2 update 2/03/2006
Post by: Parker on February 03, 2006, 12:26:05 PM
What about escapes? Do the single quotes let me do something like '\''?

No, apparently not. Or at least '\t' doesn't work.

And this piece of code is always returning 0 (tError)
if ((ch >= 'A' and ch <= 'Z') or (ch >= 'a' and ch <= 'z') or (ch = '_'))
{
return tWord;
}
else if (ch >= '0' and ch <= '9')
{
return tNumber;
}
else if (ch = '"')
{
return tString;
}
else if (ch = ';')
{
return tEOS;
}
else
{
return tError;
}
Title: Re: Alpha 2 update 2/03/2006
Post by: Bruce Peaslee on February 03, 2006, 01:01:39 PM
SetFont does not appear to work any more in my main window. It doesn't change the font or size.
Title: Re: Alpha 2 update 2/03/2006
Post by: Parker on February 03, 2006, 01:03:00 PM
I found the bug. I think you're returning the wrong byte value. Some of the assembly code produced is this
mov eax,39
lea ebx,[ebp+12]
movsx esi,byte [ebx]
mov edi,eax
cmp esi,edi
setge dl
and edx,dword 0x000000ff
mov eax,edx
mov esi,eax
xor edx,edx
cmp esi,dword 0
je near dword LA00000
mov ebx,39
lea ecx,[ebp+12]
movsx esi,byte [ecx]
mov edi,ebx
cmp esi,edi
setle dl
and edx,dword 0x000000ff
mov ebx,edx
mov edi,ebx
xor edx,edx
cmp edi,dword 0
setne dl
LA00000:
mov eax,edx
mov esi,eax
cmp esi,dword 0
je near dword LO00004
mov edx,1
jmp LO00005
LO00004:
mov ebx,39
lea ecx,[ebp+12]
movsx esi,byte [ecx]
mov edi,ebx
cmp esi,edi
setge dl
and edx,dword 0x000000ff
mov ebx,edx
mov esi,ebx
xor edx,edx
cmp esi,dword 0
je near dword LA00001
mov ecx,39
push eax
lea eax,[ebp+12]
xor eax,[esp]
xor [esp],eax
xor eax,[esp]
mov esi,[esp+0]
movsx esi,byte [esi]
mov edi,ecx
cmp esi,edi
setle dl
and edx,dword 0x000000ff
add esp,4
mov ecx,edx
mov edi,ecx
xor edx,edx
cmp edi,dword 0
setne dl
LA00001:
mov ebx,edx
mov edi,ebx
xor edx,edx
cmp edi,dword 0
setne dl
LO00005:
mov eax,edx
mov esi,eax
cmp esi,dword 0
je near dword LO00002
mov edx,1
jmp LO00003
LO00002:
mov ebx,39
lea ecx,[ebp+12]
movsx esi,byte [ecx]
mov edi,ebx
cmp esi,edi
sete dl
and edx,dword 0x000000ff
mov ebx,edx
mov edi,ebx
xor edx,edx
cmp edi,dword 0
setne dl
LO00003:
mov eax,edx
test eax,eax
jz near dword L00001


And nowhere does it test for any value but 39, which happens to be the value of the single quote character. Another one of the 2AM mistakes ;)?
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 02:35:32 PM
Quote from: peaslee on February 03, 2006, 01:01:39 PM
SetFont does not appear to work any more in my main window. It doesn't change the font or size.

Hmmm.  Works ok here.  Got an example?
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 02:36:15 PM
Quote from: Parker on February 03, 2006, 01:03:00 PM
I found the bug. I think you're returning the wrong byte value. Some of the assembly code produced is this
And nowhere does it test for any value but 39, which happens to be the value of the single quote character. Another one of the 2AM mistakes ;)?

Your probably right.  I'll update in a few minutes.

Paul.
Title: Re: Alpha 2 update 2/03/2006
Post by: Bruce Peaslee on February 03, 2006, 02:38:41 PM
My skeleton program in Software Projects.
Title: Re: Alpha 2 update 2/03/2006
Post by: Shannara on February 03, 2006, 02:41:53 PM
I have a question concerning SetFont .. it may sound stupid but ...

Why not have just a "Font" property. We can Set/Get/Let it as usual that way, instead of SetFont/GetFont?
Title: Re: Alpha 2 update 2/03/2006
Post by: Parker on February 03, 2006, 02:43:45 PM
Because properties aren't supported. I don't know if that's planned, but as of now libraries or programs can't know what function to call automatically when a variable is assigned to.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 02:58:38 PM
OK updated again.  Parker and Peaslee give it a go and see if it fixed your respective difficulties
Title: Re: Alpha 2 update 2/03/2006
Post by: Parker on February 03, 2006, 03:14:14 PM
It's taking forever to download. I don't think I'll be clicking "Checkout wxWidgets" again any time soon ;)

Well it returns the right value, but it crashes on the while part of this loop
while (
(*m_pText[m_uPos] >= 'A' and *m_pText[m_uPos] <= 'Z')
or (*m_pText[m_uPos] >= 'a' and *m_pText[m_uPos] <= 'z')
or (*m_pText[m_uPos] >= '0' and *m_pText[m_uPos] <= '9')
or (*m_pText[m_uPos] = '_'))
{
m_uPos++;
}

As in, if I put a writeln("looping\n"); before the m_uPos++; part, it doesn't even get displayed. It just crashes. The whole source for that program is in the interpreter tutorial topic.
Title: Re: Alpha 2 update 2/03/2006
Post by: Bruce Peaslee on February 03, 2006, 03:14:55 PM
My problem resolved. Thanks.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 03:23:31 PM
Parker,
You might want to try simplifying that statement a bit.  The lexer just returns an integer value for the character so I don't see that causing a problem. 

C has an isalpha() function that uses a lookup table which would probably be more suitable.
Title: Re: Alpha 2 update 2/03/2006
Post by: Parker on February 03, 2006, 03:41:25 PM
Thanks for reminding me, I was going to change that to a table of characters once single quotes were implemented. I'll do that and see how it comes out. I still am curious about this crash though.
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 03:47:36 PM
Working on a lookup table in assembly now ;)
Title: Re: Alpha 2 update 2/03/2006
Post by: Ionic Wind Support Team on February 03, 2006, 04:21:34 PM
Assembly version posted in tips and tricks.