UBasic exit_alt not working - Script Writing - CHDK Forum

UBasic exit_alt not working

  • 2 Replies
  • 3968 Views
*

Offline OldGit

  • ****
  • 303
UBasic exit_alt not working
« on: 12 / September / 2010, 07:18:41 »
Advertisements
A question from Nando on the sx200 porting thread raised the question of exit_alt usage in UBasic.

After testing it seems that this command is no longer working.

(Lua exit_alt works fine )

I checked the UBasic on camera and in the UBasic debuger under Windows XP, both give the same failure.

Anyone have any ideas ?.

Thanks OldGit.
SX200 IS-100C

*

Offline zeno

  • *****
  • 891
Re: UBasic exit_alt not working
« Reply #1 on: 12 / September / 2010, 07:52:38 »
I've just looked at the code for the debugger (which is a direct copy of the CHDK code). It seems that the exit_alt statement expects an operand. Thus:
  exit_alt
fails with a parse error, but
  exit_alt 0
works fine. The code doesn't seem to do anything with the operand. Here's the code in ubasic.c
Code: [Select]
static void exit_alt_statement()
{
    int to;
    accept(TOKENIZER_EXIT_ALT);
    to = expr();
    exit_alt(to);
    accept_cr();
}
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

*

Offline OldGit

  • ****
  • 303
Re: UBasic exit_alt not working
« Reply #2 on: 12 / September / 2010, 08:03:21 »
@zeno,
many thanks, had to be something silly.

OldGit
SX200 IS-100C

 

Related Topics


SimplePortal © 2008-2014, SimplePortal