Quantcast
Channel: Delphi Conversion
Viewing all articles
Browse latest Browse all 6

Delphi Conversion

$
0
0

Kaymaf,

the tsearchrec: Record used to hold data for FindFirst and FindNext.

a delphi example:var
  searchResult :
TSearchRec;

begin
  
// Try to find regular files matching Unit1.d* in the current dir

  if FindFirst('Unit1.d*', faAnyFile, searchResult) = 0 then
  begin
    repeat
      ShowMessage('File name = '+searchResult.Name);
      ShowMessage('File size = '+IntToStr(searchResult.Size));
    until FindNext(searchResult) <> 0;

    
// Must free up resources used by these successful finds

    FindClose(searchResult);
  end;
end;

The findfirst, findnext, findclose, faAnyfile are all part of the tsearchrec class in the delphi.sysutil

The rightstr, leftstr, middlestr are:

rightstr delphi example:

declaration
 
 
function RightStr(const AString: AnsiString; const Count: Integer): AnsiString; overload;
function RightStr(const AString: WideString; const Count: Integer): WideString; overload;

description
 
 
Returns a string containing a specified number of characters from the right side of a string.

AString represents a string expression from which the rightmost characters are returned. Count indicates how many characters to return. If greater than or equal to the number of characters in AString, the entire string is returned.

example
 
 
var s : string;
s := 'ABOUT DELPHI PROGRAMMING';
s := RightStr(s,5);

// s = 'MMING'

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>