|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Product Review BBrowse 2.14 by the PowerBuilder Developer's Resource
BBrowse 2.14 by the PowerBuilder Developer's Resource
By: Hoyt Nelson
Apr. 1, 2009 12:00 AM
PowerBuilder provides an object browser - the utility accessed via the "Cubes with a pair of eyeglasses" icon on the PowerBar menu. If you haven't tried the PB browser, you should. Among other things, it eliminates the problem of identifying which PBL contains the object of interest. Click a tab to select an object type and you're immediately presented with a list of the current application's objects of that type. Right-click an object, select Edit from the popup menu and PB opens the object in the relevant painter. It's a fast way to navigate your PB application. The PB browser has other essential functionalities: for example, the OLE tab presents the list of OLE objects known to your Windows OS. Check it out. PBBrowse 2.14 is the latest version of Ken Howe's alternative to the native PB browser. Ken is the proprietor of PBDR.COM, the PowerBuilder Developer's Resource. I've long been a fan of Ken's PBDelta differencing tool, so I came to PBBrowse optimistically. It took a little while for me to understand the value of PBBrowse, since it seemed redundant with the native browser that works so well. With time, however, I've come to appreciate that PBBrowse is a superb way to do what its name implies - browse a PB application. It's not really redundant - it's in addition to.
Features
Browse List of Applications
Double-click an application, PBBrowse processes for 5-10 seconds, then presents you with all the objects in the application. That is, it (apparently) uses the information in the PB.INI file to identify the PBLs associated with the application you selected, and generates the list of objects that appears in those PBLs. The objects are sorted by name within the object type: for example the applications are first, followed by DataWindow objects, then global functions. The object order and the icons used are just like the PB Library Painter, so you're immediately oriented. Double-click any object and the browser window opens (see Figure 2). A nicety: PBBrowse doesn't present a tab if there are no corresponding items. For example, the Local External tab appears only if the object contains external function declarations. Each of the tabs with the split window works as you'd guess: click the item on the top and it's displayed below. This is a significant win in my opinion - it's much easier to navigate among the various scripts of a window (for example) than to manipulate PB's "Declare -->> Window functions" dialog or open the Script Painter for a given control and navigate the dropdown of events. Since I've gotten this far I was thinking, "This is clearly the easiest way to browse an object when looking at it for the first time, trying to understand the lay of the land." The PB browser offers nothing similar: it dumps you into the relevant Painter and you have to navigate the object the (relatively difficult) PB way. That's the primary function of PBBrowse: to get to an object quickly and browse its scripts and attributes. Return to the main toolbar to understand its other features.
Browse Current Application
Browse a Single Library
Find Objects
The output of the find operation is a list of objects where the strings were found with each "hit" line displayed with the object (see Figure 3). You can print it. As with the Library Painter search, you can double-click a "hit" to open the corresponding object. I don't know of any other way to accomplish this advanced search functionality. Imagine trying to do it with the Library Painter: you'd typically have to do one PBL at a time, you could search only for a single string, and you'd have none of the other options of the PBBrowse find. I've put this to work to identify the changes I've made since the last time I consolidated my work into the team's shared PBLs. I searched for "Hoyt 3/10/2000" and "Hoyt 3/11/2000" (with an OR) and it identified each of the objects so marked.
Browse Enumerated Types
Preferences
Produce Statistics for Highlighted Application
These statistics are also displayed as bar charts. Run this when your boss asks you how long it will take to familiarize yourself with the code. "Hmmm, at five lines per minute..." The other main toolbar items are mostly variants on what you've seen already. A couple object-browser-specific items bear mentioning, however.
PowerScript in PB Dev Env
Paste Function/Event Call in PB Dev Env
boolean = f_dw_scroll_to_row_column(datawindow the_dw, long the_row, string the_column)You know what the arguments are and what the function returns. Can it get any easier?
Help for Highlighted Command
Browse for Highlighted Object Name
PBBrowse searches based on the object name, so it's not going to succeed with object functions (it apparently scans the object list for the name; searching each object for its functions would take until next Tuesday). If you instantiate "g_powersmith" as "g", it's not going to find "g" either. Fortunately, I use tons of global functions so this is great for my code.
Browse Ancestor Object
That's a good roundup of the main features of PBBrowse.
More Features
As you'd guess, clicking the plus sign expands the treeview to show you all of the function objects. This view lets you ask questions such as, "What windows descend from w_base?" You can do the same thing with the PB browser, by right-clicking the object and selecting "Show Hierarchy" from the popup menu. The PBBrowse presentation is very nice, nonetheless.
PBBrTray System Tray Utility
Selecting one of the objects from the list at the top of the menu will open that object in PBBrowse. How nice, I'm confused by this thing I'm looking at in PB so I'll right-click this icon and be able to view it in PBBrowse a few moments later. Interestingly, global functions aren't added to the menu, presumably because if you're looking at a global function, PBBrowse doesn't have anything else to tell you about it. Clever.
Object History
Double-clicking on any object will reopen that object in a browser window. Again, Ken uses this utility and he's made it friendly.
Cons
To my mind, a major drawback to PBBrowse is the inability to modify code. There you are: you've fired up PBBrowse and found what you're looking for, and now you want to fix it. PBBrowse is read-only, however, so you have to renavigate to the same place in PowerBuilder and do the fix the usual way. That makes sense, of course: it's a browser, not an IDE. Still, I wish Ken could surmount the storied hassle of ORCA and make PBBrowse a read-write tool.
Summary
As a peripatetic contract programmer, routinely arriving at a new client site and being presented with a pile of unfamiliar code, PBBrowse is a no-brainer for me. I'll use it whenever I make yet another foray into unfamiliar territory. It'll also be key when I'm trying to do a search more sophisticated than, "Is this string in this PBL?" I think it'll take a while before I fully appreciate the power of the regular expressions offered by PBBrowse's find facility. It's great to simply have another way to look at the application. I'm in a window function (in one-function-at-a-time PB6) and can't remember the name of another window function. I right-click the icon in the tray, select the window from the popup menu, and I'm looking at the window in the object browser, able to find the function in question with only a few clicks. If you haven't committed your entire application's code base to memory, I think you'll find PBBrowse useful too. If you're a hunt-cut-and-paste kind of programmer, the ability to search and paste from PBBrowse will become your favorite feature. If you need help with PB functions in a script, it's a three-click operation to bring up help (double-click the function name and click the icon). If the application uses a lot of global functions (like mine do), the Browse for Highlighted Object Name feature is the quickest way to get there. For purposes of browsing the application, PBBrowse has the features you want. It seems obvious that Ken Howe uses this tool and wants to make it as useful as possible, so give it a try and forward your enhancement suggestions to Ken. (Hey, Ken, how about PBBrowse 3.0 that parses the code into a database, breaking out the object functions for better performance, so we can do the Browse for Highlighted Object Name on PFC object functions and such!) Reader Feedback: Page 1 of 1
Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week
Breaking Cloud Computing News |
||||||||||||||||||||||||||||||||||||||||||||||||