You are right. I have this code to extract the *.c filename from the commando string:
str_cpy (temp_str,command_str); // get the main script name
var pos = str_stri(temp_str,".c");
var start = str_chr(temp_str,-pos,' '); // -pos --> search backwards
var end = pos + 1;
var len = str_len(temp_str);
if (end > 0 && end < len)
str_trunc(temp_str,len - end);
if (start > 0)
str_clip(temp_str,start);
if (file_exists (temp_str)) str_cpy (DT_SCRIPT,temp_str);
else DT_SPLASH("Main script not found",dt_font_25);
Maybe you can use that instead of the other
Last edited by Widi; 04/24/12 18:41.