trying to update file but not get message for other displayed items on screen

Helen Wellcome HWellcom at wsboces.org
Fri Aug 24 07:25:42 CDT 2012


I have an old program with occurs. It wasn't reading existing suppla so when the screen comes up for entry, abscode is always displayed blank.

    Date      Dow    absCode
07 09/03/12   Mon
08 09/04/12   Tue
09 09/05/12   Wed

The old code for update is as follows; it works but if a user mistakenly keys on a line record that exists, they get duplicate message and nothing updates in that session.

  Procedure preupdate
    Begin
      For suppla
        Begin
          If abscode of suppla = " "
            Then begin
              Delete suppla
            End
        End
    End
  Procedure update
    Begin
      For suppla
        Begin
          Lock suppla
          If abscode of suppla <> " "
            Then begin
              (Bunch of let statements)
              Let ....fields of suppla = xfields
            End
          Put suppla
          Unlock suppla
        End
    End

So I added an alias file of suppla, and displayed if any absent records existed.

    Date      Dow    absCode
07 09/03/12   Mon
08 09/04/12   Tue       A
09 09/05/12   Wed
so the user would know what dates existed and only key in new.
    Date      Dow    absCode
07 09/03/12   Mon
08 09/04/12   Tue       A
09 09/05/12   Wed       A

I left the preupdate alone , I had previously tried doing extra checks for existing absent records ,  but got "the limit for backup movements (/) has been reached" which I looked up and I am deleting a deleted record or something.

I changed the update to
Procedure update
  Begin
    For suppla
      Begin
        Get xsupp(alias of suppla) optional
        If not accessok (meaning new record on this screen)
          Then begin
            Lock suppla
            If abscode of suppla <> " "
            Then begin
              Let statements
            End
          Put suppla
          Unlock suppla
       End
     End
   End

When updated , the new 9/5/12 record gets added but I get an error on existing records as in 9/4/12.
*d* not all changed records have been updated

I thought "if not accessok" would only run the lock if the record was new this session and so not found on the alias file
I want to only run the lock for new items added this session.

Helen wellcome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sowder.com/pipermail/powerh-l/attachments/20120824/75644218/attachment.htm>


More information about the powerh-l mailing list