DarkGame SDK & PureBasic .DESC Files ...

Windows specific forum
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

DarkGame SDK & PureBasic .DESC Files ...

Post by freddix »

I try to convert DarkGame SDK from TGC to purebasic .
It's builded around .LIB files and .H
I try to adapt the .H to create .DESC files .
but, all isn't explained in README.TXT given with purebasic.

the sample given use 2 functions that return an integer value :
PeekS, Long (Address) - Retrieve a string from the specified address
String
;
PeekL, Long (Address) - Retrieve a long from the specified address
Long | DebuggerCheck
I didn't understand how I must do to create command that does not return value.
is it something like :
MyCommand, Long - Help
My2ndCommand, ...
Should I leave a blank line telling that there is no return ?

Should I do something else ?
Denis
Enthusiast
Enthusiast
Posts: 779
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Post by Denis »

For no return value, use None
like this

Code: Select all

MyCommand, Long, ()
None
A+
Denis
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

thanks :)

but, why should I use () ???
and when . I'm not sure to understand exactly the syntax .
( sorry I'm frensh and far to be perfect in english speaking ... :oops: )

Imagine that I need a command that need 1 long . Should I use exactly the same line than your ?
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

freddix wrote:but, why should I use () ???
and when . I'm not sure to understand exactly the syntax .

() is just the description as explained in the Library-SDK ReadMe:

Code: Select all

  ; Library functions: 
  ; FunctionName, Arg1Type, Arg2Type, ... (DescriptionArg1, Arg2) - Description of the command show on the QuickHelp status bar
  ; Return type. Can be one of the following type: 'Long', 'Word', 'Byte', 'Float' 'String', 'None', 'InitFunction' (for a function
  ; which is called automatically at the start of a PureBasic program), 'EndFunction' (called at the end, for cleaning)
  ; and 'DebuggerCheck' which tell is there is a debugger handler function for this command.
  ;

Imagine that I need a command that need 1 long . Should I use exactly the same line than your ?
This is enough (if you don't want to show anything in the statusbar of the editor) :

YourFunction, Long
None
Good programmers don't comment their code. It was hard to write, should be hard to read.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

wowow !

Thanks for your precise and "Faster Than Light" answer ;)

you grantly helped me ... I'll now work on migrating DGSDK 2 PB :)
Post Reply