Posted: March 04 2004 at 13:15 | IP Logged
|
|
|
I promised to check in periodically to let you know how this is going.
I got back to this again for a little while. The results so far are useful but I have several issues to resolve. I am able to provide a cross-reference of ids i.e. the id of a PH entity (global, macro, trigger, etc.) and where it is used, where in the PH entity it is located and what kind of line it is in (macro, formula, send key, etc.). That's the useful part.
1. I haven't been able to make an SQL statement that would do all of the selection I need. Dave's suggestion of the derived table or inline views might work but I either misapplied the concept or still don't understand it. Here's an example of what I want to do and while its illegal in SQL I think it illustrates the idea.
select * from macrodetail where send_keys like '%( select id from global_variables )%'
The intent is to get a row from macrodetail for every occurance of the global_variables id in the macrodetail send_keys. Note: this could be multiple hits per macrodetail row. I'm probably now beating a dead horse anyway because this selection isn't complete. For instance, it will select incorrectly when an id is actually a substring of another id. Bottom line: probably need to do the the same parsing that PH does when interpreting the formulas, send keys, etc.
2. OK, so I'm parsing to glean the "real" ids from the various PH tables by writing macros. This results in some really l...........ong processing times. This makes it impractical to do this on the fly when a user wants the xref results. I got around this (sort of) by doing all of the selection processing and storing the results in a table. Now when a request is made for a xref it can be done very fast. But ... the long build times for this table are in my mind prohibitive. Also, the table will be out of date as soon as a change is made to PH.
3. The userdata1 table didn't have enough numeric fields so I stole the ir table for the purpose of this experiment. This of course precludes the ability to use IR functionality.
4. The reporting of xref'd ids has to be done one location at a time because the message window is limited. that's not too bad but sometimes you like to see this sort of thing displayed as a list or table. Question: can data (other than macros) be exported from PH?
I will continue to work on this because it has been an great way to get familiar with PH programming. I am thinking about posting a request in Features to include another table that is updated using the existing PH logic whenever parsing is done. That's when PH knows all about ids. If it could maintain a table of the known ids with where they are used the long process time to build the table the way I'm doing it goes away. It would then be a simple matter for users to write macros to access the table.
|