
CHECK FILE $work_dir + "config.ini" EXISTS CHECK FTP_CONNECTION $ftp_host Even experienced users encounter issues. Here is a quick debugging table:
| Error Message | Likely Cause | Solution | |--------------------------------|---------------------------------------|-------------------------------------------| | Directive not recognized | Outdated interpreter or typo | Verify #ZXDL_VERSION matches your runtime | | Variable expansion failed | Unescaped special characters | Use quotes: SET $path = "C:\my dir" | | Job timeout exceeded | Infinite loop or slow external call | Increase #TIMEOUT or optimize nested loops | | File not found in TASK | Working directory misconfigured | Use absolute paths or CD before task | | FTP login rejected | Credentials expired or IP blocked | Rotate passwords or whitelist your IP | zxdl script
TASK loop_customers FOR EACH $cid IN $customer_array LOG "Fetching invoices for " + $cid TO $log_file RUN ftp_get --host $ftp_host --user $ftp_user --pass $ftp_pass —remote "/invoices/" + $cid + ".pdf" —local $work_dir + "downloads/" ENDFOR END_TASK CHECK FILE $work_dir + "config
#INCLUDE common/error_handling.zxdl #INCLUDE common/ftp_utils.zxdl Ensure that running the same script twice does not produce duplicate results. Check for existing output files before processing. Log Aggressively The LOG keyword is your best debugging friend. Include timestamps and context variables. Version Control Your Scripts Since zxdl scripts control critical automation, store them in Git (or equivalent). Treat them as source code. Validate External Dependencies Before a script runs, check that all required files, directories, and network resources are accessible: Log Aggressively The LOG keyword is your best