General information
Category:
Coding, syntax & commands
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only