RE: [U2] UniSubroutine question with UOJ

2008-04-24 Thread waivic
This is reponse to Symeon Breen's reply. Yes, CRT does not prevent UniObject
to call UniSubrouitne. But you can't see the CRT output unless you convert
them into an output paramater like Eric Armstrong suggests here. But my
problem is sometimes the Unidata subroutine fires some warning messages,
such as 'Uninitilized variables at line x'. In terminal mode, Unidata
subroutine still runs under this situation. But when you run UniObject for
Java to call the subroutine, UOJ just outputs nothing. Same things happen
when you turn on the Unidata debugger function. Is there a way that I can
let UOJ still successfully call the subrotuine even there could be such
warning happening:'Uninitilized variables at line x'.





That sounds odd - in standard uniobjects, or with uo.net it still works fine
even with a crt in the sub - not good practice of course but it certainly
works. I cant figure out why uoj would be different, they all use the same
backend udcs processes.  Is this Unidata on *nix or windows ?



-- 
View this message in context: 
http://www.nabble.com/UniSubroutine-question-with-UOJ-tp16763989p16852462.html
Sent from the U2 - Users mailing list archive at Nabble.com.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] UniSubroutine question with UOJ

2008-04-24 Thread Symeon Breen
Sorry - maybe I misunderstood you - when you say returns nothing I assumed you 
meant the returned parameters in the call are empty. This would be odd as it 
certainly works in uoj as I stated regardless of crt's and error messages.

However there is no way of capturing any crt, or error message statements in 
uniobjects per se - What I have done in the past (so that I can run my backend 
apps in pseudo debug mode wHich means I pass a param in and I do lots of crt's) 
is perform a COMO ON UniqueName at the top of the unibasic, and at the end, 
before returning I do a COMO OFF and then open _PH_ and read in the como output 
and return that as a parameter in the subroutine - e.g.

SUBROUTINE getdata(invars,debugmode,outvars,Err,debugOutput)

IF debugmode THEN 
EXECUTE COMO ON TEST
END


IF debugmode THEN CRT Starting processing
... do processing
IF debugmode THEN
 CRT Finished processing
 EXECUTE COMO OFF
 OPEN _PH_ TO PFIL THEN
   READ debugOutput FROM PHFIL,TEST ELSE debugOutpu=''
 END
END

RETURN

You can then use the debugOutput returned variable in your calling java.

NB If the database is universe the como output goes to a different file.


HTH

Symeon



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of waivic
Sent: 24 April 2008 21:39
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] UniSubroutine question with UOJ

This is reponse to Symeon Breen's reply. Yes, CRT does not prevent UniObject
to call UniSubrouitne. But you can't see the CRT output unless you convert
them into an output paramater like Eric Armstrong suggests here. But my
problem is sometimes the Unidata subroutine fires some warning messages,
such as 'Uninitilized variables at line x'. In terminal mode, Unidata
subroutine still runs under this situation. But when you run UniObject for
Java to call the subroutine, UOJ just outputs nothing. Same things happen
when you turn on the Unidata debugger function. Is there a way that I can
let UOJ still successfully call the subrotuine even there could be such
warning happening:'Uninitilized variables at line x'.





That sounds odd - in standard uniobjects, or with uo.net it still works fine
even with a crt in the sub - not good practice of course but it certainly
works. I cant figure out why uoj would be different, they all use the same
backend udcs processes.  Is this Unidata on *nix or windows ?



-- 
View this message in context: 
http://www.nabble.com/UniSubroutine-question-with-UOJ-tp16763989p16852462.html
Sent from the U2 - Users mailing list archive at Nabble.com.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] UniSubroutine question with UOJ

2008-04-22 Thread Eric Armstrong
What I do is convert all the CRT's and PRINTs to strings in a copy of the U2
subroutine and then pass them back as an argument to the Uniobject
subroutine, which calls the copy, not the original.

Eric


-Original Message-
From: waivic [mailto:[EMAIL PROTECTED]
Sent: Friday, April 18, 2008 11:02 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] UniSubroutine question with UOJ


I use the UniSubroutine object of Uinobject For Java to call a subroutine
with Unidata. But if I have any CRT or PRINT command inside Unidata
Subroutine, it will mess up the UniSubroutine call. Basically, it runs but
returns nothing. Anyone know why this happens and how I can prevent this
happen?
-- 
View this message in context:
http://www.nabble.com/UniSubroutine-question-with-UOJ-tp16763989p16763989.ht
ml
Sent from the U2 - Users mailing list archive at Nabble.com.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/





LOBEL FINANCIAL PRIVACY NOTICE: 
This communication may contain confidential company information that is 
protected by federal law. Federal regulations prohibit the disclosure (or 
re-disclosure) of confidential information without the written consent of the 
person(s) to whom it pertains. Additionally, the views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of the company.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] UniSubroutine question with UOJ

2008-04-20 Thread Symeon Breen
That sounds odd - in standard uniobjects, or with uo.net it still works fine 
even with a crt in the sub - not good practice of course but it certainly 
works. I cant figure out why uoj would be different, they all use the same 
backend udcs processes.  Is this Unidata on *nix or windows ?



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of waivic
Sent: 18 April 2008 19:02
To: u2-users@listserver.u2ug.org
Subject: [U2] UniSubroutine question with UOJ

I use the UniSubroutine object of Uinobject For Java to call a subroutine
with Unidata. But if I have any CRT or PRINT command inside Unidata
Subroutine, it will mess up the UniSubroutine call. Basically, it runs but
returns nothing. Anyone know why this happens and how I can prevent this
happen?
-- 
View this message in context: 
http://www.nabble.com/UniSubroutine-question-with-UOJ-tp16763989p16763989.html
Sent from the U2 - Users mailing list archive at Nabble.com.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] UniSubroutine question with UOJ

2008-04-19 Thread Kate Stanton
It has always been thus.  You will notice that you can execute a UV program 
OK.


The solution we set up over 10 years ago still stands: use execute to do 
subroutines.


3 UV programs named something like: SRTN1, SRTN2, SRTN3, all using 
SRTN.COMMON


You are welcome to use these: suggestions welcome.

Notes:
-Our names are prefixed with PT (we call out utilities Pilot).
-the PTACT file contains a record for each active user, including if 
select list is active

-SP TEST and TEST.S are used to track diagnostic data in the TEST file

SRTN.COMMON contains:
001: *
002: *  Common areas for PTSRTN1, PTSRTN2  PTSRTN3
003: *   PTSRTN.COMMON vn 02 18 JUN 2003 Copyright: Walstan Systems
004: *
005: COM /SRTN/ SID, ACNT, A1, A2, A3, A4, A5, A6 ;* For PTSRTN
006: COM /SELS/ SLYN  ;* Saved list Y/N

001: SUBROUTINE PTSRTN1(ID,SCNT,P1,P2,P3,P4,P5,P6)
002: *  Set up data for subroutine to execute from PC
003: *   PTSRTN1 vn 03 06 SEP 2007   Copyright: Walstan Systems
004: *
005: $INCLUDE BPT PTSRTN.COMMON
006: $INCLUDE BPT PT.COMMON
007: FN = 'PTSRTN1 ':ID  ;* Function name
008: $INCLUDE BPT TEST.COMMON;* For SP.TEST
009: SID = ID;* Name of srtn to call
010: ACNT = SCNT ;* No of arguments
011: A1 = P1 ;* 1st argument
012: A2 = P2 ;* 2nd argument
013: A3 = P3 ;* 3rd argument
014: A4 = P4 ;* 4st argument
015: A5 = P5 ;* 5th argument
016: A6 = P6 ;* 6th argument
017: CALL READ.S(FN,ACTR,'PTACT',ACTF,@USERNO)   ;* User activity
018: IF ACTR25 NE  THEN SLYN = 'Y' ELSE SLYN = 'N';* Active list
019: IF SP.TEST13 = 'Y' THEN GOSUB 200 ;* Save call detail
020: RETURN
021: **
022: *  Save call detail  *
023: **
024: 200 MSG = 'Call   ':SID ;* Srtn to call
025: IF ACNT  0 THEN MSG := '(':A1  ;* 1st parameter
026: IF ACNT  1 THEN MSG := ',':A2  ;* 2nd parameter
027: IF ACNT  2 THEN MSG := ',':A3  ;* 3rd parameter
028: IF ACNT  3 THEN MSG := ',':A4  ;* 4th parameter
029: IF ACNT  4 THEN MSG := ',':A5  ;* 5th parameter
030: IF ACNT  5 THEN MSG := ',':A6  ;* 6th parameter
031: IF ACNT  0 THEN MSG := ')' ;* Close brackets
032: CALL TEST.S(FN,MSG,TF)  ;* To show user
033: RETURN
034:   END

001: *
002: *  Execute a subroutine (so PC can provide user interface)
003: *   PTSRTN2 vn 02 18 JUN 2003   Copyright: Walstan Systems
004: *
005: $INCLUDE BPT PTSRTN.COMMON
013: FN = 'PTSRTN2 ':SID  ;* Function name
014: PROG = SID   ;* Program to call
*  removed lines here from the test version capturing a specific call
021: IF SLYN = 'Y' THEN   ;* Has active list
022:   SLID = 'SL':@USERNO   ;* Select list ID
023:   EXECUTE 'GET.LIST ':SLID CAPTURING X   ;* Activate the list
024: END
025: BEGIN CASE
026:   CASE ACNT = 0; CALL @PROG
027:   CASE ACNT = 1; CALL @PROG(A1)
028:   CASE ACNT = 2; CALL @PROG(A1,A2)
029:   CASE ACNT = 3; CALL @PROG(A1,A2,A3)
030:   CASE ACNT = 4; CALL @PROG(A1,A2,A3,A4)
031:   CASE ACNT = 5; CALL @PROG(A1,A2,A3,A4,A5)
032:   CASE ACNT = 6; CALL @PROG(A1,A2,A3,A4,A5,A6)
033:   CASE 1
034: PRINT 'PTSRTN.COMMON areas not set up to execute subroutine'
035: END CASE
036:  END

001: SUBROUTINE PTSRTN3(ID,PCNT,P1,P2,P3,P4,P5,P6)
002: *  Get results of executed subroutine
003: *   PTSRTN3 vn 02 06 SEP 2007   Copyright: Walstan Systems
004: *
005: $INCLUDE BPT PTSRTN.COMMON
006: FN = 'PTSRTN3 ':SID ;* Function name
007: $INCLUDE BPT TEST.COMMON;* For SP.TEST
008: ID = SID;* Subroutine called
009: PCNT = ACNT  ;* Arguments passed
010: P1 = A1  ;* 1st argument
011: P2 = A2  ;* 2nd argument
012: P3 = A3  ;* 3rd argument
013: P4 = A4  ;* 4st argument
014: P5 = A5  ;* 5th argument
015: P6 = A6  ;* 6th argument
016: IF SP.TEST14 = 'Y' THEN GOSUB 200 ;* Save details
017: RETURN
018: *---*
019: *  Save details returned from the call  *
020: 

RE: [U2] UniSubroutine question with UOJ

2008-04-18 Thread Dennis Bartlett
It probably runs as a phantom, and therefore follows the same rules. I don't
think there is a way to turn that on or off.

You could just write to a file, then view the result elsewhere. I created a
type 19 file which looks just like a directory to windows / unix apps. In
there I create files and give the appropriate file extension so the when
clicked open, even to the point of having a U2 program create a 'bat' file
run by Windows scheduler.. and we're on a linux machine.

If you do want the data to show up in UniData, then write to a file, and let
another U2 proggie poll that file, or add a trigger to pick up that
something new is there, anything found can be displayed.

Hope I didn't miss the point there..


-Original Message-


I use the UniSubroutine object of Uinobject For Java to call a subroutine
with Unidata. But if I have any CRT or PRINT command inside Unidata
Subroutine, it will mess up the UniSubroutine call. Basically, it runs but
returns nothing. Anyone know why this happens and how I can prevent this
happen?
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/