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

Why VdB 5.7 ignores ampersand?

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
571
US
Colleagues,

AFAIR, the xBase family accepted the & (ampersand) operator and treated it as a sign of a macro substitution, i.e.
Code:
cFile2Open = cPath + "MyTable.DBF"
USE &cFile2Open
worked just fine. It still does in Visual FoxPro, but I'm having trouble with it in Visual dBase 5.7: whatever I have the memvar for the full path to a DBF named, it ignores that & and treats the memvar as a file name, i.e.

&cFile2Open

becomes

cFile2Op.DBF

that is ignoring & operator and truncating it down to 8 chars (if it's more than 8), and then dBase errs saying
"cFile2Op.DBF not found".

What and/or where I have to look to find the cause of such behavior?


Regards,

Ilya
 
Awww, b-bllllloody hell!
dBase ignores ampersand in front of the memvars declared as LOCAL! [evil] And I declared my memvar as LOCAL... [mad]
The issue's resolved, the case is being closed.
My apologies for the "disturbance in the Force". [ :~/]

Regards,

Ilya
 
Could you use "name expressions"? From what I remember, it has the advantage of being a few microseconds faster than macrosubstitution too.
Code:
cFile2Open = cPath + "MyTable.DBF"
USE (cFile2Open)
Or this simpler usage:
Code:
USE (cPath + "MyTable.DBF")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top