Retrieve Cursor position in S/36 display file - IBM AS400

This is a discussion on Retrieve Cursor position in S/36 display file - IBM AS400 ; Hi, We've got some programs developed in S/36 and the associated DSPF's. We need to be able to add a prompt function to these screens now but we need to be able to recognise which field we're in, ie cursor ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Retrieve Cursor position in S/36 display file

  1. Retrieve Cursor position in S/36 display file

    Hi,

    We've got some programs developed in S/36 and the associated DSPF's.

    We need to be able to add a prompt function to these screens now but
    we need to be able to recognise which field we're in, ie cursor
    position.

    Can anybody offer any advice on how to do this?

    Thanks


    Steve


  2. Re: Retrieve Cursor position in S/36 display file

    Yeah, I did it before.

    Use a INFDS on the display file in the program:
    ================================================== ==========
    FDISPLAY CD F 1024 WORKSTN
    F KINFDS INFDS
    ================================================== ==================
    Than use a data structure like this:
    ================================================== ==========
    *
    IINFDS DS
    I 370 370 CURROW
    I 371 371 CURCOL

    ================================================== ==========
    CURROW is the binairy value of the current row and
    CURCOL is the binairy value of the current column
    where the cursor is at the moment of reading the display file.

    You have to do some calculation of both fields

    HTH, Cheers
    Pjotr



    Silverfox wrote:
    > Hi,
    >
    > We've got some programs developed in S/36 and the associated DSPF's.
    >
    > We need to be able to add a prompt function to these screens now but
    > we need to be able to recognise which field we're in, ie cursor
    > position.
    >
    > Can anybody offer any advice on how to do this?
    >
    > Thanks
    >
    >
    > Steve


  3. Re: Retrieve Cursor position in S/36 display file

    As you have mentioned dspf then I assume you are working in the System/36
    environment. If you were on a true System/36, then it needs a subroutine
    EXIT.

    This is I hope all that is required, extracted from an old (1997) program.
    If you change it to a fixed pitch font, it will look better, but should
    paste into SEU

    FOPERATORCD F 1200 WORKSTN
    F KFMTS TWBN62FM
    0016 F KINFDS INFDS

    0013 E BBIT 8 1

    0341 I* DATA STRUCTURE - ERROR HANDLING
    0342 IINFDS DS
    0343 I *STATUS STATUS
    0048 I 370 370 ROW
    0048 I 371 371 COL
    0344 I**
    0223 I* DATA STRUCTURE - ROW & COLUMN
    0061 I DS
    0066 I 1 2 ROWN
    0066 I 3 4 COLN
    0066 I 1 4 ROWCOL

    0084 C MOVE ROW HEX 1
    0084 C EXSR CONV
    0084 C MOVE DEC ROWN 2
    C*
    0084 C MOVE COL HEX 1
    0084 C EXSR CONV
    0084 C MOVE DEC COLN 2

    0002 C************************************************* ******
    0003 C* SET UP BINARY ARRAY
    0004 C************************************************* ******
    C BINSR3 BEGSR
    0011 C BITOF'01234567'BBIT,1
    0012 C BITON'0' BBIT,1
    0013 C BITOF'01234567'BBIT,2
    0014 C BITON'1' BBIT,2
    0015 C BITOF'01234567'BBIT,3
    0016 C BITON'2' BBIT,3
    0017 C BITOF'01234567'BBIT,4
    0018 C BITON'3' BBIT,4
    0019 C BITOF'01234567'BBIT,5
    0020 C BITON'4' BBIT,5
    0021 C BITOF'01234567'BBIT,6
    0022 C BITON'5' BBIT,6
    0023 C BITOF'01234567'BBIT,7
    0024 C BITON'6' BBIT,7
    0025 C BITOF'01234567'BBIT,8
    0026 C BITON'7' BBIT,8
    C MOVE 'Y' BINMK 1
    C ENDSR
    0002 C************************************************* ****************
    0082 C CONV BEGSR
    0089 C Z-ADD0 DEC 30
    0090 C 1 DO 8 I DO
    0089 C TESTBBBIT,I HEX 97 |
    0089 C 97 ADD BVAL,I DEC |
    C END END
    C ENDSR
    C************************************************* ****************

    The binary to decimal conversion is extremely tedious, but I seem to
    remenber that in later programs, ROW and COL were considered a two byte
    binary number, so one was the nymber modulus 256 and the other was the
    remainder, but I cannot find any reference at present.

    If it doesn't do what you want, let me know and I will have another delve.

    Peter Kinsman

    "Silverfox" wrote in message
    news:1186396594.390323.137010@k79g2000hse.googlegr oups.com...
    > Hi,
    >
    > We've got some programs developed in S/36 and the associated DSPF's.
    >
    > We need to be able to add a prompt function to these screens now but
    > we need to be able to recognise which field we're in, ie cursor
    > position.
    >
    > Can anybody offer any advice on how to do this?
    >
    > Thanks
    >
    >
    > Steve
    >




  4. Re: Retrieve Cursor position in S/36 display file

    Peter,

    You forget to tell where BVAL is coming from. Compile time table ?

    Cheers,
    Pjotr

    Peter Kinsman wrote:
    > As you have mentioned dspf then I assume you are working in the
    > System/36 environment. If you were on a true System/36, then it
    > needs a subroutine EXIT.
    >
    > This is I hope all that is required, extracted from an old (1997) program.
    > If you change it to a fixed pitch font, it will look better,
    > but should paste into SEU
    >
    > FOPERATORCD F 1200 WORKSTN
    > F KFMTS TWBN62FM
    > 0016 F KINFDS INFDS
    >
    > 0013 E BBIT 8 1
    >
    > 0341 I* DATA STRUCTURE - ERROR HANDLING
    > 0342 IINFDS DS
    > 0343 I *STATUS STATUS
    > 0048 I 370 370 ROW
    > 0048 I 371 371 COL
    > 0344 I**
    > 0223 I* DATA STRUCTURE - ROW & COLUMN
    > 0061 I DS
    > 0066 I 1 2 ROWN
    > 0066 I 3 4 COLN
    > 0066 I 1 4 ROWCOL
    >
    > 0084 C MOVE ROW HEX 1
    > 0084 C EXSR CONV
    > 0084 C MOVE DEC ROWN 2
    > C*
    > 0084 C MOVE COL HEX 1
    > 0084 C EXSR CONV
    > 0084 C MOVE DEC COLN 2
    >
    > 0002 C************************************************* ******
    > 0003 C* SET UP BINARY ARRAY
    > 0004 C************************************************* ******
    > C BINSR3 BEGSR
    > 0011 C BITOF'01234567'BBIT,1
    > 0012 C BITON'0' BBIT,1
    > 0013 C BITOF'01234567'BBIT,2
    > 0014 C BITON'1' BBIT,2
    > 0015 C BITOF'01234567'BBIT,3
    > 0016 C BITON'2' BBIT,3
    > 0017 C BITOF'01234567'BBIT,4
    > 0018 C BITON'3' BBIT,4
    > 0019 C BITOF'01234567'BBIT,5
    > 0020 C BITON'4' BBIT,5
    > 0021 C BITOF'01234567'BBIT,6
    > 0022 C BITON'5' BBIT,6
    > 0023 C BITOF'01234567'BBIT,7
    > 0024 C BITON'6' BBIT,7
    > 0025 C BITOF'01234567'BBIT,8
    > 0026 C BITON'7' BBIT,8
    > C MOVE 'Y' BINMK 1
    > C ENDSR
    > 0002
    > C************************************************* ****************
    > 0082 C CONV BEGSR 0089 C Z-ADD0 DEC
    > 30 0090 C 1 DO 8 I DO 0089 C
    > TESTBBBIT,I HEX 97 |
    > 0089 C 97 ADD BVAL,I DEC |
    > C END END
    > C ENDSR
    > C************************************************* ****************
    >
    > The binary to decimal conversion is extremely tedious, but I seem to
    > remenber that in later programs, ROW and COL were considered a two
    > byte binary number, so one was the nymber modulus 256 and the other
    > was the remainder, but I cannot find any reference at present.
    >
    > If it doesn't do what you want, let me know and I will have another
    > delve.
    > Peter Kinsman
    >
    > "Silverfox" wrote in message
    > news:1186396594.390323.137010@k79g2000hse.googlegr oups.com...
    >> Hi,
    >>
    >> We've got some programs developed in S/36 and the associated DSPF's.
    >>
    >> We need to be able to add a prompt function to these screens now but
    >> we need to be able to recognise which field we're in, ie cursor
    >> position.
    >>
    >> Can anybody offer any advice on how to do this?
    >>
    >> Thanks
    >>
    >>
    >> Steve




  5. Re: Retrieve Cursor position in S/36 display file

    Sorry

    0087.00 0005 E BVAL 8 8 3 0

    2144.00 ** BVAL
    2145.00 128 64 32 16 8 4 2 1

    Peter

    "Pjotr" wrote in message
    news:46b707b8$0$37725$5fc3050@dreader2.news.tiscal i.nl...
    > Peter,
    >
    > You forget to tell where BVAL is coming from. Compile time table ?
    >
    > Cheers,
    > Pjotr
    >
    > Peter Kinsman wrote:
    >> As you have mentioned dspf then I assume you are working in the
    >> System/36 environment. If you were on a true System/36, then it
    >> needs a subroutine EXIT.
    >>
    >> This is I hope all that is required, extracted from an old (1997)
    >> program. If you change it to a fixed pitch font, it will look better,
    >> but should paste into SEU
    >>
    >> FOPERATORCD F 1200 WORKSTN
    >> F KFMTS TWBN62FM
    >> 0016 F KINFDS INFDS
    >>
    >> 0013 E BBIT 8 1
    >>
    >> 0341 I* DATA STRUCTURE - ERROR HANDLING
    >> 0342 IINFDS DS
    >> 0343 I *STATUS STATUS
    >> 0048 I 370 370 ROW
    >> 0048 I 371 371 COL
    >> 0344 I**
    >> 0223 I* DATA STRUCTURE - ROW & COLUMN
    >> 0061 I DS
    >> 0066 I 1 2 ROWN
    >> 0066 I 3 4 COLN
    >> 0066 I 1 4 ROWCOL
    >>
    >> 0084 C MOVE ROW HEX 1
    >> 0084 C EXSR CONV
    >> 0084 C MOVE DEC ROWN 2
    >> C*
    >> 0084 C MOVE COL HEX 1
    >> 0084 C EXSR CONV
    >> 0084 C MOVE DEC COLN 2
    >>
    >> 0002 C************************************************* ******
    >> 0003 C* SET UP BINARY ARRAY
    >> 0004 C************************************************* ******
    >> C BINSR3 BEGSR
    >> 0011 C BITOF'01234567'BBIT,1
    >> 0012 C BITON'0' BBIT,1
    >> 0013 C BITOF'01234567'BBIT,2
    >> 0014 C BITON'1' BBIT,2
    >> 0015 C BITOF'01234567'BBIT,3
    >> 0016 C BITON'2' BBIT,3
    >> 0017 C BITOF'01234567'BBIT,4
    >> 0018 C BITON'3' BBIT,4
    >> 0019 C BITOF'01234567'BBIT,5
    >> 0020 C BITON'4' BBIT,5
    >> 0021 C BITOF'01234567'BBIT,6
    >> 0022 C BITON'5' BBIT,6
    >> 0023 C BITOF'01234567'BBIT,7
    >> 0024 C BITON'6' BBIT,7
    >> 0025 C BITOF'01234567'BBIT,8
    >> 0026 C BITON'7' BBIT,8
    >> C MOVE 'Y' BINMK 1
    >> C ENDSR
    >> 0002
    >> C************************************************* ****************
    >> 0082 C CONV BEGSR 0089 C Z-ADD0 DEC
    >> 30 0090 C 1 DO 8 I DO 0089 C
    >> TESTBBBIT,I HEX 97 |
    >> 0089 C 97 ADD BVAL,I DEC |
    >> C END END
    >> C ENDSR
    >> C************************************************* ****************
    >>
    >> The binary to decimal conversion is extremely tedious, but I seem to
    >> remenber that in later programs, ROW and COL were considered a two
    >> byte binary number, so one was the nymber modulus 256 and the other
    >> was the remainder, but I cannot find any reference at present.
    >>
    >> If it doesn't do what you want, let me know and I will have another
    >> delve.
    >> Peter Kinsman
    >>
    >> "Silverfox" wrote in message
    >> news:1186396594.390323.137010@k79g2000hse.googlegr oups.com...
    >>> Hi,
    >>>
    >>> We've got some programs developed in S/36 and the associated DSPF's.
    >>>
    >>> We need to be able to add a prompt function to these screens now but
    >>> we need to be able to recognise which field we're in, ie cursor
    >>> position.
    >>>
    >>> Can anybody offer any advice on how to do this?
    >>>
    >>> Thanks
    >>>
    >>>
    >>> Steve

    >
    >




  6. Re: Retrieve Cursor position in S/36 display file

    OK, than it is a nice solution.

    Cheers,
    Pjotr


    Peter Kinsman wrote:
    > Sorry
    >
    > 0087.00 0005 E BVAL 8 8 3 0
    >
    > 2144.00 ** BVAL
    > 2145.00 128 64 32 16 8 4 2 1
    >
    > Peter
    >
    > "Pjotr" wrote in message
    > news:46b707b8$0$37725$5fc3050@dreader2.news.tiscal i.nl...
    >> Peter,
    >>
    >> You forget to tell where BVAL is coming from. Compile time table ?
    >>
    >> Cheers,
    >> Pjotr
    >>
    >> Peter Kinsman wrote:
    >>> As you have mentioned dspf then I assume you are working in the
    >>> System/36 environment. If you were on a true System/36, then it
    >>> needs a subroutine EXIT.
    >>>
    >>> This is I hope all that is required, extracted from an old (1997)
    >>> program. If you change it to a fixed pitch font, it will look
    >>> better, but should paste into SEU
    >>>
    >>> FOPERATORCD F 1200 WORKSTN
    >>> F KFMTS TWBN62FM
    >>> 0016 F KINFDS INFDS
    >>>
    >>> 0013 E BBIT 8 1
    >>>
    >>> 0341 I* DATA STRUCTURE - ERROR HANDLING
    >>> 0342 IINFDS DS
    >>> 0343 I *STATUS STATUS
    >>> 0048 I 370 370 ROW
    >>> 0048 I 371 371 COL
    >>> 0344 I**
    >>> 0223 I* DATA STRUCTURE - ROW & COLUMN
    >>> 0061 I DS
    >>> 0066 I 1 2 ROWN
    >>> 0066 I 3 4 COLN
    >>> 0066 I 1 4 ROWCOL
    >>>
    >>> 0084 C MOVE ROW HEX 1
    >>> 0084 C EXSR CONV
    >>> 0084 C MOVE DEC ROWN 2
    >>> C*
    >>> 0084 C MOVE COL HEX 1
    >>> 0084 C EXSR CONV
    >>> 0084 C MOVE DEC COLN 2
    >>>
    >>> 0002 C************************************************* ******
    >>> 0003 C* SET UP BINARY ARRAY
    >>> 0004 C************************************************* ******
    >>> C BINSR3 BEGSR
    >>> 0011 C BITOF'01234567'BBIT,1
    >>> 0012 C BITON'0' BBIT,1
    >>> 0013 C BITOF'01234567'BBIT,2
    >>> 0014 C BITON'1' BBIT,2
    >>> 0015 C BITOF'01234567'BBIT,3
    >>> 0016 C BITON'2' BBIT,3
    >>> 0017 C BITOF'01234567'BBIT,4
    >>> 0018 C BITON'3' BBIT,4
    >>> 0019 C BITOF'01234567'BBIT,5
    >>> 0020 C BITON'4' BBIT,5
    >>> 0021 C BITOF'01234567'BBIT,6
    >>> 0022 C BITON'5' BBIT,6
    >>> 0023 C BITOF'01234567'BBIT,7
    >>> 0024 C BITON'6' BBIT,7
    >>> 0025 C BITOF'01234567'BBIT,8
    >>> 0026 C BITON'7' BBIT,8
    >>> C MOVE 'Y' BINMK 1
    >>> C ENDSR
    >>> 0002
    >>> C************************************************* ****************
    >>> 0082 C CONV BEGSR 0089 C Z-ADD0 DEC
    >>> 30 0090 C 1 DO 8 I DO
    >>> 0089 C TESTBBBIT,I HEX 97 |
    >>> 0089 C 97 ADD BVAL,I DEC |
    >>> C END END
    >>> C ENDSR
    >>> C************************************************* ****************
    >>> The binary to decimal conversion is extremely tedious, but I seem to
    >>> remenber that in later programs, ROW and COL were considered a two
    >>> byte binary number, so one was the nymber modulus 256 and the other
    >>> was the remainder, but I cannot find any reference at present.
    >>>
    >>> If it doesn't do what you want, let me know and I will have another
    >>> delve.
    >>> Peter Kinsman
    >>>
    >>> "Silverfox" wrote in message
    >>> news:1186396594.390323.137010@k79g2000hse.googlegr oups.com...
    >>>> Hi,
    >>>>
    >>>> We've got some programs developed in S/36 and the associated
    >>>> DSPF's. We need to be able to add a prompt function to these screens
    >>>> now
    >>>> but we need to be able to recognise which field we're in, ie cursor
    >>>> position.
    >>>>
    >>>> Can anybody offer any advice on how to do this?
    >>>>
    >>>> Thanks
    >>>>
    >>>>
    >>>> Steve




  7. Re: Retrieve Cursor position in S/36 display file

    Here is an example of the mod 256 arithmetic.

    0001 H
    0002 F************************************************* **************
    0005 F*
    0006 F* test SCREEN MODEL
    0007 F*
    0008 F************************************************* **************
    0009 FTESTCWFMCF F 512 WORKSTN
    0010 F KINFDS INFDS
    0012 E* MSG 1 2 75
    0013 E SEL 8 1
    0014 E SF1 8 6
    0015 E SF2 8 30
    0016 ITESTCWFMNS 01
    0017 I 1 8 SEL
    0018 I**
    0016 IINFDS DS
    0343 I *STATUS STATUS
    0021 I 272 277 MODEL
    0048 I B 370 3710ROWCOL
    0060 C EXCPTDISP1
    0060 C READ TESTCWFM 90
    0060 C*
    0060 C ROWCOL DIV 256 ROW 30
    0060 C MVR COL 30
    0060 C MOVE MODEL MODEL1 6
    0060 C*
    0045 C POST TESTCWFM INFDS 90
    0060 C*
    0060 C EXCPTDISP1
    0060 C READ TESTCWFM 90
    0060 C*
    0060 C DIV ZERO ZERO 10
    0060 C*
    0061 C END TAG
    0062 C SETON LR
    0063 OTESTCWFME DISP1
    0064 O K8 'TESTCW01'
    0065 O* SEL 8
    0066 O MODEL 14
    0066 O ROW Z 20
    0066 O COL Z 26
    0067 O SF2 296
    0068 O* 90 MSG,1 371
    0069 O* N90 MSG,2 371

    Here it is from a native program, but I believe it works for a System/36
    format as well..

    Peter

    "Pjotr" wrote in message
    news:46b707b8$0$37725$5fc3050@dreader2.news.tiscal i.nl...
    > Peter,
    >
    > You forget to tell where BVAL is coming from. Compile time table ?
    >
    > Cheers,
    > Pjotr
    >
    > Peter Kinsman wrote:
    >> As you have mentioned dspf then I assume you are working in the
    >> System/36 environment. If you were on a true System/36, then it
    >> needs a subroutine EXIT.
    >>
    >> This is I hope all that is required, extracted from an old (1997)
    >> program. If you change it to a fixed pitch font, it will look better,
    >> but should paste into SEU
    >>
    >> FOPERATORCD F 1200 WORKSTN
    >> F KFMTS TWBN62FM
    >> 0016 F KINFDS INFDS
    >>
    >> 0013 E BBIT 8 1
    >>
    >> 0341 I* DATA STRUCTURE - ERROR HANDLING
    >> 0342 IINFDS DS
    >> 0343 I *STATUS STATUS
    >> 0048 I 370 370 ROW
    >> 0048 I 371 371 COL
    >> 0344 I**
    >> 0223 I* DATA STRUCTURE - ROW & COLUMN
    >> 0061 I DS
    >> 0066 I 1 2 ROWN
    >> 0066 I 3 4 COLN
    >> 0066 I 1 4 ROWCOL
    >>
    >> 0084 C MOVE ROW HEX 1
    >> 0084 C EXSR CONV
    >> 0084 C MOVE DEC ROWN 2
    >> C*
    >> 0084 C MOVE COL HEX 1
    >> 0084 C EXSR CONV
    >> 0084 C MOVE DEC COLN 2
    >>
    >> 0002 C************************************************* ******
    >> 0003 C* SET UP BINARY ARRAY
    >> 0004 C************************************************* ******
    >> C BINSR3 BEGSR
    >> 0011 C BITOF'01234567'BBIT,1
    >> 0012 C BITON'0' BBIT,1
    >> 0013 C BITOF'01234567'BBIT,2
    >> 0014 C BITON'1' BBIT,2
    >> 0015 C BITOF'01234567'BBIT,3
    >> 0016 C BITON'2' BBIT,3
    >> 0017 C BITOF'01234567'BBIT,4
    >> 0018 C BITON'3' BBIT,4
    >> 0019 C BITOF'01234567'BBIT,5
    >> 0020 C BITON'4' BBIT,5
    >> 0021 C BITOF'01234567'BBIT,6
    >> 0022 C BITON'5' BBIT,6
    >> 0023 C BITOF'01234567'BBIT,7
    >> 0024 C BITON'6' BBIT,7
    >> 0025 C BITOF'01234567'BBIT,8
    >> 0026 C BITON'7' BBIT,8
    >> C MOVE 'Y' BINMK 1
    >> C ENDSR
    >> 0002
    >> C************************************************* ****************
    >> 0082 C CONV BEGSR 0089 C Z-ADD0 DEC
    >> 30 0090 C 1 DO 8 I DO 0089 C
    >> TESTBBBIT,I HEX 97 |
    >> 0089 C 97 ADD BVAL,I DEC |
    >> C END END
    >> C ENDSR
    >> C************************************************* ****************
    >>
    >> The binary to decimal conversion is extremely tedious, but I seem to
    >> remenber that in later programs, ROW and COL were considered a two
    >> byte binary number, so one was the nymber modulus 256 and the other
    >> was the remainder, but I cannot find any reference at present.
    >>
    >> If it doesn't do what you want, let me know and I will have another
    >> delve.
    >> Peter Kinsman
    >>
    >> "Silverfox" wrote in message
    >> news:1186396594.390323.137010@k79g2000hse.googlegr oups.com...
    >>> Hi,
    >>>
    >>> We've got some programs developed in S/36 and the associated DSPF's.
    >>>
    >>> We need to be able to add a prompt function to these screens now but
    >>> we need to be able to recognise which field we're in, ie cursor
    >>> position.
    >>>
    >>> Can anybody offer any advice on how to do this?
    >>>
    >>> Thanks
    >>>
    >>>
    >>> Steve

    >
    >




+ Reply to Thread