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

string concatenation making me sick!

Status
Not open for further replies.

csvideo

Programmer
Oct 19, 2001
74
BB
I using VFP6 with a form the has a danazip activeX control for zippin all the files in my data path. The follow code is where I'm getting the problem

h = set ('path')
h = alltr(h)+"*.*"

h hold something like C:\SALES\DATA\*.* however it holds

C:\SALES\DATA*.*


as if they is a CHR(13) in there. It does the correct thing in VFP5 but whats happen in VFP6?

 
chrisman

Have just tried your exact code under VFP 6.0 without a problem

h = SET('path') + "*.*"

also works correctly, so it is not a feature of VFP 6.0. HTH

Chris [pc2]
 
Chrisman,
Try this instead, it *might* help...
NEWPATH = ALLTRIM(SET('PATH'))
IF RIGHT(NEWPATH,1) # "\"
NEWPATH = NEWPATH+"\*.*"
ELSE
NEWPATH = NEWPATH+"*.*"
ENDIF

I think you might find this slightly more consistant than your current code, and may solve your problem.

Best Regards,
Scott

Please let me know if this has helped [hammer]
 
Scott,
newpath = ADDBS(SET('path')) + "*.*"

SET() always returns the string ALLTRIM(), and ADDBS() [add backslash - if not trailing character] has been with us since FPW, either in FoxTools or since VFP 6.0 natively.

Rick
 
Rick,
Ahh, yes, I forgot about that one... I so rarely have a need to muck with proper paths.... Good eye...
Best Regards,
Scott

Please let me know if this has helped [hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top