G-Day all

We have the following code that has worked up until we installed the DOS 65 
build 1.842xRT03 at one of our subsidiary plants. I am goind to install the 
inline patch when I go down there today. I was just wondering if anyone has 
seen something similar to this, and could reccommend some suggestions. 

CASE 'Process Exceptions'
        CLS
        WRITE 'TUFTCO FINISHING' AT 1,2
        WRITE 'Exception Processing Module' AT 2,2
        DECLARE cursor1 CURSOR +
        FOR SELECT invoice, itemnum, qty, price, extnded FROM phdetail +
        WHERE chgflg = 1
        OPEN cursor1
        FETCH cursor1 +
        INTO vinv INDICATOR vi1, vitem INDICATOR vi2, vqty +
        INDICATOR vi3, vprice INDICATOR vi4, vexten INDICATOR vi5
        SELECT cost FROM itemfile WHERE itemnum = .vitem
        IF SQLCODE = 100 THEN
            CLS FROM 3 TO 24
            WRITE 'INVOICE NUMBER: ' AT 4,5
            SHOW VAR vinv AT 4,21
            WRITE 'ITEM NUMBER: ' AT 5,5
            SHOW VAR vitem AT 5,21
            SET VAR msg1 TEXT = 'ITEM NOT IN FILE. NOTE THE ITEM'
            SET VAR msg2 TEXT = ' & INVOICE ABOVE, ADD IT & RERUN EXCEPTIONS.'
            SET VAR msg TEXT = (msg1 & msg2)
            PAUSE 1 USING .msg AT CENTER CENTER
            CLEAR VAR msg%
            FETCH cursor1 +
            INTO vinv INDICATOR vi1, vitem INDICATOR vi2, vqty +
            INDICATOR vi3, vprice INDICATOR vi4, vexten INDICATOR vi5
        ENDIF
        WHILE SQLCODE <> 100 THEN
          CLS FROM 3 TO 24
          WRITE 'INVOICE NUMBER: ' AT 4,5
          SHOW VAR vinv AT 4,21
          WRITE 'ITEM NUMBER: ' AT 5,5
          SHOW VAR vitem AT 5,21
          WRITE 'QUANTITY:' AT 6,5
          SHOW VAR vqty AT 6,21
          WRITE 'PRICE: ' AT 7,5
          SHOW VAR vprice AT 7,21
          WRITE 'TOTAL: ' AT 8,5
          SHOW VAR vexten AT 8,21
          SET VAR vvnum = vendnum IN phheader WHERE invoice = .vinv
          SET VAR vvend = vendname IN vendors WHERE vendnum = .vvnum
          WRITE 'VENDOR: ' AT 10,5
          SHOW VAR vvend AT 10,21
          SET VAR vdate = trandate IN phheader WHERE invoice = .vinv
          WRITE 'INV DATE: ' AT 11,5
          SHOW VAR vdate AT 11,21
          SET VAR vcost = cost IN itemfile WHERE itemnum = .vitem
          WRITE 'ITEM COST: ' AT 13,5
          SHOW VAR vcost AT 13,21
          WRITE 'TOTAL COST: ' AT 14,5
          SET VAR vcsttot CURRENCY
          SET VAR vcsttot = (.vcost * .vqty)
          SHOW VAR vcsttot AT 14,21
          WRITE +
          'Purchase Price of this Item exceeds Current Cost in Inventory.' +
          AT 16,5
          SET VAR vdiff CURRENCY
          SET VAR vdiff = (.vexten - .vcsttot)
          WRITE 'TOTAL DIFFERENCE: ' AT 17,5
          SHOW VAR vdiff AT 17,25
          LABEL excepts
          WRITE 'Exceptions should be cleared as follows:' AT 19,5
          WRITE '(1) Update Current Cost in Kardex File, (2) One time ' +
          AT 20,5
          WRITE 'purchase-do not update cost, 3) Immaterial Difference-Do ' +
          AT 21,5
          WRITE 'not update cost.' AT 22,5
          SET VAR vcho TEXT
          LABEL check2
          FILLIN vcho USING 'CHOICE===> ' AT 23,25
          IF vcho <> '1' AND vcho <> '2' AND vcho <> '3' THEN
              CLS FROM 23 TO 24
              GOTO check2
          ENDIF
          LABEL CHECK
          SET VAR vans TEXT
          FILLIN vans = 0 USING 'ARE YOU SURE? ([Y]/N)' AT 24,21
          IF vans = 'N' THEN
              CLS FROM 20 TO 24
              GOTO excepts
          ENDIF
          IF vans <> 'N' AND vans <> 'Y' AND vans <> '[ENTER]' THEN
              GOTO CHECK
          ENDIF
          IF vcho = '1' THEN
              UPDATE phdetail SET reason = (.vcho) WHERE CURRENT OF cursor1
              UPDATE phdetail SET diff = (.vdiff) WHERE CURRENT OF cursor1
              SET VAR vpr1 CURRENCY
              SET VAR vprd1 DATE
              SET VAR vcstdte DATE
              SET VAR vpr1 = prior1 IN itemfile WHERE itemnum = .vitem
              SET VAR vprd1 = prdate1 IN itemfile WHERE itemnum = .vitem
              SET VAR vcstdte = costdate IN itemfile WHERE itemnum = .vitem
              UPDATE itemfile SET prior2 = (.vpr1), prdate2 = +
              (.vprd1), prior1 = (.vcost), prdate1 = (.vcstdte), cost = +
              (.vprice), costdate = (.vdate), updflg = 1 +
              WHERE itemnum = .vitem
              UPDATE phdetail SET chgflg = 2 WHERE CURRENT OF cursor1
            ELSE
              UPDATE phdetail SET reason = (.vcho), diff = +
              (.vdiff), chgflg = 2 WHERE CURRENT OF cursor1
          ENDIF
          FETCH cursor1 +
          INTO vinv INDICATOR vi1, vitem INDICATOR vi2, vqty +
          INDICATOR vi3, vprice INDICATOR vi4, vexten INDICATOR vi5
        ENDWHILE
        CLS
        OUTPUT PRINTER WITH rpt1.rpt   XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        PRINT procexe1  +
        WHERE chgflg = 2 AND reason = '1' +
        ORDER BY reason, invoice
        OUTPUT SCREEN
        OUTPUT PRINTER WITH rpt2.rpt
        PRINT procexe  +
        WHERE chgflg = 2 AND reason > '1'+
        ORDER BY reason, invoice
        OUTPUT SCREEN
        UPDATE phdetail SET chgflg = 0 WHERE chgflg = 2
        DROP CURSOR cursor1
        RUN makeplay.cmd USING .pick11, 6
        BREAK
    ENDSW
    BREAK

The problem lies at the line where I put all the XXXXXXXXXXXXXXXXXXXXXXXXXX's
The statements:

PRINT procexe1  +
WHERE chgflg = 2 AND reason = '1' +
ORDER BY reason, invoice

PRINT procexe  +
WHERE chgflg = 2 AND reason > '1'+
ORDER BY reason, invoice

Did have SORTED BY obsolete wording that I changed, but this did not seem to
make any difference. 

The problem I am having is that the when it get's to these it use to send it
to the EPSON printer. Now it sends the results of procexe1 and procexe to the 
screen instead.

I have to confess that I don't fully understand any reasoning for the OUTPUT 
PRINTER WITH rpt1.rpt and OUTPUT PRINTER WITH rpt2.rpt statements other than 
at one time one of the original programmers did this in case the printing 
failed for some reason..

In looking at what was in these rpt1.rpt and rpt2.rpt both seemed to be dated
around ????-1996 so I don't think this part has run for a long time now 
anyway. 

One big question I have is if I was to send these reports to a file and then
use ??? syntax to send them to the printer, what would be the correct syntax, 
and would the embedded control codes get read by the printer so it would 
print landscape and compressed. If not then I will have to use some kind of 
GOTO loop to ask the user if they printer properly. 

One other question is does the FILLIN still work in RBase6.5.. I see it in 
the list of Obsolete commands but does this only apply to Windows version?
The FILLIN that is embedded in this code seems to be prompting the user 
correctly now, but I haven't fully tested it.. 

One other question. Does the Where current of Cursor work still without 
problems? I see in the obsolete command where the IN #n says to use it in
the dos version, but it says to use UPDATE/SET VAR testing in the WIN 
version. Would it be better change the code to the WIN style UPDATE/SET VAR
now and not have to deal with it later or is there a hitch with this?

Thanks for any feedback.

Jim Limburg

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l

Reply via email to