QB64 Phoenix Edition
Anyone have a tool to list the variables in a QB64 program? - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: Anyone have a tool to list the variables in a QB64 program? (/showthread.php?tid=3246)

Pages: 1 2


Anyone have a tool to list the variables in a QB64 program? - Pete - 12-04-2024

I swear I have one I made 20+ years ago but I'd probably have to crack open a storage computer to find it. I think Fell coded such a routine for his vWatch. Basically what I'm trying to do is run a tool that will list all the variable names in a QB program.

Pete


RE: Anyone have a tool to list the variables in a QB64 program? - FellippeHeitor - 12-04-2024

If you open a program in qb64 and hit f4 you’ll get a list of all variables and arrays it has.


RE: Anyone have a tool to list the variables in a QB64 program? - TempodiBasic - 12-04-2024

(12-04-2024, 02:30 AM)FellippeHeitor Wrote: If you open a program in qb64 and hit f4 you’ll get a list of all variables and arrays it has.

Nope.
The first time that you stroke F4, QB64IDE ask you to add $debug on the first line of code.
At the second stroke of F4 you get the Add Watch window with the count and the list of all variables , the type pf data and the scope (global/SUB/Function).


RE: Anyone have a tool to list the variables in a QB64 program? - Pete - 12-04-2024

Oh, and my pisan left out the Windows Defender message that adding $Debug causes. Windows DEI-Fender. Big Grin 

Cool. Except I can't find where, if anywhere other than memory, that list can be copied. Ultimately that is what I was hoping for, but a visual list is certainly doable. It's not like I cannnn't tyoe.

Thanks guys,

+1 for all and all for +1

Pete


RE: Anyone have a tool to list the variables in a QB64 program? - bplus - 12-04-2024

+1 for Pete, good challenge exercise!

The first thing I'd look for are Dim's, For's, and stuff before an = sign. UDT's eeeh!


RE: Anyone have a tool to list the variables in a QB64 program? - Dimster - 12-04-2024

If only the Search function would add multiple items to the query.


RE: Anyone have a tool to list the variables in a QB64 program? - Pete - 12-04-2024

(12-04-2024, 03:24 PM)Dimster Wrote: If only the Search function would add multiple items to the query.
@Dimster

Can you provide an example of what you'd like the search function to do?

Pete


RE: Anyone have a tool to list the variables in a QB64 program? - Pete - 12-04-2024

(12-04-2024, 02:59 PM)bplus Wrote: +1 for Pete, good challenge exercise!

The first thing I'd look for are Dim's, For's, and stuff before an = sign. UDT's eeeh!
@bplus

Thanks!

Yeah, to be honest I think I left UDTs out of the one I made many years ago. I didn't use TYPE back then, so I didn't need it, and I realized it would greatly complicate the process of identifying and parsing out variables.

There were also fewer keywords. Of course if we get rid of the option not to underscore the new QB64 keywords, then all we need to do is dismiss any word that starts with an underscore. Easy peasy.

For lazy folks like me, who never used to dim anything, looking for math symbols was a great way to hunt numeric variables, otherwise just look for the type declarations like !,  &, etc. at the end of a word.

If you are interested in making one, feel free to use all or part of utility I posted for Dimster to remove remarks for code. That at least narrows the hunt by excluding quoted and remarked text.

I'm working on a couple of different projects at the moment, so I'm not sure if I will revisit this one. I just used Fell's vWatch routine to put up a list in the IDE window and typed the variables to notepad.

Pete


RE: Anyone have a tool to list the variables in a QB64 program? - bplus - 12-05-2024

Yes I am interested in this as project. I started but then my brother brought his Christmas gift over early, a Roku TV to replace what we had, worked great! No more cable bills now for 2 months, now we have ABC News back.

I am wondering if we add a routine to our program, we might get values of the variables updated when called.


RE: Anyone have a tool to list the variables in a QB64 program? - Delsus - 12-05-2024

I would also like to have such a feature as I implemented a "save" function in my program, but for it to work, I have to print all the variable values into a file, then read all those value from the file to restore them.