Ghost screen

Herald Kaffka Herald.Kaffka at westfraser.com
Thu Oct 13 15:04:31 CDT 2016


Here’s an example, (This one is keeping accounting happy by preventing various control #’s from duplicating rather than due to a file limit, but the concepts are the same).

Declare the screen as normal.  List/define/type any passed in variables.
po/order#’s fall out by mill-id (t-pass-mill-id), do I want a Po or order # (t-x2), return the next # to the caller in t-number                  (Variable Names aren’t mine, working example someone did a long time ago).

Declare local files.  Note that the only file in this one is a designer, (no find/change/browse processing in this screen, just do something the background and exit).

Some internal procedures that do the actual “work”.

An initialize procedure which in this case is examining the input variables and calling the correct internal procedure.
If your processing is small, just chunk all the processing in the initialize procedure.  (The initialize procedure is a good place to drive small ghosts).

Better to have several small, tightly focused ghosts than a big “general purpose” one that’s trying to do a bunch of unrelated
Tasks while trying to hide/autocomplete in the background.

All the explicit lock/get/put processing is in here as this one is not doing find/preupdate/update/postupdate type flow,
Just initialize, do it, and get out.

If you have no need to pass information back to the caller, a simple 1 line qtp call can also work in place of a ghost screen.



SCREEN name RECEIVING T-PASS-MILL-ID, T-X2, T-NUMBER

TEMP T-PASS-MILL-ID   CHAR*2
TEMP T-X2             CHAR*2
TEMP T-NUMBER         ZONED*5

FILE LAST_NUMBER_CONTROL DESIGNER
ACCESS VIA MILL_ID USING T-PASS-MILL-ID

PROCEDURE INTERNAL GET-NEXT-ORDER
BEGIN
   LET T-NUMBER = 0
   WHILE T-NUMBER = 0
   BEGIN
      LOCK LAST_NUMBER_CONTROL RECORD
      GET LAST_NUMBER_CONTROL OPT
      IF ACCESSOK
      THEN BEGIN
             LET T-NUMBER = LAST_ORDER_NUMBER OF LAST_NUMBER_CONTROL + 1
             IF T-NUMBER = 99999
               THEN LET LAST_ORDER_NUMBER OF LAST_NUMBER_CONTROL = 0
               ELSE LET LAST_ORDER_NUMBER OF LAST_NUMBER_CONTROL = T-NUMBER
             PUT LAST_NUMBER_CONTROL
           END
      UNLOCK LAST_NUMBER_CONTROL
   END
END

PROCEDURE INTERNAL GET-NEXT-PO
BEGIN
  LET T-NUMBER = 0
  WHILE T-NUMBER = 0
  BEGIN
    LOCK LAST_NUMBER_CONTROL RECORD
    GET LAST_NUMBER_CONTROL OPT
    IF ACCESSOK
    THEN BEGIN
           LET T-NUMBER = LAST_PO_NUMBER OF LAST_NUMBER_CONTROL + 1
           IF T-NUMBER = 99999
             THEN LET LAST_PO_NUMBER OF LAST_NUMBER_CONTROL = 0
             ELSE LET LAST_PO_NUMBER OF LAST_NUMBER_CONTROL = T-NUMBER
           PUT LAST_NUMBER_CONTROL
         END
    UNLOCK LAST_NUMBER_CONTROL
  END
END

PROCEDURE INITIALIZE
BEGIN
  IF T-X2 = "OR"
    THEN DO INTERNAL GET-NEXT-ORDER
  IF T-X2 = "PO"
    THEN DO INTERNAL GET-NEXT-PO

  RETURN
END

BUILD


From: powerh-l-bounces+herald.kaffka=westfraser.com at lists.sowder.com [mailto:powerh-l-bounces+herald.kaffka=westfraser.com at lists.sowder.com] On Behalf Of tadjodha at stlucianic.org
Sent: Thursday, October 13, 2016 2:26 PM
To: powerh-l at lists.sowder.com
Subject: Ghost screen








                             Does any one have examples of  a Ghost screen  as the 31 file limit has been reached.   OpenVMS 8.3  PH 8.40G  Index file system?





Thanks








-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DISCLAIMER: This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information.Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system.Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful. (Please note that it is your responsibility to scan this message for v iruses).



-------------EOP---------------

This e-mail message and any attachments are confidential. Any dissemination or use of this information by a person other than the intended recipient is unauthorized. If you are not the intended recipient, please notify me by return e-mail, do not open any attachment and delete this communication and any copy.

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sowder.com/pipermail/powerh-l/attachments/20161013/2e216245/attachment-0001.htm>


More information about the powerh-l mailing list