If Then Statement when outputting data

Hi all...

Using VBScript how can I make this conditional:

' Write out the data to the file.
objEMEFile.Write DataRecord.Get( "CATID" ) + vbTab
objEMEFile.Write DataRecord.Get( "MODEL" ) + vbTab

IF DATARECORD.GET("LP") IS NOT EMPTY THEN
objEMEFile.Write DataRecord.Get( "LP" ) + vbTab
ELSE
WRITE DATARECORD.GET("LP") = NULL

Hope that makes sense?

If Then Statement when outputting data

AHarris,

By default any value extracted by screen-scraper is stored as a string. Because VB interprets strings differently depending on certain conditions you may need to evaluate the dataRecord in multiple ways.

According to one reference I found out Googlling you should be able to call the VBS function IsNull in conjunction with your current approach, and along with checking for a zero-length string. Without knowing the nuances of your scraping session see my suggestion below. No one here uses VB regularly so please excuse my syntax lapses but you should be able to do something like this.

IF !IsNull(DATARECORD.GET("LP")) OR DATARECORD.GET("LP") IS NOT EMPTY OR DATARECORD.GET("LP") IS NOT "" THEN

"[i]Null[/i] is not the same as [i]Empty[/i], which indicates that a variable has not yet been initialized. It is also not the same as a zero-length string (""), which is sometimes referred to as a null string"

http://ns7.webmasters.com/caspdoc/html/vbscript_isnull_function.htm

I hope this helps.

-Scott