Page 1 of 1

Posted: Sun Jan 12, 2003 4:34 pm
by BackupUser
Restored from previous forum. Originally posted by FonkFonk.

As for a concurrent compiler/editor to Purebasic, does anybody here knows the name of a help file that gives the exact syntax (and examples) of api calls under PB ?

Just dreaming of such a file !!! ...

Pierre

Posted: Sun Jan 12, 2003 4:39 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> As for a concurrent compiler/editor to Purebasic, does anybody here
> knows the name of a help file that gives the exact syntax (and
> examples) of api calls under PB ?
> Just dreaming of such a file !!! ...

Hi Pierre,

This is spooky -- at 16:33:52 I just made the following post...

viewtopic.php?t=4772

...and you just missed it by a mere 15 seconds (16:34:07). :)

Posted: Sun Jan 12, 2003 7:08 pm
by BackupUser
Restored from previous forum. Originally posted by FonkFonk.

Thanks for the tip !:)

The thing is, this help file won't give the specific syntax needed in PureBasic for API calls ...

Pierre

Posted: Sun Jan 12, 2003 7:34 pm
by BackupUser
Restored from previous forum. Originally posted by PB.

> this help file won't give the specific syntax needed in PureBasic
> for API calls ...

:) I disagree. Take MessageBox, for example. The Win32.hlp file says:

Code: Select all

HWND hWnd,           // handle of owner window
LPCTSTR lpText,      // address of text in message box
LPCTSTR lpCaption,   // address of title of message box  
UINT uType           // style of message box
From this, we can see that MessageBox takes 4 parameters:

The first is the handle of the calling window (just set to 0).
The second is the text for the box (a PureBasic string).
The third is the title for the box (a PureBasic string).
The fourth is the style of the box, with the permitted values listed.

So, to prompt the user with a Yes/No box, you do it like this:

r=MessageBox_(0,"Yes or no?","Question",#MB_ICONQUESTION|#MB_YESNO)

Thus, "r" holds the value of the button clicked by the user.

This is just a quick example, but as you can see, all the required
parameters are listed, along with the type (string, long, etc) and
the flags required. Not too hard once you get the hang of it. :)

Posted: Sun Jan 12, 2003 8:29 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

If you have trouble, finding out, what all those types like 'LPCTSTR' and 'HWND' are in PureBasic, go here to find answers:

viewtopic.php?t=4435">http://forums.pur ... ntypes.txt

@PB: Maybe you can also add this info to your 'API command help' Post, might be useful.

Timo