How to find if a path contains a valid file name
Posted
#1
(In Topic #395)
Regular

This is best I can do:-
Code
Dim sVar as string
sVar = User.Home &/ "00.mp3"
Print IsDir(File.Dir(sVar) &/ File.Name(sVar))
Posted
Posted
Regular

Code (gambas)
- '--- It's either you get the path building it in a procedure, OR, just build the string, according to a specific situation
- '--- strFilePath= Application.Path & "/App.conf" '--- it's just an example, can be more ellaborate than that.
- '--- DoWhatIsRequired()
- '--- BranchForErrors()
“The only thing necessary for the triumph of evil is for good men to do nothing.”― Edmund Burke;
It's easy to die for an idea. It is way harder to LIVE for your idea! (Me)
It's easy to die for an idea. It is way harder to LIVE for your idea! (Me)
Posted
Regular

bill-lancaster said
I need to know if sVar is just a directory or if it contains a file name
Are you SURE YOU need to know?
Why would you need?
In my view, THE COMPUTER needs to know. Your approach is from the human perspective. It has nothing to do with what the computer needs to know.
Try the sample code I put before this comment.
Also, try to get the computer's perspective, since me, or you, or anyone else as users, we need buttons and labels and the like, while the computer, needs a different type of data: figures. Numbers.
“The only thing necessary for the triumph of evil is for good men to do nothing.”― Edmund Burke;
It's easy to die for an idea. It is way harder to LIVE for your idea! (Me)
It's easy to die for an idea. It is way harder to LIVE for your idea! (Me)
Posted
Regular

Thanks again
Posted
Regular

/comp/gb/file/realpath - Gambas Documentation
/lang/stat - Gambas Documentation
Ced
.... and carry a big stick!
Posted
Regular

1 guest and 0 members have just viewed this.



