I'm getting to the point where some I/O would be useful. Maybe a short example?ÂÃ, Ã‚Ã, ::)
Also, FileRequest() returns type HEAP. How does that work?
Thanks.
See editor.src. Uses file I/O. Or ask a specific question ;)
HEAP is the same as string. It is just dynamically allocated, the compiler handles it internally.
Quote from: Ionic Wizard on December 28, 2005, 11:12:27 AM
See editor.src.ÂÃ, Uses file I/O.ÂÃ, Or ask a specific question ;)
Duh.ÂÃ, :-[ÂÃ, I was just studying it, too.
Quote from: Ionic Wizard on December 28, 2005, 11:12:27 AM
HEAP is the same as string.ÂÃ, It is just dynamically allocated, the compiler handles it internally.
Got it.
I assume that HEAP is the same as in IB, where it works like this:
pointer pMem;
pMem = AllocHeap(6);
*(string)pMem = "Hello"; // five characters plus the null
return *(string)pMem;
And then anything that uses that function, the compiler will call FreeHeap after the statement is done executing. I do wonder though, how it's different to return the type STRING rather than HEAP, what the compiler does differently.
Use heap when the length of the returned string is an unknown at compile time. Returning a string does the same memory management but the length of the string itself is fixed.
FileRequest can return an unlimited amount of multiple selected filenames. A string or dstring type wouldn't work since we don't know how many files a user is going to select, and you wouldn't want a limit on that.
Here's a question. How do I read/write by UDT to disk?
write(file, udt, len(udt));
read(file, udt, len(udt));
use SEEK for positioning.
//read the 4th record
seek(file, len(udt) * 3);
reac(file, udt, len(udt);