Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Info from Two Dimensional Array

Status
Not open for further replies.

gforrest

Programmer
Apr 26, 2000
39
CA
Hi,

I'm using this bit of code to read some information stored in a two dimensional array of Single at the line indicated. No luck so far. The information is at 0,1 in the array but I'm not sure how to get it.

Any thoughts would be apprecicated.

Thanks.


procedure TTaxOptFrm.FormActivate(Sender: TObject);
var
RecINFO : INFO;
i : Integer;
StrArray : Array[0..9] of Char;
PStrArray : PChar;

begin
PStrArray := @StrArray;
for i := 0 to 1 do
begin
read_options(@RecINFO);
Move(RecInfo.taxpcr[i,0],StrArray[0],10); //HERE'S THE LINE
CurPstEdt.Text := PStrArray;
end;
 
if it's a two domensional array, don't you need to reference it with two dimensions!!

Secondly, a string

// mystring : string;

is an array of chars by default (one dimensional) and can be referenced by character alone. Is this any easier?

Hope this helps.
 
Here's how I fixed it:

procedure TTaxOptFrm.FormActivate(Sender: TObject);
var
RecINFO : INFO;
begin
read_options(@RecINFO);
CurGstRegEdt.Text := RecINFO.gst_reg_number;
CurPstEdt.Text := FloatToStr(RecInfo.taxpcr[0,1]);
CurGstEdt.Text := FloatToStr(RecInfo.taxpcr[1,1]);
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top