Ich habe ein Package erstellt mit einer unit myInterface.pas. Dort sind im Interface-Teil diverse Konstanten und Typen definiert. Bsp:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
| interface myInterface;
uses ...
const c1 = $00000000; c2 = $00000001; c3 = $00000002; c4 = $00000003;
type TmyTyp1 = c1..c4; |
Ich habe nun mein Package kompiliert und binde es als Referenz in mein Hauptprogramm ein. Dort definiere ich eine lokale Variable vom Typ TmyTyp1. Diese soll nun mit dem Wert c1 initialisiert werden. Also etwa so:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9:
| var v1 : myInterface.TmyTyp1;
procedure init; begin ... v1:=myInterface.c1; ... end; |
Das Problem:
Als mögliche, zu verwendende Werte für eine Variable vom Typ TmyTyp1 gibt mir nun die IDE nur einen Bereich MinValue..MaxValue an - und nicht c1..c4!
Ein Wert c1 etc. wird auch nicht akzeptiert, wenn man ihn mal so reinschreibt (entweder "nicht bekannt" oder "inkompatibler Typ"). Auch wenn man mit dem Cursor auf die Variablendeklaration geht und die Typ-Info im Hint abfragt, kriegt man den (falschen) Bereich MinValue..MaxValue angezeigt.
Wo liegt das Problem?
Moderiert von UGrohne: Code- durch Delphi-Tags ersetzt.