Exceptions and old error handling

Olivier vidal_olivier at yahoo.fr
Fri Jan 7 09:01:50 CST 2005


I think that I have to appeal in my loop to an independent method to be 
able to process the update and possibly the error.
But that makes me change many methods in my application. I go to see 
that.

olivier

Le 7 janv. 05, à 08:52, Olivier a écrit :

> 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_______________________________________________
> Valentina-beta mailing list
> Valentina-beta at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina-beta
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1590 bytes
Desc: not available
Url : http://lists.macserve.net/pipermail/valentina-beta/attachments/20050107/c5010667/attachment.bin


More information about the Valentina-beta mailing list