Is and as operator example

Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, actnlist, stdctrls, extctrls; Type tform1 = Class (tform) button1: tbutton; edit1: tedit; Procedure formcreate (Sender: tobject); Private

Auxiliary Control of program processes

Abort // triggers an exception to exit. If you are in the try block, wait t and finallyProgramExit // exit normally. If the try block contains blocks, blocks T and finally will execute the halt // non-normal end program. You can use the integer

Winapi: midioutcachepatches-preinstalled tone

Tip: Each element in the array of parameter 3 represents one of the 128 tone types; The MIDI channel is represented by 0 .. 15. For example, the channels 0 and 8 use the 0 tone, and The 0th elements of the array are $0101. // Declaration:

Winapi: midioutcachedrumpatches-pre-installed drums

Tip: Each element in the array of parameter 3 represents one of the 128 drums; MIDI channels are represented by 0-15. For example, channels 9 and 15 use the tone on the 60 key. The 60th elements of the array are $8200. // Declaration:

Call functions in external DLL (2. Bind later)

Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type // late binding, that is, to call an external function dynamically, use the following three commands: // loadlibrary: Get

String segmentation Function

Classes. extractstrings is recommended. Function split (SS, S: string): tstringlist; begin result: = tstringlist. create; while pos (S, SS)> 0 do begin result. add (copy (SS, 1, pos (S, SS)-1); Delete (SS, 1, pos (S, SS); end; result. add (SS);

Tcolortohex and hextotcolor

Function tcolortohex (color: tcolor): string; begin result: = inttohex (getrvalue (color), 2) + inttohex (getgvalue (color), 2) + inttohex (getbvalue (color), 2); end; function hextotcolor (scolor: string): tcolor; begin result: = RGB (strtoint (#36

Language Character Set

Object Pascal uses the ASCII character set, including a-Z, a-Z, 0-9, and other standard characters. Letters are case-insensitive. special single character symbols: # $ & '() * + ,-. /:; @ [] ^ {} combination of special characters :(**)(..).. //: =

Get local IP Address

Uses Winsock; function localip: string; Type tapinaddr = array [0 .. 10] of pinaddr; papinaddr = ^ tapinaddr; var Phe: phostent; pptr: papinaddr; Buffer: array [0 .. 63] of ansichar; I: integer; ginitdata: twsadata; begin wsastartup ($101, ginitdata)

Getting started with classes (1): Inheriting forms

Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) button1: tbutton; button2: tbutton; procedure button1click (Sender: tobject); Procedure button2click (

Use of Edit

// Make edit accept only numbers. // Method 1: Procedure tform1.edit1keypress (Sender: tobject; var key: Char); begin if not (key in ['0 '.. '9']) then key: = CHR (0); end; // Method 2: Procedure tform1.edit1keypress (Sender: tobject; var key: Char )

Common API functions (1): network functions

Wnetaddconnection Create a permanent connection to the same network resource Wnetaddconnection2 Create a connection to the same network resource Wnetaddconnection3 Create a connection to the same network

Common API functions (4): Print Functions

Abortdoc Cancel printing a document Abortprinter Deletes a buffer file associated with a printer. Addform Add a new form to the printer form List Addjob Obtain a valid path name to create a

Common API functions (5): Text and font Functions

Addfontresource Add a Font Resource in Windows Createfont Creates a logical font with the specified property. Createfontindirect Creates a logical font with the specified property.

Delphi regular expression syntax (3): matching range

// [A-Z]: match all uppercase letters var REG: tperlregex; begin REG: = tperlregex. create (NiL); Reg. subject: = 'codegear Delphi 2007 for Win32 '; Reg. regEx: = '[A-Z]'; Reg. replacement: = '◆ '; Reg. replaceall; showmessage (Reg. subject); //

Attributes and methods of tperlregex in Delphi Regular Expressions (2): subexpressions

// Matchedexpression and subexpressions [0] var REG: tperlregex; begin REG: = tperlregex. create (NiL); Reg. subject: = 'codegear Delphi 2007 '; Reg. regEx: = 'delphi '; while Reg. matchagain do begin showmessage (Reg. matchedexpression); // Delphi;

Common table Effects

1 2 3 4 5 6 //CodeAs follows: 1 2 3 4 5 6 // You can also use the style sheet control: // My table Header Copyright 20.13

Getting started with classes (2): Digital box

// Class unit numbox; interfacetype tnumbox = class private fcount: integer; public procedure addone; Procedure addfive; Procedure zerocount; function getcount: integer; end; implementation {tnumbox} procedure tnumbox. addone; begin Inc (fcount);

Make full use of generic Arrays

It took a week to solve a problem. At the same time, the first time I really started to use generic arrays, it felt great. If you use tarray instead of array of word, you can also useAlgorithm(Point missing ). Uses generics. collections,

Official Regular Expression component regularexpressions (5): Strong Testing

Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) memo1: tmemo; button1: tbutton; procedure button1click (Sender: tobject); end; var form1: tform1;

Total Pages: 64722 1 .... 54257 54258 54259 54260 54261 .... 64722 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.