Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace path
Message
From
26/04/2011 05:18:10
 
 
To
24/04/2011 06:19:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01508234
Message ID:
01508367
Views:
49
>hi all,
>i try to add path at the field via this code,
>this code rename all as .doc,if i change .doc to tif it take all as tif
>the folder ta3ameem2010 have tif,.doc,.pdf.bitmap immage,jpeg....etc
>i need to replace the extention as it is
>thanks
>
>
> replace mycur12005.clint with iif(file("d:\ta3ameem2010\" +alltr(mycur12005.fielda )+".tif"),"d:\ta3ameem2010\" +alltr(mycur12005.fielda )+".DPF","d:\ta3ameem2010\" +alltr(mycur12005.fielda )+".doc") ALL in mycur12005
>
>
>
>
>thanks

Hi,
you could do this like this:
CREATE CURSOR mycur12005(clint c(50),fielda c(20))
INSERT INTO mycur12005(clint, fielda) VALUES ([],[datei1])
INSERT INTO mycur12005(clint, fielda) VALUES ([],[datei2])
INSERT INTO mycur12005(clint, fielda) VALUES ([],[datei3])
INSERT INTO mycur12005(clint, fielda) VALUES ([],[datei4])
INSERT INTO mycur12005(clint, fielda) VALUES ([],[datei5])

lcDir = [d:\ta3ameem2010\]

REPLACE ALL clint ;
WITH ;
IIF( ;
	FILE( FORCEEXT( lcDir + ALLTRIM( fielda ) , [.tif] ) ) , ;
	FORCEEXT( lcDir + ALLTRIM( fielda ) , [.dpf] ) , ;
	FORCEEXT( lcDir + ALLTRIM( fielda ) , [.doc] ) ;
	) ;
	IN mycur12005

BROWSE LAST 

USE IN SELECT( [mycur12005] )
Best Regards
-Tom

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011
Previous
Reply
Map
View

Click here to load this message in the networking platform