identification division.

 class-id. pn as "DBNET.pn001".

*> *****************************************************************

*>

*>

*> DESCRIPTION.     Phone Number Program.

*>

*> AUTHOR.          DB-Net.

*>

*> *****************************************************************

*>

*> Copyright (c) 1990-2008 by DB-Net, Inc.

*> 23 Ridgeway Court

*> Howard, Ohio  43028

*> Phone: (740) 397-9229

*> Fax: (740) 397-9459

*> E-Mail: rickh@db-net.com

*> Website: www.db-net.com or

*> www.sweet3000.com

*> DB-Net and Sweet3000 are registered trademarks of DB-Net, Inc.

*>

*> *****************************************************************

*>

*> MODIFICATION HISTORY :

*>

*> bring up to version 4 standards

*>

*> *****************************************************************

 environment division.

 configuration section.

 special-names.

 repository.

interface icobapp as "DBNetRT.ICobolAppWCF"

class clsTrace as "DBNetRT.Debug"

class clsIntrinsics as "DBNetRT.Intrinsics"

class clsVersion as "DBNetRT.Version"

class clsString as "System.String"

interface clsSIONet as "DBNetRT.ISIONet"

class phone-file as "DBNetIO.phone_file"

 .

 static.

 data division.

 working-storage section.

 01 instance0  object reference pn private.

 procedure division.

 

 method-id. get property Instance.

 data division.

 linkage section.

 01 obj  object reference pn.

 procedure division returning obj.

        if instance0 = null

                invoke pn "NEW" returning instance0

        end-if

        set obj to instance0

 end method.

 

 method-id. methodc as "Cancel".

 data division.

 procedure division.

        set instance0 to null

 end method methodc.

 end static.

 

 object. implements icobapp.

 environment division.

 input-output section.

 file-control.

select print-file assign to print-name file status is print-status organization is line sequential.

 data division.

 file section.

 

*> ************************************************************

 

fd print-file.

       

 01 print-record pic x(132) value spaces.

 working-storage section.

 01 cobol-switches  pic x(32).

 01 redefines cobol-switches.

      05 switch-0 pic 9.

      05 switch-1 pic 9.

      05 switch-2 pic 9.

      05 switch-3 pic 9.

      05 switch-4 pic 9.

      05 switch-5 pic 9.

      05 switch-6 pic 9.

      05 switch-7 pic 9.

      05 switch-8 pic 9.

      05 switch-9 pic 9.

      05 switch-10 pic 9.

      05 switch-11 pic 9.

      05 switch-12 pic 9.

      05 switch-13 pic 9.

      05 switch-14 pic 9.

      05 switch-15 pic 9.

      05 switch-16 pic 9.

      05 switch-17 pic 9.

      05 switch-18 pic 9.

      05 switch-19 pic 9.

      05 switch-20 pic 9.

      05 switch-21 pic 9.

      05 switch-22 pic 9.

      05 switch-23 pic 9.

      05 switch-24 pic 9.

      05 switch-25 pic 9.

      05 switch-26 pic 9.

      05 switch-27 pic 9.

      05 switch-28 pic 9.

      05 switch-29 pic 9.

      05 switch-30 pic 9.

      05 switch-31 pic 9.

 

01 DBNetKey   pic x(64) value space.

01 DBNetData  pic x(6400) value space.

01 DBNetLine  pic x(400) value space.

01 DBNetInt   binary-long value zero.

01 DBNetlin   pic 99 value 1.

01 DBNetcol   pic 99 value 1.

01 DBNetidx   pic s9(9) comp-5 value 0.

01 objSIONet     object reference clsSIONet.

01 objSIONet2    object reference clsSIONet.

01 objIntrinsics object reference clsIntrinsics.

01 SIONetHowTerminated pic x(8) value space.

01 SIONetPtr     pointer.

01 SIONetString  object reference clsString.

01 SIONetData    pic x(2000) value space.

01 SIONetRow     binary-long value zero.

01 SIONetCol     binary-long value zero.

01 SIONetLen     binary-long value zero.

01 SIONetSize    binary-long value zero.

01 SIONetRC      binary-long value zero.

01 SIONetMode    pic x(1) value space.

    88 SIONetAccept        value "A".

    88 SIONetDisplay       value "D".

01 SIONetBSW     pic x(1) value space.

       

 01 phon-line.

  02 phon-key.

     05 phon-numb pic x(19) value spaces.

     05 phon-num redefines phon-numb.

          10 phon-1 pic x(03).

          10 phon-2 pic x(03).

          10 phon-3 pic x(04).

          10 phon-4 pic x(06).

          10 phon-5 pic x(03).

  02 other-data.

     05 phon-name pic x(30) value spaces.

     05 phon-cont pic x(30) value spaces.

     05 phon-addr pic x(30) value spaces.

     05 phon-add2 pic x(30) value spaces.

     05 phon-city pic x(19) value spaces.

     05 phon-stat pic x(02) value spaces.

     05 phon-zip1 pic x(05) value spaces.

     05 phon-zip2 pic x(04) value spaces.

     05 phon-sort pic x(10) value spaces.

     05 phon-rema pic x(300) value spaces.

     05 phon-fax1 pic x(03) value space.

     05 phon-fax2 pic x(03) value space.

     05 phon-fax3 pic x(04) value space.

     05 phon-fax4 pic x(06) value space.

     05 phon-mdm1 pic x(03) value space.

     05 phon-mdm2 pic x(03) value space.

     05 phon-mdm3 pic x(04) value space.

     05 phon-mdm4 pic x(06) value space.

     05 phon-home1 pic x(03) value space.

     05 phon-home2 pic x(03) value space.

     05 phon-home3 pic x(04) value space.

     05 phon-auto1 pic x(03) value space.

     05 phon-auto2 pic x(03) value space.

     05 phon-auto3 pic x(04) value space.

     05 phon-page1 pic x(03) value space.

     05 phon-page2 pic x(03) value space.

     05 phon-page3 pic x(04) value space.

     05 phon-work1 pic x(03) value space.

     05 phon-work2 pic x(03) value space.

     05 phon-work3 pic x(04) value space.

     05 phon-work4 pic x(06) value space.

     05 phon-spou pic x(30) value space.

     05 phon-bdat pic x(08) value space.

     05 phon-sdat pic x(08) value space.

     05 phon-cell pic x(15) value space.

     05 phon-cust pic x(05) value space.

     05 phon-dfax pic x(15) value space.

     05 phon-dmdm pic x(15) value space.

     05 phon-dhme pic x(15) value space.

     05 phon-daut pic x(15) value space.

     05 phon-dpag pic x(15) value space.

     05 phon-dwrk pic x(15) value space.

     05 phon-emal pic x(50) value space.

     05 phon-callok pic x(1) value space.

     05 phon-emalok pic x(1) value space.

     05 phon-remove pic x(1) value space.

     05 phon-type pic x(1) value space.

 

01 FIONetphone-file redefines phon-line pic x(767).

01 FIONetStatus  pic x(2).

       

 01 key-pressed pic 99 value 00.

         88 no-key value 13.

         88 f1-key value 01.

         88 f2-key value 02.

         88 cmd-key value 12.

         88 scan-key value 91.

         88 grid-key value 92.

       

*> 01 phon-status pic xx.

 01 phon-status pic xx value space.

       

 01 phones pic x(80) value "PHONES".

       

 01 print-name pic x(80) value "PRINTER".

 

 01 send-news-letter pic x value "N".

       

 01 program-flags.

     05 falsx pic s9(04) comp-5 value 0.

     05 trux pic s9(04) comp-5 value 1.

     05 done-switch pic s9(04) comp-5 value 0.

         88 done value 1.

     05 finished-switch pic s9(04) comp-5 value 0.

         88 finished value 1.

     05 eof-switch pic s9(04) comp-5 value 0.

         88 eof value 1.

     05 error-switch pic s9(04) comp-5 value 0.

         88 erros value 1.

         88 no-error value 0.

     05 line-count pic 9(05) value 66.

     05 max-lines pic 9(05) value 57.

     05 page-count pic 9(05) value 0.

     05 key-switch pic s9(04) comp-5 value 0.

         88 valid-key value 1.

         88 invalid-key value 0.

     05 blank-line pic x(80) value spaces.

     05 ver-ans pic x(512) value spaces.

     05 err-no pic 9(02) value zero.

     05 print-status pic x(02) value spaces.

       

 01 system-vars.

     05 system-time pic x(8) value spaces.

     05 system-date pic 9(8) value zeroes.

     05 system-yymmdd redefines system-date.

          10 system-cc pic 99 value zero.

          10 system-yy pic 99 value zero.

          10 system-mmdd pic 9999 value zero.

       

 01 page-hdr-1.

     05 filler pic x(02) value spaces.

     05 screen-hdr-1.

          10 p-date pic x(10) value zeroes.

          10 filler pic x(47) value spaces.

          10 p-name pic x(30) value spaces.

          10 filler pic x(13) value spaces.

          10 p-time pic x(05) value spaces.

          10 filler pic xx value spaces.

     05 filler pic x(12) value spaces.

     05 filler pic x(04) value "Page".

     05 p-page-count pic zzzz9 value zeroes.

     05 filler pic x value ".".

       

 01 page-hdr-2.

     05 print-command pic x(15) value spaces.

     05 print-version pic x(04) value spaces.

     05 filler pic x(35) value spaces.

     05 screen-hdr-2.

          10 p-address pic x(40) value spaces.

       

 01 phone-funt pic x(1) value spaces.

       

 01 print-lines.

     05 phone-hdr-1.

          10 filler pic x(30) value spaces.

          10 filler pic x(40) value "PHONE NUMBER INFORMATION".

     05 phone-hdr-2.

          10 filler pic x(50) value "Phone         Extension   Company ".

          10 filler pic x(40) value "       Contact                    ".

          10 filler pic x(40) value "Birth Date          Spouse Birth  ".

     05 phone-detail-line.

          10 prt-phon-num.

               15 filler pic x value "(".

               15 prt-phon-1 pic x(03) value space.

               15 filler pic x value ")".

               15 prt-phon-2 pic x(03) value space.

               15 filler pic x value "-".

               15 prt-phon-3 pic x(04) value space.

               15 filler pic x value "x".

               15 prt-phon-4 pic x(06) value space.

               15 filler pic x value "[".

               15 prt-phon-5 pic x(03) value space.

               15 filler pic x value "]".

               15 filler pic x value spaces.

          10 prt-phon-name pic x(31) value spaces.

          10 prt-phon-cont pic x(31) value spaces.

          10 prt-phon-bdat pic x(15) value spaces.

          10 prt-phon-sdat pic x(15) value spaces.

     05 dash-line.

          10 filler pic x(100) value all "=".

       

 01 print-date1.

     05 print-yy pic xx value space.

     05 print-mm pic xx value space.

     05 print-dd pic xx value space.

       

 01 print-date2.

     05 filler pic x value " ".

     05 print-mm pic xx value space.

     05 filler pic x value "/".

     05 print-dd pic xx value space.

     05 filler pic x value "/".

     05 print-yy pic xx value space.

       

 01 print-date3.

     05 print-yy pic 99 value zero.

     05 print-mm pic 99 value zero.

     05 print-dd pic 99 value zero.

       

01 print-date4 redefines print-date3 pic 9(6) value zero.

       

 01 print-date5.

     05 print-mm pic 99 value zero.

     05 print-dd pic 99 value zero.

     05 print-yy pic 99 value zero.

       

01 print-date6 redefines print-date5 pic 9(6) value zero.

       

 01 print-date7 pic b99/99/99.

       

01 display-date1 pic x(06) value space.

       

 01 display-date1r redefines display-date1.

     05 display-yy1 pic s9(04) comp-5 value zero.

     05 display-mm1 pic 99 value zero.

     05 display-dd1 pic 99 value zero.

       

01 display-date2 pic 9(06) value zero.

       

 01 display-date2r redefines display-date2.

     05 display-yy2 pic s9(04) comp-5 value zero.

     05 display-mm2 pic 99 value zero.

     05 display-dd2 pic 99 value zero.

       

01 display-year pic 9(04) value zero.

 procedure division.

 

 method-id. method1 as "Start".

 data division.

 working-storage section.

 linkage section.

 01 ui     object reference clsSIONet.

 01 ui2    object reference clsSIONet.

 procedure division using by value ui, ui2.

        set objSIONet to ui

        set objSIONet2 to ui2

        set objIntrinsics to Instance of clsIntrinsics

        .

       

*> *****************************************************************

       

020-open-files section.

020-o-f.

    invoke objSIONet "ConsoleWriteLine" using by value "We are now in the pn001 cobol program"

    invoke objSIONet2 "ConsoleWriteLine" using by value "We are now in the pn001 cobol program"

    invoke phone-file "Open" using by value "i-o " returning phon-status.

    invoke phone-file "Start" using by value 1 ">=" FIONetphone-file returning phon-status.

   

*> *****************************************************************

       

030-get-system-var section.

030-g-s.

    accept system-time from time.

    accept system-date from date.

   

*> *****************************************************************

       

040-set-up-header section.

045-tiform-setup.

    perform 900-prepare-screen.

    perform 100-begin-prog until done.

    go to 999-end-program.

   

*> *****************************************************************

       

100-begin-prog section.

100-b-p.

    perform 810-get-funct-on.

    if f1-key

        go to 100-exit

    else

    if cmd-key or phone-funt = "Q" or phone-funt = "q"

        move trux to done-switch

    else

    if phone-funt = "A" or phone-funt = "a"

        perform 200-add until cmd-key or f1-key

    else

    if phone-funt = "C" or  phone-funt = "c"

        perform 300-edit until cmd-key or f1-key

        invoke phone-file "Unlock" returning phon-status

    else

    if phone-funt = "I" or  phone-funt = "i"

        perform 400-inquire until cmd-key or f1-key

    else

    if scan-key or phone-funt = "S" or  phone-funt = "s"

        perform 450-scan until cmd-key

        go to 100-b-p

    else

    if phone-funt = "D" or  phone-funt = "d"

        perform 500-delete

    else

    if phone-funt = "G" or  phone-funt = "g" or grid-key

        perform 550-grid

    else

    if phone-funt = "R" or  phone-funt = "r"

        perform 600-renumber until cmd-key or f1-key

    else

    if phone-funt = "L" or  phone-funt = "l"

        perform 700-list.

    if cmd-key

        move trux to done-switch.

       

100-exit.

    exit.

   

*> *****************************************************************

       

200-add section.

200-a.

    move trux to key-switch.

    perform 830-read-group-2 until invalid-key or cmd-key or f1-key.

    if not no-key

        go to 210-exit.

    perform 850-reply-group-3.

    if not cmd-key and not f1-key

        perform 220-move-data.

       

210-exit.

    exit.

   

*> *****************************************************************

       

220-move-data section.

220-m-d.

    invoke phone-file "Write" using by value FIONetphone-file returning phon-status

    if phon-status = "22"

    invoke objSIONet "Display" using by value 24  1 80 "error adding record " " "

    go to 220-exit.

    invoke objSIONet "Display" using by value 24  1 80 "added  " " ".

       

220-exit.

    exit.

   

*> *****************************************************************

       

300-edit section.

300-e.

    move falsx to key-switch.

    perform 830-read-group-2 until valid-key or cmd-key or f1-key.

    if not cmd-key and not f1-key

        move "pn001 has accessed the phone_file record: " to SIONetData

        move phon-numb to SIONetData(43:)

        invoke objSIONet2 "ConsoleWriteLine" using by value SIONetData

        perform 850-reply-group-3.

    if not cmd-key and not f1-key

        perform 320-move-data.

       

310-exit.

    exit.

   

*> *****************************************************************

       

320-move-data section.

320-m-d.

    invoke phone-file "Rewrite" using by value FIONetphone-file returning phon-status

    if phon-status = "22"

        invoke objSIONet "Display" using by value 24  1 80 "error changing record " " "

        go to 320-exit.

    move "pn001 has updated the phone_file record: " to SIONetData

    move phon-numb to SIONetData(43:)

    invoke objSIONet2 "ConsoleWriteLine" using by value SIONetData, "fg red"

    invoke objSIONet "Display" using by value 23  1 80 "changed  " " ".

       

320-exit.

    exit.

   

*> *****************************************************************

       

400-inquire section.

400-i.

    move falsx to key-switch.

    perform 830-read-group-2 until valid-key or cmd-key or f1-key.

    if not cmd-key and not f1-key

        move "pn001 has accessed the phone_file record: " to SIONetData

        move phon-numb to SIONetData(43:)

        invoke objSIONet2 "ConsoleWriteLine" using by value SIONetData

        perform 860-write-group-3.

       

410-exit.

    exit.

   

*> *****************************************************************

       

450-scan section.

450-i.

    move falsx to key-switch.

    perform 830-read-group-4.

    if cmd-key

        go to 450-exit.

    if no-key

        invoke phone-file "Start" using by value 1 ">=" FIONetphone-file returning phon-status

        if phon-status = "22"

        invoke objSIONet "Display" using by value 24  1 80 "no data  " " "

        go to 450-exit.

       

450-loop.

    if not f2-key

        invoke phone-file "Read" using by reference FIONetphone-file returning phon-status

        if phon-status = "23"

        invoke objSIONet "Display" using by value 24  1 80 "no more data" " "

        go to 450-exit.

 

    move "pn001 has accessed the phone_file record: " to SIONetData

    move phon-numb to SIONetData(43:)

    invoke objSIONet2 "ConsoleWriteLine" using by value SIONetData

    perform 920-wri-group2.

    perform 930-wri-group3.

       

450-exit.

    exit.

   

*> *****************************************************************

       

455-scan section.

455-i.

    move falsx to key-switch.

    perform 830-read-group-4.

    if cmd-key

        go to 455-exit.

    if no-key

        invoke phone-file "Start" using by value 1 ">=" FIONetphone-file returning phon-status

        if phon-status = "22"

        invoke objSIONet "Display" using by value 24  1 80 " no data " " "

        go to 455-exit.

       

455-loop.

    if not f2-key

        invoke phone-file "Read" using by reference FIONetphone-file returning phon-status

        if phon-status = "23"

        invoke objSIONet "Display" using by value 24  1 80 " no more data" " "

        go to 455-exit.

    perform 920-wri-group2.

    perform 930-wri-group3.

       

455-exit.

    exit.

   

*> *****************************************************************

       

500-delete section.

500-d.

    move falsx to key-switch.

    perform 830-read-group-2 until valid-key or cmd-key or f1-key.

    if not cmd-key and not f1-key

        perform 860-write-group-3

        invoke objSIONet "Display" using by value 24  1 80 "ok to delete?  " " "

        invoke objSIONet "WaitForUserInput" using by value " " returning SIONetHowTerminated

        move SIONetHowTerminated(1:2) to key-pressed.

        invoke objSIONet "Accept" using by value 24 15 1 returning ver-ans

        if ver-ans = "Y"

            perform 510-delete.

       

500-exit.

    exit.

   

*> *****************************************************************

       

510-delete section.

510-d.

    invoke phone-file "DeleteRecord" returning phon-status

    if phon-status = "22"

    invoke objSIONet "Display" using by value 24  1 80 "error deleting record " " "

    go to 510-exit.

    invoke objSIONet "Display" using by value 24  1 80 "deleted  " " ".

       

510-exit.

    exit.

   

*> *****************************************************************

 

550-grid section.

550-g.

 

*> *****************************************************************

       

600-renumber section.

600-r.

    move falsx to key-switch.

    invoke objSIONet "Display" using by value 24  1 80 "Enter Key Value To Copy From  " " "

    perform 830-read-group-2 until valid-key or f1-key or cmd-key.

    if not no-key

        go to 600-exit.

    perform 860-write-group-3.

    invoke objSIONet "Display" using by value 24  1 80 "Enter Key Value To Copy To  " " "

    perform 830-read-group-2.

    if not no-key

        go to 600-exit.

    move "Y" to ver-ans.

    if valid-key

        invoke objSIONet "Display" using by value 24  1 80 "Already Exists - OK To Delete?  " " "

        invoke objSIONet "WaitForUserInput" using by value " " returning SIONetHowTerminated

        invoke objSIONet "Accept" using by value 24 31 1 returning ver-ans.

    if ver-ans not = "Y"

        go to 600-exit.

    if valid-key

        invoke phone-file "Rewrite" using by value FIONetphone-file returning phon-status

        if phon-status = "22"

        invoke objSIONet "Display" using by value 24  1 80 "error changing record " " "

        go to 600-exit.

    if invalid-key

        invoke phone-file "Write" using by value FIONetphone-file returning phon-status

        if phon-status = "22"

        invoke objSIONet "Display" using by value 24  1 80 "error changing record " " "

        go to 600-exit.

       

600-exit.

    exit.

   

*> *****************************************************************

       

700-list section.

700-l.

    invoke objSIONet "NewUI" using by value "screen2".

    invoke objSIONet "Display" using by value 1 5 35 "Display a list of phone numbers"

    move 1 to SIONetRow

    open output print-file.

    move spaces to phon-line

    invoke phone-file "Start" using by value 1 ">=" FIONetphone-file returning phon-status

    if phon-status = "22"

        go to 750-exit.

    move 0 to eof-switch

    perform 750-read-key until eof.

    close print-file.

    add 1 to SIONetRow

    invoke objSIONet "TextBox" using by value SIONetRow 1 1 " " "name phon-test "

    invoke objSIONet "Enable" using by value "phon-test"

    invoke objSIONet "WaitForUserInput" using by value " " returning SIONetHowTerminated

    invoke objSIONet "Accept" using by value SIONetRow 1 1 returning ver-ans

    invoke objSIONet "CloseUI" using by value "screen2".

   

*> *****************************************************************

       

750-read-key section.

750-r-k.

    invoke phone-file "Read" using by reference FIONetphone-file returning phon-status

    if phon-status = "10"

        move trux to eof-switch

        go to 750-exit.

    move phon-1 to prt-phon-1.

    move phon-2 to prt-phon-2.

    move phon-3 to prt-phon-3.

    move phon-4 to prt-phon-4.

    move phon-5 to prt-phon-5.

    move phon-name to prt-phon-name.

    move phon-cont to prt-phon-cont.

    move phon-bdat to prt-phon-bdat.

    move phon-sdat to prt-phon-sdat.

    perform 890-print-line.

    move phon-num (1:) to SIONetData

    add 1 to SIONetRow

    move phone-detail-line to SIONetData

    invoke objSIONet "TextBox" using by value SIONetRow 1 132 SIONetData " ".

       

750-exit.

    exit.

   

*> *****************************************************************

       

810-get-funct-on section.

810-g-f.

    perform 910-wwr-group1.

   

*> *****************************************************************

       

830-read-group-4 section.

830-r-g.

    perform 940-wwr-group4.

    invoke objSIONet "Display" using by value 24  1 80 " " " ".

   

*> *****************************************************************

       

830-read-group-2 section.

830-r-g-2.

    move trux to key-switch.

    perform 920-wwr-group2.

    invoke objSIONet "Display" using by value 24  1 80 " " " "

    if not cmd-key and not f1-key

        if phone-funt = "C"

            invoke phone-file "Read" using by value 0 by reference FIONetphone-file by value

              "lock" returning phon-status

            if phon-status = "23"

                move falsx to key-switch

            else

                continue

    else

        invoke phone-file "Read" using by value 0 by reference FIONetphone-file returning phon-status

        if phon-status = "23"

        move falsx to key-switch.

    if not cmd-key and not f1-key

        if phone-funt = "A"

            perform 870-test-add

        else

        if phone-funt = "R"

            perform 880-test-renumber

        else

        if invalid-key

            invoke objSIONet "Display" using by value 24  1 80 "does not exist  " " ".

           

*> *****************************************************************

       

850-reply-group-3 section.

850-r-g.

    if phon-dfax = spaces

        move "Fax" to phon-dfax.

    if phon-dmdm = spaces

        move "Modem" to phon-dmdm.

    if phon-dhme = spaces

        move "Home" to phon-dhme.

    if phon-daut = spaces

        move "Cell" to phon-daut.

    if phon-dpag = spaces

        move "Pager" to phon-dpag.

    if phon-dwrk = spaces

        move "Work" to phon-dwrk.

    perform 930-wwr-group3.

    invoke objSIONet "Display" using by value 24  1 80 " " " ".

    if phon-sort = spaces

        move phon-name to phon-sort

        perform 930-wri-group3.

       

*> *****************************************************************

       

860-write-group-3 section.

860-w-g.

    perform 930-wri-group3.

   

*> *****************************************************************

       

870-test-add section.

870-t-a.

    if valid-key

        perform 860-write-group-3

        invoke objSIONet "Display" using by value 24  1 80 "already exists  " " ".

       

*> *****************************************************************

       

880-test-renumber section.

880-t-r.

    if line-count = 66

        move 0 to line-count.

    if line-count = 0

        if invalid-key

            invoke objSIONet "Display" using by value 24  1 80 "does not exist  " " ".

    if line-count = 0

        move 1 to line-count

    else

        move 0 to line-count.

       

*> *****************************************************************

       

890-print-line section.

890-p-l.

    if line-count > max-lines

        perform 895-print-page.

    move phone-detail-line to DBNetLine

    write print-record from DBNetLine.

    add 1 to line-count.

   

*> *****************************************************************

       

895-print-page section.

895-p-p.

    add 1 to page-count.

    move page-count to p-page-count.

    move page-hdr-1 to DBNetLine

    write print-record from DBNetLine after page.

    move page-hdr-2 to DBNetLine                

    write print-record from DBNetLine.          

    move phone-hdr-1 to DBNetLine               

    write print-record from DBNetLine.          

    move phone-hdr-2 to DBNetLine               

    write print-record from DBNetLine after 2.          

    move dash-line to DBNetLine                         

    write print-record from DBNetLine.                  

    move 07 to line-count.

   

*> *****************************************************************

       

900-prepare-screen section.

900-p-s.

    invoke objSIONet "TextBox" using by value 2  17 47 "  P H O N E   N U M B E R   D I R E C T O R Y  " "fg red bg yellow"

    invoke objSIONet "Button" using by value 2  2 6 "Scan" "name 'scan' returnvalue '91' tooltip 'Scan phone number records' "

    invoke objSIONet "Button" using by value 2  9 6 "Exit" "name 'exit' returnvalue '12' tooltip 'Exit phone number program' "

    invoke objSIONet "Button" using by value 2  66 6 "Next" "name 'next' returnvalue '01' tooltip 'Scan to next record' "

    invoke objSIONet "Button" using by value 2  73 6 "Grid" "name 'grid' returnvalue '92' tooltip 'Scan to previous record' "

    invoke objSIONet "Label" using by value 4  2 20 "           Function:" "noborder "

    invoke objSIONet "Label" using by value 5  2 20 "       Phone Number:" "noborder "

    invoke objSIONet "Label" using by value 5  26 1 "/" "noborder "

    invoke objSIONet "Label" using by value 5  30 1 "-" "noborder "

    invoke objSIONet "Label" using by value 5  35 1 "x" "noborder "

    invoke objSIONet "Label" using by value 5  49 10 "Customer: " "noborder "

    invoke objSIONet "Label" using by value 6  2 20 "       Company Name:" "noborder "

    invoke objSIONet "Label" using by value 7  2 20 "            Contact:" "noborder "

    invoke objSIONet "Label" using by value 8  2 20 "            Address:" "noborder "

    invoke objSIONet "Label" using by value 9  2 20 "          Address 2:" "noborder "

    invoke objSIONet "Label" using by value 10  2 20 "   City, State  Zip:" "noborder "

    invoke objSIONet "Label" using by value 10  42 1 "," "noborder "

    invoke objSIONet "Label" using by value 10  54 1 "-" "noborder "

    invoke objSIONet "Label" using by value 11  2 20 "            Sort By:" "noborder "

    invoke objSIONet "Label" using by value 12  2 20 "            Remarks:" "noborder "

    invoke objSIONet "Label" using by value 13  26 1 "/" "noborder "

    invoke objSIONet "Label" using by value 13  30 1 "-" "noborder "

    invoke objSIONet "Label" using by value 13  35 1 "x" "noborder "

    invoke objSIONet "Label" using by value 14  26 1 "/" "noborder "

    invoke objSIONet "Label" using by value 14  30 1 "-" "noborder "

    invoke objSIONet "Label" using by value 14  35 1 "x" "noborder "

    invoke objSIONet "Label" using by value 15  26 1 "/" "noborder "

    invoke objSIONet "Label" using by value 15  30 1 "-" "noborder "

    invoke objSIONet "Label" using by value 16  26 1 "/" "noborder "

    invoke objSIONet "Label" using by value 16  30 1 "-" "noborder "

    invoke objSIONet "Label" using by value 17  26 1 "/" "noborder "

    invoke objSIONet "Label" using by value 17  30 1 "-" "noborder "

    invoke objSIONet "Label" using by value 18  26 1 "/" "noborder "

    invoke objSIONet "Label" using by value 18  30 1 "-" "noborder "

    invoke objSIONet "Label" using by value 18  35 1 "x" "noborder "

    invoke objSIONet "Label" using by value 19  2 20 "             Spouse:" "noborder "

    invoke objSIONet "Label" using by value 20  2 20 "             E-Mail:" "noborder "

    invoke objSIONet "TextBox" using by value 4  23 1 " " "name phone-funt tooltip 'A-add C-change I-inquire D-delete S-scan Q-quit' "

    invoke objSIONet "TextBox" using by value 5  23 3 " " "name phon-1"

    invoke objSIONet "TextBox" using by value 5  27 3 " " "name phon-2"

    invoke objSIONet "TextBox" using by value 5  31 4 " " "name phon-3"

    invoke objSIONet "TextBox" using by value 5  36 6 " " "name phon-4"

    invoke objSIONet "TextBox" using by value 5  43 3 " " "name phon-5"

    invoke objSIONet "TextBox" using by value 5 59 5 " " "name phon-cust "

    invoke objSIONet "TextBox" using by value 6 23 30 " " "name phon-name "

    invoke objSIONet "TextBox" using by value 7 23 30 " " "name phon-cont "

    invoke objSIONet "TextBox" using by value 7 55 8 " " "name phon-bdat "

    invoke objSIONet "TextBox" using by value 8 23 30 " " "name phon-addr "

    invoke objSIONet "TextBox" using by value 9 23 30 " " "name phon-add2 "

    invoke objSIONet "TextBox" using by value 10 23 19 " " "name phon-city "

    invoke objSIONet "ComboBox" using by value 10 43 2 " " "name phon-stat "

    invoke objSIONet "Display" using by value 10 43 2 "AL" "clear "

    invoke objSIONet "Display" using by value 10 43 2 "MO" " "

    invoke objSIONet "Display" using by value 10 43 2 "NY" " "

    invoke objSIONet "Display" using by value 10 43 2 "OH" " "

    invoke objSIONet "Display" using by value 10 43 2 "PA" " "

    invoke objSIONet "TextBox" using by value 10 49 5 " " "name phon-zip1 "

    invoke objSIONet "TextBox" using by value 10 55 4 " " "name phon-zip2 "

    invoke objSIONet "TextBox" using by value 11 23 10 " " "name phon-sort "

    invoke objSIONet "TextBox" using by value 11 35 15 " " "name phon-cell "

    invoke objSIONet "TextBox" using by value 12 23 30 " " "name phon-rema "

    invoke objSIONet "ComboBox" using by value 13 5 15 " " "name phon-dfax "

    invoke objSIONet "Display" using by value 13 5 15 "Fax" "clear "

    invoke