We help IT Professionals succeed at work.

How Can I See the Data

brianm
brianm asked
on
How can I assign the Data in (var Rec) to a Normal var Type and modify if.

Function TFile.FBlockRead(Var Buf;  Size: Cardinal): Cardinal;
begin
   If Assigned(fOnIo) then OnIo(Self);
(*$IfDef Win32 *)
   Size:=FileRead(FHandle,Buf,Size*RecLen);
   Result:=Size div RecLen;
(*$Else *)
   BlockRead(f,Buf,Size*RecLen,Size);  FBlockRead:=Size div RecLen;
(*$EndIf *)
end;


Thank You
Comment
Watch Question

Commented:
If you need to change the data in buf, like looping through it and changing specific characters I recently did something like this:

Function TFile.FBlockRead(Var Buf;  Size: Cardinal): Cardinal;
Type
  TArrByte = Array[0..MAXInt-1] Of Byte;
Var
  Loop : Integer;
begin
  If Assigned(fOnIo) then OnIo(Self);
(*$IfDef Win32 *)
  Size:=FileRead(FHandle,Buf,Size*RecLen);
  Result:=Size div RecLen;
(*$Else *)
  BlockRead(f,Buf,Size*RecLen,Size);  FBlockRead:=Size div RecLen;
(*$EndIf *)
 For Loop := 0 To Size*RecLen Do
   If TArrByte(Buf)[Loop] = 0 Then
     TArrByte(Buf)[Loop] := 32;
end;

If this isn't what you want, maybe you should clarify the question.
Commented:
You can do things like this:

Function TFile.FBlockRead(Var Buf; Size: Cardinal): Cardinal;
var TypedBuf : array [0..999] of integer absolute Buf;
begin

Now when using TypedBuf, you'll in reality access Buf.

Regards, Madshi.
brianm:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
CERTIFIED EXPERT

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split points between raidos and Madshi

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.