[V4RB] Try Catch VException Problem

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Oct 15 23:41:01 CDT 2004


On 10/15/04 10:50 PM, "Frank Schima" <frank-list3 at mindstarprods.com> wrote:

> Hi everyone,
> 
> 
> I'm having a problem translating the _TEST project to V4RB 2a19. This
> may be more of an RB issue though.
> 
> In the following lines of code in the Test_Field_Add_To_Unique Method
> of the Test_Fields class, a RuntimeException is thrown as a VException.
> 
>  res = BaseObject.FirstRecord
>  for i = 1 to 5000
>    fldLong.value = i
>    bAddRecordFailed = False
>    Try
>      iNewRecord = BaseObject.AddRecord()
>    Catch
>      bAddRecordFailed = True
>    End Try
>    if bAddRecordFailed = False Then
>      ONE_TEST_FAIL( "Add unique value: " + str(i) )
>      Exit
>    end if
>  Next
>  LOOP_TEST_DONE( "Add unique value.", i, 5000 )
> 
> Basically the test is trying to add duplicate records with the Unique
> flag set. So the line:
> iNewRecord = BaseObject.AddRecord()
> Should fail because of the Unique flag. But RB quits into the debugger
> and says "VException". I thought that the Try...Catch block would catch
> it.
> 
> What am I doing wrong?

Hi Frank,

In the debugger, in the menu DEBUG you can set OFF option

    "stop on exception"  (or something like this)


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina-beta mailing list