Question

Having written my PowerBuilder code I may have several datawindows, one of which is called, let us say, d_Gubbins. Can I search through the whole uncompiled program to see if the datawindow is actually used or not please?

Was it helpful?

Solution

Download PBLPeeper and run the DataWindow Object Usage report. You can also run the Object Cross-Reference and take a look at the unreferenced objects. Beware of code like this:

public subroutine evil(string as_thing);
string ls_hidden = "d_muahahah_"
ls_hidden = ls_hidden + as_thing
dw_1.dataobject = ls_hidden
end subroutine

We've banned building names like this.

OTHER TIPS

You may also find PB Tools useful for this. http://myelkovan.codeplex.com/

You can do a text search of your dataobject name :

  • Right-click on the target (the green circle at level 2 of the project tree view - not the workspace on top level)
  • Search...
  • enter d_Gubbins in the text field, uncheck the match case option and check both of the "search in" options

If that dataobject is mentionned somewhere, it will be listed in the search results tab page. You might have some false positive results that mention OBJ: these where the datawindow is listed in deployment targets, but it does not tell that the object is actually used. You can also have wrong results if you have some other objects with the same name radix, e.g. d_Gubbins_old or d_Gubbins_temp_for_test.

If you search with double quotes around the name it will find only proper references.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top