01-12-2012, 07:13 AM
To load whole file, use this:
Macro Macro1599
When need more control, I use Windows API. Example:
Macro Macro1598
Macro Macro1599
When need more control, I use Windows API. Example:
Macro Macro1598
out
;Opens file. Repeatedly reads into a fixed size buffer until end of file.
__HFile f.Create("$desktop$\test\test.txt" OPEN_EXISTING GENERIC_READ FILE_SHARE_READ) ;;open file for read
str b.all(1024 2) ;;allocate 1 KB of memory
int nbRead
rep
,if(!ReadFile(f b b.len &nbRead 0)) end _s.dllerror
,if(nbRead=0) break ;;end of file
,
,out nbRead
,outb b nbRead 1