From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I test for a NULL return from a DLL for a C-type string?


0 Kudos
Message 1 of 3
(2,403 Views)
I am not sure if this will answer your question, but a NULL character is an ASCII 0.
To test this in LabVIEW, you can use the comparison fuction called 'equal?'. To create a string constant with a NULL character: go to the string menu and get a string constant; right-click the constant and select 'Hex Display'; enter a 0 into the constant. Compare this to the string in question to see if it is a NULL.
0 Kudos
Message 2 of 3
(2,403 Views)
(Thanks, jwf.)
(although no, that wasn't really the problem)

My further testing revealed that LV doesn't distinguish between the return of NULL for a (char *) (ie, C String) and the return of a pointer to the empty string: in either case, it reports the return as the empty string, which casts to a 0 integer.

(I tried to post this earlier, but Outlook Express sucked too much.)
0 Kudos
Message 3 of 3
(2,403 Views)