You don't really have to make a formula or anything; I'm pretty sure this works:
Basically, instead of using a variable for the folder, use CurrentDir() and ChangeDir().
;; Global folder$="C:\Program Files\Blitz3D\Samples" ChangeDir folder$ SetBuffer BackBuffer() ;; read the directory .loaddir sel=ReadDir(CurrentDir()) ;; load files ; ;; ;; draw the folders etc Repeat Cls Text 0,0,folder$,0,0 If KeyHit(14) ;[backspace] ChangeDir ".." ;Delete Each file Goto loaddir EndIf If KeyHit(1) End Flip Forever
Basically, instead of using a variable for the folder, use CurrentDir() and ChangeDir().