Bill

There is a very cludgy routine below to get it for UniVerse. 

However, on some revisions of UniVerse there was a bug that prevented the
catalog path being written to the catdir object, so your luck may vary.

Brian

--- cut here ---

PROGRAM GetCatdirPath

$OPTIONS PICK
Get(Arg.) ProgName Else
Crt "Program Name :":; input ProgName
if ProgName = "" then 
   GoSub Usage
STOP
End
End

OpenSeq "GLOBAL.CATDIR", ProgName To FL Else
   Crt "Cant open it"
   STOP
End                
Status FStat From FL Else
   Crt "Cannot status ":ProgName
   CloseSeq FL
   STOP
End
ObjectLength = FStat<6>
ReadBlk Object From FL, ObjectLength Else
   Crt "Cannot read ":ProgName  
   CloseSeq FL
   STOP
End    

CloseSeq FL
L = ObjectLength
Loop While Object[L,1] = Char(0) Do
  L -= 1
Repeat
Path = ""
Loop While Object[L,1] <> Char(0) Do
  Path = Object[L,1]: Path
  L -= 1
Repeat

Crt Path

STOP 
*---------------------------------------------------------------------------
* Usage 
*---------------------------------------------------------------------------
Usage:

Crt "GetCatdirPath"
Crt "============="
Crt
Crt "Get original path name from Global catalog entry."
Crt
Crt "Syntax:"
Crt
Crt "GetCatdirPath *MyProg"
Crt

Return                                              

--- end cut --- 

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Brutzman, Bill
Sent: 23 September 2009 19:11
To: U2 Users List
Subject: [U2] Reading the Global Catalog


Is there a way to programatically...

        [1] read the global catalog?

        [2] determine the original path (file folder) of a cataloged
(compiled) SubRoutine?

In other words, is it possible to do something like...

        read R.Catalog from F.Catalog, MY.SUB.NAME  else  R.Catalog = ''
        My.Sub.Path = R.Catalog<2>

Suggestions would be appreciated.

--Bill Brutzman
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to