Cardinal

数据类型表(DELPHI、C++)

谁都会走 提交于 2020-12-12 21:26:52
delphi整型数据表 Integer -2147483648..2147483647 signed 32-bit Cardinal 0..4294967295 unsigned 32-bit Shortint -128..127 signed 8-bit Smallint -32768..32767 signed 16-bit Longint -2147483648..2147483647 signed 32-bit Int64 -2^63..2^63? signed 64-bit Byte 0..255 unsigned 8-bit Word 0..65535 unsigned 16-bit Longword 0..4294967295 unsigned 32-bit C++ char -128 到 127 或者 0 到 255 1 个字节 unsigned char 0 到 255 1 个字节 signed char -128 到 127 1 个字节 int -2147483648 到 2147483647 4 个字节 unsigned int 0 到 4294967295 4 个字节 signed int -2147483648 到 2147483647 4 个字节 short int -32768 到 32767 2 个字节 unsigned short int 0 到

delphi:常用系统函数(转载)

送分小仙女□ 提交于 2020-08-10 06:44:34
原文: https://www.cnblogs.com/Little-Star/p/7541389.html 字符串处理函数 Unit System 函数原型 function Concat(s1 [, s2,..., sn]: string): string; 说明 与 S := S1 + S2 + S3 ...; 相同. 将字符串相加. 函数原型 function Copy(S: string; Index, Count: Integer): string;说明 S : 字符串. Indexd : 从第几位开始拷贝. Count : 总共要拷贝几位. 从母字符串拷贝至另一个字符串. 函数原型 procedure Delete(var S: string; Index, Count:Integer);说明 S : 字符串. Indexd : 从第几位开始删. Count : 总共要删几位. 删除字符串中的数个字元. 函数原型 procedure Insert(Source: string; var S: string; Index: Integer);说明 Source : 子字符串. S : 被插入字符串. Indexd : 从第几位开始插入. 将一个子字符串插入另一个字符串中. 函数原型 function Length(S: string): Integer; 求字符数

leetcode 789. Escape The Ghosts

和自甴很熟 提交于 2020-05-05 16:31:52
You are playing a simplified Pacman game. You start at the point (0, 0), and your destination is (target[0], target[1]). There are several ghosts on the map, the i-th ghost starts at (ghosts[i][0], ghosts[i][1]). Each turn, you and all ghosts simultaneously may move in one of 4 cardinal directions: north, east, west, or south, going from the previous point to a new point 1 unit of distance away. You escape if and only if you can reach the target before any ghost reaches you (for any given moves the ghosts may take.) If you reach any square (including the target) at the same time as a ghost, it

Delphi公用函数单元

本小妞迷上赌 提交于 2020-04-29 10:01:21
{ ******************************************************* } { } { Delphi公用函数单元 } { } { 版权所有 (C) 2008 } { } { ******************************************************* } unit YzDelphiFunc; interface uses ComCtrls, Forms, Windows, Classes, SysUtils, ComObj, ActiveX, ShlObj, Messages, Graphics, Registry, Dialogs, Controls, uProcess, uCpuUsage, StrUtils, CommCtrl, jpeg, WinInet, ShellAPI, SHFolder, ADODB, WinSock; { 保存日志文件 } procedure YzWriteLogFile(Msg: String); { 延时函数,单位为毫秒 } procedure YzDelayTime(MSecs: Longint); { 判断字符串是否为数字 } function YzStrIsNum(Str: string ):boolean; { 判断文件是否正在使用 } function

mormot数据集二进制序列还原

元气小坏坏 提交于 2020-04-06 15:17:06
mormot数据集二进制序列还原 /// <summary> /// 数据集转二进制流单元 /// </summary> unit UDBDatasetToBinary; interface uses System.SysUtils, System.Classes, Data.DB, DBAccess,SynCommons,SynTable,SynDBVCL; type /// <summary> /// bit set to identify columns, e.g. null columns /// </summary> TSQLDBProxyStatementColumns = set of 0..255; /// <summary> /// 数据集转二进制流类 /// </summary> TDBDatasetToBinary = class protected class procedure ColumnsToBinary(aDataSet: TDataSet;W: TFileBufferWriter;const Null: TSQLDBProxyStatementColumns;const ColTypes: TSQLDBFieldTypeDynArray); class function FetchAllToBinary(aDataSet: TDataSet

再探Delphi字符串

痞子三分冷 提交于 2019-11-30 17:59:54
闲来无事,又开始扒拉起Delphi的源码,这次发现一个比较有意思的函数 StringCodePage ,作用是返回传入字符串的 CodePage 。至于什么 CodePage ,暂且认为是字符编码吧。 先测试一把: var s1: AnsiString; s2: WideString; s3: UTF8String; cp1, cp2, cp3: Word; begin s1 := '123abc中国'; s2 := '123abc中国'; s3 := '123abc中国'; cp1 := StringCodePage(s1); //936 - GBK(简体中文) cp2 := StringCodePage(s2); //1200 - UCS-2LE Unicode 小端序 cp3 := StringCodePage(s3); //65001 - UTF-8 Unicode end; 来看下是怎么实现的: function StringCodePage(const S: UnicodeString): Word; overload; begin if S <> '' then Result := PWord(PByte(S) - 12)^ // StrRec.codePage else Result := Word(DefaultUnicodeCodePage); end;