LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to distinguish NULL and Empty Strings

Hi,

 

Just to set the context right; I'm an experienced C programmer trying labview for the first time. As such I ran in to a problem being that Labview has no concept of NULL-pointers and more specifically appears to have no concept of the difference between a NULL-string and an empty-string

 

I'm trying to make a structure (bundle) of strings (in it's most basic form key-value pairs) which i'd like to (for instance) URI encode in order to send it to a web server. For those who are not familiar with URI encoding; there is a distinguished difference between setting a key to an empty string and setting a key with no value. In C I would use a pointer to an empty string vs a NULL string pointer to symbolize this.

 

In essence I need an elegant way to distinguish between a defined but empty string and an undefined string (hmmm this is actually describing the same problem but now in terms of perl).

 

Anybody have any pointers (pun not intended) for me ?

0 Kudos
Message 1 of 2
(3,798 Views)

This is a bit depending on the interface you have with your encoder. The whole issue is that LV has no pointers at all (and you will like it, as you will never have any Null-Pointer exeptions and the like).

 

Assuming that you use a dll (so the Call Library node).

Use CString as input -> NULL-Terminated String.

Use I32 as input and pass 0 -> NULL string.

 

Felix

Message 2 of 2
(3,797 Views)