Does Thor Have a Tool to Examine Program Files and Check For Undeclared Variables?

3 views
Skip to first unread message

Ryan Cannon

unread,
May 17, 2017, 3:05:47 PM5/17/17
to Thor, the Tool Manager for FoxPro
Hello,

I am looking for a tool that can be used to examine a program file or code from a form in VFP and report if there are any undeclared variables throughout. I am told Thor is able to do this but I wanted to make sure and if it is able to do this how to go about using that tool. If Thor does not have this capability is there something else that does?

Thank you,
Ryan

Koen Piller

unread,
May 17, 2017, 3:30:52 PM5/17/17
to Thor, the Tool Manager for FoxPro
Ryan,
Thor has such a tool, it will spot and add any undeclared local variables. Provided they are prefixed with a l (small letter L)
others are declared as global variables.
Regards,
Koen

P.S. there exists a 'Thor forum' please check out: https://groups.google.com/forum/?hl=nl&fromgroups#!forum/foxprothor

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Cannon

unread,
May 17, 2017, 4:20:43 PM5/17/17
to Thor, the Tool Manager for FoxPro
Thank you for such a quick reply. I have downloaded Thor but am having some trouble finding the tool that does the above tasks.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.

Jim Nelson

unread,
May 17, 2017, 4:32:44 PM5/17/17
to FoxPr...@googlegroups.com
Ryan --

Thor has a tool, "Create Locals", that adds any undeclared variables to the LOCAL list of the method or PRG you are currently editing.

However, I see your request that your request is to report on undeclared variables, either in a PRG or in the methods in a form or class.  Thor does not have such a tool.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Matt Slay

unread,
May 17, 2017, 5:00:39 PM5/17/17
to FoxPr...@googlegroups.com

Eric Selje

unread,
May 18, 2017, 11:02:57 AM5/18/17
to FoxPr...@googlegroups.com
BeautifyX will also do that for you, among other things.

To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+unsubscribe@googlegroups.com.

Koen Piller

unread,
May 18, 2017, 11:36:46 AM5/18/17
to Thor, the Tool Manager for FoxPro
Hi,
After you have installed Thor your VFP menu will be extended with two new options: Thor and Thor Utilities
You should look for: Menu->Thor Utilites ->Code ->Create Locals.
The use of the utility is simple:
Open your .prg or class.method than clink on 'Create Locals' and variables preceding with a 'l' (small L) will be found and put on the top of your file / method. If you follow comman habit and preceed your variables with 'c' = character, 'i'= integer a.s.o, the variables are declared as such (not that it matters much as you can easily assign a datevalue to a string declared variable cName, but it easies reading.
An other possibiliy, if you dont like the way this Create Locals is working (inserting without your interference code lines to your prg or methods, there exists a "PraseLocals" which shows you the missing declare local variables and arrays and prompts to add this to your prg or method. The use of ParseLocals and Create Locals are identical: first open your prg or method than apply the procedure.If in need I will upload you the ParseLocals procedure.
There are situations where CreateLocals donot find all the variables where ParseLocals does and the otherway around, have not yet taken the time to determine exactly why one does not work and the other does.
Regards,
Koen
Reply all
Reply to author
Forward
0 new messages