WPCubed Product Support

WPTools Variables can not be save

for example:

procedure TForm1.Button1Click(Sender: TObject);
var
Item:TWPRTFExtraDataItem;
begin
WPRichText1.RTFVariables.Strings['abc']:='a';
WPRichText1.RTFVariables.Strings['def']:='a';
Item:=WPRichText1.RTFVariables.Find('abc');
Item.Mode:=wpxData;
Item.LoadFromFile('e:\abc.txt');
WPRichText1.SaveToFile('e:\cs.wpt');
end;

then,Reopen Application ,Use the code:

procedure TForm1.Button2Click(Sender: TObject);
var
Item:TWPRTFExtraDataItem;
begin
WPRichText1.LoadFromFile('e:\cs.wpt');
Item:=WPRichText1.RTFVariables.Find('abc',wpxData);
if Item<>nil then
begin
Item.SaveToFile('e:\a.txt');
end;
end;

the item is nil,but the variable 'def' exists。

#1 ♥ 0
6.6k Views 2 users read 1 min

After the study,I found the unit file WPIOWptools.pas, 1636 line,
Not processing the wpxData variable,
This code:

else if aTag.NameEqual ('variable') then / / Load Stream Variable
begin
/ / TODO
end
I hope that you improve this code.

#2 ♥ 0
support

WPTools 6.29 is available now.
It includes the missing code to load the stream data. (saving worked before)

#3 ♥ 0
This category is archived. No new posts are possible.