If you need to find a component or a business term in your PB code, you can easily run a search. But if those references are spread across different applications and types of files, (PB, UNIX script, DB code, XML files, .INI files…) this search quickly becomes complicated, and you’ll need more than one tool to perform it.
However, with Visual Expert, you an quickly analyze multiple file types and applications in a single, global search, to find all occurrences. It’s like Google for your application code!
1 - In the menu Options > General Setup, activate the option “Use Textfile categories”.
2 - In the Project Wizard, select “Text files” as the language you would like to analyze.
3 - You can choose to analyze and entire folder, or specific files. For this example, we’ll choose “Files”.
4 - Select the files or folders you would like to analyze. Click on the arrows to add them to the project.
Once you’ve selected all the files you want to add, click “Accept”.
Visual Expert will ask you to confirm the selection. If you wish to add more files, select “Previous”. To continue, click “Next”.
If you wish to add more code to the project, click the checkbox and click “Next”. This is optional, but for this example, we will add more code.
This time, we will add PowerBuilder code.
Select the version of PowerBuilder you are using. We’re using PB11.5.
Select the type of files. We will use PowerBuilder Library Files.
Select the files you wish to analyze. To continue, click “Accept”.
We are now satisfied with our selection, and confirm by clicking “Next”.
This time, we choose not to add more code, so we do not select the checkbox, and click “Next” to continue.
Now, we choose a name for the project.
If we would like Visual Expert to automatically update the code analysis for thos project, we can use the scheduler to choose how frequently this will happen. We will not select this at this time.
5 - Visual Expert now shows us all the elements in the code analyzed. You can see that there are standard PB elements (PBLs, Windows, UserObjects, etc…) but notice that under “Miscellaneous items, there are several Text files listed.
6 - Run the search. Open the menu Tools>Search
In the pop-up search box, enter the string you would like to search for. We will use the term “employee”, which is used throughout our sample application.
7 - The results. As you can see, Visual Expert has found the term “employee” throughout the application. It is used in PBLs and DataWindows, but is also found in, for example, the demopfc .INI file.