Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: Does a thread = a Pick process?



In D3NT the process that initiates the trigger is part of the logon user
name, so you can use the WHO statement to parse out who caused the calling
trigger. See sample code below:

Example LU statement where the trigger is running on port 1 and port 97
caused the trigger.

pib# user.......... udate utime account.......... mdate mtime
location.......

   1 S$97$          11/24 20:16 PM.PROGRAMS       11/24 20:16 CUSTOMER.ENTRY


* D3NT. Parse who statement out.
  WHO=OCONV("","U50BB")
  TEMP.USER=FIELD(WHO," ",2)
  TEMP.PORT=FIELD(TEMP.USER,"$",2)
  TEMP.USER=FIELD(TEMP.USER,"$",1)
  TEMP.ACCT=FIELD(WHO," ",3)
  WHO=TEMP.PORT:" ":TEMP.USER:" ":TEMP.ACCT
  PORT=TRIM(TEMP.PORT)
  IF PORT="" THEN RETURN

Steve
-- 
www.perfectionsoftware.com
"Peter Kenyon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Ross Ferris" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Low tech solution .....
> >
> > Why not use your line number, read the PIBS record (assuming you don't
> > have your own "status" file somewhere), and if you are "logged on",
> > then you are a "real user", so run the trigger code ?
>
> I'm not trying to find out whether the user is logged in or not. I need to
> know whether the trigger is being called by one particular process and if
so
> exit. Apart from that, your suggestion would be a good one, except that I
> haven't found any way to find out what line number the calling process is
> on.
>
> Actually, any piece of information would do if it is unique to a process
and
> can be determined from within the trigger.
>
> >
> > OR MAYBE SOMETHING LIKE THE FOLLOWING SUBROUTINE IN YOUR LOGON
> > PARAGRAPH
> >
> > SUBROUTINE ONLINEUSER
> > COMMON /ONLINEUSER/ IAMANONLINEUSER
> > IAMANONLINEUSER = 1
> > RETURN
> >
> >
> > Include this COMMON in your trigger, and
> >
> > IF ASSIGNED(IAMANONLINEUSER) THEN <do your online code>
> >
> > HTH
> >
>
> This does seem to work, and it would do the job. Ideally I would prefer
not
> to rely on setting a flag in the calling process, because if for some
reason
> it does not exit cleanly then the flag won't be reset. However, it will do
> as a last resort.
>
> Thanks,
>
> Peter
>
>





<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.