Multi-language implementation of string variables using a global hash table

1. Create a global hash table InitializationG_hash: = thashedstringlist. Create;FinalizationFreeandnil (g_hash );   2. Write all the rows read by the specified section of the INI file to the global hash table (the string definition is

Unicode GBK big5

Function unicodeencode (STR: string; codePage: integer): widestring;VaRLen: integer;BeginLen: = length (STR) + 1;Setlength (result, Len );Len: = multibytetowidechar (codePage, 0, pchar (STR),-1, pwidechar (result), Len );Setlength (result, Len-1); //

Three States of memory

free free : The Memory Page is neither submitted nor retained. It cannot be accessed by processes, but can be allocated by a memory allocation function. reserved reserved : the memory is retained by the calling process and cannot

Interface's demo

Unit unit1; Interface UsesWindows, messages, sysutils, variants, classes, graphics, controls, forms,Dialogs, stdctrls; TypeTform1 = Class (tform)Button1: tbutton;Procedure button1click (Sender: tobject );Private{Private

Load Balancing Policy

All Server Load balancer products require certain load balancing policies, which are also called Server Load balancer policies.Algorithm. Currently, there are three most common load balancing algorithms: Round Robin (Round-Robin), The minimum number

Summary of methods for Object serialization in Delphi

1. serialization of Component Objects The serialization of Component Objects inherited from tcomponent is simple, because it supports streaming, and streaming achieves the goal of serializing component objects. Both treader and twriter only

Object sharing between various plug-ins of Hydra through the INI File

Type tloginuser = record // Login User Structure ID: string; Name: string; Ruleid: string; Rulename: string; PWD: string; End;   Psung objectrecord = ^ Tsung objectrecord; Tsung objectrecord = record // Share Object Structure

Possible Memory leakage of Treeview. Data

Data in items using listview and Treeview in Delphi may be ignored due to memory leakage. If data is used as a pointer, the memory will not be released when the project is deleted, you can add dispose (item. data); statement to release.When using

A simple and efficient algorithm for dataset + tree

This method can be used to design the function module tree, user permission tree, category tree, and all hierarchical relationships that need to be represented by the tree... This method generates the entire tree by traversing the dataset once.  

Code to set tsqlconnection Parameters

Function connremotesvr (CN: tsqlconnection; const hostname, username, password: string; const port: integer): Boolean;BeginTryCN. close;CN. drivername: = 'datasnap ';CN. loginprompt: = false;CN. connectionname: = 'datasnapconnection ';CN. Params.

DLL direct return object

An error may occur when the DLL directly returns an object. This is because the program and the DLL use different VCL, which is equivalent to different instances of an interface, therefore, an error occurs when VCL-related objects are returned from

Determine whether the network is connected

It is important to determine whether the network is connected or how it is connected. If you clearly have no connection, you can tell that you have it, and you are connected, but you are not connected, the following two methods are

Use trzpagecontrol on the Multi-label Main Interface

// Author: cxg 08:22:30 Unit umain;{. $ Hints off}Interface UsesWindows, messages, sysutils, variants, classes, graphics, controls, forms,Dialogs, menus, rztabs, rzsplit, rzpanel, extctrls, comctrls, rzbutton, ADODB, DB, imglist, stdctrls, rzstatus;

Use of trzchecktree

1. Status:If rzchecktree1.selected. stateindex = 2 then// It is selected.Else if rzchecktree1.selected. stateindex = 1 then// It is not selectedElse if rzchecktree1.selected. stateindex = 3 then// The status is not all selectedOrIf

Stream compression and decompression Functions

UsesZlib; // Compression functionProcedureZip (VaRFS: tmemorystream );VaRCS: tcompressionstream;MS: tmemorystream;Num: integer;BeginIf Not(Assigned (FS)And(FS. size> 0))ThenExit; Num: = FS. size;MS: = tmemorystream. Create;CS: = tcompressionstream.

Memory Management 2

The number of addresses provided by the system to the program is 4 GB. Why not 3G or 5G? Because the maximum value of the 32-bit pointer is $ ffffffff, it cannot represent more, the root cause is to return to the addressing capability of the CPU,

Release multiple tag forms

Write the release in the formclose () of the subform. Procedure tformlogin. formclose (Sender: tobject; var action: tcloseaction );BeginAction: = cafree;Formlogin: = nil;End;   When you close tabsheet, traverse and find the form in it, and then

Fastscript script for multiple languages

Main Program Load script Procedure tform1.formcreate (Sender: tobject ); Begin Fsscript1.clear; Fsscript1.parent: = fsglobalunit; Fsscript1.addcomponent (form1 ); Fsscript1.lines.loadfromfile('1.txt '); Fsscript1.run; End;   1.txt File Uses

The script engine registers the classes, attributes, methods, and functions to be used.

Use the import tool for scripter to generate the ap_xxx.pas file. In the following example, tprintdbgrideh is supported. Unit myscript;{$ Define printdbgrideh}{$ Define xpman}Interface Implementation Uses ap_db, ap_dbgrids, ap_controls, ap_forms, ap_

One of the TMS script DEMO code

In this example, the host Program (exe) only has the interface design, and all the business rules are placed in the script file. This script file is a plain text file and can be modified at will. Once the host program is run, the script-based

Total Pages: 64722 1 .... 54259 54260 54261 54262 54263 .... 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.