[Android Software/Hacking General [Developers Only]] Dblfstr:
Common Errors

This post is intended to display the most common errors made while writing a script:

1.

Adding that damn extra comma that we all know you do not need:

selectbox(
#-- Title
"Main Title",

#-- Sub Title
"Your lovely subtitle:",

#-- Icon: <AROMA Resource Dir>/icons/default.png or <ThemeDir>/icon.default.png
"@default",

#-- Will be saved in /tmp/aroma/mods.prop
"mods.prop",

#----------------[ Selectbox With Groups ]--------------------#
# TITLE | SUBTITLE | Initial Value #
#-------------+------------------------------------+-----------------#

"Words", "", 2, #-- Group 1. key = "selected.1"
"Words", "", 1, #-- selected.1 = 1
"Words", "", 0 #-- selected.1 = 2
);

NO COMMA AFTER THAT LAST '0'​

****************************************************************************************************************************************

****************************************************************************************************************************************

****************************************************************************************************************************************

****************************************************************************************************************************************

2.

End all of your if statements:

if
something then
if
something then
Do stuff
stuff happens
endif;
endif;

Many nested if statements can be difficult to track, and it is very easy to forget to end them all.

You can go down your list of code to count your if and endif statements.

When I write code and write any ifs, I also write the endif so I do not forget to add it later.

If you get a random syntax error on the LAST LINE of your script, it is usually caused by an expected end statement.​

************************************************** ************************************************** ************************************

************************************************** ************************************************** ************************************

************************************************** ************************************************** ************************************

************************************************** ************************************************** ************************************

3.

Selected options are not executed but no error is reported.

aroma-config

menubox(
#-- Title
"Would you like to rdo stuff?",
#-- Sub Title
"Please Select:",
#-- Icon
"icons/apps",
#-- Will be saved in /tmp/aroma/whatever.prop
"whatever.prop",

#-------------------------+-----------------[ Menubox Items ]-------------------+---------------#
# TITLE | SUBTITLE | Something #
#-------------------------+-----------------------------------------------------------+-----------------#

"Option 1","This will do some stuff",0, #-- selected.0
"Option 2","This will something different",0, #-- selected.0
"Option 4","This will probably explode",0, #-- selected.0
"Option 4!","This option doesn't do sh*t but you can select if you want",1 #-- selected.0

);

Notice #-- selected.0

updater-script

if prop("whatever.prop","selected.0")=="1" then
#-- Do Option 1
alert(
#-- Title
"This is option 1",
#-- Text
"Option 1, do some stuff."
);

Notice the key is selected.0 also. If these are not matched, nothing will happen, or something else will happen depending on the key specified.

Makes sure your key values in your select boxes, check boxes, menu boxes etc. translate properly to your updater-script.​

Here is a way to find out if you have your keys coded correctly:

************************************************** ************************************************** ************************************

************************************************** ************************************************** ************************************

************************************************** ************************************************** ************************************

************************************************** ************************************************** ************************************

4. not really an error

icon usage:

Icons of any size can be supplied. But they will automatically be rendered at 72x72 pixels. ​