Zoho: Deluge: What techniques are used to debug Zoho Deluge syntax errors?
Often the online Zoho Deluge code provides minimal information regarding syntax errors. What techniques are successful to quickly identify the code with the incorrect syntax?
Earlier version of the question
Zoho: Deluge: syntax checking for Zoho Deluge code in an offline editor (vim, emacs, vscode...)?
Does anyone have suggested techniques for syntax checking Zoho Deluge code when editing the code offline from Zoho?
Background:
I often write/modify deluge code in offline editors like vim, emacs and nano because I'm used to their keyboard options and their ability to 'diff' different versions of the code. Then I paste the code back into the Zoho Deluge editor which sometimes reports some syntax error that I missed when working in the offline editor.
Some Practical Deluge Debugging Steps
Over time, I developed these notes for debugging Zoho-Deluge code. Posting them here in case it helps anyone who runs across this question.
The Zoho Deluge Editor's syntax error messages are often general in nature. The most common one is:
"Improper Statement. Error might be due to missing ';' at the end of line or incomplete expression"
The full list of error messages is here.
https://www.zoho.com/deluge/help/error-messages.html
This is a good reference for when one runs across an unfamiliar error message.
Techniques for debugging Zoho Deluge syntax errors.
- Check for missing end of line semi-colons.
- Check for missing '+' signs or double-quotes in recently added string construction.
- Example: mystr = "this" "that" + "other";
- Example: mystr = "this" + "that + "other";
- Check for a recently added function call where the data type is included before the variable:
- Example MyFunction(string Param); should be MyFunction(Param); when calling it.
- Check if recently added ',' (comma) was typed in as '.' (dot).
- Check for Missing paren at the end of an 'if' clause that includes multiple parens.
- Example: if(response.get("responseCode")
- Check that 'info' isn't missing at the beginning of a debug/display statement:
- Examples
- bad: myvar;
- good: info myvar;
- Check there there isn't a semi-colon at the end of a 'for each' loop statement but before the curly brackets
- Examples
- bad: (has comma at the end of the 'for each' line
for each field in fields;
{
...
}
- good
for each field in fields
{
...
}
- Check that there isn't a trailing comma in a list definition.
- Examples
- bad: mylist = {"this", "that",};
- good: mylist = {"this", "that");