Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///iterate files and write
- var OUTPUT, FILETYPE, STARTTAG, ENDTAG, PREFIX, SUFFIX;
- OUTPUT = "output.txt";
- FILETYPE = "mid";
- STARTTAG = "[";
- ENDTAG = "]";
- PREFIX = '"';
- SUFFIX = '",';
- var file;
- file = file_text_open_write(OUTPUT);
- var name;
- name = file_find_first("*." + FILETYPE,0);
- file_text_write_string(file,STARTTAG);
- file_text_writeln(file);
- var files;
- files = 0;
- while name != "" {
- file_text_write_string(file,PREFIX + name + SUFFIX);
- file_text_writeln(file);
- draw_clear(c_white);
- draw_text(0,0,"Found: " + name);
- screen_refresh();
- name = file_find_next();
- files += 1;
- }
- file_text_write_string(file,ENDTAG);
- file_text_writeln(file);
- file_text_close(file);
- draw_clear(c_white);
- draw_text(0,0,"Done, found " + string(files) + " files. Output is in " + OUTPUT);
- screen_refresh();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement