SetBlank

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Feb 7 15:03:14 CST 2003


on 2/7/03 1:48 PM, Klamp, Kurt at Kurt.Klamp at abdnb.bayern.de wrote:

>>>    Clears the memory buffer of the Cursor, i.e. set values
>>>    of all fields of current record to NULL. You can use this
>>>    function before adding a new record to the database.
>>> 
>> 
>> Thanks for clarification. Yes, this make a difference. You should
>> really make this change in docs. What is in docs is a mental shortcut
>> -- its meaning is obvious to you and people-in-know but ambiguous to
>> others.
>> 
>> 
>> There is also ambiguity related to the last sentence -- another
>> mental shortcut of yours me thinks.

>> As far as I know, a new record is
>> automatically set to Blank values, so using this function is not
>> needed at all (and certainly not just before adding).

No.

IF you simply do AddRecord() then new record will get CURRENT VALUES
Of Current Record buffer.

>> I believe you 
>> refer to using this function when creating a new record from current
>> one (as opposed to new SQL with recid=0). I think that you could
>> simply remove this sentence.
> 
> I don't think so Robert. The last sentence of ruslan must be ->You can use
> this function before adding a new empty record to the database <-
> If you make a new cursor (except an empty one) the current record is set to
> 1 and the buffer contains the data of record 1.  Now if you make a new
> record a new record with the data of record 1 is added to the db. It's a
> nice feature to duplicate records.

> If you want to create a new rec with different data you have to set all
> fields in buffer before with new values.

EXPLANATION:

Let cursor have 10 fields.
You want add a new record and specify values only for 3 fields.
So the shortest way do this"

    curs.setBlank()  -- now buffer of Current record is Blank.
                        this means that Nullable fields are NULL,
                        numeric fields are ZERO,
                        strings are EMPTY.

    curs.f1 = 1
    curs.f5 = 2
    curs.f8 = 8

    curs.addRecord()
    

-- 
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://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list