Liberty BASIC Community Forum
« path and file »

Welcome Guest. Please Login or Register.
Jan 23rd, 2018, 7:29pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: path and file  (Read 296 times)
alincon2001
Guru
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 510
xx path and file
« Thread started on: Nov 20th, 2016, 10:25am »

you can nest two of the functions new to LB4.5 to get the file name from the path name, and remove the dot and extension:

Code:
upto$(afterlast$(areaName$,"\"),".")
 


r.m.
User IP Logged

Jack Kelly
New Member
Image


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 17
xx Re: path and file
« Reply #1 on: Nov 22nd, 2016, 08:16am »

Alincon, this is a brilliant and elegant use of the new functions. It should be useful for everyone. Thank you for sharing it.

Jack
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5618
xx Re: path and file
« Reply #2 on: Nov 23rd, 2016, 02:14am »

Padded out a bit to make a runable example.

Code:
filePath$="c:\basic\light&lenses\light.bas"
fileName$=upto$(afterlast$(filePath$,"\"),".")
print fileName$
 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls