Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Issue with Formula

Status
Not open for further replies.

frankyberry

Programmer
Mar 15, 2007
33
US
using CR 8.
When I use the below formula, it appears that the formula returns a null, so I'm using the IsNull() to trap it.
If I comment lines 4 & 5, I return "N/A". If I don't it continues to return a null...

any ideas??

Code:
whilereadingrecords;
StringVar x;
StringVar Array Places;
Places[UBound(Places)] := {VW_GEO.LOCATIONS}; //Line 4
Redim Preserve Places[UBound(Places) + 1];    //Line 5

If IsNull({VW_GEO.LOCATIONS}) Then
    x := "N/A"
 
Let me elaborate on what I want...
The array Places may contain a particular location, if it does, I want it to display "Y", else "N" but if the field {VW_GEO.LOCATIONS} is null, I want it to display "N" as well...

Here is my formula that handles everything fine except nulls...

Code:
whilereadingrecords;
StringVar x;
StringVar Array Places;
Places[UBound(Places)] := {VW_GEO.LOCATIONS}; //Line 4
Redim Preserve Places[UBound(Places) + 1];    //Line 5

//If IsNull({VW_GEO.LOCATIONS}) Then
//    x := "N/A"

If "Store" in Places Then
   x := 'Y'
Else
   x := 'N'
 
I've had issues with nulls in the past. try to place the "null trap" at the top of the formula.

whilereadingrecords;
StringVar x;
StringVar Array Places;
If IsNull({VW_GEO.LOCATIONS}) Then
x := "N/A"
else Places[UBound(Places)] := {VW_GEO.LOCATIONS}; //Line 4
Redim Preserve Places[UBound(Places) + 1]; //Line 5


If "Store" in Places Then
x := 'Y'
Else
x := 'N'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top