CHDK Forum

Using CHDK => Script Writing => Topic started by: zeno on 24 / March / 2008, 07:09:38

Title: uBasic @default statement ignored?
Post by: zeno on 24 / March / 2008, 07:09:38
I'm using Allbest build 37. It seems that the @default statement in a script is not executed properly if the script has run previously with different values. In other words, editing a script to change the defaults and then loading it into the camera does not work - the camera just uses values that were last used (not necessarily the 'old' defaults - just whatever values were in effect when the script was last run).

To get the default statement to execute properly it's necessary to load a different script and then load the changed one. Is this a bug or is it meant to work this way :-)
Title: Re: uBasic @default statement ignored?
Post by: Barney Fife on 24 / March / 2008, 07:43:42
Deleted
Title: Re: uBasic @default statement ignored?
Post by: zeno on 24 / March / 2008, 08:26:27
I partly agree with what you say Barney, but I think if you reload a script and it's been edited since you last ran it, then you might expect the changes to be accepted. As far as I can tell, logic changes are accepted, but changes to the @default statement are not.
Title: Re: uBasic @default statement ignored?
Post by: fudgey on 24 / March / 2008, 08:57:07
A "revert to default settings" item wouldn't be a bad thing to have in the script menu. Although some might say it would take valuable space along with the remote settings making the menu too cluttered, and it would be quite unnecessary if merely reloading the same script would clear the changes.

Meanwhile, to get back to the script's defaults, you can load some other script and after that load your newly modified script, since the settings are remembered for only the most recent script (or is there a way to save them for other scripts as well? This is actually something I'd like to see, maybe in the form of a "save defaults to script" option ... I know we'll be getting a file editor some day to partially solve this by another means completely).

Meanwhile (unless I'm mistaken about losing script settings on loading a different script), I'd vote for the settings to be always cleared when a script is loaded from the script file browser, even when the loaded script has the same name as the currently loaded script.

Retaining settings for the current script on power-off is another thing completely, it's a great thing to have.
Title: Re: uBasic @default statement ignored?
Post by: Barney Fife on 24 / March / 2008, 09:14:21
Deleted