For - Next Schleife geht nicht
Verfasst: 20.06.2014 13:55
Irgendwie will die schleife nicht funktionieren. Sie durchläuft sie nur einmal und ich kann nicht herausfinden warum. Hier mal die Codeauskopplung testbar.
und hier das dazugehörige Textfile test.txt
Kann da jemand helfen ? Manchmal sieht man den Wald vor Bäumen nicht.
Code: Alles auswählen
Structure FTP_List
chmod_raw.s
chmod.s
Name.s
size.s
Dat.s
Type.l
Type2.l
link.s
EndStructure
Global NewList FTP_List.FTP_List()
If ReadFile(0, "c:\test.txt")
f$=ReadString(0,#PB_File_IgnoreEOL)
Else
MessageRequester("Information","Couldn't open the file!")
EndIf
ClearList(FTP_List())
For k=1 To CountString(f$, Chr(10))
f$ = StringField(f$, k, Chr(10))
AddElement(FTP_List())
FTP_List()\chmod_raw.s=StringField(f$,1,",")
FTP_List()\Name.s=StringField(f$,9,",")
FTP_List()\size.s=StringField(f$,5,",")
FTP_List()\dat.s=StringField(f$,6,",")+" "+StringField(f$,7," ")+","+StringField(f$,8,",")
FTP_List()\type.l=Val(StringField(f$,2,","))
FTP_List()\link.s=StringField(f$,11,",")
;file name with no spaces
FTP_List()\name = StringField(f$, 9, ",")
NextElement(FTP_List())
Next
ForEach FTP_List()
Debug FTP_List()\Name
Next
und hier das dazugehörige Textfile test.txt
Code: Alles auswählen
drwxr-xr-x,2,0,0,0,Nov,02,2013,bin
drwxr-xr-x,2,0,0,0,Nov,02,2013,boot
drwxr-xr-x,8,0,0,12460,Jan,01,2000,dev
drwxr-xr-x,7,0,0,0,Jan,01,2000,dev.static
drwxr-xr-x,12,0,0,0,May,27,22:45,etc
lrwxrwxrwx,1,0,0,10,Nov,02,2013,hdd,->,/media/hdd
drwxr-xr-x,3,0,0,0,Nov,02,2013,home
drwxr-xr-x,8,0,0,0,Jan,01,2000,lib
drwxr-xr-x,5,0,0,0,Jan,01,2000,media
drwxr-xr-x,5,0,0,0,Nov,02,2013,mnt
dr-xr-xr-x,67,0,0,0,Jan,01,2000,proc
drwxrwxrwt,3,0,0,60,Jan,01,2000,ram
drwxr-xr-x,3,0,0,0,Apr,24,19:49,root
drwxr-xr-x,2,0,0,0,Nov,02,2013,sbin
drwxr-xr-x,2,0,0,0,Nov,02,2013,share
drwxr-xr-x,11,0,0,0,Jan,01,2000,sys
drwxrwxrwt,3,0,0,260,Jun,19,22:22,tmp
drwxr-xr-x,11,0,0,0,Jun,09,18:18,usr
drwxrwxr-x,15,0,0,0,Jun,18,14:12,var