By the way ...

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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). :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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. :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post 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
Post Reply