12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538 |
- %
- % $Id$
- % This file is part of the FPC documentation.
- % Copyright (C) 1999, by Michael Van Canneyt
- %
- % The FPC documentation is free text; you can redistribute it and/or
- % modify it under the terms of the GNU Library General Public License as
- % published by the Free Software Foundation; either version 2 of the
- % License, or (at your option) any later version.
- %
- % The FPC Documentation is distributed in the hope that it will be useful,
- % but WITHOUT ANY WARRANTY; without even the implied warranty of
- % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- % Library General Public License for more details.
- %
- % You should have received a copy of the GNU Library General Public
- % License along with the FPC documentation; see the file COPYING.LIB. If not,
- % write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- % Boston, MA 02111-1307, USA.
- %
- \chapter{The SYSUTILS unit.}
- This chapter describes the \file{sysutils} unit. The \var{sysutils} unit
- was largely written by Gertjan Schouten, and completed by michael Van Canneyt.
- It aims to be compatible to the Delphi sysutils unit, but in contrast with
- the latter, it is designed to work on multiple platforms.
- This chapter starts out with a definition of all types and constants
- that are defined, followed by a complete explanation of each function.
- \section{Constants and types}
- The following general-purpose constants are defined:
- \begin{verbatim}
- const
- SecsPerDay = 24 * 60 * 60; // Seconds and milliseconds per day
- MSecsPerDay = SecsPerDay * 1000;
- DateDelta = 693594; // Days between 1/1/0001 and 12/31/1899
- Eoln = #10;
- \end{verbatim}
- The following types are used frequently in date and time functions.
- They are the same on all platforms.
- \begin{verbatim}
- type
- TSystemTime = record
- Year, Month, Day: word;
- Hour, Minute, Second, MilliSecond: word;
- end ;
- TDateTime = double;
- TTimeStamp = record
- Time: integer; { Number of milliseconds since midnight }
- Date: integer; { One plus number of days since 1/1/0001 }
- end ;
- \end{verbatim}
- The following type is used in the \seef{FindFirst},\seef{FindNext}
- and \seep{FindClose} functions. The \var{win32} version differs from
- the other versions. If code is to be portable, that part shouldn't
- be used.
- \begin{verbatim}
- Type
- THandle = Longint;
- TSearchRec = Record
- Time,Size, Attr : Longint;
- Name : TFileName;
- ExcludeAttr : Longint;
- FindHandle : THandle;
- {$ifdef Win32}
- FindData : TWin32FindData;
- {$endif}
- end;
- \end{verbatim}
- The following constants are file-attributes that need to be matched in the
- findfirst call.
- \begin{verbatim}
- Const
- faReadOnly = $00000001;
- faHidden = $00000002;
- faSysFile = $00000004;
- faVolumeId = $00000008;
- faDirectory = $00000010;
- faArchive = $00000020;
- faAnyFile = $0000003f;
- \end{verbatim}
- The following constants can be used in the \seef{FileOpen} call.
- \begin{verbatim}
- Const
- fmOpenRead = $0000;
- fmOpenWrite = $0001;
- fmOpenReadWrite = $0002;
- \end{verbatim}
- The following variables are used in the case translation routines.
- \begin{verbatim}
- type
- TCaseTranslationTable = array[0..255] of char;
- var
- UpperCaseTable: TCaseTranslationTable;
- LowerCaseTable: TCaseTranslationTable;
- \end{verbatim}
- The initialization code of the \file{sysutils} unit fills these
- tables with the appropriate values. For the win32 and go32v2
- versions, this information is obtained from the operating system.
- The following constants control the formatting of dates.
- For the Win32 version of the \file{sysutils} unit, these
- constants are set according to the internationalization
- settings of Windows by the initialization code of the unit.
- \begin{verbatim}
- Const
- DateSeparator: char = '-';
- ShortDateFormat: string = 'd/m/y';
- LongDateFormat: string = 'dd" "mmmm" "yyyy';
- ShortMonthNames: array[1..12] of string[128] =
- ('Jan','Feb','Mar','Apr','May','Jun',
- 'Jul','Aug','Sep','Oct','Nov','Dec');
- LongMonthNames: array[1..12] of string[128] =
- ('January','February','March','April',
- 'May','June','July','August',
- 'September','October','November','December');
- ShortDayNames: array[1..7] of string[128] =
- ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
- LongDayNames: array[1..7] of string[128] =
- ('Sunday','Monday','Tuesday','Wednesday',
- 'Thursday','Friday','Saturday');
- \end{verbatim}
- The following constants control the formatting of times.
- For the Win32 version of the \file{sysutils} unit, these
- constants are set according to the internationalization
- settings of Windows by the initialization code of the unit.
- \begin{verbatim}
- Const
- ShortTimeFormat: string = 'hh:nn';
- LongTimeFormat: string = 'hh:nn:ss';
- TimeSeparator: char = ':';
- TimeAMString: string[7] = 'AM';
- TimePMString: string[7] = 'PM';
- \end{verbatim}
- The following constants control the formatting of currencies
- and numbers. For the Win32 version of the \file{sysutils} unit,
- these constants are set according to the internationalization
- settings of Windows by the initialization code of the unit.
- \begin{verbatim}
- Const
- DecimalSeparator : Char = '.';
- ThousandSeparator : Char = ',';
- CurrencyDecimals : Byte = 2;
- CurrencyString : String[7] = '$';
- { Format to use when formatting currency :
- 0 = $1 1 = 1$ 2 = $ 1 3 = 1 $
- 4 = Currency string replaces decimal indicator.
- e.g. 1$50
- }
- CurrencyFormat : Byte = 1;
- { Same as above, only for negative currencies:
- 0 = ($1)
- 1 = -$1
- 2 = $-1
- 3 = $1-
- 4 = (1$)
- 5 = -1$
- 6 = 1-$
- 7 = 1$-
- 8 = -1 $
- 9 = -$ 1
- 10 = $ 1-
- }
- NegCurrFormat : Byte = 5;
- \end{verbatim}
- The following types are used in various string functions.
- \begin{verbatim}
- type
- PString = ^String;
- TFloatFormat = (ffGeneral, ffExponent, ffFixed, ffNumber, ffCurrency);
- \end{verbatim}
- The following constants are used in the file name handling routines. Do not
- use a slash of backslash character directly as a path separator; instead
- use the \var{OsDirSeparator} character.
- \begin{verbatim}
- Const
- DirSeparators : set of char = ['/','\'];
- {$ifdef Linux}
- OSDirSeparator = '/';
- {$else}
- OsDirSeparator = '\';
- {$endif}
- \end{verbatim}
- \section{Date and time functions}
- \subsection{Date and time formatting characters}
- \label{se:formatchars}
- Various date and time formatting routines accept a format string.
- to format the date and or time. The following characters can be used
- to control the date and time formatting:
- \begin{description}
- \item[c] : shortdateformat + ' ' + shorttimeformat
- \item[d] : day of month
- \item[dd] : day of month (leading zero)
- \item[ddd] : day of week (abbreviation)
- \item[dddd] : day of week (full)
- \item[ddddd] : shortdateformat
- \item[dddddd] : longdateformat
- \item[m] : month
- \item[mm] : month (leading zero)
- \item[mmm] : month (abbreviation)
- \item[mmmm] : month (full)
- \item[y] : year (four digits)
- \item[yy] : year (two digits)
- \item[yyyy] : year (with century)
- \item[h] : hour
- \item[hh] : hour (leading zero)
- \item[n] : minute
- \item[nn] : minute (leading zero)
- \item[s] : second
- \item[ss] : second (leading zero)
- \item[t] : shorttimeformat
- \item[tt] : longtimeformat
- \item[am/pm] : use 12 hour clock and display am and pm accordingly
- \item[a/p] : use 12 hour clock and display a and p accordingly
- \item[/] : insert date seperator
- \item[:] : insert time seperator
- \item["xx"] : literal text
- \item['xx'] : literal text
- \end{description}
- \begin{type}{TDateTime}
- \Declaration
- TDateTime = Double;
- \Description
- Many functions return or require a \var{TDateTime} type, which contains
- a date and time in encoded form. The date and time are converted to a double
- as follows:
- \end{type}
- \begin{function}{Date}
- \Declaration
- Function Date: TDateTime;
- \Description
- \var{Date} returns the current date in \var{TDateTime} format.
- For more information about the \var{TDateTime} type, see \seety{TDateTime}.
- \Errors
- None.
- \SeeAlso
- \seef{Time},\seef{Now}, \seety{TDateTime}.
- \end{function}
- \latex{\inputlisting{sysutex/ex1.pp}}
- \html{\input{sysutex/ex1.tex}}
- \begin{function}{DateTimeToFileDate}
- \Declaration
- Function DateTimeToFileDate(DateTime : TDateTime) : Longint;
- \Description
- \var{DateTimeToFileDate} function converts a date/time indication in
- \var{TDateTime} format to a filedate function, such as returned for
- instance by the \seef{FileAge} function.
- \Errors
- None.
- \SeeAlso
- \seef{Time}, \seef{Date}, \seef{FileDateToDateTime},
- \seep{DateTimeToSystemTime}, \seef{DateTimeToTimeStamp}
- \end{function}
- \latex{\inputlisting{sysutex/ex2.pp}}
- \html{\input{sysutex/ex2.tex}}
-
- \begin{function}{DateTimeToStr}
- \Declaration
- Function DateTimeToStr(DateTime: TDateTime): string;
- \Description
- \var{DateTimeToStr} returns a string representation of
- \var{DateTime} using the formatting specified in
- \var{ShortDateTimeFormat}. It corresponds to a call to
- \var{FormatDateTime('c',DateTime)} (see \sees{formatchars}).
- \Errors
- None.
- \SeeAlso
- \seef{FormatDateTime}, \seety{TDateTime}.
- \end{function}
- \latex{\inputlisting{sysutex/ex3.pp}}
- \html{\input{sysutex/ex3.tex}}
-
- \begin{procedure}{DateTimeToString}
- \Declaration
- Procedure DateTimeToString(var Result: string; const FormatStr: string; const DateTime: TDateTime);
- \Description
- \var{DateTimeToString} returns in \var{Result} a string representation of
- \var{DateTime} using the formatting specified in \var{FormatStr}.
- for a list of characters that can be used in the \var{FormatStr} formatting
- string, see \sees{formatchars}.
- \Errors
- In case a wrong formatting character is found, an \var{EConvertError} is
- raised.
- \SeeAlso
- \seef{FormatDateTime}, \sees{formatchars}.
- \end{procedure}
- \latex{\inputlisting{sysutex/ex4.pp}}
- \html{\input{sysutex/ex4.tex}}
-
- \begin{procedure}{DateTimeToSystemTime}
- \Declaration
- Procedure DateTimeToSystemTime(DateTime: TDateTime; var SystemTime: TSystemTime);
- \Description
- \var{DateTimeToSystemTime} converts a date/time pair in \var{DateTime}, with
- \var{TDateTime} format to a system time \var{SystemTime}.
- \Errors
- None.
- \SeeAlso
- \seef{DateTimeToFileDate}, \seef{SystemTimeToDateTime},
- \seef{DateTimeToTimeStamp}
- \end{procedure}
- \latex{\inputlisting{sysutex/ex5.pp}}
- \html{\input{sysutex/ex5.tex}}
- \begin{function}{DateTimeToTimeStamp}
- \Declaration
- Function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
- \Description
- \var{DateTimeToSystemTime} converts a date/time pair in \var{DateTime}, with
- \var{TDateTime} format to a \var{TTimeStamp} format.
- \Errors
- None.
- \SeeAlso
- \seef{DateTimeToFileDate}, \seef{SystemTimeToDateTime},
- \seef{DateTimeToSystemTime}
- \end{function}
- \latex{\inputlisting{sysutex/ex6.pp}}
- \html{\input{sysutex/ex6.tex}}
- \begin{function}{DateToStr}
- \Declaration
- Function DateToStr(Date: TDateTime): string;
- \Description
- \var{DateToStr} converts \var{Date} to a string representation. It uses
- \var{ShortDateFormat} as it's formatting string. It is hence completely
- equivalent to a \var{FormatDateTime('ddddd', Date)}.
- \Errors
- None.
- \SeeAlso
- \seef{TimeToStr}, \seef{DateTimeToStr}, \seef{FormatDateTime},
- \seef{StrToDate}
- \end{function}
- \latex{\inputlisting{sysutex/ex7.pp}}
- \html{\input{sysutex/ex7.tex}}
-
- \begin{function}{DayOfWeek}
- \Declaration
- Function DayOfWeek(DateTime: TDateTime): integer;
- \Description
- \var{DayOfWeek} returns the day of the week from \var{DateTime}.
- \var{Sunday} is counted as day 1, \var{Saturday} is counted as
- day 7. The result of \var{DayOfWeek} can serve as an index to
- the \var{LongDayNames} constant array, to retrieve the name of
- the day.
- \Errors
- None.
- \SeeAlso
- \seef{Date}, \seef{DateToStr}
- \end{function}
- \latex{\inputlisting{sysutex/ex8.pp}}
- \html{\input{sysutex/ex8.tex}}
- \begin{procedure}{DecodeDate}
- \Declaration
- Procedure DecodeDate(Date: TDateTime; var Year, Month, Day: word);
- \Description
- \var{DecodeDate} decodes the Year, Month and Day stored in \var{Date},
- and returns them in the \var{Year}, \var{Month} and \var{Day} variables.
- \Errors
- None.
- \SeeAlso
- \seef{EncodeDate}, \seep{DecodeTime}.
- \end{procedure}
- \latex{\inputlisting{sysutex/ex9.pp}}
- \html{\input{sysutex/ex9.tex}}
-
- \begin{procedure}{DecodeTime}
- \Declaration
- Procedure DecodeTime(Time: TDateTime; var Hour, Minute, Second, MilliSecond: word);
- \Description
- \var{DecodeDate} decodes the hours, minutes, second and milliseconds stored
- in \var{Time}, and returns them in the \var{Hour}, \var{Minute} and
- \var{Second} and \var{MilliSecond} variables.
- \Errors
- None.
- \SeeAlso
- \seef{EncodeTime}, \seep{DecodeDate}.
- \end{procedure}
- \latex{\inputlisting{sysutex/ex10.pp}}
- \html{\input{sysutex/ex10.tex}}
-
- \begin{function}{EncodeDate}
- \Declaration
- Function EncodeDate(Year, Month, Day :word): TDateTime;
- \Description
- \var{EncodeDate} encodes the \var{Year}, \var{Month} and \var{Day} variables to
- a date in \var{TDateTime} format. It does the opposite of the
- \seep{DecodeDate} procedure.
- The parameters must lie withing valid ranges (boundaries included):
- \begin{description}
- \item[Year] must be between 1 and 9999.
- \item[Month] must be within the range 1-12.
- \item[Day] msut be between 1 and 31.
- \end{description}
- \Errors
- In case one of the parameters is out of it's valid range, 0 is returned.
- \SeeAlso
- \seef{EncodeTime}, \seep{DecodeDate}.
- \end{function}
- \latex{\inputlisting{sysutex/ex11.pp}}
- \html{\input{sysutex/ex11.tex}}
- \begin{function}{EncodeTime}
- \Declaration
- Function EncodeTime(Hour, Minute, Second, MilliSecond:word): TDateTime;
- \Description
- \var{EncodeTime} encodes the \var{Hour}, \var{Minute}, \var{Second},
- \var{MilliSecond} variables to a \var{TDateTime} format result.
- It does the opposite of the \seep{DecodeTime} procedure.
- The parameters must have a valid range (boundaries included):
- \begin{description}
- \item[Hour] must be between 0 and 23.
- \item[Minute,second] must both be between 0 and 59.
- \item[Millisecond] must be between 0 and 999.
- \end{description}
- \Errors
- In case one of the parameters is outside of it's valid range, 0 is returned.
- \SeeAlso
- \seef{EncodeDate}, \seep{DecodeTime}.
- \end{function}
- \latex{\inputlisting{sysutex/ex12.pp}}
- \html{\input{sysutex/ex12.tex}}
-
- \begin{function}{FileDateToDateTime}
- \Declaration
- Function FileDateToDateTime(Filedate : Longint) : TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FormatDateTime}
- \Declaration
- Function FormatDateTime(FormatStr: string; DateTime: TDateTime):string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{IncMonth}
- \Declaration
- Function IncMonth(const DateTime: TDateTime; NumberOfMonths: integer): TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{IsLeapYear}
- \Declaration
- Function IsLeapYear(Year: Word): boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{MSecsToTimeStamp}
- \Declaration
- Function MSecsToTimeStamp(MSecs: Comp): TTimeStamp;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{Now}
- \Declaration
- Function Now: TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrToDate}
- \Declaration
- Function StrToDate(const S: string): TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrToDateTime}
- \Declaration
- Function StrToDateTime(const S: string): TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrToTime}
- \Declaration
- Function StrToTime(const S: string): TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{SystemTimeToDateTime}
- \Declaration
- Function SystemTimeToDateTime(const SystemTime: TSystemTime): TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{Time}
- \Declaration
- Function Time: TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{TimeStampToDateTime}
- \Declaration
- Function TimeStampToDateTime(const TimeStamp: TTimeStamp): TDateTime;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{TimeStampToMSecs}
- \Declaration
- Function TimeStampToMSecs(const TimeStamp: TTimeStamp): comp;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{TimeToStr}
- \Declaration
- Function TimeToStr(Time: TDateTime): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \section{Disk functions}
- \begin{function}{CreateDir}
- \Declaration
- Function CreateDir(Const NewDir : String) : Boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{DiskFree}
- \Declaration
- Function DiskFree(Drive : Byte) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{DiskSize}
- \Declaration
- Function DiskSize(Drive : Byte) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{GetCurrentDir}
- \Declaration
- Function GetCurrentDir : String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{RemoveDir}
- \Declaration
- Function RemoveDir(Const Dir : String) : Boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{SetCurrentDir}
- \Declaration
- Function SetCurrentDir(Const NewDir : String) : Boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \section{File handling functions}
-
-
- \begin{function}{ChangeFileExt}
- \Declaration
- Function ChangeFileExt(const FileName, Extension: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{DeleteFile}
- \Declaration
- Function DeleteFile(Const FileName : String) : Boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{procedure}{DoDirSeparators}
- \Declaration
- Procedure DoDirSeparators(Var FileName : String);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{function}{ExpandFileName}
- \Declaration
- Function ExpandFileName(Const FileName : string): String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{ExpandUNCFileName}
- \Declaration
- Function ExpandUNCFileName(Const FileName : string): String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{ExtractFileDir}
- \Declaration
- Function ExtractFileDir(Const FileName : string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{ExtractFileDrive}
- \Declaration
- Function ExtractFileDrive(const FileName: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{ExtractFileExt}
- \Declaration
- Function ExtractFileExt(const FileName: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{ExtractFileName}
- \Declaration
- Function ExtractFileName(const FileName: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{ExtractFilePath}
- \Declaration
- Function ExtractFilePath(const FileName: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{ExtractRelativepath}
- \Declaration
- Function ExtractRelativepath(Const BaseName,DestNAme : String): String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileAge}
- \Declaration
- Function FileAge(Const FileName : String): Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{procedure}{FileClose}
- \Declaration
- Procedure FileClose(Handle : Longint);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{function}{FileCreate}
- \Declaration
- Function FileCreate(Const FileName : String) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileExists}
- \Declaration
- Function FileExists(Const FileName : String) : Boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileGetAttr}
- \Declaration
- Function FileGetAttr(Const FileName : String) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileGetDate}
- \Declaration
- Function FileGetDate(Handle : Longint) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileOpen}
- \Declaration
- Function FileOpen(Const FileName : string; Mode : Integer) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileRead}
- \Declaration
- Function FileRead(Handle : Longint; Var Buffer; Count : longint) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileSearch}
- \Declaration
- Function FileSearch(Const Name, DirList : String) : String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileSeek}
- \Declaration
- Function FileSeek(Handle,Offset,Origin : Longint) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileSetAttr}
- \Declaration
- Function FileSetAttr(Const Filename : String; Attr: longint) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileSetDate}
- \Declaration
- Function FileSetDate(Handle,Age : Longint) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileTruncate}
- \Declaration
- Function FileTruncate(Handle,Size: Longint) : boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FileWrite}
- \Declaration
- Function FileWrite(Handle : Longint; Var Buffer; Count : Longint) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{procedure}{FindClose}
- \Declaration
- Procedure FindClose(Var F : TSearchrec);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{function}{FindFirst}
- \Declaration
- Function FindFirst(Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FindNext}
- \Declaration
- Function FindNext(Var Rslt : TSearchRec) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{GetDirs}
- \Declaration
- Function GetDirs(Var DirName : String; Var Dirs : Array of pchar) : Longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{RenameFile}
- \Declaration
- Function RenameFile(Const OldName, NewName : String) : Boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{SetDirSeparators}
- \Declaration
- Function SetDirSeparators(Const FileName : String) : String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \section{PChar functions}
- \begin{function}{StrAlloc}
- \Declaration
- Function StrAlloc(Size: cardinal): PChar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrBufSize}
- \Declaration
- Function StrBufSize(var Str: PChar): cardinal;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{procedure}{StrDispose}
- \Declaration
- Procedure StrDispose(var Str: PChar);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{function}{StrPCopy}
- \Declaration
- Function StrPCopy(Dest: PChar; Source: string): PChar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrPLCopy}
- \Declaration
- Function StrPLCopy(Dest: PChar; Source: string; MaxLen: cardinal): PChar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrPas}
- \Declaration
- Function StrPas(Str: PChar): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrCat}
- \Declaration
- Function StrCat(dest,source : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrComp}
- \Declaration
- Function StrComp(str1,str2 : pchar) : longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrCopy}
- \Declaration
- Function StrCopy(dest,source : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrECopy}
- \Declaration
- Function StrECopy(dest,source : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrEnd}
- \Declaration
- Function StrEnd(p : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrIComp}
- \Declaration
- Function StrIComp(str1,str2 : pchar) : longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrLCat}
- \Declaration
- Function StrLCat(dest,source : pchar;l : longint) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrLComp}
- \Declaration
- Function StrLComp(str1,str2 : pchar;l : longint) : longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrLCopy}
- \Declaration
- Function StrLCopy(dest,source : pchar;maxlen : longint) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrLen}
- \Declaration
- Function StrLen(p : pchar) : longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrLIComp}
- \Declaration
- Function StrLIComp(str1,str2 : pchar;l : longint) : longint;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrLower}
- \Declaration
- Function strlower(p : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrMove}
- \Declaration
- Function StrMove(dest,source : pchar;l : longint) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrNew}
- \Declaration
- Function StrNew(p : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrPos}
- \Declaration
- Function StrPos(str1,str2 : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrRScan}
- \Declaration
- Function StrRScan(p : pchar;c : char) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrScan}
- \Declaration
- Function StrScan(p : pchar;c : char) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrUpper}
- \Declaration
- Function StrUpper(p : pchar) : pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
- \section{String functions}
- \begin{function}{AdjustLineBreaks}
- \Declaration
- Function AdjustLineBreaks(const S: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiCompareStr}
- \Declaration
- Function AnsiCompareStr(const S1, S2: string): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiCompareText}
- \Declaration
- Function AnsiCompareText(const S1, S2: string): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiExtractQuotedStr}
- \Declaration
- Function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiLastChar}
- \Declaration
- Function AnsiLastChar(const S: string): PChar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiLowerCase}
- \Declaration
- Function AnsiLowerCase(const s: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiQuotedStr}
- \Declaration
- Function AnsiQuotedStr(const S: string; Quote: char): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiStrComp}
- \Declaration
- Function AnsiStrComp(S1, S2: PChar): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiStrIComp}
- \Declaration
- Function AnsiStrIComp(S1, S2: PChar): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiStrLComp}
- \Declaration
- Function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiStrLIComp}
- \Declaration
- Function AnsiStrLIComp(S1, S2: PChar; MaxLen: cardinal): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiStrLast}
- \Declaration
- Function AnsiStrLast(Str: PChar): PChar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{CharAnsiStrLower}
- \Declaration
- Function AnsiStrLower(Str: PChar): PChar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiStrUpper}
- \Declaration
- Function AnsiStrUpper(Str: PChar): PChar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{AnsiUpperCase}
- \Declaration
- Function AnsiUpperCase(const s: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{procedure}{AppendStr}
- \Declaration
- Procedure AppendStr(var Dest: PString; const S: string);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{procedure}{AssignStr}
- \Declaration
- Procedure AssignStr(var P: PString; const S: string);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{function}{BCDToInt}
- \Declaration
- Function BCDToInt(Value: integer): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{CompareMem}
- \Declaration
- Function CompareMem(P1, P2: Pointer; Length: cardinal): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{CompareStr}
- \Declaration
- Function CompareStr(const S1, S2: string): Integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{CompareText}
- \Declaration
- Function CompareText(const S1, S2: string): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{procedure}{DisposeStr}
- \Declaration
- Procedure DisposeStr(S: PString);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{function}{FloatToStr}
- \Declaration
- Function FloatToStr(Value: Extended): String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FloatToStrF}
- \Declaration
- Function FloatToStrF(Value: Extended; format: TFloatFormat; Precision, Digits: Integer): String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{procedure}{FmtStr}
- \Declaration
- Procedure (Var Res: String; Const Fmt : String; Const args: Array of const);
- \Description
- \Errors
- \SeeAlso
- \end{procedure}
-
- \begin{function}{Format}
- \Declaration
- Function Format(Const Fmt : String; const Args : Array of const) : String;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{FormatBuf}
- \Declaration
- Function FormatBuf(Var Buffer; BufLen : Cardinal; Const Fmt; fmtLen : Cardinal; Const Args : Array of const) : Cardinal;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{IntToHex}
- \Declaration
- Function IntToHex(Value: integer; Digits: integer): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{IntToStr}
- \Declaration
- Function IntToStr(Value: integer): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{IsValidIdent}
- \Declaration
- Function IsValidIdent(const Ident: string): boolean;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{LeftStr}
- \Declaration
- Function LeftStr(const S: string; Count: integer): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{LoadStr}
- \Declaration
- Function LoadStr(Ident: integer): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{LowerCase}
- \Declaration
- Function LowerCase(const s: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{NewStr}
- \Declaration
- Function NewStr(const S: string): PString;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{QuotedStr}
- \Declaration
- Function QuotedStr(const S: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{RightStr}
- \Declaration
- Function RightStr(const S: string; Count: integer): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrFmt}
- \Declaration
- Function StrFmt(Buffer,Fmt : PChar; Const args: Array of const) : Pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrLFmt}
- \Declaration
- Function StrLFmt(Buffer : PCHar; Maxlen : Cardinal;Fmt : PChar; Const args: Array of const) : Pchar;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrToInt}
- \Declaration
- Function StrToInt(const s: string): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{StrToIntDef}
- \Declaration
- Function StrToIntDef(const S: string; Default: integer): integer;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{Trim}
- \Declaration
- Function Trim(const S: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{TrimLeft}
- \Declaration
- Function TrimLeft(const S: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{TrimRight}
- \Declaration
- Function TrimRight(const S: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
- \begin{function}{UpperCase}
- \Declaration
- Function UpperCase(const s: string): string;
- \Description
- \Errors
- \SeeAlso
- \end{function}
-
|