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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Statement 1

Status
Not open for further replies.

mander23

MIS
Jan 30, 2005
28
US
I am new to FoxPro. I am actually converting a foxpro application to vb.net. Could someone explain what this if statement is doing. Not sure what the {} means. Thank you.

IF folup_dt1 >= rep3_beg_dt;
AND folup_dt1 <= rep3_end_dt;
AND comp_dt1 = {};
AND !rereg_dt1 = {};
AND posted1 = .f.
 
You can use {} as a way of getting an empty date.

Another way is ctod("//")

So here you are looking for comp_dt1 to be empty, and for rereg_dt1 to not be empty.





Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
It is checking for an empty date. There isn't an empty date concept in VB.Net. I am afraid you need to ask it to VFP in VFP syntax and maybe convert to null on the fly. Something like:

OleDbConnection con = new OleDbConnection(
@"Provider=VFPOLEDB;Data Source=c:\MyDataFolder");
OleDbCommand cmd = new OleDbCommand(
"select cast(evl(myDate, null) as date) as myDate, ... from myTable", con );

Or you may try the alternative poor concept that some developers use and accept any date with value 12/30/1899 12:00:00 AM as empty date ({}).


Cetin Basoz
MS Foxpro MVP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top