It's only available from routines, but you can use GetCallerContext to get
the context object. From there, you can use the package method to get the
package object and the name method of that to get the fully qualified name
of the file.
Rick
On Sat, Nov 16, 2013 at 4:59 PM, Mark Miesfeld <[email protected]> wrote:
> I'm looking for a way to obtain the value of the parse source string from
> within the native API.
>
> Is that possible?
>
> Indirectly is okay. That is if I could get the complete path name of the
> Rexx program, I can parse the directory name from that.
>
> What I'm really trying to do is capture the directory that the main Rexx
> program is located in. For example I have:
>
> /* somePrg.rex */
> -- Ensure we can be run from any directory.
> parse source . .* srcDir*
> * srcDir *= filespec('L', srcDir)
>
> rcFile =* srcDir*"resources\imageButton.rc"
> symbolFile =* srcDir*"resources\imageButton.h"
>
> .application~setDefaults("O", symbolFile, .false)
>
> dlg = .ImageListDlg~new(rcFile, IDD_IMAGELIST_BUTTON)
>
> *dlg~srcDir = srcDir*
> dlg~Execute("SHOWTOP", IDI_DLG_OOREXX)
>
> return 0
>
> ::requires "ooDialog.cls"
>
> ::class 'ImageListDlg' subclass RcDialog
>
> *::attribute srcDir*
>
> ::method SomeMethod
> expose *srcDir*
> say* srcDir*
>
>
> The whole purpose is to be able to start 'somePrg.rex' from any directory
> and have the program be able to locate its needed resource files correctly.
>
> The above code is not all that difficult to code, but I'l like to replace
> it with something more convenient for the ooDialog user.
>
> Something like:
>
> /* somePrg.rex */
> -- Ensure we can be run from any directory.
>
> srcDir = .application~locate()
>
> rcFile = srcDir"resources\imageButton.rc"
> symbolFile = srcDir"resources\imageButton.h"
>
> .application~setDefaults("O", symbolFile, .false)
>
> dlg = .ImageListDlg~new(rcFile, IDD_IMAGELIST_BUTTON)
>
> dlg~Execute("SHOWTOP", IDI_DLG_OOREXX)
>
> return 0
>
> ::requires "ooDialog.cls"
>
> ::class 'ImageListDlg' subclass RcDialog
>
> ::method SomeMethod
> say .application~srcDir
>
> The .application object is initialized when the ooDialog.cls package is
> loaded. * Ideally,* I'd like to capture srcDir doing that initialization,
> so that for the users it was always available and they didn't have to do
> anything:
>
> /* somePrg.rex */
>
> rcFile = .application~srcDir"resources\imageButton.rc"
> symbolFile = .application~srcDir"resources\imageButton.h"
> ...
>
> ::method SomeMethod
> say .application~srcDir
>
>
> Any ideas?
>
> --
> Mark Miesfeld
>
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
>
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel