V4MD Noob: VOID instead of Vset with zero records?

Bart Pietercil bart.pietercil at gmail.com
Tue Apr 22 00:36:46 CDT 2008


On 22-apr-08, at 07:10, Ruslan Zasukhin wrote:

> On 4/22/08 7:45 AM, "Bart Pietercil" <bart.pietercil at gmail.com> wrote:
>
>> Hi Marc,
>>
>> well it has been a few years since I left behind Director (or did it
>> left me behind?) but the case you are describing seems to be  
>> something
>> along the lines of
>> -- pseudocode
>> myVSet  = BuildVSet()
>> if not objectP(myVSet) (or if VoidP(myVSet)) then
>>   --return an empty VSet
>>  myVSet =  new VSet() --zero records set
>> end if
>> return myVSet
>>
>> or maybe I am missing your point ?
>
> Okay, and now lets really consider some examples.
>
> What is logic of your code?
> For example in C++ we usually have such code:
>
>    BitSet_Ptr pSet = fld.Findsomething()
>
>    if( pSet == NULL) // it is empty
>    {
>        do something for empty case
>    }
>    else // we have found some records
>    {
>        ulong Count = pSet->get_Count();
>        for( ulong i = 1; i <= Count ; ++i )
>        {
>            // iterate records
>        }
>    }
>
>
> I do not see reasons why you need substitute VOID/NIL object by an  
> empty Set
> in the Lingo ... Why you need EMPTY set object ? Why Lingo code  
> cannot looks
> like above C++ code?
>
>    VBitSet pSet = fld.Findsomething()
>
>    if( not objectP(myVSet) (or if VoidP(myVSet) ) // it is empty
>    {
>        do something for empty case
>    }
>    else // we have found some records
>    {
>        ulong Count = pSet->get_Count();
>        for( ulong i = 1; i <= Count ; ++i )
>        {
>            // iterate records
>        }
>    }
>
>
> ----------------------------------------
> P.S.
>
> What is difference between
>    objectP(myVSet) and VoidP(myVSet)
> ?
>
> If you know that it can be only VOID then may be enough just single?

I just used both because I don't know (for Director) if VSet is an  
object or not;

Want I meant was:
if VSet is meant to be an object you can use if ObjectP(VSet)
if VSet is not an object you should use if VoidP(VSet).

In my book ObjectP is one step (as a test) higher then VoidP

Conclusion: use ObjectP or VoidP not both at the same time

>
>
>
> ----------------------------------------
> P.S.  You have told in prev letter that NIL object is better for you  
> than
> VOID, can you explain why it is better and what difference between  
> VOID and
> NIL in the Lingo?  Does NIL preserve original type of object ??


I don't think Lingo has NIL, just Void (but as I said I has been some  
years now)


hth

Bart


More information about the Valentina mailing list