| |
|
|
| |
|
| |
|
|
|
Michael Wodrich | Yes, then ists clear. and with iFs drumherum-functions go itself too The C-Indianer here well feel.
though can To foot program one further Assign with obigem Example of Roland entfallen.
the a is well for further edit, the others is well for sofortige lever-release.
thanks Best wishes Michael Wodrich |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 05/02/06 ▲ |
|
|
|
|
RGH | [quote:4504e32796=iF]I see means should one real fopen/fclose so looks: ...[/quote:4504e32796] correctly! |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 05/02/06 ▲ |
|
|
|
|
H.Brill | Irgendwas shining but not spare given To go. at that renewed write in a with OpenRW opened File, is the last DS twice drin, if The To schreibenden data less are. means instead of 3 DS only yet 2 drin stand should.
Declare Long File, Memory were[]
Set("Decimals", 2)
Struct item = name$(30), Price!
Dim were[], item
SetSize were[], 3
File = Assign($PROGDIR + "Waren.dat")
OpenRW File
With were[0]
were[0].name$ = "Milch"
were[0].Price! = 0.99
EndWith
With were[1]
were[1].name$ = "Butter"
were[1].Price! = 2.25
EndWith
With were[2]
were[2].name$ = "Käse"
were[2].Price! = 3.55
EndWith
Print "\nAus the aray red :"
AusgabeArray()
Save()
Print "\nTaste for Dateiausgabe..."
WaitKey
spending()
Print "\nDelete set Nr. 2 in Datei"
WaitKey
Arrdel were[], 1, 1
Print "\nAusgabe aray to ArrDel"
Waitkey
AusgabeArray()
Save()
Print "\nNach Save the new File."
spending()
WaitKey
Proc Save
Declare Long offset
Assign #1, $PROGDIR + "Waren.dat"
Erase #1
Close #1
Assign #1, ""
Assign #1, $PROGDIR + "Waren.dat"
OpenRW #1
offset = 0
WhileLoop 0, SizeOf(were[]) - 1
BlockWrite #1, were[&LOOP]
Inc offset, 35
EndWhile
Close #1
Assign #1, ""
ENDPROC
Proc spending
Declare Long Records
Assign #1, $PROGDIR + "Waren.dat"
OpenRW #1
Records = GetFileSize(#1) / 34
Clear were[]
SetSize were[], Records
Seek #1, 0
WhileLoop 0, Records - 1
BlockRead(#1, were[&LOOP], 0, SizeOf(were[&LOOP]))
With were[&LOOP]
Print "Artikel :", .name$, "Preis : ", .Price!
EndWith
EndWhile
Close #1
Assign #1, ""
ENDPROC
Proc AusgabeArray
WhileLoop 0, SizeOf(were[]) - 1
With were[&LOOP]
Print "Artikel : ", were[&LOOP].name$, "Preis :", were[&LOOP].Price!
EndWith
EndWhile
Save()
ENDPROC
End
shining so, as would one profaninterner Speicherbereich, the not or not entire reset watts, involved. The File Yes to the renewed write deleted. ArrDel functions time anyway correctly.. what me yet noticed is : first, if I The File with the Explorer gänzlich deleted have, are too The remains of Dateiende disappeared. |
|
|
| Benutze XPROFAN X3 + FREEPROFAN Wir sind die XProfaner. Sie werden von uns assimiliert. Widerstand ist zwecklos! Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.
Was die Borg können, können wir schon lange. | 11/29/23 ▲ |
|
|
|
|
Georg Teles | Nabend,
look time in line 7, füge simply time to OpenRW File
as long as The File "doppelt geöffnet" is, shining XProfan The old Filesize of 177 Bytes instead of new 78 auszulesen, because these blocked is, so becomes tappt im dunkeln too with Erase not deleted, therefore verzwickt itself the
then works
your whole code:
Declare Long File, Memory were[]
Set("Decimals", 2)
Struct item = name$(30), Price!
Dim were[], item
SetSize were[], 3
File = Assign($PROGDIR + "Waren.dat")
OpenRW File
Close File
With were[0]
were[0].name$ = "Milch"
were[0].Price! = 0.99
EndWith
With were[1]
were[1].name$ = "Butter"
were[1].Price! = 2.25
EndWith
With were[2]
were[2].name$ = "Käse"
were[2].Price! = 3.55
EndWith
Print "\nAus the aray red :"
AusgabeArray()
Save()
Print "\nTaste for Dateiausgabe..."
WaitKey
spending()
Print "\nDelete set Nr. 2 in Datei"
WaitKey
Arrdel were[], 1, 1
Print "\nAusgabe aray to ArrDel"
Waitkey
AusgabeArray()
Save()
Print "\nNach Save the new File."
spending()
WaitKey
Proc Save
Declare Long offset
Assign #1, $PROGDIR + "Waren.dat"
Erase #1
Close #1
Assign #1, ""
Assign #1, $PROGDIR + "Waren.dat"
OpenRW #1
offset = 0
WhileLoop 0, SizeOf(were[]) - 1
BlockWrite #1, were[&LOOP]
Inc offset, 35
EndWhile
Close #1
Assign #1, ""
ENDPROC
Proc spending
Declare Long Records
Assign #1, $PROGDIR + "Waren.dat"
OpenRW #1
Records = GetFileSize(#1) / 34
Clear were[]
SetSize were[], Records
Seek #1, 0
WhileLoop 0, Records - 1
BlockRead(#1, were[&LOOP], 0, SizeOf(were[&LOOP]))
With were[&LOOP]
Print "Artikel :", .name$, "Preis : ", .Price!
EndWith
EndWhile
Close #1
Assign #1, ""
ENDPROC
Proc AusgabeArray
WhileLoop 0, SizeOf(were[]) - 1
With were[&LOOP]
Print "Artikel : ", were[&LOOP].name$, "Preis :", were[&LOOP].Price!
EndWith
EndWhile
Save()
ENDPROC
End
Regards Georg |
|
|
| |
|
|