Buchempfehlung
Windows System Programming
Windows System Programming
Das Kompendium liefert viele interessante Informationen zur Windows-Programmierung auf Englisch. [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

Line Input Split

Uploader:Mitgliedmax06
Datum/Zeit:22.01.2012 15:44:22

dim as string fromfile


open command(1) for input as #1
line input #1, fromfile

dim as integer x = val(fromfile)

dim as integer  N (1 to x), P (1 to x), _
                W (1 to x), M (1 to x), _
                K (1 to x), A (1 to x), _
                B (1 to x), C (1 to x), D (1 to x)

for y as integer = 1 to 2
        line input #1, fromfile
        print "Runde " + str(y) + ": " + fromfile

        dim as integer array(0 to 8)

        for i as integer = 0 to len(fromfile)
                static as integer nr=0
                static as string temp
                if fromfile[i] = 32 then
                        array(nr) = ValInt(temp)
                        temp=""
                        nr += 1
                Else
                        temp &= Chr(fromfile[i])
                End if

                if i = len(fromfile) then
                        array(nr) = ValInt(temp)
                end if
        next i

        N(y)=array(0)
        P(y)=array(1)
        W(y)=array(2)
        M(y)=array(3)
        K(y)=array(4)
        A(y)=array(5)
        B(y)=array(6)
        C(y)=array(7)
        D(y)=array(8)

        print ""
        print N(y)
        print P(y)
        print C(y)
        print D(y)
next y