Checking Code in Scripts

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bamakojeff
Posts: 37
Joined: Tue Dec 06, 2022 6:53 pm

Checking Code in Scripts

Post by bamakojeff » Mon Apr 20, 2026 4:50 am

I've been wanting to do a series of checks on my code like making sure that all queries are parameterized, database calls are checked for success or failure, etc. I started by searching for every "revDataFromQuery" (for example) in the code and then going to that script and checking it manually, but that's tedious and easy to miss errors. Then Bernd's recent stack to diff scripts inspired me that there was a better way.

So (with a little help from Claude.ai) I worked up a stack to crawl my stack and copy out all the code and then print everything either in one big document or each script in its own file (which will make it a lot easier to move this project to using scripts, which I need to do before it gets even bigger than it is). One big document made it fairly easy to write scripts to check that every call to "revDataFromQuery" was parameterized if possible, was followed by a check for success or failure, etc., etc.

I suspect that this already exists, but as Hubris is a virtue in a programmer, I wrote my own. For anyone who doesn't want to write their own, the script is attached here, and you can also get it on github: https://github.com/claypotfrog/LCScriptInspector

Jeff
Attachments
LCScriptInspector.livecode.zip
Utility to crawl a LiveCode stack and print all the scripts either in one document or each one separately.
(6.89 KiB) Downloaded 4 times

Post Reply