IonicWind Software

Aurora Compiler => General Discussion => Topic started by: Ionic Wind Support Team on December 30, 2005, 08:30:31 AM

Title: More syntax discussion
Post by: Ionic Wind Support Team on December 30, 2005, 08:30:31 AM
There will be some new syntax available in the next update to declare external and imported functions.  The old methods of using 'declare' will still work as not to break anything.

The new methods are to aid in converting header files from C.

extern int SomeFunction(...);
import float AnotherFunction(...);

extern int cdecl SomeFunction(...);
import float cdecl AnotherFunction(...);

C lists the return value first, which I always thought was odd.  With the new syntax I can convert header files by doing search and replaces for foreign keywords. WINAPIV becomes 'cdecl' and WINUSERAPI becomes 'import' for example.

Eventually the #define system will be linked into all keywords.

Paul.
Title: Re: More syntax discussion
Post by: Zen on December 30, 2005, 09:04:06 AM
will this mean that we can create subroutines the same too? i would like to be able to do...


sub string getErrorText() {
...

return errorString;

}


Lewis
Title: Re: More syntax discussion
Post by: Ionic Wind Support Team on December 30, 2005, 09:05:26 AM
I'll think about it.  It's easy to break the parser when you have too many options ;)
Title: Re: More syntax discussion
Post by: Ionic Wind Support Team on December 30, 2005, 09:34:03 AM
I've also added the 'void' keyword for return types.  Which generates an error if you attempt to assign something returning void.

And also to aid in converting those header files.

Title: Re: More syntax discussion
Post by: Parker on December 30, 2005, 01:57:54 PM
Cool, I think the windows API headers can't be far behind ;)
Any possibility of unicode string support sometime soon? I don't know how it would work in here, maybe a wchar and wstring type, where the wchar type can work like dstring and wstring like string:
wchar CustomLengthString[20];
CustomLengthString = U"This is unicode";


I don't know how it would be implemented, just something to think about so all the string functions can support unicode before we're too far along. There'd have to be unicode STR$, LEFT$, etc. but also the window class would have to be modified to use the 'W' versions of the Windows API.