PowerBuilder Forum

Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: FUNCTION: Blank String Test


Veteran Member

Status: Offline
Posts: 40
Date:
FUNCTION: Blank String Test


This function simply tests a string to see whether or not it's blank. Why? Because sometimes you could have a NULL string returned, and simply testing with something like: IF ls_test = '' THEN... is not going to work. However, using this function, you will be able to use: IF is_blank( ls_test ) THEN...

/* is_blank( String as_test ) */
/* RETURNS:  Boolean */

IF NOT IsValid( as_test ) THEN RETURN TRUE
IF IsNull( as_test ) THEN RETURN TRUE
IF as_test = '' THEN RETURN TRUE


RETURN FALSE



-- Edited by thekl0wn at 21:31, 2008-07-23

__________________


Veteran Member

Status: Offline
Posts: 40
Date:

In addition...  Often times you will be testing to see if the string is NOT NULL.  This additional function can save a bit of typing time:

/* not_blank( String as_test ) */
/* RETURNS: Boolean */

RETURN NOT is_blank( as_test )


__________________
Page 1 of 1  sorted by
Quick Reply

Please log in to post quick replies.

Tweet this page Post to Digg Post to Del.icio.us


Create your own FREE Forum
Report Abuse
Powered by ActiveBoard