BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Assigning WideString to Variant truncates data at first null

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ObjectPascal
View previous topic :: View next topic  
Author Message
byron
Guest





PostPosted: Tue Sep 02, 2003 6:05 am    Post subject: Assigning WideString to Variant truncates data at first null Reply with quote



i've raised a bug report with borland's quality central (5754) but i'm
hoping someone here is able to help me..

starting with delphi 6 rtl2 update when a widestring is assigned to a
variant it is truncated at the first null. this bug exists in delphi
7 as well.

the issue also applies to variants created with varArrayCreate.

due to this bug i'm unable to upgrade to delphi 7 -- i've already paid
for the upgrade, but i can't build my application with it Sad.

wideString to Variant

procedure TForm1.Button1Click(Sender: TObject);
var
temp_str : WideString;
temp_var : Variant;
begin
temp_str := 'test' + #0 + 'test 2';
temp_var := temp_str;
ShowMessage('temp_str length = ' + inttostr(length(temp_str)));
ShowMessage('temp_var length = ' + inttostr(length(temp_var)));
end;

varArrayCreate

procedure TForm1.Button1Click(Sender: TObject);
var
temp_str : AnsiString;
var_param : Variant;
begin
temp_str := 'test' + #0 + 'test 2';
var_param := VarArrayCreate([0,0], varVariant);
var_param[0] := temp_str;
ShowMessage('temp_str length = ' + inttostr(length(temp_str)));
ShowMessage('temp_var length = ' + inttostr(length(var_param[0])));
end;
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ObjectPascal All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.