Exceptions and old error handling

Olivier vidal_olivier at yahoo.fr
Fri Jan 7 08:52:46 CST 2005


Hi list,

Sorry for this problem which has to seem to you very simple,
but I shall like knowing how you would use the Exceptions in the 
following case.

I open a cursor which contains one field (String).
This String is modified by RB methods and recorded again in the DB.
If the update fails (unique field: doubloon), the recording is deleted.
With the old error handling, it is simple, tests it is made IN the loop.
With the management of the exceptions, what is the most elegant 
solution?


dim a,i as integer
dim s1 as string
   cur=new vcursor(DB,"SELECT string1 FROM Table1",2,3,2)
   a=cur.recordCount
   i=1

  if a>0 then

do until i=a+1
      cur.position=i
       s1=Method1(cur.stringField("string1").value)

       if len(s1)>2 then
         cur.stringField("string1").value=s1
         cur.updaterecord //rs=cur.update()
         //if rs=false then
           //cur.deleteRecord()
           //i=i-1
           //a=cur.recordCount
         //end if
       end if

       i=i+1
     loop

   end if

thank you

olivier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1144 bytes
Desc: not available
Url : http://lists.macserve.net/pipermail/valentina-beta/attachments/20050107/323c28c4/attachment.bin


More information about the Valentina-beta mailing list