Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 file name functions
Message
From
31/01/2000 13:22:03
 
 
To
31/01/2000 02:19:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00324545
Message ID:
00325153
Views:
30
>>I was just pointing out that your algorithm is not an equivalent replacement for juststem().
>
>Oooh ooh, what about mine?
>
>forceext(justfname(dbf()), '')

another:


function stripext (tcPath)

if len(tcPath) = 0
return ""
endif

local lnBackSlash, lnForwardSlash, lnColon, lnPeriod, lnStart

lnBackSlash = ratc('\', tcPath)
lnForwardSlash = ratc('/', tcPath)
lnColon = ratc(':', tcPath)
lnPeriod = ratc('.', tcPath)

lnStart = max(0, lnBackSlash, lnForwardSlash, lnColon) + 1

if lnPeriod < lnStart
lcStem = substr(tcPath, lnStart)
else
lcStem = substr(tcPath, lnStart, lnPeriod - lnStart)
endif

return lcStem
Previous
Reply
Map
View

Click here to load this message in the networking platform