glitchdetector icon

[GML] Generate File List

glitchdetector | PRO | 10/09/16 02:50:37 AM UTC | 0 ⭐ | 10254 👁️ | Never ⏰ | []
Game Maker |

0 B

|

None

|

0 👍

/

0 👎

///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();

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎