[V4RB] GoToRecID(xx)

Charles Yeomans yeomans at desuetude.com
Mon Jul 10 17:53:00 CDT 2006


On Jul 10, 2006, at 12:51 PM, Ruslan Zasukhin wrote:

> On 7/10/06 7:34 PM, "Charles Yeomans" <yeomans at desuetude.com> wrote:
>
>>>>> Yes, in fact METHOD
>>>>>
>>>>>     tbl.Goto( inRecID ) as Boolean
>>>>>
>>>>> Do more job than property. It also can check if such record
>>>>> exists and
>>>>> return bool result...
>>>>
>>>>
>>>> Please don't force that interface style on us.
>>>
>>> Sorry, Charles, I have not catch your point of view ?
>>>
>>> You against to add such method ? Why ?
>>
>> Why do it that way?  We could have a property VTable.CurrentRecID as
>> Integer.
>
> We have it right now :
>
>     VTable.RecID
>
>
>> If you try to assign a bad value to CurrentRecID, then the
>> function could either return or raise an exception;
>
> No, it cannot return...because this is a property of class.
> It can throw exception but I think this is too hard for developers  
> handle
> this ...
>
> Right now the only way write code is:
>
>     if tbl.RecordExists( recid ) then
>         tbl.RecID = recid
>     else
>
>     end if
>
> Function Vtable.Goto( recid ) as Boolean actually do exactly this  
> code..
>
> So it is only *cosmetic* to allow write code as simple as:
>
>     if tbl.GoTo( recid ) then
>
>     else
>
>     end if

I would rather write

   if tbl.RecordExists( recid ) then
         tbl.RecID = recid
     else

     end if

What happens now if one assigns a bad RecID value to VTable.RecID ?

Charles Yeomans


More information about the Valentina mailing list