forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Question about NULL in API

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Johnny
Newbie


Joined: 19 Feb 2005
Posts: 5

PostPosted: Sat Feb 26, 2005 3:24 pm    Post subject: Question about NULL in API Reply with quote

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... Crying or Very sad


Last edited by Johnny on Sat Feb 26, 2005 3:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 26, 2005 3:33 pm    Post subject: Reply with quote

Passing zero should work. Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Feb 26, 2005 3:37 pm    Post subject: Reply with quote

You can also use "NIL:" as a parameter... Smile

Code:
@lib(user32.dll,FunctionName,INT:,STR:Hello world!,NIL:,INT:53542)

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Johnny
Newbie


Joined: 19 Feb 2005
Posts: 5

PostPosted: Sat Feb 26, 2005 3:38 pm    Post subject: Reply with quote

Mac wrote:
Passing zero should work. Wink

Cheers, Mac Smile


I will try on it~ Thanks~
Back to top
View user's profile Send private message
Johnny
Newbie


Joined: 19 Feb 2005
Posts: 5

PostPosted: Sat Feb 26, 2005 3:40 pm    Post subject: Reply with quote

Skit3000 wrote:
You can also use "NIL:" as a parameter... Smile

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
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Feb 26, 2005 4:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Feb 26, 2005 6:52 pm    Post subject: Reply with quote

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. Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Feb 26, 2005 9:19 pm    Post subject: Reply with quote

Mac wrote:

True - but to my knowledge, any API function will accept zero
when a NULL parameter is required. Wink


Wink Touche!?

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Feb 28, 2005 9:47 am    Post subject: Reply with quote

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. Wink

Cheers, Mac Smile


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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group