FormatStr faulty
Original Reporter info from Mantis: m_burkhard@gmx.ch
-
Reporter name:
Original Reporter info from Mantis: m_burkhard@gmx.ch
- Reporter name:
Description:
Instead of 10 to 99, 10 to 1751467531 is outputted.
The number 1751467531 seems to be random, depending on what is in RAM.
The number changes depending on where I start my program.
Steps to reproduce:
program Project1;
uses
App, Drivers, MsgBox;
procedure Test1;
var
Params: array[0..1] of longint;
begin
Params[0] := 10;
Params[1] := 99;
MessageBox('Fehler: ' + ' %d to %d', @Params, mfError or mfOKButton);
end;
procedure Test2;
var
s: ShortString;
Params: array[0..1] of longint;
p: Pointer;
begin
Params[0] := 10;
Params[1] := 99;
p:=@Params;
FormatStr(s, 'Fehler: ' + ' %d to %d', p^);
WriteLn(s);
ReadLn;
end;
var
MyApp: TApplication;
begin
Test2;
MyApp.Init;
Test1;
MyApp.Run;
MyApp.Done;
end.
Additional information:
I've noticed the error here:
InputLine: = new (PInputLine, Init (Rect, 6));
InputLine ^ .SetValidator (new (PRangeValidator, Init (0, 99)));
Insert (Input Line);
Mantis conversion info:
- Mantis ID: 32522
- OS: Linux
- OS Build: Mint 182
- Build: 3.0.2
- Platform: X86_64