Page 1 of 1

Posted: Sun Jan 12, 2003 9:49 am
by BackupUser
Restored from previous forum. Originally posted by XuMuk.

Can you give me an idea how to load file in memory after "openfilereqester" and to read from txt file a line, then this line must be put in the specific "line$" for example? ( did somebody undrstood me??? :))

Posted: Sun Jan 12, 2003 10:07 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi XuMuk,
If you want load the complete file into memory, just get the filelenght with "lenght = Lof()" of your specific file, then allocate the needed memory with "result = AllocateMemory(#Memory, Size, Flags)" and load read your file using "ReadData(*MemoryBuffer, LengthToRead" into your allocated memory! This is only a basical example how to get it work. Please note, that reading files with >256 or 512 MB, like movies for example will slow down your program, due fact of reading/writing all time temp to the big temp file of windows...



PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX9.0, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Jan 12, 2003 10:12 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi XuMuk,
just search on the forum or take a look at:

viewtopic.php?t=2450

maybe this will help you while coding your stuff...!?

PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX9.0, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Jan 12, 2003 10:18 am
by BackupUser
Restored from previous forum. Originally posted by XuMuk.

and what about lines? how to cut out each line and to use it?

Posted: Sun Jan 12, 2003 10:45 am
by BackupUser
Restored from previous forum. Originally posted by geoff.

I think this is all you wanted?

OpenFile(1,"c:\temp\myfile.txt"); open the text file for reading
While Eof(1)=0 ; while there is some left to read
a$=ReadString(); read one line to string
Debug(a$); display the line
Wend;
CloseFile(1)

Geoff

Posted: Sun Jan 12, 2003 1:14 pm
by BackupUser
Restored from previous forum. Originally posted by XuMuk.

2 geoff : THX