[General] SaveToDisk

Status
Not open for further replies.
Level 17
Joined
Dec 11, 2014
Messages
2,003
I've seen this in multiple save-load systems, specifically in CodeGen (spell section).

JASS:
function SaveToDisk takes string msg, string filename returns nothing
    call PreloadGenClear()
    call PreloadGenStart()
    call Preload(msg)
    call PreloadGenEnd(filename)
    call ClearSelection()
endfunction

Isn't preloading for preloading? Then how can I create a text file with preloading? How can I use it?
 
It is correct, just that you will end up with creating 1 text line only, you would need multiple Preload() for creating more lines.

Oh and for the PreloadGenEnd(), the input should be file path+file name+file extesion type instead of file name only, else your file will just end up creating at war3 folder.
 
So
JASS:
call Preload(msg1)
call Preload(msg2)
call Preload(msg3)
would create three lines ?
 
It is correct, just that you will end up with creating 1 text line only, you would need multiple Preload() for creating more lines.

Oh and for the PreloadGenEnd(), the input should be file path+file name+file extesion type instead of file name only, else your file will just end up creating at war3 folder.

Yes, the filename string will have it all. Thanks so much!

So
JASS:
call Preload(msg1)
call Preload(msg2)
call Preload(msg3)
would create three lines ?

Yes.
 
Status
Not open for further replies.
Back
Top