Buchempfehlung
Mikrocomputertechnik mit Controllern der Atmel AVR-RISC-Familie
Mikrocomputertechnik mit Controllern der Atmel AVR-RISC-Familie
Umfassend, aber leicht verständlich führt dieses Buch in die Programmierung von ATMEL AVR Mikrocontrollern ein. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

Datei-wähler (mit verzeichnis-wechsel)

Uploader:MitgliedThe_Muh
Datum/Zeit:22.12.2008 18:28:31

type file_type
    title as string
    flag as integer
end type

#macro datei(fl)
    K = DIR("*.*" ,fl + &H04 + &H01)
    do
        if len(k) > 0 and k <> "." and k <> ".." then
            redim preserve files(i)
            files(i).title = K
            files(i).flag = fl
            i += 1
        end if
        K = DIR("")
    LOOP until LEN(K) = 0
#endmacro

#macro blubb()
dim key as string
dim sh as integer
c = 0
do
    cls
    if A > 1 then print "...."
    for sh  = lbound(files) to 30   'text anzeigen...
        if SH + A <= ubound(files) then
            locate sh+3,1
            if sh = c then
                if files(sh+a).flag = &h10 then
                    print "X) /"& files(sh+A).title;
                else
                    print "X)  "& files(sh+A).title;
                end if
            else
                if files(sh+a).flag = &h10 then
                    print " ) /"& files(sh+A).title;
                else
                    print " )  "& files(sh+A).title;
                end if
            end if
        else
            exit for
        end if
    next sh
    print ""
    if sh+a < ubound(files) then print "...."
    do : sleep 1 : key = inkey : loop until key <> ""
    select case asc(right(key,1))
    case 60, 62
        if flag = &h10 then
            flag = &h00
        else
            flag = &h10
        end if
        exit do
    case 73
        if A > 0 then
            A -= 1
        end if
    case 81
        if c + a < ubound(files) then A += 1
    case 72                   'oben
        if c > 0 then c -= 1
        if A > 0 and c = 0 then a -= 1
    case 80                   'unten
        if c < 30 and c < ubound(files) then
            c += 1
        else
            if c + a < ubound(files) then A += 1
        end if
    end select
    select case asc(left(key,1))
    case 27
        if flag = &h10 then
            weiter = 0
        else
            C = -1
            weiter = 0
        end if
        exit do
    case 13
        if files(c).flag = &h10 then
            if c = 0 then
                dirs = ".."
              else
                dirs = files(c).title
            end if
            chdir(dirs)
        else
            seite = files(c).title
            weiter = 0
        end if
        exit do
    end select
loop
#endmacro

dim shared seite as string

function directory() as string
    dim dirs as string
    dim files() as file_type
    dim as integer i = 1
    dim c as integer
    dim K as string
    dim A as integer
    dim key as string
    dim flag as integer
    dim weiter as integer
    weiter = 1
    Locate 4,1

    files(0).title = ".."
    do
    redim preserve files(1)
    i = 1
    files(0).flag = &h10
    flag = &h10
    datei(&h10)
    datei(&h00)


    blubb()
    if c > ubound(files) then continue do
    loop until weiter = 0
    locate 1,1
    return curdir
end function

screenres 400,400
print directory() &"/"& seite
sleep
cls