Dear P.O.: first of all, like Rick I would strongly advise, if possible, to not use path fragments in Rexx programs/packages that you invoke. Just have them located via the environment, either by placing the directories on the path or change the local directory to the location where your scripts reside.
Having said that, I just tested using paths with forward and backward slashes on Windows and Linux: * Windows will work with forward slashes, Linux as well, * Windows will work with backward slashes, Linux would not ("43.901 Could not find file ...") So using forward slashes seems to be fine. There is however another possibility: "dynamic requires", here an example: .context~package~addPackage(.package~new("rgf_util2.rex")) Place the above line at the top of your program. It will resolve "rgf_util2.rex" according to the requires rules. HTH, ---rony On 15.10.2018 11:06, P.O. Jonsson wrote: > Sorry for late response but I am in Spain with only the telephone as an > internet source so a bit > restricted access. > > Rick: from what you write it appears that in principle it is not possible to > ::requires a class so > that it works in both Win and *nix worlds? It would all have to be done > outside of the program > itself? The ::requires is checked when the program starts, hence it cannot be > „filled in“ at > runtime, right? > > To give the context: > > I have started to write test cases for the ooRexx samples (another show > stopper) and in doing so > try to make them as portable as possible. I have copied the samples back from > */<install > directory>/share/ooRexx* and grind through them to try to find meaningful > tests and take note of > things that may need amendment as I go along. > > For the time being I keep the samples in a subdirectory */ooRexx* of the test > directory (hence the > question), later I can change this with a search&replace. > > I have attached the first 3 1/2 test cases, feel free to comment on what you > (or any developer) > consider needs to be changed/added/improved/deleted. > > A question in the same context: how do I redirect standard input to a rexx > program from a test > case in the best way? I need to feed some samples with input that is supposed > to come from the > user. I have never done this so any help is welcome. > > > > > Von meinen Macbook gesendet > > Hälsningar/Regards/Grüsse, > P.O. Jonsson > oor...@jonases.se <mailto:oor...@jonases.se> > > > >> Am 15.10.2018 um 01:00 schrieb Rick McGuire <object.r...@gmail.com >> <mailto:object.r...@gmail.com>>: >> >> No, the ::requires has to be a constant literal string or symbol. >> >> Rick >> >> On Sun, Oct 14, 2018 at 5:55 PM J Leslie Turriff <jlturr...@mail.com >> <mailto:jlturr...@mail.com>> >> wrote: >> >> Is it possible to build the string using the separator method of >> the File >> class, store it in a string, and refer to it in the ::requires >> statement? >> e.g. >> reqPath = 'ooRexx'.file~separator'complex.rex' >> >> Leslie >> >> On 2018-10-14 15:34:18 Rick McGuire wrote: >> > Really not good practice to do this. A better choice would be to add >> the >> > subdirectory to your path and just use the simple name. >> > >> > Rick >> > >> > On Sun, Oct 14, 2018 at 3:52 PM P.O. Jonsson <oor...@jonases.se >> <mailto:oor...@jonases.se>> >> wrote: >> > > Dear ooRexxers, >> > > >> > > I need to require a file from a subdirectory, like this >> > > >> > > ::requires 'ooRexx/complex.rex' -- load the complex class >> > > >> > > My question is: how can I make this so that it works on both Mac and >> Win? >> > > >> > > The Win version of this would be (I guess, no Win machine at hand): >> > > ::requires 'ooRexx\complex.rex' -- load the complex class >> > > >> > > I need something that works on all ooRexx platforms (Win, Darwin, >> Linux, >> > > AIX, ARM-32 and any other) >> > > >> > > Von meinen Macbook gesendet >> > > >> > > Hälsningar/Regards/Grüsse, >> > > P.O. Jonsson >> > > oor...@jonases.se <mailto:oor...@jonases.se> >> > > >>
_______________________________________________ Oorexx-users mailing list Oorexx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-users