[V4RB] more questions

Charles Yeomans yeomans at desuetude.com
Wed Jan 29 13:18:38 CST 2003


On Wednesday, January 29, 2003, at 11:56  AM, Pedro fp wrote:

> G'day Folks
>
> A few more questions that I haven't been able to find answered in the 
> docs ...
>
> When getting the value from a VString where the actual value in the 
> field is shorter than MaxLength is the value returned padded to 
> MaxLength? i.e. Does a does a VString of MaxLength 10 & containing 
> "Hello" return "Hello" or "Hello     "?

It returns "Hello".  I believe that VString stores a C-string.  The 
purpose of the fixed length is to make access very fast.

>
> When using a VByte for 1 byte strings, as suggested in the docs, is it 
> necessary to convert between strings & integers when setting & getting 
> values?

It depends -- VByte.value is an Integer property.  But you can also use 
VByte.GetString /VByte.SetString (methods inherited from VField); in 
which case you just pass a string.  So it should be that VByte.value = 
Asc("A") and VByte.SetString("A") achieve the same thing.

>
> Can the MaxLength of VString &/or VVarChar fields be changed at 
> runtime?

Yes.

>
> Is the page size of VVarChar fields always a multiple of 1024 bytes?
>

I think so; Ruslan appears to suggest this in the Kernel docs.  In my 
experience, I usually just use VarChar with a max length of 504 bytes 
(and thus a 1024-byte page), and use a VText field when I expect longer 
strings.  But Ruslan sorts the VarChar v. VText choice with some care 
in the Kernel docs.

Charles Yeomans




More information about the Valentina mailing list