Re: [vb6] Project Scanner
Quote:
I managed to remove a lot and just show a bit and the functions that resulted in the missing variables.
Thank you. I'll begin looking at it later this week, also to add in that other duplication check you suggested.
I found the bug where the last variable in a line with 2+ variables is being ignored. So that was an easy fix. If interested, you can fix that now... but the same fix needs to be applied in two different areas:
module: modMain, method: pvParseName_Variable
module: clsValidation, method: pvParseDeclares
change:
Code:
from...
If n = p Then Exit Do
to...
If n = p And lMode = 0 Then Exit Do
edited: the patch needed to be applied in 2 methods, not one. Above has been updated
Re: [vb6] Project Scanner
Really useful! many thanks LaVolpe!
Re: [vb6] Project Scanner
Useful tool - thanks for making this available!
I think I've found a bug... On the Standard Scan report window, the Save to File menu doesn't work. It appends a portion of the text from some other line of the report to the end of the current line. Strange behavior.
Re: [vb6] Project Scanner
Quote:
Originally Posted by
AAraya
Useful tool - thanks for making this available!
I think I've found a bug...
Egads, that's embarrassing. You found some test code I forgot to remove.
Open the frmValidationHelp form and in the mnuMain_Click event, remove the 6 test-lines starting with "Dim s$"
Re: [vb6] Project Scanner
Quote:
Originally Posted by
LaVolpe
Egads, that's embarrassing. You found some test code I forgot to remove.
Open the frmValidationHelp form and in the mnuMain_Click event, remove the 6 test-lines starting with "Dim s$"
Happens to all of us - glad to help with the code clean-up!
Re: [vb6] Project Scanner
Quote:
Originally Posted by
AAraya
Happens to all of us - glad to help with the code clean-up!
Hmmm, how to get the scanner to alert on test code :rolleyes:
Re: [vb6] Project Scanner
Attachment 178750
Checked. M2000 Environment (M2000 Language)..
Re: [vb6] Project Scanner
Sorry. Trying project scanner on a vb6 project of mine, just after loading the project the application stops with this error message. Why? How can i remedy?
Attachment 179969
Attachment 179968
Re: [vb6] Project Scanner
If you want to explain a huge BB 6 project works, you should use multi-threading, the speed can be increased by five to ten times.
Re: [vb6] Project Scanner
Impressive work !
Thanks a much for this great tool !!!
Re: [vb6] Project Scanner
Are there any ways or tricks to make LaVolpe's ProjectScanner 10x faster?
Re: [vb6] Project Scanner
Quote:
Originally Posted by
xiaoyao
If you want to explain a huge BB 6 project works, you should use multi-threading, the speed can be increased by five to ten times.
Have you done any of the tests, or are you just guessing?
Re: [vb6] Project Scanner
If you need to use the CPU for computing, parsing code, lexical analysis, multithreading can certainly improve the speed. Six-core CPUs are now the norm. Six people doing a job at the same time must be faster than one person.
Re: [vb6] Project Scanner
One of the things I used to do is to need a control or a module in the project. How to delete all other useless modules or codes? It's always done by hand. First copy the module to a file, and then run the missing function. Or the above structures are copied one by one, sometimes it takes a few minutes to an hour. If possible, specify a project file or a function to leave behind. The process of removing any superfluous files and code is required for the self-burst. For example, some people have developed a lot of controls that support Unicode, but I only need one text box control inside, so I have to manually delete them one by one, while keeping the other modules that are useful.
以前我经常做的一件事情是:需要工程里面的一个控件或者一个模块.如何把其他没用的模块或者代码全部删除?一直是手工做的。先把模块复制到一个文件,然后运行缺少哪个函数.或者缺少上面结构体一个一个复制过来,有 的时候需要花费几分钟到一个小时.。如果可以,指定某个工程文件,或者某个函数留下来。自暴流相关需要的啊过程,删除任何多余的文件和代码,
比如有的人开发了一大堆的支持unicode的控件,但是我只需要里面的一个文本框控件,所以我只能手工一个个删除,同时要保留有用的那些其他模块。
Re: [vb6] Project Scanner
Your project is a great invention. If the project file can be perfectly parsed into a tree structure or a JSON data format, if the declaration of each function or API can be split into words and become JSON elements.
I have a friend who is working on turning his project into VC + +. Forms are now supported, as are many controls. The main thing is that it can be compiled into a 64-bit program.
Maybe this is the principle of twinbasic.
b4a is a program that uses VB syntax to develop Android APP. It has been perfectly realized for more than 10 years. Its principle is to turn VB code into Java code and compile it into app.
Re: [vb6] Project Scanner
Quote:
Originally Posted by
dreammanor
Edit:
My VBP is stored in the U-Disk (USB flash disk). I copied the VBP from the U-Disk to the hard disk and re-tested it. The test results did not change much:
Old PrjScan:
Time1: 423.61 seconds; Time2(DataClone): 5.98 seconds (frmMain.tvItems(0).Nodes.Count = 16)
New PrjScan:
Time1: 415.86 seconds; Time2(DataClone): 0.59 seconds (frmMain.tvItems(0).Nodes.Count = 14)
In addition, there are 507 files in Elroy's project and 567 in my project. IMO, the time of scanning depends not only on the speed of the computer and the number of project files, but also on the number of lines of source code. Krool's ComCtlsDemo.vbp has 107 files,which is one-fifth of my project, but it takes only one-twentieth of the time of my project.
I can offer some advice. Scan the project and copy all the files to a memory hard disk.
You can also save all the scanning results of the entire project and the module function API to many tables in a database.
If most people in the airport program, it can be based on tabular input. For example, to call a windows API, it has four parameters, and we only need to enter these four values in the market of the table.Its structure is parameter name and parameter type. Chinese name. A detailed introduction. Optional Value
This is what I used to deal with a lot of web POS requests to submit data.The website needs to deal with re-login, ah, to extract, to deal with the post of more than a dozen pages.Each POS machine may contain 10 to 50 items of data.So I always make it into a table and input it manually.Which values are extracted from the previous page, which values are fixed, and which values are extracted from that variable?
If a project has dozens or hundreds of files, multithreading can certainly speed things up.
Re: [vb6] Project Scanner
It would be better if some functions could be made into modules for others to call.Such as parsing project files. Parse module files, parse functions.
For example, add runtime detection to every function or procedure in the program.
It takes tens to hundreds of seconds for your tool to detect some large-scale projects. You can detect which function most of the time is spent in, and then you can optimize there. Or multithread that process. Let the CPU run at full capacity. If the CPU is 6 cores and 12 threads. Let the most CPU-heavy process be handled by the other 11 threads.
If there are many duplicate module files on the computer, some of them may have some improvements. If you can analyze how many functions there are, two modules, which module has more functions? Is the same function code different? If you do code formatting for modules and functions. It should be possible to compare more accurately.
I usually like to put some public modules in a fixed directory, and then different projects are referenced from it. This will cause the module paths to be wrong if the project is moved. It would be better to add a function of moving the project, or export all the files of the project to a directory (you can specify which modules and put them in subfolders). Add the function of generating installation files, package the DLLs OCX used in the project together, use the bat or VBS method, and register those DLLs with the administrator permission method
Re: [vb6] Project Scanner
How do you figure out how much time each function consumes, and how do you add a few lines of code in front of each procedure? How do I add some more code at the end of the function? If you exit in the middle of the process, how do you add the code?
Code:
test bas
function add()
startLogTime "test.add"
*** code
*** code
if a then exit function
if a then endlogTime "test.add":exit function
*** code
endlogTime "test.add"
end gunction
or only use logtime
Code:
test bas
function add()
LogTime "test.add"
*** code
*** code
if a then exit function
*** code
end gunction
test2.bas
function method2()
LogTime "test2.add"2
*** code
*** code
if a then exit function
*** code
end gunction
sub logtime(functionName)
end function
Re: [vb6] Project Scanner
Quote:
Originally Posted by
xiaoyao
One of the things I used to do is to need a control or a module in the project. How to delete all other useless modules or codes? It's always done by hand. First copy the module to a file, and then run the missing function. Or the above structures are copied one by one, sometimes it takes a few minutes to an hour. If possible, specify a project file or a function to leave behind. The process of removing any superfluous files and code is required for the self-burst. For example, some people have developed a lot of controls that support Unicode, but I only need one text box control inside, so I have to manually delete them one by one, while keeping the other modules that are useful.
以前我经常做的一件事情是:需要工程里面的一个控件或者一个模块.如何把其他没用的模块或者代码全部删除?一直是手工做的。先把模块复制到一个文件,然后运行缺少哪个函数.或者缺少上面结构体一个一个复制过来,有 的时候需要花费几分钟到一个小时.。如果可以,指定某个工程文件,或者某个函数留下来。自暴流相关需要的啊过程,删除任何多余的文件和代码,
比如有的人开发了一大堆的支持unicode的控件,但是我只需要里面的一个文本框控件,所以我只能手工一个个删除,同时要保留有用的那些其他模块。
Good advice
Re: [vb6] Project Scanner
Quote:
Originally Posted by
xiaoyao
Your project is a great invention. If the project file can be perfectly parsed into a tree structure or a JSON data format, if the declaration of each function or API can be split into words and become JSON elements.
I have a friend who is working on turning his project into VC + +. Forms are now supported, as are many controls. The main thing is that it can be compiled into a 64-bit program.
Maybe this is the principle of twinbasic.
b4a is a program that uses VB syntax to develop Android APP. It has been perfectly realized for more than 10 years. Its principle is to turn VB code into Java code and compile it into app.
LaVolpe, the author of ProjectScanner, is no longer coming to this forum. IMO, what you want seems to need to be done with a specialized lexical analyzer.