S
Sam (Deleted User)
Guest
I wrote a script for my Execute Statement extension which allows me to read the entire contents of a VBScript text file. It works in GMStuido 1.4 and 2. But for whatever reason I can't get it working in GM 8.1. It's obvious legacy GM can do this too, but needs to be done slightly different in order for it to work, I just can't remember how it used to be done.
Anyone know what I should do differently?
Thanks!
Samuel
Code:
// ExecuteVBScriptFile executes .VBS script files.
// argument0: The VBScript script file to execute.
if (file_exists(argument0) == true) {
var __vbsFile__, __vbsString__;
__vbsFile__ = file_text_open_read(argument0);
__vbsString__ = "";
while (file_text_eof(__vbsFile__) == false) {
__vbsString__ += file_text_readln(__vbsFile__);
}
file_text_close(__vbsFile__);
ExecuteStatement(__vbsString__, "VBScript");
} else {
show_message("File not found!");
}
Thanks!
Samuel