Problem with Format function
Kellouche
Algeria
Hi !
please any one for help me.
why does this code not work
please any one for help me.
why does this code not work
procedure SysMemo27OnAfterData(Sender: TfrxComponent);
var
  res : string;
begin
  SysMemo27.Text :=    SysMemo14.Value + SysMemo15.Value + SysMemo16.Value +
                      SysMemo18.Value + SysMemo19.Value + SysMemo20.Value +
                      SysMemo21.Value + SysMemo22.Value + SysMemo23.Value +
                      SysMemo24.Value + SysMemo25.Value + SysMemo26.Value;
  try
    res := Format('%2.0n', [SysMemo27.Text]); // this does not work
    SysMemo27.Text := res;
  except
    ShowMessage('Erreur de formatage');
  end
end;
Comments
Try to test your variable before you make formating.
And yet - I'm not sure one should use square brackets for declared variable in FR3 (I use FR4)
Mick
I have no error message !
the text is not formated, f.e if the value is "3841" the result after application of format function is "3841" so i think format function does not support text property (SysMemoxx.Tex)
is there other way to do this ?!
I use FR4 and can't test your issue in the environment you have [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Mick[/img]
And bonus for you to let you make your code more simple: Mick