Can a GLOBAL_LSCALL be called from Global Logic
Posted 16 October 2002 - 12:23 PM
I have found that you can't pass numerics in/out, but
alpha's can be passed successfully.
And you can call globals that have no parameters.
I've made a few global logics that save @$com* to
scratch variables, set up values for the global,
and restore @$com* when done.
Not pretty, but it has the advantage of working.
Posted 16 October 2002 - 01:09 PM
In general it's a bit ropey - suck it and see! But it DOES work if you persist and it's extremely useful.
Posted 16 October 2002 - 04:03 PM
I 1-st defined this:
GLOBAL CALL INTERFACE FUNCTION NAME: SALESWK Caculate the salesweek
CALLED GLOBAL FUNCTION: SW INTERFACE ID: 1
CALLED GLOBAL FUNCTION: SW2 INTERFACE ID: 1
So even though the 'CALLED GLOBAL FUNCTION' is different,the fact they have the same 'INTERFACE ID' will call problems?
Also, is ther a way to delete a 'GLOBAL CALL INTERFACE' for a Function or Global Logic?
Posted 17 October 2002 - 08:36 AM
1. Don't use interface names that start with a numeric - causes all kinds of weird problems on some versions of PRO-IV. And use unique interface names for unique calls.
2. To delete an interface, either use the cleanup stuff in Studio, or delete the records in GLFINTFS bootstrap file.
3. Don't give up! It really does work.
4. Damn, that's 3 things...
Posted 17 October 2002 - 11:07 AM
The problem I have is the inconsistancy. SOmetimes this works and other not. Using the salme global logic.
The problem I'm running into could happen when:
1- the calling function is big.
2- the calling function needs a larger number of
variables returned.... I Just eliminated this possibility by testing..
I have 300 functions that call the Global Logic. I tested 30-40 of them then put the whole group in production. 10 minutes later I had to revert to a backup... So I'll find the problem & solution and get back to you.
The best solution may be to write a pgm
1- enter pgm name
2- auto add recs to GLPARMS .
3- use GLOBAL_LSCALL from the 300 pgms instead of calling the global logic..
That would cut the production work of adding 300
GLOBAL CALL INTERFACE sets of records. Which is the only reason I;m trying to use GLOBAL LOGIC to do the GLOBAL_LSCALL.
Posted 17 October 2002 - 11:09 AM
Appendix F of principles and practice doc explicitly lists 'Calling Global Functions from Global Logic' as something that does not work ON THE MAINFRAME.
Which rather implies it is supposed to work anywhere else!
I'd like to think this can work as it is something I was hoping to use heavily in future
Don't give up!
Use the forum Luke...
Although I don't use this now, one question nevertheless occurs to me..
Might there be a problem if one used a NON-EXTERN scratch variable in global logic with the same name as one used elsewhere in the function?
Posted 17 October 2002 - 11:33 AM
I've about spent as long as I can on this.
GLOBAL_LSCALL from Global Logic works if the function which calls the global logic is not big. It does not work from large functions.
THe problem is the inconsistancy. So I can't use it.
I did not try every possibility to get this to work. But I'd bet that if I got it to work now, that some upgrade to pro4 would eliminate the bug I utilized to get it to work.
I think for 4.6 rev213 that GLOBAL_LSCALL called from Global Logic is not reliable.
Posted 17 October 2002 - 11:40 AM
Just wanted to be sure what you meant by 'use unique interface names for unique calls'.
I understood you to mean - use a systemwide-unique interface-id for every distinct global-logic:called-function pair. This is not quite 'every GLOBAL_LSCALL from a global logic' because I presume it is OK to use the same interface-id to call the same function more than once from the same global logic?
This presumably ensures that whatever combination of global logics end up being used by a function, none of them can use a common interface-id (and none of them will use an interface-id also used by the calling function or any called functions)?
I presume it's no problem to use the same interface-id twice within the same or different local logic routines of the top-level calling function?
Do you have a view on where problems arise? Does it seem to be with scratch variables for example or with specific parameter types (ie. I/O/B/E) ?
Do you think there's an issue if there are global logics with the SAME NAME as the (calling or called) function?
Ps. More tortuously...
Do you have any experience with this issue where a called global FUNCTION itself makes further GLOBAL_LSCALLs (via global logic or otherwise)?
What if a global functions ends up being used recursively (via global logic or otherwise) ?! Obviously in this case the same interface-id(s) must be reused in some sense!
Ouch. my brain hurts. I think I'll stop now.
Sorry that turned into such a long post..
Posted 17 October 2002 - 11:47 AM
Your interpretation of my loosely-defined statement is, of course, correct. You can use the same interface ID multiple times in one global logic to call the same function.
As for recursive calling of global screens, it seems to work fine. Some of the apps I've written do this quite deliberately and seem to work OK (for example, opening multiple logic editor windows, all using the same logic editor global function, in the editor I've written).
Of course eventually you'll run out of function workspace if you keep calling more and more functions...
Posted 17 October 2002 - 11:49 AM
Can you tell me specifically what you meant by 'doesn't work' ie. does it coredump, do some of the parameter values not arrive in the called function or what? Do the symptoms vary?
I'll try and make some time to pursue it later.
Posted 17 October 2002 - 03:33 PM
1- pgm which had problem:
10/17/02 FUNCTION DEFINITION REV#: 4.6000
FUNCTION NAME: OS1B TITLE: ORDER ENTER HEADER SCREEN 08-2002
LOGIC SIZE: 3594 GLOBAL LOGIC SIZE: 259 FORMAT/HEADER SIZE: 599
FIELDS SIZE: 9792 BASE SIZE: SYMBOL TABLE SIZE: 21000
2- pgm which worked:
FUNCTION NAME: DATES_S TITLE: TEST YEAR DATA LOGIC
LOGIC SIZE: 12 GLOBAL LOGIC SIZE: 200 FORMAT/HEADER SIZE: 344
FIELDS SIZE: 680 BASE SIZE: SYMBOL TABLE SIZE: 4176
- The 1-st pgm calls the global logic 4 times. I just tried having it call the global logic 1x. Same problem.
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users