| View previous topic :: View next topic |
| Author |
Message |
Johnny Newbie
Joined: 19 Feb 2005 Posts: 5
|
Posted: Sat Feb 26, 2005 3:24 pm Post subject: Question about NULL in API |
|
|
I would like to ask how I can pass a NULL as parameter to API functions?
Is there something in VDS like vbNullString in VB, that can be passed to API functions?
I have tried leaving the parameter blank (as a VDS null), but when i run it the VDS IDE just close itself... 
Last edited by Johnny on Sat Feb 26, 2005 3:36 pm; edited 1 time in total |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 26, 2005 3:33 pm Post subject: |
|
|
Passing zero should work.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Johnny Newbie
Joined: 19 Feb 2005 Posts: 5
|
Posted: Sat Feb 26, 2005 3:38 pm Post subject: |
|
|
| Mac wrote: | Passing zero should work.
Cheers, Mac  |
I will try on it~ Thanks~ |
|
| Back to top |
|
 |
Johnny Newbie
Joined: 19 Feb 2005 Posts: 5
|
Posted: Sat Feb 26, 2005 3:40 pm Post subject: |
|
|
| Skit3000 wrote: | You can also use "NIL:" as a parameter...
| Code: | | @lib(user32.dll,FunctionName,INT:,STR:Hello world!,NIL:,INT:53542) |
|
o really? this will be very useful.
Thanks very much~ |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Feb 26, 2005 4:23 pm Post subject: |
|
|
Technically zero (0) is not how NULL is defined. Look at the ASCII codes.
ASCII for 0(zero) is 48
ASCII for NULL is 0
Basically what I'm saying is pass @chr(0) instead of just 0. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 26, 2005 6:52 pm Post subject: |
|
|
| bweckel wrote: |
Technically zero (0) is not how NULL is defined.
|
True - but to my knowledge, any API function will accept zero
when a NULL parameter is required.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Feb 26, 2005 9:19 pm Post subject: |
|
|
| Mac wrote: |
True - but to my knowledge, any API function will accept zero
when a NULL parameter is required.
|
Touche!? _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Feb 28, 2005 9:47 am Post subject: |
|
|
| Mac wrote: | | bweckel wrote: |
Technically zero (0) is not how NULL is defined.
|
True - but to my knowledge, any API function will accept zero
when a NULL parameter is required.
Cheers, Mac  |
Correct. Only fussy type-safe languages will raise an objection to it.
The VDS @lib function will see that 0 is a number, and therefore pass it as a 32-bit binary value. To pass the character '0' you would have to put STR:0. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
|