Post Reply 
(50g) FNINVARS: Object finder for couch hackers
10-16-2017, 12:01 AM
Post: #7
FLIBS: Library Finder for couch hackers
Several years ago when Joe Horn shared the FNINVARS program, I was also looking for a similar tool to report which libraries a program is using. After some (!) attempts and much patience from Joe, I came up with the following, somewhat brute force program, FLIBS, to do this:


%%HP: T(3)A(R)F(.);
  THEN "Not a program object!" DOERR
    WHILE "
 " "
  { } SWAP
      DUPDUP "
29E20" POS DUP
      6. + DUP 2. + SUB
      ROT OVER "00" + H\->A B\->R R\->I \->STR + UNROT
29E20" SWAP + "
  3. DROPN

Note this program requires TOHEX (I believe written by Joe):


%%HP: T(3)A(R)F(.);
    END A\->H

which in turn requires DCOD, which I assume most folks have.

To use FLIBS to examine program PROG, recall your RPL program to the stack and run FLIBS;


The result is a list of the (decimal) library numbers utilized in the program.

The above dependency explanation is a perfect example of why such tools are so essential in RPL.

There almost has to be a better way to convert the format of the found library numbers for output, but in those early days of exploring RPL, I was pleased that even this ugly sequence worked OK.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
FLIBS: Library Finder for couch hackers - rprosperi - 10-16-2017 12:01 AM

User(s) browsing this thread: 1 Guest(s)