Re: Assigning Variables at runtime?
- From: Andreas Koch <mail@xxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 20:30:57 +0200
Damfino wrote:
The text file would then look something like this: Var1 1 Bit Var2 16 Bits Var3 3 Bits etc.
My application can then use this definition to interpret the data block and allow for manipulation, etc.
Anyone has an idea if this is even possible?
Of course thats possible.
What you can't do is something like "create a record type fitting the type specified in the textfile, then read that record at once".
What you of course CAN do, is something like defining 3 arrays:
VarName:array[0..maxfieldnum] of string;
VarLength:array[0..maxfieldnum] of integer;
VarValue:array[0..maxfieldnum] of integer; // for any var size from 1 to 31 bits
fill it from the text file, write yourself a routine like
function ReadVar(NumberOfBits:integer):integer;
that will read the bits one by one and merge them to an int.
.
- References:
- Assigning Variables at runtime?
- From: Damfino
- Assigning Variables at runtime?
- Prev by Date: Re: Delphi7.1 for Windows Server2003 Std Edition
- Next by Date: Re: Array pointers like C++
- Previous by thread: Re: Assigning Variables at runtime?
- Next by thread: Re: Assigning Variables at runtime?
- Index(es):
Relevant Pages
|
|