Is there any way to say what a file name is, where VB6 assigned it only a number?

I am working with some old VB6 code and still a newbie. I know that in VB6 you assign an integer to represent a file. I have a program that uses quite a lot of files, and it's hard to determine which file it works with, when it will display the number, when I am on the variable. (pic below).

enter image description here

So, in the example above, how do you know what file # 5 is?

thanks

+6
source share
2 answers

You may need to change the program to "register" file names with file numbers:

Dim FileRegister as Collection Dim FileName as String Dim FileNumber as Integer ... FileRegister.add FileName, str(FileNumber) Open FileName For Output as #FileNumber ... FileRegister.Remove str(FileNumber) Close #FileNumber 
+3
source
  • Find the code for the variable name? Do you have MZTools ? This is a free plugin with great search capabilities.
  • Track code execution to find out where the device number comes from? Use the call stack function when debugging, or use MZTools to list all the calls of any procedure.
  • (last option) add a log.
    • Each time a file is opened, register the file name and device number.
    • Each time the file is closed, write down the device number.
    • You can leave a record in the production code, perhaps in order to enable / disable it at run time. This may be useful again.
+3
source

Source: https://habr.com/ru/post/946293/


All Articles