>>>> 3)What is correct way to code:
>>>>  pCairo = hb_cairo_par( 1 ); // generate RTE if parameter is wrong
>>>>  if( pData )
>>>>     cairo_something( pCairo );
>>>> or this is also ok?:
>>>>   cairo_something( hb_cairo_par( 1 ) ); 
>> The first one is right. You should always check for at least NULL, as users 
>> may just pass other types, or non-cairo handles to the functions.
> 
> 
> Yes, user may pass any parameter, but hb_cairo_par() checks if it is valid 
> parameter and generates runtime error. Does hb_errRT_BASE() returns? Or it 
> uses some C stack functions (like setjump) to exit to the nearest BEGIN 
> SEQ/END SEQ.

It returns, so you should not have code after hb_errRT_BASE() call. 
(except for retry-able RTEs obviously)

I used to put hb_errRT_BASE() in outmost if()'s else branch.

Brgds,
Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to