LS and null values

Please excuse my novice Lotuscript experience. I have a question, that will most likely be simple to someone more experienced.

I have some lotuscript that is executing but failing below:

Set viewf = db.GetView(“stlselracehid”)

Set entry = viewf.GetEntryByKey(lo+"_"+jg+"_Minority")

sel3 = Cstr(entry.SiblingCount)

If sel3 = Null Then Call uidoc.FieldSetText("selminorities", 0) Else Call uidoc.FieldSetText("selminorities", Cstr(entry.SiblingCount))

What I am trying to do is put a 0 if the siblingcount is nothing, but it doesn’t. See anything that sticks out? Any help, much appreciated.

Chris

Subject: LS and null values

You’re casting the SiblingCount property to a string, so testing it thus will do: If sel3=“”…

sel3 = Cstr(entry.SiblingCount)

If sel3 = Null Then Call uid

Or, even easier, SiblingCount returns an integer, so you could just do If sel3 = 0 … and ignore the cast altogether.

HTH

Subject: RE: LS and null values

I think you and I said the same thing, only you were much more eloquent and simple in the answer (I wrote mine in code…eee gads:-) )

Subject: But YOU got an “egads” in :wink: (WAS: LS and null values)

Subject: Duplicate response - Please Ignore

Subject: LS and null values

Set viewf = db.GetView(“stlselracehid”)Set entry = viewf.GetEntryByKey(lo+“_”+jg+“_Minority”)

if Not (entry is nothing then)

If entry.SiblingCount < 1 then

Call uidoc.FieldSetText

   ("selminorities", "0") 

Else

Call uidoc.FieldSetText("selminorities", 

   Cstr(entry.SiblingCount))

end if

else

Messagebox “No Entry Found”

End if