| | |
Declaring a Record Type using Case.
Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
![]() |
I just ran across some code that declares a complex packed record:
aSInt = Integer;
The entlin, entln3, entmrk are constants used to identify specific types.
This code confuses me. The case statement is using an aSint, which is an integer, but does not assign it to a variable such as with this:
where Etype is a variable that conveys the type constant to apply.
How is this code used without an identification of what the aSint? How is the Asint value passed on when the record is used since it varies in size and the type of each instance must known to determine its size and allocate memory and read the data?
aSInt = Integer;
entity = packed Record
Enttype : byte;
field2 : double;
... //continues with other standard fields and then uses this case
CASE aSInt OF
entlin: (linpt1,
linpt2: point);
entln3: (ln3pt1,
ln3pt2: point);
entmrk: (mrkpnt,
mrkvec: point;
mrktyp,
mrksiz: aSInt);
... //other case types
End;
end;The entlin, entln3, entmrk are constants used to identify specific types.
This code confuses me. The case statement is using an aSint, which is an integer, but does not assign it to a variable such as with this:
Case Etype of
entlin: (linpt1,
linpt2: point);
...//etc.How is this code used without an identification of what the aSint? How is the Asint value passed on when the record is used since it varies in size and the type of each instance must known to determine its size and allocate memory and read the data?
![]() |
Similar Threads
- Classes (C++)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Undetermined numbers
- Next Thread: A Nice Shortest path problem !
| Thread Tools | Search this Thread |
Tag cloud for Pascal and Delphi





