Delphi: If Folder or Drive

[ Delphi Forum -- by DelphiLand ]

Posted by WAllison on November 19, 2003 at 11:50:42:

In Reply to: If Folder or Drive posted by Joey on November 18, 2003 at 21:25:10:

: The app i'm making at the moment is so close to finish! Thanks to WAllison i got the copying to the lisbox in the right order to work (made a few changed to ur loop) but theres one more thing i need to know:
: From a string how can i see if theres a '\' at the end or not?
: Because im now going to copy the items from the box to a folder or drive (using a component thats like TOpenDialog, just returns the save as the Shell things in the samples page) and when u searcch it returns where u are example:
: C:\Windows\Desktop
: but if im on a drive it says
: C:\
: and i want to copy to either of these so how can i tell if the last char in each string is a backslash or not and if it is then not to add 1 and if it isnt to add 1? ;s
: Thx for n e help in advance

If s[Length(s)] <> '\' Then s := s + '\';

Related Articles and Replies:

[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]