| |
|
|
|
Description:
WriteFile writes data ex the actually position the Dateizeigers in a File.
Deklaration:
DEF @WriteFile(5) !kernel32,WriteFile
Parameter:
1.Parameter: lever the File, into one write wants. 2.Parameter: address of/ one variables with data or Memory-Variable with data, The written go should. 3.Parameter: Number of Bytes, The written go should as LongInt. 4.Parameter: Memory-Variable, The The Number of really written Bytes aufnimmt. 5.Parameter: Structure or 20 byte Memory-Variable for überlappendes reading and write. can zero his, if the lever the Files not $40000000 (with CreateFile Parameter 6) opened watts. -byte 0-3 = for Systemgebrauch reserved. -byte 4-7 = for Systemgebrauch reserved. -byte 8-11 = The downstairs 32 bit the Startadresse for the write. -byte 12-15 = The oberen 32 bit the Startadresse for the write. -byte 16-19 = lever the Ereignisses, the one signal angibt, if The Übertragung exits is.
Return Value:
0 with failure, 1 with success.
Examples:
CompileMarkSeparationDEF @CreateFile(7) !"kernel32","CreateFileA"
Def @CloseHandle(1) !"kernel32","CloseHandle"
DEF @WriteFile(5) !"kernel32","WriteFile"
Declare Dateiname$,Text$,Written#,DateiHandle&
Declare Button&
LET TEXT$="Hallo Welt!"
LET DATEINAME$="C:TEST.TXT"
LET DateiHandle&=@CreateFile(@ADDR(Dateiname$),$80000000+$40000000,0,0,4,$80,0)
Dim Written#,4
@WriteFile(DateiHandle&,@ADDR(TEXT$),@len(Text$),Written#,0)
Dispose Written#
@CloseHandle(DateiHandle&)
WINDOWSTYLE 31
Windowtitle "Datei erzeugen"
WINDOW 0,0-640,440
Let Button&=@Createbutton(%HWND,"Datei löschen",20,200,200,30)
While 0=0
Waitinput
IF @GetFocus(Button&)
ASSIGN #1,Dateiname$
Erase #1
Enablewindow Button&,0
Beep 1
Endif
WEND
|
|
|
| |
|
|