Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone have a tool to list the variables in a QB64 program?
#1
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
Reply
#2
If you open a program in qb64 and hit f4 you’ll get a list of all variables and arrays it has.
Reply
#3
(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).
Reply
#4
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
Reply
#5
+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!
b = b + ...
Reply
#6
If only the Search function would add multiple items to the query.
Reply
#7
(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
Shoot first and shoot people who ask questions, later.
Reply
#8
(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
Reply
#9
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.
b = b + ...
Reply
#10
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.
Reply




Users browsing this thread: 5 Guest(s)