Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write code does not work but Rewrite code works

Status
Not open for further replies.

soniabharat

Programmer
Aug 9, 2001
18
US
Hi,

My project is to maintain address record of clients.On screen I enter 8 digi no. and it displays all matching records.
It displays address no. and address-instruction of the record.Address no. is system generated,whenever new record is added.
Now when I enter client no. on screen,New address button form activates.When I click it another form opens where i enter information of client,then I click Apply and then OK button.On clicking ok it comes to main screen but doesnot add the new address.Code for Add is

WRITE-BILLADDR-RECORD.
IF ADD-ADDRESS
DISPLAY "IT ADD-ADDRESS IN WRITE PARA"
MOVE 'A' TO ACTION-FLAG
CALL 'BADRIO' USING BILLING-ADDRESS-RECORD
BILL-ADDR-IO-WS
WRITE-CODE
DISPLAY "IN ADD-ADDRESS IN WRITE PARA IT WRITES CODE"
ELSE
MOVE 'C' TO ACTION-FLAG
CALL 'BADRIO' USING BILLING-ADDRESS-RECORD
BILL-ADDR-IO-WS
REWRITE-CODE
DISPLAY "ELSE OF ADD-ADDRESS REWRITES CODE".


The code of rewrites work fine.But not of write.
Thx
 
Check the return code from 'BADRIO' when you do your initial write. It looks like you are getting an abnormal return code and you need to look into why this is happening.

Nina Too
 
Hi Sonia,

I'm assuming that the term user tells you what to do (add, chg, del, etc.). It's not a good idea to assume that the user knows what should be done in any circomstance.
It's generally considered GPP to check for the existance of a rec to be chged/added (as Stephen said) and take apppropriate action if there is a conflict.

Regards, Jack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top