Using Java with Uniobjects for Java to call a UniBasic routine.  The 
UniBasic routine has two parameters; part number and result (html code). 
As long as it is passed a valid part number, it works OK.  However, when 
the part number is not valid it returns an empty string RESULT = '' (two 
single quotes). 

The Java class method checks for an empty string and returns null if it 
finds one

*******************************
OpenU2Session();
UniSubroutine uSub = uSession.subroutine("GetInventoryStatus", 2);
uSub.setArg(0, partnum);
uSub.call();
result = uSub.getArg(1);
CloseU2Session();
if(result == "") {
        return null;
} else {
        return result;
}
******************************** 

The php action that calls the class method checks for null and behaves 
accordingly.
********************************
$result = $U2->GetInventoryStatus($partnumber);
if($result) {
        echo $result;
} else {
        echo "No information found for " + $partnumber;
}
********************************

The problem is that when the Java routine checks the result from the 
UniBasic sub, it doesn't seem to see the empty string as an empty string. 
Does anyone know what is happening here?  Is there a better way to 
indicate an empty string

Charles Shaffer
Senior Analyst
NTN-Bower Corporation
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to