delphi常用函数二

原创 2012年03月28日 21:44:46

COLLATE

sql语句里面的COLLATE主要用于对字符进行排序,经常出现在表的创建语句中  

列:CREATE TABLE tt  [ID] [bigint] IDENTITY(1,1) NOT NULL,[FTUID] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,表示输入记录是,FTUID按照Chinese_PRC_CI_AS格式进行排序

mentation fault

A segmentation fault (often shortened to segfault), bus error or access violation is generally an attempt to access memory that the CPU cannot physically address. It occurs when the hardware notifies an operating system about a memory access violation. The OS kernel then sends a signal to the process which caused the exception. By default, the process receiving the signal dumps core and terminates. The default signal handler can also be overridden to customize how the signal is handled.

A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system).

Segmentation is one approach to memory management and protection in the operating system. It has been superseded by paging for most purposes, but much of the terminology of segmentation is still used, "segmentation fault" being an example. Some operating systems still have segmentation at some logical level although paging is used as the main memory management policy.

On Unix-like operating systems, a signal called SIGSEGV is sent to a process that accesses an invalid memory address. On Microsoft Windows, a process that accesses invalid memory receives the STATUS_ACCESS_VIOLATION exception.

TGraphicsObject.OwnerCriticalSection

Points to the TRTLCriticalSection that the canvas which draws with this graphics object uses to lock out other threads.

type

  PRTLCriticalSection = ^TRTLCriticalSection;

  TRTLCriticalSection = _RTL_CRITICAL_SECTION;

  _RTL_CRITICAL_SECTION = record

    DebugInfo: PRTLCriticalSectionDebug;

    LockCount: Longint;

    RecursionCount: Longint;

    OwningThread: THandle;

    LockSemaphore: THandle;

    Reserved: DWORD;

  end;

property OwnerCriticalSection: PRTLCriticalSection;

Description

Use OwnerCriticalSection to obtain information about the thread locking state of the canvas that draws with this graphics object. The canvas sets OwnerCriticalSection when it creates the graphics object. Do not change this property while the canvas is using the graphics object.

If the graphics object is created on behalf of a drawing surface that is not a canvas, set OwnerCriticalSection to an initialized TRTLCriticalSection that is maintained by the drawing surface.

To use OwnerCriticalSection to block other execution threads, use the Lock method.

Format function

Returns a formatted string assembled from a format string and an array of arguments.

Unit

SysUtils

Category

string formatting routines

function Format(const Format: string; const Args: array of const): string;

Description

This function formats the series of arguments in the open array Args. Formatting is controlled by the format string Format; the results are returned in the function result as a string.

For information on the format strings, see Format Strings.

Format strings

Format strings specify required formats to general-purpose formatting routines.

 

Description

 

Format strings passed to the string formatting routines contain two types of objects -- literal characters and format specifiers. Literal characters are copied verbatim to the resulting string. Format specifiers fetch arguments from the argument list and apply formatting to them.

 

Format specifiers have the following form:

 

"%" [index ":"] ["-"] [width] ["." prec] type

 

A format specifier begins with a % character. After the % come the following, in this order:

 

An optional argument index specifier, [index ":"]

       An optional left justification indicator, ["-"]

       An optional width specifier, [width]

       An optional precision specifier, ["." prec]

       The conversion type character, type

 

The following table summarizes the possible values for type:

 

d     Decimal. The argument must be an integer value. The value is converted to a string of decimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has less digits, the resulting string is left-padded with zeros.

u     Unsigned decimal. Similar to 'd' but no sign is output.

e     Scientific. The argument must be a floating-point value. The value is converted to a string of the form "-d.ddd...E+ddd". The resulting string starts with a minus sign if the number is negative. One digit always precedes the decimal point.The total number of digits in the resulting string (including the one before the decimal point) is given by the precision specifier in the format string default precision of 15 is assumed if no precision specifier is present. The "E" exponent character in the resulting string is always followed by a plus or minus sign and at least three digits.

f     Fixed. The argument must be a floating-point value. The value is converted to a string of the form "-ddd.ddd...". The resulting string starts with a minus sign if the number is negative.The number of digits after the decimal point is given by the precision specifier in the format string default of 2 decimal digits is assumed if no precision specifier is present.

g     General. The argument must be a floating-point value. The value is converted to the shortest possible decimal string using fixed or scientific format. The number of significant digits in the resulting string is given by the precision specifier in the format string default precision of 15 is assumed if no precision specifier is present.Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary. The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value is less than or equal to the specified precision, and if the value is greater than or equal to 0.00001. Otherwise the resulting string uses scientific format.

n     Number. The argument must be a floating-point value. The value is converted to a string of the form "-d,ddd,ddd.ddd...". The "n" format corresponds to the "f" format, except that the resulting string contains thousand separators.

m    Money. The argument must be a floating-point value. The value is converted to a string that represents a currency amount. The conversion is controlled by the CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator, DecimalSeparator, and CurrencyDecimals global variables, all of which are initialized from the Currency Format in the International section of the Windows Control Panel. If the format string contains a precision specifier, it overrides the value given by the CurrencyDecimals global variable.

p     Pointer. The argument must be a pointer value. The value is converted to an 8 character string that represents the pointers value in hexadecimal.

s      String. The argument must be a character, a string, or a PChar value. The string or character is inserted in place of the format specifier. The precision specifier, if present in the format string, specifies the maximum length of the resulting string. If the argument is a string that is longer than this maximum, the string is truncated.

x    Hexadecimal. The argument must be an integer value. The value is converted to a string of hexadecimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has fewer digits, the resulting string is left-padded with zeros.

Conversion characters may be specified in uppercase as well as in lowercaseoth produce the same results.

For all floating-point formats, the actual characters used as decimal and thousand separators are obtained from the DecimalSeparator and ThousandSeparator global variables.

Index, width, and precision specifiers can be specified directly using decimal digit string (for example "%10d"), or indirectly using an asterisk character (for example "%*.*f"). When using an asterisk, the next argument in the argument list (which must be an integer value) becomes the value that is actually used. For example,

Format('%*.*f', [8, 2, 123.456])

is the same as

Format('%8.2f', [123.456]).

A width specifier sets the minimum field width for a conversion. If the resulting string is shorter than the minimum field width, it is padded with blanks to increase the field width. The default is to right-justify the result by adding blanks in front of the value, but if the format specifier contains a left-justification indicator (a "-" character preceding the width specifier), the result is left-justified by adding blanks after the value.

An index specifier sets the current argument list index to the specified value. The index of the first argument in the argument list is 0. Using index specifiers, it is possible to format the same argument multiple times. For example "Format('%d %d %0:d %1:d', [10, 20])" produces the string '10 20 10 20'.

Note:     Setting the index specifier affects all subsequent formatting. That is, Format('%d %d %d %0:d %d', [1, 2, 3, 4]) returns '1 2 3 1 2', not '1 2 3 1 4'. To get the latter result, you have must use  Format('%d %d %d %0:d %3:d', [1, 2, 3, 4])

paramstr(0) ----->  代表可执行文件路径(全路径)

可以用下面的语句木检验一下.

ShowMessage(paramstr(0));

TADOConnection

TADOConnection connects to an ADO data store.

Description

TADOConnection encapsulates the ADO connection object. Use TADOConnection for connecting to ADO data stores. The connection provided by a single TADOConnection component can be shared by multiple ADO command and dataset components through their Connection properties.

TADOConnection allows you to control the attributes and conditions of a connection to a data store. Use the properties of TADOConnection to control such attributes as record locking scheme (optimistic versus pessimistic), cursor type, cursor location, isolation level, and connection timeout. Methods are also provided for implementing transactions and retrieving metadata about the database to which this component connects.

Assigned function

Tests for a nil (unassigned) pointer or procedural variable.

Unit

System

Category

miscellaneous routines

function Assigned(const P): Boolean;

Description

Use Assigned to determine whether the pointer or procedure referenced by P is nil. P must be a variable reference of a pointer or procedural type. Assigned(P) corresponds to the test P<> nil for a pointer variable, and @P <> nil for a procedural variable.

Assigned returns False if P is nil, True otherwise.

Note:     Assigned can't detect a dangling pointer--that is, one that isn't nil but no longer points to valid data. For example, in the code example for Assigned, Assigned won't detect the fact that P isn't valid.

Copy function

Returns a substring of a string or a segment of a dynamic array.

Unit

System

Category

string handling routines

function Copy(S; Index, Count: Integer): string;

function Copy(S; Index, Count: Integer): array;

Description

S is an expression of a string or dynamic-array type. Index and Count are integer-type expressions. Copy returns a substring or sub array containing Count characters or elements starting at S[Index].

If Index is larger than the length of S, Copy returns an empty string or array.

If Count specifies more characters or array elements than are available, only the characters or elements from S[Index] to the end of S are returned.

Note:     When S is a dynamic array, Copy can only be used as a parameter in a call to a procedure or function that expects an array parameter. That is, it acts like the Slice function when working with dynamic arrays.

i是字符串开始的位置.1为长度

copy(s,i,1)

i :=1;的时候

字符串为H

第一个参数是字符,第二个参数是起始位置,第三个参数是终止位置

相关文章推荐

Delphi字符串操作的常用函数二

1.LeftStr(返回从字符串首开始指定长度的子字符串) function LeftStr(const AText: AnsiString; const ACount: Integer): A...

Delphi字符串操作的常用函数二

1.LeftStr(返回从字符串首开始指定长度的子字符串) function LeftStr(const AText: AnsiString; const ACount: Integer): Ans...
  • kimifdw
  • kimifdw
  • 2013年02月06日 16:34
  • 4197

delphi常用函數

  • 2013年10月13日 17:23
  • 56KB
  • 下载

Delphi常用函数PDF版

  • 2006年02月23日 15:31
  • 314KB
  • 下载

自己写的一些Delphi常用函数

今天在整理以前写过的代码,发现有些函数还是挺实用的,决定将其贴到Blog上,与众多好友一起分享。 {***********************************************...

常用的BCB &amp; Delphi 函数

  • 2007年11月15日 10:59
  • 26KB
  • 下载

DELPHI常用函数集及简要范例

  • 2008年07月05日 17:10
  • 239KB
  • 下载

Delphi数学常用操作函数一

1.Abs function Abs(X);:返回指定数值的绝对值。例如: Abs(-15); //结果为15   2. Ceil、Floor Ceil function Ceil(co...
  • kimifdw
  • kimifdw
  • 2013年02月17日 09:02
  • 4268

delphi常用函数2

  • 2008年04月13日 15:45
  • 11KB
  • 下载

delphi常用函数速查手册

  • 2013年04月18日 10:47
  • 128KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:delphi常用函数二
举报原因:
原因补充:

(最多只允许输入30个字)