For Programmers: Free Programming Magazines  


Home > Archive > Rexx > November 2006 > getting routine not found for a loaded routine









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author getting routine not found for a loaded routine
ari

2006-11-09, 8:03 am

We are building an application in oorexx. There are a large number of
support routines. We wanted to have the application code simply do one
"requires" or one "call" at the start, that will call a rexx that will
load all the support routines - but when one support routine calls
another, its not found.

The following example will show what I mean:

~/ari/rextest >cat master.rexx
#!/usr/local/bin/rexx

/* this is the main program */
CALL 'reqall.rexx'

say 'this is master'
sink=fromtwo();
sink=fromone();



~/ari/rextest >cat reqall.rexx
#!/usr/local/bin/rexx

/* this loads two support files, one, and two - we've tried swapping
the order here, to no avail */

CALL 'two.rexx'
CALL 'one.rexx'

~/ari/rextest >cat one.rexx
#!/usr/local/bin/rexx
say 'one is init'

::ROUTINE fromone PUBLIC

/* this will call a routine from two.rexx */
say 'this is from one - about to call fromtwo'
sink=fromtwo()
say 'this is end of fromone'
return 0

~/ari/rextest >cat two.rexx
#!/usr/local/bin/rexx

say 'two is init'

::ROUTINE fromtwo PUBLIC
say 'this is from two '
return 0

When we run master.rexx we get the following:

two is init
one is init
this is master
this is from two
this is from one - about to call fromtwo
6 *-* sink=fromtwo()
7 *-* sink=fromone();
REX0043E: Error 43 running /home/jcl2ksh/ari/rextest/one.rexx line 6:
Routine not found
REX0417E: Error 43.1: Could not find routine "FROMTWO"


Now ,we can see that "fromtwo" runs correctly when called from "master"
- why can't it be found when its called from "one.rexx"???

Any suggestions???

Ari

Graham

2006-11-09, 7:01 pm

ari wrote:
> We are building an application in oorexx. There are a large number of
> support routines. We wanted to have the application code simply do one
> "requires" or one "call" at the start, that will call a rexx that will
> load all the support routines - but when one support routine calls
> another, its not found.
>
> The following example will show what I mean:
>
> ~/ari/rextest >cat master.rexx
> #!/usr/local/bin/rexx
>
> /* this is the main program */
> CALL 'reqall.rexx'
>
> say 'this is master'
> sink=fromtwo();
> sink=fromone();
>
>
>
> ~/ari/rextest >cat reqall.rexx
> #!/usr/local/bin/rexx
>
> /* this loads two support files, one, and two - we've tried swapping
> the order here, to no avail */
>
> CALL 'two.rexx'
> CALL 'one.rexx'
>
> ~/ari/rextest >cat one.rexx
> #!/usr/local/bin/rexx
> say 'one is init'
>
> ::ROUTINE fromone PUBLIC
>
> /* this will call a routine from two.rexx */
> say 'this is from one - about to call fromtwo'
> sink=fromtwo()
> say 'this is end of fromone'
> return 0
>
> ~/ari/rextest >cat two.rexx
> #!/usr/local/bin/rexx
>
> say 'two is init'
>
> ::ROUTINE fromtwo PUBLIC
> say 'this is from two '
> return 0
>
> When we run master.rexx we get the following:
>
> two is init
> one is init
> this is master
> this is from two
> this is from one - about to call fromtwo
> 6 *-* sink=fromtwo()
> 7 *-* sink=fromone();
> REX0043E: Error 43 running /home/jcl2ksh/ari/rextest/one.rexx line 6:
> Routine not found
> REX0417E: Error 43.1: Could not find routine "FROMTWO"
>
>
> Now ,we can see that "fromtwo" runs correctly when called from "master"
> - why can't it be found when its called from "one.rexx"???
>
> Any suggestions???


I don't see anything in "master" which defines the fromone or fromtwo
routines, so unless they are external routines, I would not expect them
to be found.

Graham.
David Ruggles

2006-11-09, 7:01 pm

ari wrote:
> We are building an application in oorexx. There are a large number of
> support routines. We wanted to have the application code simply do one
> "requires" or one "call" at the start, that will call a rexx that will
> load all the support routines - but when one support routine calls
> another, its not found.
>


Ok, I wasn't planning on replying because I didn't have time today, but
here goes:

You have the following programs:

A
/ \
B C

A can call routines from both B and C, but B and C cannot call routines
from each other nor from A.

In this example:

A
|
B
|
C

A can call routines from both B and C AND B can call routines from C,
but B cannot call routines from A and C cannot call routines from A or B.

The order of the calls or requires directives don't matter. The
hierarchy will be the same.

You can uses classes and the local enviornment to get around this
limitation, but I don't really have time to delve in to any examples
right now.

I hope this will at least give you better understanding of the issue.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com