Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add - to the result
Message
From
20/04/2011 16:33:51
 
 
To
20/04/2011 15:37:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01507956
Message ID:
01507972
Views:
39
>thank you for reply,
>how i can use it instead or with NewName=left(m.NewName,4)+right(m.NewName,len(m.NewName)-4)
>
After that statement, does NewName have a value of "132002" ????

If so then it's very simple
NewName = STUFF(LEFT(m.NewName,4) + RIGHT(m.NewName,LEN(m.NewName)-4),3,0,"-")
Check the documentation for STUFF()

STUFF(yourstring, lnstart, 0, insertstring) will put insertstring into yourstring starting at character lnstart

>>>hi all
>>>
>>>i try this code below it work, but i need to add - to the result..
>>>132002 i need to add 13-2002
>>
>>How about
>>
>>myVar = STUFF(someExpression,3,0,"-")
>>><pre>
>>>gnDbcnumber=ADIR(MyAllFiles,"d:\picture2002\*.*")
>>>   FOR i = 1 TO m.gnDbcnumber  && Loop for number of databases
>>>     lcOK = "d:\picture2002\"+MyAllFiles(m.i,1)
>>>       NewName=CHRTRAN(m.lcok,"ÇÈ Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ý Þ ß á ã ä å æ í É Â Ä ì Æ Ã Á","")
>>>      NewName=""+left(m.NewName,4)+right(m.NewName,len(m.NewName)-4)
>>>      Rename (M.lcOK) to (m.NewName) 
>>>  ENDFOR
>>>
>>>thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform