Changeset 1044


Ignore:
Timestamp:
01/15/11 22:11:51 (2 years ago)
Author:
reyalP
Message:

Improved error messages with script ifdefs, from ultimA in http://chdk.setepontos.com/index.php?topic=5793.msg59721#msg59721

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/script.c

    r1036 r1044  
    455455} 
    456456 
    457 #ifdef OPT_LUA 
    458457static int is_lua() 
    459458{ 
     
    467466    && s[len-4] == '.'; 
    468467} 
    469 #endif 
    470468 
    471469static void wait_and_end(void) 
     
    630628        script_console_add_line(lang_str(LANG_CONSOLE_TEXT_STARTED)); 
    631629 
     630    if( is_lua() ) { 
    632631#ifdef OPT_LUA 
    633     if( is_lua() ) { 
    634632        if( !lua_script_start(script_source_str) ) { 
    635633            script_print_screen_end(); 
     
    646644        } 
    647645        state_lua_kbd_first_call_to_resume = 1; 
     646#else 
     647        console_add_line("Cannot run script."); 
     648        console_add_line("There is no Lua"); 
     649        console_add_line("support in this build."); 
     650        return -1; 
     651#endif 
    648652    } else 
    649 #endif 
    650653    { // ubasic 
    651654#ifdef OPT_UBASIC 
     
    655658            ubasic_set_variable(i, conf.ubasic_vars[i]); 
    656659        } 
     660#else 
     661        console_add_line("Cannot run script."); 
     662        console_add_line("There is no UBasic"); 
     663        console_add_line("support in this build."); 
     664        return -1; 
    657665#endif 
    658666    } 
Note: See TracChangeset for help on using the changeset viewer.