Features
How to
Others

SourceForge.net Logo

PB Assistant 3.5 User's Manual

Welcome to use PB Assistant! It is a helper for PowerBuilder developers, she can help you do some analysis to your project and clean up your code. This tool is developed using PowerBuilder, and need run with PBVM. If you have any suggestion or problem, please contact with the author(jack74@gmail.com).

Features
Search Objects

1. Description
Search objects by name in the selected PBLs, find all objects which name include the specified string.
2. Instructions
a. Load PBL list;
b. [Search]-->[Search Object]
3. Screenshot

Search Script

1. Description
Search objects by script in the selected PBLs, find all objects which source/script include the specified text.
2. Instructions
a. Load PBL list;
b. [Search]-->[Search Script];
c. Find the occurrences in object source by Find Text.
3. ScreenShot
Similar with the "Search Objects".

Objects List

1. Description
List all objects in the selected PBLs.
2. Instructions
a. Load PBL list;
b. [Search]-->[Objects List];
3. Screenshot

Duplicate Objects

1. Description
List all objects in the selected PBLs.
2. Instructions
a. Load PBL list;
b. [Search]-->[Duplicate Objects];
3. Screenshot

Useless objects

1. Description
Search useless objects in a project.
Note: The useless object searching is based on whether the object name is explicitly referred by other useful objects. But this is not always correct, many objects are referred in the form of variables and can't be found by name searching. So the result may include some really USEFUL objects! It's strongly recommended to backup your source before clean up it with the result. Usually there are 2 exceptions that will result in a wrong judgement.
a. The object name is combined dynamically in runtime;
window w_1
string ls_1
ls_1 = '_it'
open(w_1,'w_find_it')           //Ok, the windown "w_find_it" is detected.
open(w_1,'w_find' + '_it') //Sorry, the windown "w_find_it" can NOT be detected.
open(w_1,'w_find' + ls_1)   //Sorry, the windown "w_find_it" can NOT be detected.
b. The object name is retrieved from DB.
window w_1
string ls_1
select WIN_NAME into :ls_1
form TABLE_WIN WHERE using sqlca; //e.g. ls_1 = 'w_find_it'
open(w_1,ls_1) //Sorry, the windown "w_find_it" can NOT be detected.
2. Instructions
a. Load PBL list;
b. [Search]-->[Useless Objects];
3. Screenshot
Similar with the "Search Objects".

 
Auto Comment

1. Description
Insert customized comments in PB script editor.
2. Instructions
a. First, select menu [Search]-->[Setting] to edit your own comment templates. The placeholds such as %func%, %argv% are pre-defined and will be replaced accordingly in the comments, please don't change their names;
b. [Search]-->[Header Comment] or [Modify Note];
c. The comments will be inserted in the current position in PB script editor. Note: If the active window in PB is not a editor, the operation has no effect.
3. Screenshot

Format Code

1. Description
Format the code in PB script editor with the default indent rules.Note: If the active window in PB is not a editor, the operation has no effect.
2. Instructions
a. [Tools]-->[Format Code];

Code Statistic

1. Description
Give a code statistic to your application, includes: objects count of each type, the number of executive lines, comment lines in each object, etc.
Executive lines -- all user's code except for comments.
2. Instructions
a. Load PBL list;
b. [Tools]-->[Code Statistic];
3. Screenshot

Code Explorer

1. Description
Explore object source just like in PB IDE. Note: This software is bound to PB's version, opening a PBL which version is different from the version for which the tool is built may result in errors.
2. Instructions
a. Load PBL list;
b. Double click a PBL, will open a tab "Objects in PBL", then you can choose a object to see its code;
3. Screenshot

Object Hierarchy

1. Description
Get the hierarchy tree of a object if applicable.
2. Instructions
a. In the tab "Searching Result" or "Objects in PBL", right click on a object;
3. Screenshot

PB Toolbar

1. Description
Integrate major functions into PB IDE, that is: add a PB Assistant toolbar in it. You need restart PB to see the toolbar. If auto-adding failed, you can add them manually, the corresponding commands are:
%InstalledDir%\pbfind.exe -header
%InstalledDir%\pbfind.exe -modify
%InstalledDir%\pbfind.exe -format
%InstalledDir%\pbfind.exe -searchname
%InstalledDir%\pbfind.exe -searchsrc
2. Instructions
a. [File]-->[PB Toolbar];
3. Screenshot

   
Floating Bar & Tray Icon

1. Description
Change the main window to a floating bar, or minimize to a tray icon.
2. Instructions
a. [View]-->[Floating Bar];
b. Click the "Main Window" icon to restore;
3. Screenshot
      

How to
Load PBL List

1. Use the "Open" button on the window, currently support following types.
a. *.pbw(PowerBuilder workspace files);
b. pb.ini(Only for PB6);
c. A single PBL file;
d. A PBL list file(*.txt);
2. Use the "Add" button on the winodw to add many PBL files at one time;
3. Note: Only the checked PBL files in the ListBox will be involved in your searching.
3. Screenshot

Find Text

When the object source is displayed in the right editor, you can use CTRL+F to find text, by default the selected text in the editor will be used as your target string. Press F3 for the next match.
Note: If the found string happens to locate inside a event or function, the name of this event/func will be displayed in the statusbar. You can see this in the screenshot "Search Objects".

Paste to PB

When the object source is displayed in the right editor, you can select any text and click the icon on the toolbar or press CTRL+P to paste it into PB's script editor. Note: the active window in PB IDE must be a text editor.

Save Result

Save the searching result displayed on right panel, the result can be the name list of all found objects, or the object source in the editor. In a word, what you saves is the content of the active tab on right panel.

Others
Thanks

Thanks to PBHelper/PBComment, following features code: Auto Comment, Format Code, Floating Bar are copied from it.
Thanks to Scintilla, the syntax highlight editor is based on this excellent control!
Also thanks to those kindly users, your suggestions make PB Assistant different. They are Ma.ys, Xunhua xia, liudh etc.