weird. Caching of Extern commands?

BlitzMax Forums/BlitzMax Programming/weird. Caching of Extern commands?

I have been using a few different Win32 functions in a project. Then I made a brand new bmx file and called a Win32 function without declaring it first with Extern. I'm also not including any source files. For example

SetClassLongA(TheWindow,-14,icon)


This compiles on its own as a full program! How can it do that?
If I add this line:
abc()

it won't compile as it says "identifier abc not found", fair enough.

It's almost like the the extern declarations are cached by BlitzMax or something. What's going on?

Some core commands are already in the BM libraries used and thus externed in one of the BRL / PUB modules.

A lot of the Win32 functions are already declared.

Btw, using API specific stuff is going to make a Mac port of your next game a complete nightmare!

Check Pub.Win32's user32.bmx.

You're just redefining functions that were already extern'd.

What E said: Line 1471

I figured it might be something like that, but how come when I posted a tutorial here:

http://www.blitzbasic.com/Community/posts.php?topic=58571

that was originally missing the definition for setclasslonga, it worked on my PC but not TonyG's hence his comment

TonyG
'Identifier setclasslonga not found'


weird.

Indiepath:
Btw, using API specific stuff is going to make a Mac port of your next game a complete nightmare!
yeah but it's all in one place (in my TGame object) and I'll make a MacFlag Const and just run some different code to set the icon and add a minimise button etc. (if I can figure out how the hell to do that on a Mac!)

I gotta ask : Why bother with all this API specific stuff? what are you trying to achieve?

well, like I just said, I need an icon in the top left, can't do it without API calls. Need a minimise icon in the top right, again needs API calls. Know any other way to do this in Max, no? Thought so ;-)

I'll make a MacFlag Const and just run some different code to set the icon and add a minimise button etc.
No need to set a constant, use compiler directives.

How Extraordinarily useful!