SELECT ACTION processing

James B. Byrne byrnejb at harte-lyne.ca
Mon Oct 24 11:23:45 CDT 2022


We run PH-8.39C on MPE/iX-7.5pp5.

I have a SCREEN that handles foreign currency (FC) transactions using the
following code:

. . .
PROCEDURE INTERNAL INPUT-FC
BEGIN
IF   0 NE SIZE(FIELDTEXT)                                          &
AND  EXCHANGE-RATE OF TRANSACTIONS NE 0                            &
AND  EXCHANGE-RATE OF TRANSACTIONS NE 1
THEN BEGIN
  IF "$" NE FIELDTEXT[1:1]
  THEN BEGIN
    LET QKT-AMOUNT = ROUND((NCONVERT(FIELDTEXT) *                  &
                            EXCHANGE-RATE OF TRANSACTIONS),2,NEAR)
    LET FIELDTEXT = ASCII(QKT-AMOUNT) + "."                        &
                  + ASCII(ROUND(MOD((QKT-AMOUNT * 100),100)        &
                          ,0,NEAR),2)
    END
  ELSE BEGIN
    LET FIELDTEXT = FIELDTEXT[2:(SIZE(FIELDTEXT))]
    END
  END
END

PROCEDURE INTERNAL OUTPUT-FC
BEGIN
IF   EXCHANGE-RATE OF TRANSACTIONS NE 0                            &
AND  EXCHANGE-RATE OF TRANSACTIONS NE 1
THEN BEGIN
  LET QKT-AMOUNT = ROUND(NCONVERT(FIELDTEXT)                       &
                 / EXCHANGE-RATE OF TRANSACTIONS,0,NEAR)
  LET FIELDTEXT =                                                  &
      ASCII(QKT-AMOUNT)
  END
END
. . .


PROCEDURE INPUT AMOUNT OF TRANSACTIONS
BEGIN
DO INTERNAL INPUT-FC
END


PROCEDURE PROCESS AMOUNT OF TRANSACTIONS
BEGIN
  DISPLAY QKD-CD-AMOUNT
  DISPLAY QKD-CD-BALANCE
END


PROCEDURE OUTPUT AMOUNT OF TRANSACTIONS
BEGIN
DO INTERNAL OUTPUT-FC
END



INPUT-FC converts the entered value into the standard currency value and
returns that value as INPUT; UNLESS the entered value is prefaced with a $ in
which case the raw value is returned instead.  On OUTOUT-FC converts the
standard currency value as stored to the FC value and displays that.  The
standard currency values are always displayed using the QKD-CD- defines.

What I wish to do is to be able to search based on the FC value.

According to the manual during the SELECT ACTION a default SELECT PROCEDURE is
triggered by the input of the associated FIELD ID number and uses a SELECT verb
to prompt for input.  In other words, if the FIELD ID of AMOUNT OF TRANSACTIONS
is 21; and the SELECT ACTION is chosen; and ID 21 is entered as a SELECT FIELD
ID; then a SELECT PROCEDURE is generated containing code similar to this:

PROCEDURE SELECT
BEGIN
  . . .
  SELECT AMOUNT OF TRANSACTIONS
  . . .
END

If this is not the case in effect then I would like to be told what actually
happens.

Given that the SELECT ACTION operates essentially as written above then the
SELECT VERB is documented as begin processed with the PROCEDURE INPUT AMOUNT OF
TRANSACTIONS, followed by the modified retrieval process, followed by the
PROCEDURE OUTPUT AMOUNT OF TRANSACTIONS.

If this actually what is supposed to occur then I expect that the INPUT value
is converted using the INPUT-FC procedure and that the converted value is then
used for retrieval.  This is not the observed behaviour. The raw input value is
evidently simply taken and used for retrieval.  This indicates that either the
INPUT PROCEDURE is not used or that there is something wrong with the
conversion code which is only triggered by the SELECT PROCEDURE.  The OUTPUT
PROCEDURE works as expected.

Can someone tell me which is the case and how one would implement this capability?



-- 
***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
   Unencrypted messages have no legal claim to privacy
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3



More information about the powerh-l mailing list