Autor Beitrag
GuaAck
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 376
Erhaltene Danke: 32

Windows 8.1
Delphi 10.4 Comm. Edition
BeitragVerfasst: Mo 06.09.21 23:33 
Hallo,

in dem Code für eine kleine Finanzsoftware

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
TYPE
  t_IBAN = STRING[22];

VAR
  viban: t_IBAN;
  check: INTEGER;
...
check := strtoint(midstr(viban, 32)); // << Zeile 120


erhalte ich von Delphi10.4 folgende Warnungen:

[dcc32 Warnung] USepa.pas(120): W1000 Symbol 'MidStr' ist veraltet: 'Moved to the AnsiStrings unit'
[dcc32 Warnung] USepa.pas(120): W1057 Implizite String-Umwandlung von 'AnsiString' zu 'string'

Demnach müsste STRING[22] ein AnsiString sein, aber der Delphi-Hilfe nach sollte es ein normaler (UNICODE-) String sein.

Das Programm ergibt saubere Ergebnisse.

Hat jemand eine Idee, was der Widerspruch ist?

Viele Grüße
Günter Ackermann
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 07.09.21 11:29 
user profile iconGuaAck hat folgendes geschrieben Zum zitierten Posting springen:
Demnach müsste STRING[22] ein AnsiString sein, aber der Delphi-Hilfe nach sollte es ein normaler (UNICODE-) String sein.
Nein, laut Hilfe ist es ein ShortString (quasi ein AnsiString mit fester Länge):
docwiki.embarcadero....e/System.ShortString
GuaAck Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 376
Erhaltene Danke: 32

Windows 8.1
Delphi 10.4 Comm. Edition
BeitragVerfasst: Di 07.09.21 22:35 
Vielen Dank,

die Hilfe hatte ich gelesen, aber den Satzteil "0 bis 255 Einzelbyte-Zeichen" nicht richtig verinnerlicht.

Gruß
GuaAck