QuothTheRaven,
You might need to get the whole path, then take the path string and use a bit of string manipulation to get just the folder name. Take the string and use the
right$() command in a loop, until you come to the first [i][/i](backslash) symbol. Then, grab the string, leaving the backslash behind, and then you're left with just the folder name. I believe this is what you are needing. Below is an example code snippet, using a fake directory path string to use string manipulation on.
set display mode 800,600,32
sync on
sync rate 60
REM << fake path name
pathstr$ = "C:\Documents and Settings\My Documents\My Pictures"
REM << search for a backslash, and record number of loops until then
repeat
cls
inc count
REM << get rightmost characters,amount extracted determined by count variable,check if first character
REM << is equal to ASCII code of the backslash(\) symbol
if asc(right$(pathstr$,count)) = 92
REM << if symbol is backslash then record all characters after it into a variable string
fldname$ = right$(pathstr$,count - 1)
endif
REM << these next lines are just to show a slow visual of what is happenning whithin the program
print "Path = ",pathstr$
print "Current search statistic = ",right$(pathstr$,count)
print "Program slowed for to show a visual"
sync
wait 2000
REM << end loop when fldname variable string is not empty anymore
until fldname$ <> ""
REM <<<<<< main loop >>>>>>>
repeat
print "Path = ",pathstr$
print "Folder Name = ",fldname$
print "Press any key to end program"
sync
cls
until scancode() > 0
end
+NanoBrain+