May 04, 2024, 10:20:37 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


More syntax discussion

Started by Ionic Wind Support Team, December 30, 2005, 08:30:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ionic Wind Support Team

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.
Ionic Wind Support Team

Zen

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

Ionic Wind Support Team

I'll think about it.  It's easy to break the parser when you have too many options ;)
Ionic Wind Support Team

Ionic Wind Support Team

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.

Ionic Wind Support Team

Parker

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.