ubasic errors - missing functions - General Help and Assistance on using CHDK stable releases - CHDK Forum

ubasic errors - missing functions

  • 4 Replies
  • 3142 Views
*

Offline zeno

  • *****
  • 891
ubasic errors - missing functions
« on: 29 / May / 2008, 05:13:53 »
Advertisements
In testing my ubasic script debugger (see Any interest in an interactive UBasic debugger for PC (or Mac?)) I've discovered that there are a number of 'missing' functions. For example get_disk_size, get_free_disk_space, get_jpeg_count and get_raw_count cannot be used in asignment statements like this:
Code: [Select]
x = get_disk_size

but only in statements like this:
Code: [Select]
get_disk_size x
This is not what the documentation says. The "bugs" are in the factor function in ubasic.c - to work in assignment statements the functions need to be listed there and they are not - they're only listed in the statement function.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: ubasic errors - missing functions
« Reply #1 on: 29 / May / 2008, 08:09:02 »
Hi, this is due to the history of UBASIC implementation. There are these two method's in use. Some developers work on making this uniform in their versions. See discussion on  http://chdk.setepontos.com/index.php/topic,688.msg12568.html#msg12568

*

Offline zeno

  • *****
  • 891
Re: ubasic errors - missing functions
« Reply #2 on: 29 / May / 2008, 08:48:08 »
Agreed, fingalo, but the trouble is that here
http://chdk.wikia.com/wiki/UBASIC/TutorialScratchpad#And_some_recently_introduced_commands:
it says the "x=..." syntax works in Allbest (but it doesn't). Guess either Allbest needs fixing or that Wiki page needs updating.
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: ubasic errors - missing functions
« Reply #3 on: 29 / May / 2008, 15:32:51 »
Ah, now I understand your error report :) You are right.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: ubasic errors - missing functions
« Reply #4 on: 29 / May / 2008, 15:40:00 »
sorry, my bad. these functions were coded mostly by me and comitted by allbest. as i used only the one method for testing, i didnt notice the error. afaik jucifer already addresses that issue in his special build. should of course be fixed in the official trunk as well though.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal