Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 file name functions
Message
From
31/01/2000 12:58:59
 
 
To
31/01/2000 12:56:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00324545
Message ID:
00325133
Views:
46
minor adjustment:

>>>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
>
*** added forward slash
> 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
Reply
Map
View

Click here to load this message in the networking platform