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

Although your code works, the following code is much clearer:


function stripext (tcPath)

local lcStem, i, lnExt

lnExt = null

for i = len(tcPath) to 1 step -1

if substr(tcPath, i, 1) $ "/:"
exit
endif

if isnull(lnExt) and substr(tcPath, i, 1) = "."
lnExt = i
endif

endfor

if isnull(lnExt)
lcStem = substr(tcPath, i + 1)
else
lcStem = substr(tcPath, i + 1, lnExt - (i + 1))
endif

return lcStem

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform