text
stringlengths
14
6.51M
{ Role - Show Mouse-Over Item Connection Handle(연결자 표시) } unit ThItemConnection; interface uses System.Generics.Collections, GR32, ThTypes, ThItemHandle; type TThItemAnchorPoint = TThShapeHandle; TThItemAnchorPoints = class(TThCustomItemHandles, IThItemConnectionHandles) protected procedure Draw(Bitmap: TBitmap32; AScale, AOffset: TFloatPoint); procedure CreateHandles; override; procedure RealignHandles; override; public constructor Create(AParent: IThItem); override; end; implementation uses ThItem; constructor TThItemAnchorPoints.Create(AParent: IThItem); begin inherited; FFillColor := clGray32; FHotColor := clYellow32; end; procedure TThItemAnchorPoints.Draw(Bitmap: TBitmap32; AScale, AOffset: TFloatPoint); begin // Draw frame // Draw Anchor point DrawHandles(Bitmap, AScale, AOffset); end; procedure TThItemAnchorPoints.CreateHandles; const ANCHOR_HANDLES: array[0..3] of TShapeHandleDirection = ( shdTop, shdRight, shdBottom, shdLeft ); var I: Integer; begin SetLength(FHandles, Length(ANCHOR_HANDLES)); for I := Low(ANCHOR_HANDLES) to High(ANCHOR_HANDLES) do FHandles[I] := TThItemAnchorPoint.Create(ANCHOR_HANDLES[I], FRadius); end; procedure TThItemAnchorPoints.RealignHandles; function HandlePoint(R: TFloatRect; D: TShapeHandleDirection): TFloatPoint; var Center: TFloatPoint; begin Center.X := (R.Left+R.Right)/2; Center.Y := (R.Top+R.Bottom)/2; case D of shdTop: Result := FloatPoint(Center.X, R.Top); shdRight: Result := FloatPoint(R.Right, Center.Y); shdBottom: Result := FloatPoint(Center.X, R.Bottom); shdLeft: Result := FloatPoint(R.Left, Center.Y); end; end; var I: Integer; Shape: TThFaceShapeItem; begin Shape := TThFaceShapeItem(FParentItem); for I := Low(FHandles) to High(FHandles) do FHandles[I].Point := HandlePoint(Shape.Rect, TThItemAnchorPoint(FHandles[I]).Direction); end; end.
(* Hashing-Tabelle mit Chaining *) PROGRAM chain; CONST size = 10; TYPE NodePtr = ^Node; Node = RECORD key: STRING; (* DATA *) next : NodePtr; END; ListPtr = NodePtr; HashTable = ARRAY[0..size-1] OF ListPtr; VAR (* Globale Variable *) table : HashTable; (* Init Hash Table *) PROCEDURE InitHashTable; var i: INTEGER; BEGIN FOR i:=0 to size-1 do begin table[i] := nil; end; END; (* Generiert NewNode *) function NewNode(key : STRING; next: NodePtr): NodePtr; VAR n : NodePtr; BEGIN New(n); n^.key := key; n^.next := next; (* n^.data := data; *) NewNode := n; END; (* Generiert den HashCode *) FUNCTION HashCode(key : STRING) : INTEGER; BEGIN HashCode := Ord(key[1]) MOD size; END; (* Generiert den HashCode *) FUNCTION HashCode2(key : STRING) : INTEGER; BEGIN HashCode2 := (Ord(key[1])+ Length(key)) MOD size; END; (* Generiert den HashCode (KOMPILER) *) FUNCTION HashCode3(key : STRING) : INTEGER; BEGIN IF Length(key) = 1 then HashCode3 := (Ord(key[1])*7+ 1)*17 MOD size ELSE HashCode3 := (Ord(key[1])*7+ Ord(key[2]) + Length(key))*17 MOD size; END; (* Generiert den HashCode (JAVA) *) FUNCTION HashCode4(key : STRING) : INTEGER; VAR hc, i : INTEGER; BEGIN hc := 0; FOR i:=1 to Length(key) do begin {Q-} {R-} hc := 31* hc + Ord(key[i]); {R+} {Q+} end; HashCode4 := Abs(hc) Mod Size; END; (* Sucht und fügt ein und gibt den eingefügten Ptr zurück *) FUNCTION Lookup(key : STRING): NodePtr; Var h: INTEGER; n : NodePtr; BEGIN h := HashCode4(key); //writeln('Hash of ', key , ' is ', h ); n := table[h]; while (n <> nil) AND (n^.key <> key) do n := n^.next; If n = nil then begin n := NewNode(key, table[h]); table[h] := n; end; Lookup := n; END; (* Prints the HAshTable *) PROCEDURE PrintTable; VAR h : INTEGER; n : NodePtr; BEGIN FOR h := 0 to size -1 do begin if table[h] <> nil then begin write(h, ' : '); n := table[h]; while n <> nil do begin write(n^.key, ', '); n := n^.next; end; writeln; end; end; END; VAR n : NodePtr; BEGIN InitHashTable; n := Lookup('Auer'); n := Lookup('Daniel'); n := Lookup('Andi'); PrintTable; END.
unit UsbAspHW; {$mode objfpc}{$H+} interface uses Classes, SysUtils, basehw, libusb, usbhid, msgstr, utilfunc; type { TUsbAspHardware } TUsbAspHardware = class(TBaseHardware) private FDevOpened: boolean; FDevHandle: Pusb_dev_handle; FDeviceDescription: TDeviceDescription; FStrError: string; public constructor Create; destructor Destroy; override; function GetLastError: string; override; function DevOpen: boolean; override; procedure DevClose; override; function SendControllMessage(direction: byte; request, value, index, bufflen: integer; var buffer: array of byte): integer; //spi function SPIRead(CS: byte; BufferLen: integer; var buffer: array of byte): integer; override; function SPIWrite(CS: byte; BufferLen: integer; buffer: array of byte): integer; override; function SPIInit(speed: integer): boolean; override; procedure SPIDeinit; override; //I2C procedure I2CInit; override; procedure I2CDeinit; override; function I2CReadWrite(DevAddr: byte; WBufferLen: integer; WBuffer: array of byte; RBufferLen: integer; var RBuffer: array of byte): integer; override; procedure I2CStart; override; procedure I2CStop; override; function I2CReadByte(ack: boolean): byte; override; function I2CWriteByte(data: byte): boolean; override; //return ack //MICROWIRE function MWInit(speed: integer): boolean; override; procedure MWDeinit; override; function MWRead(CS: byte; BufferLen: integer; var buffer: array of byte): integer; override; function MWWrite(CS: byte; BitsWrite: byte; buffer: array of byte): integer; override; function MWIsBusy: boolean; override; end; implementation const USBASP_FUNC_GETCAPABILITIES = 127; USBASP_FUNC_DISCONNECT = 2; USBASP_FUNC_SETISPSCK = 10; USBASP_FUNC_25_CONNECT = 50; USBASP_FUNC_25_READ = 51; USBASP_FUNC_25_WRITE = 52; USBASP_FUNC_I2C_INIT = 70; USBASP_FUNC_I2C_READ = 71; USBASP_FUNC_I2C_WRITE = 72; USBASP_FUNC_I2C_START = 73; USBASP_FUNC_I2C_STOP = 74; USBASP_FUNC_I2C_READBYTE = 75; USBASP_FUNC_I2C_WRITEBYTE = 76; USBASP_FUNC_MW_READ = 92; USBASP_FUNC_MW_WRITE = 93; USBASP_FUNC_MW_BUSY = 94; constructor TUsbAspHardware.Create; begin FDevHandle := nil; FDeviceDescription.idPRODUCT := $05DC; FDeviceDescription.idVENDOR := $16C0; FHardwareName := 'UsbAsp'; FHardwareID := CHW_USBASP; end; destructor TUsbAspHardware.Destroy; begin DevClose; end; function TUsbAspHardware.GetLastError: string; begin result := usb_strerror; if UpCase(result) = 'NO ERROR' then result := FStrError; end; function TUsbAspHardware.DevOpen: boolean; var err: integer; buff : array[0..3] of byte; begin if FDevOpened then DevClose; FDevHandle := nil; FDevOpened := false; err := USBOpenDevice(FDevHandle, FDeviceDescription); if err <> 0 then begin case err of USBOPEN_ERR_ACCESS: FStrError := STR_CONNECTION_ERROR+ FHardwareName +'(Can''t access)'; USBOPEN_ERR_IO: FStrError := STR_CONNECTION_ERROR+ FHardwareName +'(I/O error)'; USBOPEN_ERR_NOTFOUND: FStrError := STR_CONNECTION_ERROR+ FHardwareName +'(Not found)'; end; Exit(false); end; //0=не поддерживается //1=урезана //2=полная USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_GETCAPABILITIES, 1, 0, 4, buff); //if buff[3] = 11 then result := 1; //if buff[3] = 1 then result := 2; if buff[3] = 0 then begin FStrError := STR_NO_EEPROM_SUPPORT; Exit(false); end; FDevOpened := true; Result := true; end; procedure TUsbAspHardware.DevClose; begin if FDevHandle <> nil then begin USB_Close(FDevHandle); FDevHandle := nil; FDevOpened := false; end; end; function TUsbAspHardware.SendControllMessage(direction: byte; request, value, index, bufflen: integer; var buffer: array of byte): integer; begin result := USBSendControlMessage(FDevHandle, direction, request, value, index, bufflen, buffer); end; //SPI___________________________________________________________________________ function TUsbAspHardware.SPIInit(speed: integer): boolean; var buff: byte; begin if not FDevOpened then Exit(false); buff := $FF; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_SETISPSCK, speed, 0, 1, buff); if buff <> 0 then begin FStrError := 'STR_SET_SPEED_ERROR'; Exit(false); end; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_25_CONNECT, 0, 0, 0, buff); Result := true; end; procedure TUsbAspHardware.SPIDeinit; var buff: byte; begin if not FDevOpened then Exit; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_DISCONNECT, 0, 0, 0, buff); end; function TUsbAspHardware.SPIRead(CS: byte; BufferLen: integer; var buffer: array of byte): integer; begin if not FDevOpened then Exit(-1); result := USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_25_READ, CS, 0, BufferLen, buffer); end; function TUsbAspHardware.SPIWrite(CS: byte; BufferLen: integer; buffer: array of byte): integer; begin if not FDevOpened then Exit(-1); result := USBSendControlMessage(FDevHandle, PC2USB, USBASP_FUNC_25_WRITE, CS, 0, BufferLen, buffer); end; //i2c___________________________________________________________________________ procedure TUsbAspHardware.I2CInit; var buff: byte; begin if not FDevOpened then Exit; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_I2C_INIT, 0, 0, 0, buff); end; procedure TUsbAspHardware.I2CDeinit; var buff: byte; begin if not FDevOpened then Exit; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_DISCONNECT, 0, 0, 0, buff); end; function TUsbAspHardware.I2CReadWrite(DevAddr: byte; WBufferLen: integer; WBuffer: array of byte; RBufferLen: integer; var RBuffer: array of byte): integer; var StopAfterWrite: byte; begin if not FDevOpened then Exit(-1); StopAfterWrite := 1; if WBufferLen > 0 then begin if RBufferLen > 0 then StopAfterWrite := 0; Result := USBSendControlMessage(FDevHandle, PC2USB, USBASP_FUNC_I2C_WRITE, DevAddr, StopAfterWrite, WBufferLen, WBuffer); end; if RBufferLen > 0 then Result := Result + USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_I2C_READ, DevAddr, 0, RBufferLen, RBuffer); end; procedure TUsbAspHardware.I2CStop; var dummy: byte; begin if not FDevOpened then Exit; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_I2C_STOP, 0, 0, 0, dummy); end; procedure TUsbAspHardware.I2CStart; var dummy: byte; begin if not FDevOpened then Exit; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_I2C_START, 0, 0, 0, dummy); end; function TUsbAspHardware.I2CWriteByte(data: byte): boolean; var ack: byte; begin ack := 0; if not FDevOpened then Exit; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_I2C_WRITEBYTE, data, 0, 1, ack); Result := Boolean(ack); end; function TUsbAspHardware.I2CReadByte(ack: boolean): byte; var data: byte; acknack: byte = 1; begin if not FDevOpened then Exit; if ack then acknack := 0; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_I2C_READBYTE, acknack, 0, 1, data); Result := data; end; //MICROWIRE_____________________________________________________________________ function TUsbAspHardware.MWInit(speed: integer): boolean; var buff: byte; begin if not FDevOpened then Exit(false); buff := $FF; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_SETISPSCK, speed, 0, 1, buff); if buff <> 0 then begin FStrError := 'STR_SET_SPEED_ERROR'; Exit(false); end; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_25_CONNECT, 0, 0, 0, buff); Result := true; end; procedure TUsbAspHardware.MWDeInit; var buff: byte; begin if not FDevOpened then Exit; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_DISCONNECT, 0, 0, 0, buff); end; function TUsbAspHardware.MWRead(CS: byte; BufferLen: integer; var buffer: array of byte): integer; begin if not FDevOpened then Exit(-1); result := USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_MW_READ, CS, 0, BufferLen, buffer); end; function TUsbAspHardware.MWWrite(CS: byte; BitsWrite: byte; buffer: array of byte): integer; var bytes: byte; begin if not FDevOpened then Exit(-1); bytes := ByteNum(BitsWrite); result := USBSendControlMessage(FDevHandle, PC2USB, USBASP_FUNC_MW_WRITE, CS, BitsWrite, bytes, buffer); if result = bytes then result := BitsWrite; end; function TUsbAspHardware.MWIsBusy: boolean; var buf: byte; begin buf := 0; result := False; USBSendControlMessage(FDevHandle, USB2PC, USBASP_FUNC_MW_BUSY, 0, 0, 1, buf); Result := Boolean(buf); end; end.
unit SDPartitionImage_File; interface uses Classes, SDPartitionImage, SDUGeneral, Windows; type EPartitionUnableToOpen = class (EPartitionError); TSDPartitionImage_File = class (TSDPartitionImage) PROTECTED FFilename: String; FFileHandle: THandle; FSize: ULONGLONG; PUBLIC constructor Create(); OVERRIDE; destructor Destroy(); OVERRIDE; function DoMount(): Boolean; OVERRIDE; procedure DoDismount(); OVERRIDE; function GetSize(): ULONGLONG; OVERRIDE; function ReadConsecutiveSectors(startSectorID: uint64; sectors: TStream; maxSize: Integer = -1): Boolean; OVERRIDE; function WriteConsecutiveSectors(startSectorID: uint64; sectors: TStream; maxSize: Integer = -1): Boolean; OVERRIDE; PUBLISHED property Filename: String Read FFilename Write FFilename; end; implementation uses Math, SDUClasses; constructor TSDPartitionImage_File.Create(); begin inherited; FFilename := ''; FFileHandle := INVALID_HANDLE_VALUE; FSize := 0; end; destructor TSDPartitionImage_File.Destroy(); begin inherited; end; function TSDPartitionImage_File.DoMount(): Boolean; begin FSize := SDUGetFileSize(Filename); FFileHandle := CreateFile(PChar(Filename), (GENERIC_READ or GENERIC_WRITE), //GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, // (FILE_FLAG_RANDOM_ACCES or FILE_FLAG_NO_BUFFERING) FILE_ATTRIBUTE_NORMAL, 0); if (FFileHandle = INVALID_HANDLE_VALUE) then begin raise EPartitionUnableToOpen.Create('Unable to open partition file'); end else begin Result := True; end; end; procedure TSDPartitionImage_File.DoDismount(); begin if (FFileHandle <> INVALID_HANDLE_VALUE) then begin CloseHandle(FFileHandle); FFileHandle := INVALID_HANDLE_VALUE; end; end; function TSDPartitionImage_File.ReadConsecutiveSectors(startSectorID: uint64; sectors: TStream; maxSize: Integer = -1): Boolean; var hs: THandleStream; useLength: Integer; begin // Short circuit... if (maxSize = 0) then begin Result := True; end else begin FSerializeCS.Acquire(); try hs := THandleStream.Create(FFileHandle); try useLength := SectorSize; if (maxSize > 0) then begin useLength := maxSize; end; hs.Position := (startSectorID * SectorSize); sectors.CopyFrom(hs, min(SectorSize, useLength)); finally hs.Free(); end; Result := True; finally FSerializeCS.Release(); end; end; end; function TSDPartitionImage_File.WriteConsecutiveSectors(startSectorID: uint64; sectors: TStream; maxSize: Integer = -1): Boolean; var hs: THandleStream; useLength: Integer; begin if ReadOnly then begin Result := False; end // Short circuit... else if (maxSize = 0) then begin Result := True; end else begin FSerializeCS.Acquire(); try hs := THandleStream.Create(FFileHandle); try useLength := SectorSize; if (maxSize > 0) then begin useLength := maxSize; end; hs.Position := (startSectorID * SectorSize); hs.CopyFrom(sectors, min(SectorSize, useLength)); finally hs.Free(); end; Result := True; finally FSerializeCS.Release(); end; end; end; function TSDPartitionImage_File.GetSize(): ULONGLONG; begin Result := FSize; end; end.
unit TestAppMain; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, System.Generics.Collections, AST.Pascal.Project, AST.Pascal.Parser, AST.Delphi.Classes, SynEdit, SynEditHighlighter, SynEditCodeFolding, SynHighlighterPas, AST.Delphi.Project, Vcl.ComCtrls, System.Types, Vcl.ExtCtrls, AST.Intf, AST.Parser.ProcessStatuses, Vcl.CheckLst, SynEditMiscClasses, SynEditSearch, AST.Parser.Messages, SynMemo; // system type TSourceFileInfo = record FullPath: string; DateModify: TDateTime; end; TSourcesDict = TDictionary<string, TSourceFileInfo>; TfrmTestAppMain = class(TForm) SynPasSyn1: TSynPasSyn; PageControl1: TPageControl; tsSource: TTabSheet; edUnit: TSynEdit; tsAST: TTabSheet; tvAST: TTreeView; Panel1: TPanel; tsNameSpace: TTabSheet; edAllItems: TSynEdit; Panel2: TPanel; Panel3: TPanel; Button3: TButton; Splitter1: TSplitter; lbFiles: TCheckListBox; Button4: TButton; chkbShowSysDecls: TCheckBox; chkbShowConstValues: TCheckBox; chkbShowAnonymous: TCheckBox; Splitter2: TSplitter; Panel4: TPanel; SynEditSearch1: TSynEditSearch; Panel5: TPanel; Button5: TButton; NSSearchEdit: TEdit; ErrMemo: TSynMemo; Panel6: TPanel; Label1: TLabel; edSrcRoot: TEdit; chkStopIfError: TCheckBox; chkCompileSsystemForASTParse: TCheckBox; chkParseAll: TCheckBox; Button1: TButton; Button2: TButton; chkShowWarnings: TCheckBox; procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Button5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); private { Private declarations } //fPKG: INPPackage; fFiles: TStringDynArray; fSettings: IASTProjectSettings; FStartedAt: TDateTime; procedure OnProgress(const Module: IASTModule; Status: TASTProcessStatusClass); procedure ShowAllItems(const Project: IASTDelphiProject); procedure ShowResult(const Project: IASTDelphiProject); procedure CompilerMessagesToStrings(const Project: IASTDelphiProject); public { Public declarations } procedure IndexSources(const RootPath: string; Dict: TSourcesDict); end; var frmTestAppMain: TfrmTestAppMain; implementation uses System.IOUtils, System.TypInfo, System.Rtti, AST.Delphi.System, AST.Delphi.Parser, AST.Classes, AST.Writer, AST.Targets, AST.Delphi.DataTypes, AST.Parser.Utils; {$R *.dfm} procedure TfrmTestAppMain.CompilerMessagesToStrings(const Project: IASTDelphiProject); var I: Integer; Msg: TCompilerMessage; begin ErrMemo.Lines.Add('==================================================================='); for i := 0 to Project.Messages.Count - 1 do begin Msg := Project.Messages[i]; if (Msg.MessageType >= cmtError) or chkShowWarnings.Checked then begin ErrMemo.Lines.AddStrings(Msg.AsString.Split([sLineBreak])); if Msg.MessageType = cmtError then begin ErrMemo.CaretY := ErrMemo.Lines.Count; ErrMemo.CaretX := Length(Msg.AsString) + 1; if Msg.UnitName = 'TestUnit.XXX' then begin edUnit.CaretX := Msg.Col; edUnit.CaretY := Msg.Row; if edUnit.CanFocus then edUnit.SetFocus; end; end; end; end; end; procedure ASTToTreeView2(ASTUnit: TASTDelphiUnit; TreeView: TTreeView); var WR: TASTWriter<TTreeView, TTreeNode>; begin TreeView.Items.Clear; WR := TASTWriter<TTreeView, TTreeNode>.Create(TreeView, ASTUnit, function (const Container: TTreeView; const RootNode: TTreeNode; const NodeText: string): TTreeNode begin Result := Container.Items.AddChild(RootNode, NodeText); end, procedure (const Node: TTreeNode; const ASTItem: TASTItem) begin Node.Text := ASTItem.DisplayName; end); try WR.Write(nil); finally WR.Free; end; TreeView.FullExpand; end; const ExcludePath = 'C:\Program Files (x86)\Embarcadero\Studio\19.0\source\DUnit\examples\'; procedure TfrmTestAppMain.IndexSources(const RootPath: string; Dict: TSourcesDict); var Files: TStringDynArray; i: Integer; FileName: string; FilePath: string; FileInfo: TSourceFileInfo; begin Files := TDirectory.GetFiles(RootPath, '*.inc', TSearchOption.soAllDirectories); for i := 0 to Length(Files) -1 do begin FilePath := ExtractFilePath(Files[i]); if Pos(ExcludePath, FilePath) >= Low(string) then Continue; FileInfo.FullPath := Files[i]; FileName := ExtractFileName(FileInfo.FullPath); try Dict.Add(FileName, FileInfo); except ErrMemo.Lines.Add(FileInfo.FullPath); ErrMemo.Lines.Add(Dict.Items[FileName].FullPath); end; end; end; function GetDeclName(const Decl: TASTDeclaration): string; begin try if Decl.Name <> '' then Result := Decl.DisplayName else Result := '[Anonymous]' + Decl.DisplayName; var CastedDecl := (Decl as TIDDeclaration); case CastedDecl.ItemType of itVar, itConst: Result := Result + ' : ' + CastedDecl.DataType.DisplayName; itType: Result := Result + ' [' + GetDataTypeName(TIDType(CastedDecl).DataTypeID) + ']'; end; except on E: Exception do Result := E.Message; end; end; procedure TfrmTestAppMain.Button1Click(Sender: TObject); var UN: TASTDelphiUnit; Prj: IASTDelphiProject; begin ErrMemo.Clear; FStartedAt := Now; Prj := TASTDelphiProject.Create('test'); Prj.AddUnitSearchPath(ExtractFilePath(Application.ExeName)); if chkCompileSsystemForASTParse.Checked then Prj.AddUnitSearchPath(edSrcRoot.Text); Prj.Target := TWINX86_Target.TargetName; Prj.Defines.Add('CPUX86'); Prj.Defines.Add('CPU386'); Prj.Defines.Add('WIN32'); Prj.Defines.Add('MSWINDOWS'); Prj.Defines.Add('ASSEMBLER'); Prj.Defines.Add('UNICODE'); Prj.OnProgress := OnProgress; Prj.StopCompileIfError := chkStopIfError.Checked; Prj.OnConsoleWrite := procedure (const Module: IASTModule; Line: Integer; const Msg: string) begin ErrMemo.Lines.Add(format('#console: [%s: %d]: %s', [Module.Name, Line, Msg])); end; UN := TASTDelphiUnit.Create(Prj, 'test', edUnit.Text); Prj.AddUnit(UN, nil); ShowResult(Prj); Prj.Clear; end; procedure TfrmTestAppMain.OnProgress(const Module: IASTModule; Status: TASTProcessStatusClass); begin //if Status = TASTStatusParseSuccess then ErrMemo.Lines.Add(Module.Name + ' : ' + Status.Name); end; procedure TfrmTestAppMain.ShowAllItems(const Project: IASTDelphiProject); begin edAllItems.BeginUpdate; try edAllItems.Clear; Project.EnumAllDeclarations( procedure(const Module: TASTModule; const Decl: TASTDeclaration) begin if not chkbShowAnonymous.Checked and (Decl.ID.Name = '') then Exit; if not chkbShowSysDecls.Checked and (Module.Name = 'system') then Exit; var Str := format('%s - %s.%s', [GetItemTypeName(TIDDeclaration(Decl).ItemType), Module.Name, GetDeclName(Decl)]); if chkbShowConstValues.Checked and (Decl is TIDConstant) then Str := Str + ' = ' + TIDConstant(Decl).AsString; edAllItems.Lines.Add(Str); Application.ProcessMessages; end); finally edAllItems.EndUpdate; end; end; procedure TfrmTestAppMain.ShowResult(const Project: IASTDelphiProject); begin var Msg := TStringList.Create; try var CResult := Project.Compile; if CResult = CompileSuccess then Msg.Add('compile success') else Msg.Add('compile fail'); Msg.Add(format('total units parsed: %d (interface only: %d)', [Project.TotalUnitsParsed, Project.TotalUnitsIntfOnlyParsed])); Msg.Add(format('total lines parsed: %d in %s', [Project.TotalLinesParsed, FormatDateTime('nn:ss.zzz', Now - FStartedAt)])); //ASTToTreeView2(UN, tvAST); ShowAllItems(Project); CompilerMessagesToStrings(Project); ErrMemo.Lines.AddStrings(Msg); finally Msg.Free; end; end; procedure TfrmTestAppMain.Button2Click(Sender: TObject); procedure AddDelphiUnits(var AUsesList: string; const APath: string); begin var LRtlSources := GetDirectoryFiles(edSrcRoot.Text + APath, '*.pas'); for var LPath in LRtlSources do begin var LUnitName := StringReplace(ExtractFileName(LPath), '.pas', '', [rfReplaceAll]); AUsesList := AddStringSegment(AUsesList, LUnitName, ','); end; end; var UN: TASTDelphiUnit; Prj: IASTDelphiProject; begin ErrMemo.Clear; FStartedAt := Now; Prj := TASTDelphiProject.Create('test'); Prj.AddUnitSearchPath(edSrcRoot.Text); Prj.Target := TWINX86_Target.TargetName; Prj.Defines.Add('CPUX86'); Prj.Defines.Add('CPU386'); Prj.Defines.Add('WIN32'); Prj.Defines.Add('MSWINDOWS'); Prj.Defines.Add('ASSEMBLER'); Prj.OnProgress := OnProgress; Prj.StopCompileIfError := chkStopIfError.Checked; Prj.CompileAll := chkParseAll.Checked; var LUsesUntis := ''; AddDelphiUnits(LUsesUntis, 'rtl\sys'); var RTLUsesSourceText := 'unit RTLParseTest; '#10#13 + 'interface'#10#13 + 'uses'#10#13 + LUsesUntis + ';'#10#13 + 'implementation'#10#13 + 'end.'; UN := TASTDelphiUnit.Create(Prj, 'RTLParseTest', RTLUsesSourceText); Prj.AddUnit(UN, nil); ShowResult(Prj); end; procedure TfrmTestAppMain.Button3Click(Sender: TObject); begin fFiles := TDirectory.GetFiles(edSrcRoot.Text, '*.pas', TSearchOption.soAllDirectories); lbFiles.Clear; lbFiles.Items.BeginUpdate; try for var i := 0 to Length(fFiles) - 1 do lbFiles.AddItem(ExtractRelativePath(edSrcRoot.Text, fFiles[i]), nil); lbFiles.CheckAll(cbChecked); finally lbFiles.Items.EndUpdate; end; end; procedure TfrmTestAppMain.Button4Click(Sender: TObject); var Msg: TStrings; Prj: IASTDelphiProject; CResult: TCompilerResult; begin ErrMemo.Clear; Prj := TASTDelphiProject.Create('test'); Prj.AddUnitSearchPath(edSrcRoot.Text); Prj.Target := TWINX86_Target.TargetName; Prj.Defines.Add('CPUX86'); Prj.Defines.Add('CPU386'); Prj.Defines.Add('MSWINDOWS'); Prj.Defines.Add('ASSEMBLER'); Prj.OnProgress := OnProgress; for var f in fFiles do Prj.AddUnit(f); Msg := TStringList.Create; try Msg.Add('==================================================================='); CResult := Prj.Compile; if CResult = CompileSuccess then Msg.Add('compile success') else Msg.Add('compile fail'); //ASTToTreeView2(UN, tvAST); edAllItems.BeginUpdate; try edAllItems.Clear; Prj.EnumIntfDeclarations( procedure(const Module: TASTModule; const Decl: TASTDeclaration) begin edAllItems.Lines.Add(format('%s - %s.%s', [GetItemTypeName(TIDDeclaration(Decl).ItemType), Module.Name, GetDeclName(Decl)])); Application.ProcessMessages; end); finally edAllItems.EndUpdate; end; CompilerMessagesToStrings(Prj); ErrMemo.Lines.AddStrings(Msg); finally Msg.Free; end; end; procedure TfrmTestAppMain.Button5Click(Sender: TObject); begin edAllItems.SearchReplace(NSSearchEdit.Text, '', []); end; procedure TfrmTestAppMain.FormClose(Sender: TObject; var Action: TCloseAction); begin TPooledObject.ClearPool; end; procedure TfrmTestAppMain.FormCreate(Sender: TObject); begin fSettings := TPascalProjectSettings.Create; end; end.
//============================================================================= // sgCamera.pas //============================================================================= // // The Camera unit is used to change the view port (ie the camera location.) // //============================================================================= /// SwinGame's Camera functionality can be used to create scrolling games where /// the camera moves around a virtual game world. Using the camera allows you to /// position and draw game elements using game world coordinates, and then to /// move the camera around within this game world. /// ///@module Camera ///@static unit sgCamera; //============================================================================= interface uses sgTypes; //============================================================================= //--------------------------------------------------------------------------- // Camera - position //--------------------------------------------------------------------------- /// Returns the x location of the camera in game coordinates. This represents /// the left most x value shown on the screen, with the right of the screen /// being at `CameraX` + `ScreenWidth`. /// /// @lib /// /// @class Camera /// @getter X /// @static function CameraX(): Single; /// Returns the y location of the camera in game coordinates. This represents /// the stop most y value shown on the screen, with bottom of screen being /// at `CameraY` + `ScreenHeight`. /// /// @lib /// /// @class Camera /// @getter Y /// @static function CameraY(): Single; /// Returns the current camera position in world coordinates. This is the top /// left hand corner of the screen. /// /// @lib /// /// @class Camera /// @getter Position /// @static function CameraPos(): Point2D; /// Change the X position of the camera to a specified world coordinate. This /// will then be the new left most position of the screen within the world. /// /// @lib /// /// @class Camera /// @setter X /// @static procedure SetCameraX(x: Single); /// Change the Y position of the camera to a specified world coordinate. This /// will then be the new top most position of the screen within the world. /// /// @lib /// /// @class Camera /// @setter Y /// @static procedure SetCameraY(y: Single); /// Change the position of the camera to a specified world coordinate. This /// will then be the new top left most position of the screen within the world. /// /// @lib /// /// @class Camera /// @setter Position /// @static procedure SetCameraPos(const pt: Point2D); //--------------------------------------------------------------------------- // Camera - movement //--------------------------------------------------------------------------- /// Move the camera (offset its world x and y values) using the specified /// vector. For example, if you move the camera by the same speed vector of /// a sprite the camera will "track" (be locked on to) the sprite as it moves. /// /// @param offset The offset vector to move the camera world position by. /// @lib procedure MoveCameraBy(const offset: Vector); overload; /// Move the camera (offset its world x and y values) using the specified /// dx (change in x) and dy (change in x) values. /// /// @param dx the amount of x axis offset to apply /// @param dy the amount of x axis offset to apply /// /// @lib MoveCameraByXY /// @sn moveCameraByX:%s y:%s procedure MoveCameraBy(dx, dy: Single); overload; /// Move the camera view to a world location specified by the x and y values. /// This will be the new top left corner of the screen. /// /// @param x The world x axis value to move the camera to. /// @param y The world y axis value to move the camera to /// /// @lib MoveCameraToXY /// @sn moveCaneraToX:%s y:%s procedure MoveCameraTo(x, y: Single); overload; /// Move the camera view to a world location specified as a Point2D. /// This will be the new top left corner of the screen. /// /// @param pt The point to move the camera view to. /// @lib /// @sn moveCameraTo:%s procedure MoveCameraTo(const pt: Point2D); overload; //--------------------------------------------------------------------------- // Camera - sprite tracking //--------------------------------------------------------------------------- /// Set the camera view to be centered over the specified sprite, with an /// offset from the center of the sprite if needed. The sprites size (width /// and height) are taken into account. Use x and y offset of 0.0 if you want /// the camera to be exaclty over the center of the sprite. /// /// @param s The sprite to center the camera on /// @param offsetX The amount of x axis offset for the camaera to use /// @param offsetY The amount of y axis offset for the camaera to use /// @lib CenterCameraOnWithXYOffset /// /// @sn centerCameraOnSprite:%s offsetX:%s offsetY:%s /// /// @class Sprite /// @overload CenterCamera CenterCameraOffsetXY /// @csn centerCameraOffsetX:%s offsetY:%s procedure CenterCameraOn(s: Sprite; offsetX, offsetY: Single); overload; /// Set the camera view to be centered over the specific sprite. The offset /// vector allows you to move the sprite from the direct center of the screen. /// /// @param offset The amount of offset from sprite center for the camera to use. /// @lib /// /// @sn centerCameraOnSprite:%s offset:%s /// /// @class Sprite /// @method CenterCamera /// @csn centerCameraOffset:%s procedure CenterCameraOn(s: Sprite; const offset: Vector); overload; //--------------------------------------------------------------------------- // World-To-Screen Translation //--------------------------------------------------------------------------- /// Translate a world x value to the current screen x value which is based on /// the camera position. /// /// @param worldX The world x value to be translated /// @returns The translated screen x value /// @lib function ToScreenX(worldX: Single): Single; /// Translate a world y value to the current screen y value set by the camera. /// /// @param worldY The world y value to be converted /// @returns A screen y value /// @lib function ToScreenY(worldY: Single): Single; /// Translate a Point2D from world coordinates to screen coordinates. /// /// @param worldPoint The screen coordinate to translate /// @returns A screen coordinate point /// @lib ToScreen function ToScreen(const worldPoint: Point2D): Point2D; overload; /// Translate the points in a rectangle to screen coordinates. This can /// be used to indicate the screen area used by a rectangle in game /// coordinates. /// /// @lib ToScreenRect function ToScreen(const rect: Rectangle): Rectangle; overload; //--------------------------------------------------------------------------- // Screen-To-World Translation //--------------------------------------------------------------------------- /// Translate a screen x value (based on the camera) to a world x value /// /// @param screenX The current screen x value to be converted /// @returns A world x value /// @lib function ToWorldX(screenX: Single) : Single; /// Translate a screen y value (based on the camera) to a world y value /// /// @param screenY The current screen y value to be converted /// @returns A world y value /// @lib function ToWorldY(screenY: Single) : Single; /// Translate a Point2D from screen coordinates to world coordinates. /// /// @param screenPoint The screen coordinate to translate /// @returns A world coordinate point /// @lib function ToWorld(const screenPoint: Point2D): Point2D; //--------------------------------------------------------------------------- // Screen tests //--------------------------------------------------------------------------- /// Tests if the point pt is on the screen. /// /// @lib PointOnScreen function PointOnScreen(const pt: Point2D): Boolean; overload; /// Tests if the rectangle rect is on the screen. /// /// @lib RectOnScreen function RectOnScreen(const rect: Rectangle): Boolean; overload; //============================================================================= implementation uses sgTrace, SysUtils, sgGraphics, sgGeometry, sgSprites, sgShared, sgImages, sgWindowManager; //============================================================================= var _cameraX: Single; _cameraY: Single; //--------------------------------------------------------------------------- // Camera - position //--------------------------------------------------------------------------- function CameraX(): Single; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'CameraX(): Single', ''); {$ENDIF} result := _cameraX; {$IFDEF TRACE} TraceExit('sgCamera', 'CameraX(): Single', ''); {$ENDIF} end; function CameraY(): Single; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'CameraY(): Single', ''); {$ENDIF} result := _cameraY; {$IFDEF TRACE} TraceExit('sgCamera', 'CameraY(): Single', ''); {$ENDIF} end; function CameraPos(): Point2D; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'CameraPos(): Point2D', ''); {$ENDIF} result.x := _cameraX; result.y := _cameraY; {$IFDEF TRACE} TraceExit('sgCamera', 'CameraPos(): Point2D', ''); {$ENDIF} end; procedure SetCameraX(x: Single); begin {$IFDEF TRACE} TraceEnter('sgCamera', 'SetCameraX(x: Single)', ''); {$ENDIF} _cameraX := x; {$IFDEF TRACE} TraceExit('sgCamera', 'SetCameraX(x: Single)', ''); {$ENDIF} end; procedure SetCameraY(y: Single); begin {$IFDEF TRACE} TraceEnter('sgCamera', 'SetCameraY(y: Single)', ''); {$ENDIF} _cameraY := y; {$IFDEF TRACE} TraceExit('sgCamera', 'SetCameraY(y: Single)', ''); {$ENDIF} end; procedure SetCameraPos(const pt: Point2D); begin {$IFDEF TRACE} TraceEnter('sgCamera', 'SetCameraPos(const pt: Point2D)', ''); {$ENDIF} _cameraX := pt.x; _cameraY := pt.y; {$IFDEF TRACE} TraceExit('sgCamera', 'SetCameraPos(const pt: Point2D)', ''); {$ENDIF} end; //--------------------------------------------------------------------------- // Camera - movement //--------------------------------------------------------------------------- procedure MoveCameraBy(const offset: Vector); overload; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'MoveCameraBy(const offset: Vector)', ''); {$ENDIF} _cameraX := _cameraX + offset.x; _cameraY := _cameraY + offset.y; {$IFDEF TRACE} TraceExit('sgCamera', 'MoveCameraBy(const offset: Vector)', ''); {$ENDIF} end; procedure MoveCameraBy(dx, dy: Single); overload; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'MoveCameraBy(dx, dy: Single)', ''); {$ENDIF} _cameraX := _cameraX + dx; _cameraY := _cameraY + dy; {$IFDEF TRACE} TraceExit('sgCamera', 'MoveCameraBy(dx, dy: Single)', ''); {$ENDIF} end; procedure MoveCameraTo(x, y: Single); overload; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'MoveCameraTo(x, y: Single)', ''); {$ENDIF} _cameraX := x; _cameraY := y; {$IFDEF TRACE} TraceExit('sgCamera', 'MoveCameraTo(x, y: Single)', ''); {$ENDIF} end; procedure MoveCameraTo(const pt: Point2D); overload; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'MoveCameraTo(const pt: Point2D)', ''); {$ENDIF} _cameraX := pt.x; _cameraY := pt.y; {$IFDEF TRACE} TraceExit('sgCamera', 'MoveCameraTo(const pt: Point2D)', ''); {$ENDIF} end; //--------------------------------------------------------------------------- // Camera - Sprite tracking //--------------------------------------------------------------------------- procedure CenterCameraOn(s: Sprite; offsetX, offsetY: Single); var center: Point2D; scX, scY: Single; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'CenterCameraOn(s: Sprite', ''); {$ENDIF} if s = nil then begin RaiseException('CenterCameraOn requires a target sprite. No sprite was provided (nil supplied)'); exit; end; center := CenterPoint(s); scX := center.x + offsetX - (ScreenWidth() / 2); scY := center.y + offsetY - (ScreenHeight() / 2); MoveCameraTo(scX, scY); {$IFDEF TRACE} TraceExit('sgCamera', 'CenterCameraOn(s: Sprite', ''); {$ENDIF} end; procedure CenterCameraOn(s: Sprite; const offset: Vector); overload; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'CenterCameraOn(s: Sprite', ''); {$ENDIF} CenterCameraOn(s, offset.x, offset.y); {$IFDEF TRACE} TraceExit('sgCamera', 'CenterCameraOn(s: Sprite', ''); {$ENDIF} end; //--------------------------------------------------------------------------- // World-To-Screen Translation //--------------------------------------------------------------------------- function ToScreenX(worldX: Single): Single; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'ToScreenX(worldX: Single): Single', ''); {$ENDIF} result := worldX - _cameraX; {$IFDEF TRACE} TraceExit('sgCamera', 'ToScreenX(worldX: Single): Single', ''); {$ENDIF} end; function ToScreenY(worldY: Single): Single; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'ToScreenY(worldY: Single): Single', ''); {$ENDIF} result := worldY - _cameraY; {$IFDEF TRACE} TraceExit('sgCamera', 'ToScreenY(worldY: Single): Single', ''); {$ENDIF} end; function ToScreen(const worldPoint: Point2D): Point2D; overload; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'ToScreen(const worldPoint: Point2D): Point2D', ''); {$ENDIF} result.x := _cameraX - worldPoint.x; result.y := _cameraY - worldPoint.y; {$IFDEF TRACE} TraceExit('sgCamera', 'ToScreen(const worldPoint: Point2D): Point2D', ''); {$ENDIF} end; function ToScreen(const rect: Rectangle): Rectangle; overload; begin result.x := ToScreenX(rect.x); result.y := ToScreenY(rect.y); result.width := rect.width; result.height := rect.height; end; //--------------------------------------------------------------------------- // Screen-To-World Translation //--------------------------------------------------------------------------- function ToWorldX(screenX: Single) : Single; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'ToWorldX(screenX: Single) : Single', ''); {$ENDIF} result := screenX + _cameraX; {$IFDEF TRACE} TraceExit('sgCamera', 'ToWorldX(screenX: Single) : Single', ''); {$ENDIF} end; function ToWorldY(screenY: Single) : Single; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'ToWorldY(screenY: Single) : Single', ''); {$ENDIF} result := screenY + _cameraY; {$IFDEF TRACE} TraceExit('sgCamera', 'ToWorldY(screenY: Single) : Single', ''); {$ENDIF} end; function ToWorld(const screenPoint: Point2D): Point2D; begin {$IFDEF TRACE} TraceEnter('sgCamera', 'ToWorld(const screenPoint: Point2D): Point2D', ''); {$ENDIF} result.x := screenPoint.x + _cameraX; result.y := screenPoint.y + _cameraY; {$IFDEF TRACE} TraceExit('sgCamera', 'ToWorld(const screenPoint: Point2D): Point2D', ''); {$ENDIF} end; //--------------------------------------------------------------------------- // Screen tests //--------------------------------------------------------------------------- function PointOnScreen(const pt: Point2D): Boolean; overload; var scrPt: Point2D; begin scrPt := ToScreen(pt); result := not ((scrPt.x < 0) or (scrPt.y < 0) or (scrPt.x >= ScreenWidth()) or (scrPt.y >= ScreenHeight())); end; function RectOnScreen(const rect: Rectangle): Boolean; overload; begin if Assigned(_CurrentWindow) then result := RectanglesIntersect(ToScreen(rect), _CurrentWindow^.screenRect); end; //============================================================================= initialization begin InitialiseSwinGame(); end; end.
//********************************************************************************************************************** // $Id: udAbout.pas,v 1.8 2006-08-23 15:19:11 dale Exp $ //---------------------------------------------------------------------------------------------------------------------- // DKLang Translation Editor // Copyright ęDK Software, http://www.dk-soft.org/ //********************************************************************************************************************** unit udAbout; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DKLTranEdFrm, DKLang, StdCtrls, TntStdCtrls, ExtCtrls; type TdAbout = class(TDKLTranEdForm) dklcMain: TDKLanguageController; iMain: TImage; lEmail: TTntLabel; lEmailTitle: TTntLabel; lOK: TTntLabel; lVersion: TTntLabel; lWebsite: TTntLabel; lWebsiteTitle: TTntLabel; procedure FormCreate(Sender: TObject); procedure FormKeyPress(Sender: TObject; var Key: Char); procedure lEmailClick(Sender: TObject); procedure lOKClick(Sender: TObject); procedure lWebsiteClick(Sender: TObject); private procedure ApplyWindowRgn; procedure Fadeout; procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST; protected procedure DoCreate; override; end; procedure ShowAbout; implementation {$R *.dfm} uses ShellAPI, dkWebUtils, ConsVars; procedure ShowAbout; begin with TdAbout.Create(Application) do try lWebsite.Caption := DKWeb.MainSiteURI; lEmail.Caption := SAppEmail; ShowModal; finally Free; end; end; procedure TdAbout.ApplyWindowRgn; type PRGB = ^TRGB; TRGB = packed record bB, bG, bR: Byte; end; var hr, _hr: HRGN; ih, iw, ixL, ixR, iy: Integer; p: PRGB; // Returns True if a pixel refers to the transparent color function IsTransparent(p: PRGB): Boolean; begin // Assume yellow ($00ffff) to be a transparent color Result := (p.bR=$ff) and (p.bG=$ff) and (p.bB=$00); end; begin iw := iMain.Picture.Bitmap.Width; ih := iMain.Picture.Bitmap.Height; hr := CreateRectRgn(0, 0, iw, ih); iMain.Picture.Bitmap.PixelFormat := pf24bit; ixR := 0; // satisfy the compiler // Loop through bitmap rows for iy := 0 to ih-1 do begin p := iMain.Picture.Bitmap.ScanLine[iy]; ixL := 0; repeat // Look for beginning of transparent area while (ixL<=iw) and not IsTransparent(p) do begin Inc(ixL); Inc(p); end; if ixL<=iw then begin // Look for ending of transparent area ixR := ixL; while (ixR<=iw) and IsTransparent(p) do begin Inc(ixR); Inc(p); end; // Subtract the transparent region if ixL<ixR then begin _hr := CreateRectRgn(ixL, iy, ixR, iy+1); CombineRgn(hr, hr, _hr, RGN_DIFF); DeleteObject(_hr); end; ixL := ixR; end else Break; until ixR>=iw; end; // Apply the region SetWindowRgn(Handle, hr, False); end; procedure TdAbout.DoCreate; begin inherited DoCreate; // Initialize help context ID HelpContext := IDH_iface_dlg_about; end; procedure TdAbout.Fadeout; var b: Byte; begin // Enable fadeout effect on Win2K+ if (Win32Platform=VER_PLATFORM_WIN32_NT) and (Win32MajorVersion>=5) then begin AlphaBlend := True; Update; for b := 12 downto 1 do begin AlphaBlendValue := b*20; Sleep(20); end; end; Close; end; procedure TdAbout.FormCreate(Sender: TObject); begin ApplyWindowRgn; lVersion.Caption := SAppVersion; end; procedure TdAbout.FormKeyPress(Sender: TObject; var Key: Char); begin if Key in [#13, #27] then Fadeout; end; procedure TdAbout.lEmailClick(Sender: TObject); begin ShellExecute(Handle, 'open', PChar('mailto:'+SAppEmail), nil, nil, SW_SHOWNORMAL); end; procedure TdAbout.lOKClick(Sender: TObject); begin Fadeout; end; procedure TdAbout.lWebsiteClick(Sender: TObject); begin DKWeb.Open_Index; end; procedure TdAbout.WMNCHitTest(var Msg: TWMNCHitTest); var c: TControl; begin c := ControlAtPos(ScreenToClient(Point(Msg.XPos, Msg.YPos)), False); if (c<>nil) and (c is TTntLabel) and (TTntLabel(c).Cursor=crHandPoint) then inherited else Msg.Result := HTCAPTION; end; end.
(* Category: SWAG Title: SORTING ROUTINES Original name: 0009.PAS Description: Elevator Sort Author: PEDRO DUARTE Date: 05-28-93 13:57 *) { > Thanks For the code... It worked great! BTW, why are there so many > different sorting methods? Quick, bubble, Radix.. etc, etc Yes, there are lots of sorting algorithms out there! I also found this out the hard way! :-) A couple of years ago, I only knew the so-called "bubble" sort, and decided to create my own sorting algorithm. It would have to be faster than bubble, yet remaining small, simple, and not memory hungry. and I did it, but only to find out a few weeks later that there were much better sorts than the one I created... But it sure was great fun beating bubble! (which is brain-dead anyway! ;-) So here it is, my two cents to the history of sorting algorithms, the amazing, blazingly fast (*)... ELEVAtoR SorT!... Why ELEVAtoR??, you ask in unison! Because it keeps going up & down! :-) } Program mysort; Uses Crt; Const max = 1000; Type list = Array[1..max] of Word; Var data : list; dummy : Word; Procedure elevatorsort(Var a: list; hi: Word); Var lo, peak, temp, temp2 : Word; begin peak := 1; lo := 1; Repeat temp := a[lo]; temp2 := a[lo + 1]; if temp > temp2 then begin a[lo] := temp2; a[lo + 1] := temp; if lo <> 1 then dec(lo); end else begin inc(peak); lo:=peak; end; Until lo = hi; end; begin ClrScr; Writeln('Generating ', max ,' random numbers...'); randomize; For dummy:=1 to max do data[dummy]:=random(65535); Writeln('Sorting random numbers...'); elevatorsort(data,max); For dummy:=1 to max do Write(data[dummy]:5,' '); end. { (*) it's speed lies somewhere between "BUBBLE" and "inSERT"; it's much faster than "BUBBLE", and a little slower than "inSERT"... :-) }
unit UDTextObjects; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Buttons, UCrpe32; type TCrpeTextObjectsDlg = class(TForm) pnlTextObjects: TPanel; lblNumber: TLabel; lbNumbers: TListBox; editCount: TEdit; lblCount: TLabel; GroupBox1: TGroupBox; btnBorder: TButton; btnFont: TButton; btnFormat: TButton; editTop: TEdit; lblTop: TLabel; lblLeft: TLabel; editLeft: TEdit; lblSection: TLabel; editWidth: TEdit; lblWidth: TLabel; lblHeight: TLabel; editHeight: TEdit; cbSection: TComboBox; btnOk: TButton; btnClear: TButton; FontDialog1: TFontDialog; memoLines: TMemo; lblLines: TLabel; rgUnits: TRadioGroup; btnEmbeddedFields: TButton; btnParagraphs: TButton; editTextSize: TEdit; lblTextSize: TLabel; lblTextHeight: TLabel; editTextHeight: TEdit; btnInsertText: TButton; btnDeleteText: TButton; btnInsertFile: TButton; OpenDialog1: TOpenDialog; procedure btnClearClick(Sender: TObject); procedure lbNumbersClick(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure UpdateTextObjects; procedure btnOkClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure btnFontClick(Sender: TObject); procedure editSizeEnter(Sender: TObject); procedure editSizeExit(Sender: TObject); procedure cbSectionChange(Sender: TObject); procedure btnBorderClick(Sender: TObject); procedure InitializeControls(OnOff: boolean); procedure rgUnitsClick(Sender: TObject); procedure memoLinesExit(Sender: TObject); procedure btnEmbeddedFieldsClick(Sender: TObject); procedure btnParagraphsClick(Sender: TObject); procedure btnFormatClick(Sender: TObject); procedure btnInsertFileClick(Sender: TObject); procedure btnInsertTextClick(Sender: TObject); procedure btnDeleteTextClick(Sender: TObject); private { Private declarations } public { Public declarations } Cr : TCrpe; TIndex : integer; PrevSize : string; OpenDir : string; end; var CrpeTextObjectsDlg : TCrpeTextObjectsDlg; bTextObjects : boolean; implementation {$R *.DFM} uses UCrpeUtl, UDBorder, UDFormat, UDParagraphs, UDEmbeddedFields, UDFormulaEdit, UDTODeleteText, UDFont; {------------------------------------------------------------------------------} { FormCreate } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.FormCreate(Sender: TObject); begin bTextObjects := True; LoadFormPos(Self); btnOk.Tag := 1; TIndex := -1; end; {------------------------------------------------------------------------------} { FormShow } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.FormShow(Sender: TObject); begin OpenDir := ExtractFilePath(Application.ExeName); UpdateTextObjects; end; {------------------------------------------------------------------------------} { UpdateTextObjects } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.UpdateTextObjects; var OnOff : boolean; i : integer; begin TIndex := -1; {Enable/Disable controls} if IsStrEmpty(Cr.ReportName) then OnOff := False else begin OnOff := (Cr.TextObjects.Count > 0); {Get TextObjects Index} if OnOff then begin if Cr.TextObjects.ItemIndex > -1 then TIndex := Cr.TextObjects.ItemIndex else TIndex := 0; end; end; InitializeControls(OnOff); {Update list box} if OnOff then begin {Fill Section ComboBox} cbSection.Clear; cbSection.Items.AddStrings(Cr.SectionFormat.Names); {Fill Numbers ListBox} for i := 0 to Cr.TextObjects.Count - 1 do lbNumbers.Items.Add(IntToStr(i)); editCount.Text := IntToStr(Cr.TextObjects.Count); lbNumbers.ItemIndex := TIndex; lbNumbersClick(Self); end; end; {------------------------------------------------------------------------------} { InitializeControls } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.InitializeControls(OnOff: boolean); var i : integer; begin {Enable/Disable the Form Controls} for i := 0 to ComponentCount - 1 do begin if TComponent(Components[i]).Tag = 0 then begin if Components[i] is TButton then TButton(Components[i]).Enabled := OnOff; if Components[i] is TRadioGroup then TRadioGroup(Components[i]).Enabled := OnOff; if Components[i] is TComboBox then begin TComboBox(Components[i]).Color := ColorState(OnOff); TComboBox(Components[i]).Enabled := OnOff; end; if Components[i] is TListBox then begin TListBox(Components[i]).Clear; TListBox(Components[i]).Color := ColorState(OnOff); TListBox(Components[i]).Enabled := OnOff; end; if Components[i] is TMemo then begin TMemo(Components[i]).Clear; TMemo(Components[i]).Color := ColorState(OnOff); TMemo(Components[i]).Enabled := OnOff; end; if Components[i] is TEdit then begin TEdit(Components[i]).Text := ''; if TEdit(Components[i]).ReadOnly = False then TEdit(Components[i]).Color := ColorState(OnOff); TEdit(Components[i]).Enabled := OnOff; end; end; end; end; {------------------------------------------------------------------------------} { lbNumbersClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.lbNumbersClick(Sender: TObject); begin TIndex := lbNumbers.ItemIndex; memoLines.Lines.Assign(Cr.TextObjects[TIndex].Lines); editTextSize.Text := IntToStr(Cr.TextObjects.Item.TextSize); editTextHeight.Text := IntToStr(Cr.TextObjects.Item.TextHeight); {Formatting} cbSection.ItemIndex := Cr.SectionFormat.IndexOf(Cr.TextObjects.Item.Section); rgUnitsClick(Self); end; {------------------------------------------------------------------------------} { memoLinesExit } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.memoLinesExit(Sender: TObject); begin Cr.TextObjects.Item.Lines.Assign(memoLines.Lines); end; {------------------------------------------------------------------------------} { btnEmbeddedFieldsClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnEmbeddedFieldsClick(Sender: TObject); begin CrpeEmbeddedFieldsDlg := TCrpeEmbeddedFieldsDlg.Create(Application); CrpeEmbeddedFieldsDlg.Cr := Cr; CrpeEmbeddedFieldsDlg.CursorPos := memoLines.SelStart; CrpeEmbeddedFieldsDlg.ShowModal; UpdateTextObjects; end; {------------------------------------------------------------------------------} { btnParagraphsClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnParagraphsClick(Sender: TObject); begin CrpeParagraphsDlg := TCrpeParagraphsDlg.Create(Application); CrpeParagraphsDlg.Crp := Cr.TextObjects.Item.Paragraphs; CrpeParagraphsDlg.ShowModal; UpdateTextObjects; end; {------------------------------------------------------------------------------} { rgUnitsClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.rgUnitsClick(Sender: TObject); begin if rgUnits.ItemIndex = 0 then {inches} begin editTop.Text := TwipsToInchesStr(Cr.TextObjects.Item.Top); editLeft.Text := TwipsToInchesStr(Cr.TextObjects.Item.Left); editWidth.Text := TwipsToInchesStr(Cr.TextObjects.Item.Width); editHeight.Text := TwipsToInchesStr(Cr.TextObjects.Item.Height); end else {twips} begin editTop.Text := IntToStr(Cr.TextObjects.Item.Top); editLeft.Text := IntToStr(Cr.TextObjects.Item.Left); editWidth.Text := IntToStr(Cr.TextObjects.Item.Width); editHeight.Text := IntToStr(Cr.TextObjects.Item.Height); end; end; {------------------------------------------------------------------------------} { editSizeEnter } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.editSizeEnter(Sender: TObject); begin if Sender is TEdit then PrevSize := TEdit(Sender).Text; end; {------------------------------------------------------------------------------} { editSizeExit } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.editSizeExit(Sender: TObject); begin if rgUnits.ItemIndex = 0 then {inches} begin if not IsFloating(TEdit(Sender).Text) then TEdit(Sender).Text := PrevSize else begin if TEdit(Sender).Name = 'editTop' then Cr.TextObjects.Item.Top := InchesStrToTwips(TEdit(Sender).Text); if TEdit(Sender).Name = 'editLeft' then Cr.TextObjects.Item.Left := InchesStrToTwips(TEdit(Sender).Text); if TEdit(Sender).Name = 'editWidth' then Cr.TextObjects.Item.Width := InchesStrToTwips(TEdit(Sender).Text); if TEdit(Sender).Name = 'editHeight' then Cr.TextObjects.Item.Height := InchesStrToTwips(TEdit(Sender).Text); UpdateTextObjects; {this will truncate any decimals beyond 3 places} end; end else {twips} begin if not IsNumeric(TEdit(Sender).Text) then TEdit(Sender).Text := PrevSize else begin if TEdit(Sender).Name = 'editTop' then Cr.TextObjects.Item.Top := StrToInt(TEdit(Sender).Text); if TEdit(Sender).Name = 'editLeft' then Cr.TextObjects.Item.Left := StrToInt(TEdit(Sender).Text); if TEdit(Sender).Name = 'editWidth' then Cr.TextObjects.Item.Width := StrToInt(TEdit(Sender).Text); if TEdit(Sender).Name = 'editHeight' then Cr.TextObjects.Item.Height := StrToInt(TEdit(Sender).Text); end; end; end; {------------------------------------------------------------------------------} { cbSectionChange } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.cbSectionChange(Sender: TObject); begin Cr.TextObjects.Item.Section := cbSection.Items[cbSection.ItemIndex]; end; {------------------------------------------------------------------------------} { btnBorderClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnBorderClick(Sender: TObject); begin CrpeBorderDlg := TCrpeBorderDlg.Create(Application); CrpeBorderDlg.Border := Cr.TextObjects.Item.Border; CrpeBorderDlg.ShowModal; end; {------------------------------------------------------------------------------} { btnFontClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnFontClick(Sender: TObject); begin if Cr.Version.Crpe.Major > 7 then begin CrpeFontDlg := TCrpeFontDlg.Create(Application); CrpeFontDlg.Crf := Cr.TextObjects.Item.Font; CrpeFontDlg.ShowModal; end else begin FontDialog1.Font.Assign(Cr.TextObjects.Item.Font); if FontDialog1.Execute then Cr.TextObjects.Item.Font.Assign(FontDialog1.Font); end; end; {------------------------------------------------------------------------------} { btnFormatClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnFormatClick(Sender: TObject); begin CrpeFormatDlg := TCrpeFormatDlg.Create(Application); CrpeFormatDlg.Format := Cr.TextObjects.Item.Format; CrpeFormatDlg.ShowModal; end; {------------------------------------------------------------------------------} { btnInsertFileClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnInsertFileClick(Sender: TObject); var prevCursor : TCursor; begin {Set the dialog default filename, filter and title} OpenDialog1.FileName := '*.*'; OpenDialog1.Filter := 'Text File (*.*)|*.*'; OpenDialog1.Title := 'Choose Text File to Insert...'; OpenDialog1.InitialDir := OpenDir; if OpenDialog1.Execute then begin prevCursor := Screen.Cursor; Screen.Cursor := crHourglass; Refresh; OpenDir := ExtractFilePath(OpenDialog1.FileName); Cr.TextObjects.Item.InsertFile(OpenDialog1.FileName, memoLines.SelStart); UpdateTextObjects; Screen.Cursor := prevCursor; end; end; {------------------------------------------------------------------------------} { btnInsertTextClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnInsertTextClick(Sender: TObject); var sList : TStringList; prevCursor : TCursor; begin sList := TStringList.Create; try {Create the Formula editing form} CrpeFormulaEditDlg := TCrpeFormulaEditDlg.Create(Application); CrpeFormulaEditDlg.SenderList := sList; CrpeFormulaEditDlg.Caption := 'Type Text to Insert'; CrpeFormulaEditDlg.ShowModal; if CrpeFormulaEditDlg.ModalResult = mrOk then begin prevCursor := Screen.Cursor; Screen.Cursor := crHourglass; Refresh; Cr.TextObjects.Item.InsertText(sList, memoLines.SelStart); UpdateTextObjects; Screen.Cursor := prevCursor; end; finally sList.Free; end; end; {------------------------------------------------------------------------------} { btnDeleteTextClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnDeleteTextClick(Sender: TObject); begin CrpeDeleteTextDlg := TCrpeDeleteTextDlg.Create(Application); CrpeDeleteTextDlg.Cr := Cr; CrpeDeleteTextDlg.ShowModal; if CrpeDeleteTextDlg.ModalResult = mrOk then UpdateTextObjects; end; {------------------------------------------------------------------------------} { btnClearClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnClearClick(Sender: TObject); begin Cr.TextObjects.Item.Clear; UpdateTextObjects; end; {------------------------------------------------------------------------------} { btnOkClick } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.btnOkClick(Sender: TObject); begin rgUnits.ItemIndex := 1; {change to twips to avoid the UpdateTextObjects call} if (not IsStrEmpty(Cr.ReportName)) and (TIndex > -1) then begin editSizeExit(editTop); editSizeExit(editLeft); editSizeExit(editWidth); editSizeExit(editHeight); end; SaveFormPos(Self); Close; end; {------------------------------------------------------------------------------} { FormClose } {------------------------------------------------------------------------------} procedure TCrpeTextObjectsDlg.FormClose(Sender: TObject; var Action: TCloseAction); begin bTextObjects := False; Release; end; end.
{ @abstract Implements multilingual resource format for FireMonkey and VCL. FireMonkey does not support resource DLLs in Android and iOS. This is why the standard resource DLL based localization method cannot be used with FireMonkey if mobiles platforms are used. This format is designed to make it possible to localize FireMonkey applications. Even this method is ment to be used to localize FireMonkey applications you can also use it with VLC application although the resource DLL based method is the prefered way. The basic idea is to store all localized forms, strings and resources into a single .ntres file that can be added as custom RCDATA resource inside the application executable. You will have full control of form localization. This mean that you can override any form properties including dimension, colors and fonts. Note! If you use Delphi 10.3 (Rio) or earlier you cannot use the resourcestring feature. If your code is like this. @longCode(# resourcestring SStr = 'Hello'; begin Result := SStr; end; #) You need to change the code to use _T function. @longCode(# begin Result := _T('Hello', 'SStr'); end; #) } { File Format Specificaiton This format is designed to store localized form, strings and other resources in several languages. The resource is added as a RCDATA resource into the Delphi project and will be embedded inside the application executable. Numbers and offsets are 4 bit integers. All strings are without null termination. Strings lengths are specified in a word. String length is length in characters NOT in bytes. Language ids are in ASCII. All other strings are UTF16-LE strings. ~ means variable length. File format: [header] 4 'NTRE' [version] 4 File format version (2 or 1) [count] 4 Language count [idIndex1] 8 Language id offset + length [idIndex2] 8 ... [idIndexN] 8 [dataIndex1] 8 Language data offset + length [dataIndex2] 8 ... [dataIndexN] 8 [id1] ~ Language id (Ansi string) [id2] ~ ... [idN] ~ [data1] ~ Language data (binary). See language data. [data2] ~ ... [dataN] ~ Language data version 2 There is one language data or file per language. Format: [header] 4 'NTLB' [version] 4 File format version (2) [id] 16 IETF language tag in Ansi characters (e.g. fi-FI) [win32idcount] 4 String Win32 id count [win64idcount] 4 String Win64 id count [symbolcount] 4 String symbol name count [stringcount] 4 String count [formcount] 4 Form count [rescount] 4 Resource count [stringId1] 4 Sorted string Win32 id index: offset to string id data: string id + offset to string data [stringId2] 4 ... [stringIdN] 4 [stringId1] 4 Sorted string Win64 id index: offset to string id data: string id + offset to string data [stringId2] 4 ... [stringIdN] 4 [stringName1] 4 Sorted string symbol name index: offset to string symbol name data: string symbol name + offset to string data [stringName2] 4 ... [stringNameN] 4 [formName1] 4 Sorted form name index: offset to form data: name + length + data [formName2] 4 ... [formNameN] 4 [resName1] 4 Sorted resource name index: offet to resource data: name + length + data [resName2] 4 ... [resNameN] 4 [idValue1] 6 String Win32 id data: id (Word) + offset to string data [idValue2] 6 ... [idValueN] 6 [idValue1] 6 String Win64 id data: id (Word) + offset to string data [idValue2] 6 ... [idValueN] 6 [symbolName1] ~ String symbol name data: name + offset to string data [symbolName2] ~ ... [symbolNameN] ~ [string1] ~ String data: length + characters [string2] ~ ... [stringN] ~ [form1] ~ Form data: name + length + Standard binary form data: TPF0... [form2] ~ ... [formN] ~ [resource1] ~ Resource data: name + length + Plain resource data such as PNG or MP3 [resource2] ~ ... [resourceN] ~ Language data version 1 (will be deprected in 2024) There is one language data per language. Format: [header] 4 'NTLA' [formcount] 4 Form count [stringcount] 4 String group count [rescount] 4 Resource count [formName1] 8 Form name offset + length [formName2] 8 ... [formNameN] 8 [formIndex1] 8 Form data offset + length [formIndex2] 8 ... [formIndexN] 8 [stringName1] 8 String group name offset + length [stringName2] 8 ... [stringNameN] 8 [stringIndex1] 8 String group data offset + length [stringIndex2] 8 ... [stringIndexN] 8 [resName1] 8 Resource name offset + length [resName2] 8 ... [resNameN] 8 [resIndex1] 8 Resource data offset + length [resIndex2] 8 ... [resIndexN] 8 [form1] ~ Form data. Standard binary form data: TPF0... [form2] ~ ... [formN] ~ [string1] ~ String data. See String group data. [string2] ~ ... [stringN] ~ [resource1] ~ Resource data. Plain resource data such as PNG or MP3. [resource2] ~ ... [resourceN] ~ String group data: [count] 4 String count [idIndex1] 8 Id offset + length. Ids are alphapetically sorted [idIndex2] 8 ... [idIndexN] 8 [strIndex1] 8 Value offset + length. Ids are alphapetically sorted [strIndex2] 8 ... [strIndexN] 8 [id1] ~ Id [id2] ~ ... [idN] ~ [str1] ~ Value [str2] ~ ... [strN] ~ } unit NtResource; {$I NtVer.inc} interface uses Types, SysUtils, Classes, Generics.Collections; const NTRES_RESOURCE_NAME_C = 'NtLangRes'; NTRES_MAGIC_C: array[0..3] of Byte = ($4e, $54, $52, $45); // 'NTRE' NTLANG1_MAGIC_C: array[0..3] of Byte = ($4e, $54, $4c, $41); // 'NTLA' NTLANG2_MAGIC_C: array[0..3] of Byte = ($4e, $54, $4c, $42); // 'NTLB' LANG_ID_LENGTH_C = 16; //NTRES_VALUE_VERSION_C = 1; //NTRES_RESOURCE_STRING_VERSION_C = 2; type TNtResourceVersion = ( nr1 = 1, nr2 ); TNtResourceStringId = ( rsWin32, rsWin64, rsSymbol ); TNtResourceStringIds = set of TNtResourceStringId; TNtDelphiResources = class; { @abstract Contains information about the language such as id, name and image. } TNtResourceLanguage = class(TObject) private FOriginal: String; FNative: String; FLocalized: String; FId: String; FImage: String; public { @abstract Add a language image resource id. If specified the image will be drawn with the language name. @param value Image resource id. @return This same TNtResourceLanguage object. } function AddImage(const value: String): TNtResourceLanguage; property Original: String read FOriginal; property Native: String read FNative; property Localized: String read FLocalized; property Id: String read FId; property Image: String read FImage; end; TNtDelphiResource = class(TObject) private FVersion: TNtResourceVersion; FLangId: String; FOffset: Integer; FStream: TStream; FFileName: String; FId: String; // All versions FFormCount: Integer; FResourceCount: Integer; // Version 1 FFormNameOffset: Integer; FStringGroupCount: Integer; FStringGroupNameOffset : Integer; FResourceNameOffset: Integer; // Version 2 FWin32StringCount: Integer; FWin64StringCount: Integer; FSymbolStringCount: Integer; FStringCount: Integer; FWin32IndexOffset: Integer; FWin64IndexOffset: Integer; FSymbolIndexOffset: Integer; FFormIndexOffset: Integer; FResourceIndexOffset: Integer; procedure SetOffset(value: Integer); procedure CheckStream; procedure ReadHeader; {$IFDEF DELPHIDX4} {$IF defined(EXTERNALLINKER)} function FindStringSymbol(const unitName, itemName: String): String; {$ELSE} function FindStringWin(id: Word): String; {$IFEND} {$ENDIF} public function FindForm(const name: String): TStream; {$IFDEF DELPHIDX4} function FindString(resStringRec: PResStringRec): String; overload; {$ENDIF} function FindString(const original: String; id: String; const group: String): String; overload; function FindResource(const id: String): TStream; //class procedure ParseKey(const key: String; var group, id: String); class function ParseKey(name: String; var unitName, itemName: String): Boolean; property Id: String read FId; property Offset: Integer read FOffset write SetOffset; end; TTranslationSource = ( tsNone, tsResource, tsFile, tsDirectory ); TNtDelphiResources = class(TObject) private FVersion: TNtResourceVersion; FLoaded: Boolean; FResourceName: String; FResourcePath: String; FStream: TStream; FCascadingEnabled: Boolean; FLanguageIndex: Integer; FLanguages: TList<TNtDelphiResource>; FLanguageNames: TList<TNtResourceLanguage>; FTranslationSource: TTranslationSource; FTranslationSourceValue: String; function GetCurrent: TNtDelphiResource; function GetCount: Integer; function GetEnabled: Boolean; function GetLanguage(i: Integer): TNtDelphiResource; function GetLanguageId: String; function GetOriginal(const id: String): String; function GetNative(const id: String): String; function GetLocalized(const id: String): String; function GetLanguageImage(const id: String): String; function GetResourceDirectories: TStringDynArray; procedure SetLanguageId(const value: String); procedure CheckLoad; public constructor Create; destructor Destroy; override; procedure Load; function Find(const id: String): Integer; function FindLanguage(const id: String): TNtResourceLanguage; function FindForm(const name: String): TStream; function FormExists(const name: String): Boolean; {$IFDEF DELPHIDX4} function GetString(resStringRec: PResStringRec): String; overload; function GetStringInLanguage( const language: String; resStringRec: PResStringRec): String; overload; {$ENDIF} function GetString(const original, id, group: String): String; overload; function GetStringInLanguage( const language: String; const original, id, group: String): String; overload; function GetResource(const id: String; resType: PChar = RT_RCDATA): TStream; { @abstract Add a language name to the resources. Language names are used for example in the select language dialogs. The function name is _T because we also want to the string will be extracted. @param original Original language name such as "English". @param id Language id such as "en". @return Language resource. } function Translate(const original, id: String): TNtResourceLanguage; function Add(const original, native, localized, id: String): TNtResourceLanguage; class function GetResources: TNtDelphiResources; property CascadingEnabled: Boolean read FCascadingEnabled write FCascadingEnabled; property Count: Integer read GetCount; property Current: TNtDelphiResource read GetCurrent; property Enabled: Boolean read GetEnabled; property LanguageId: String read GetLanguageId write SetLanguageId; property Languages[i: Integer]: TNtDelphiResource read GetLanguage; default; property ResourceName: String read FResourceName write FResourceName; property ResourcePath: String read FResourcePath write FResourcePath; property Stream: TStream read FStream; property ResourceDirectories: TStringDynArray read GetResourceDirectories; property Originals[const id: String]: String read GetOriginal; property Natives[const id: String]: String read GetNative; property Localizeds[const id: String]: String read GetLocalized; property LanguageImages[const id: String]: String read GetLanguageImage; property TranslationSource: TTranslationSource read FTranslationSource; property TranslationSourceValue: String read FTranslationSourceValue; end; {$IFDEF DELPHIDX4} // _T has been moved to NtResourceEx.pas procedure InitializeResourceStringTranslation; {$ENDIF} function Translate( const original: String; const id: String = ''; const group: String = ''; const language: String = ''): String; overload; { Get the string value in the current language. @param original Original string value. @param group String group. @param language Optional language id. If not present the current language is used. @return String value in the current languages.} function _TG( const original, group: String; const language: String = ''): String; function TranslateGroup( const original, group: String; const language: String = ''): String; var NtResources: TNtDelphiResources; implementation uses {$IF CompilerVersion = 22} Windows, {$IFEND} RTLConsts, {$IFDEF DELPHIXE2} System.IOUtils, {$ENDIF} NtBase, NtResourceEx; // TStreamHelper type TStreamHelper = class helper for TStream function ReadBytes(length: Integer): TBytes; function ReadAnsi(length: Integer): String; overload; function ReadAnsi(offset, length: Integer): String; overload; function ReadString: String; overload; function ReadString(length: Integer): String; overload; function ReadString(offset, length: Integer): String; overload; function ReadWord: Word; function ReadInt32: Int32; end; function TStreamHelper.ReadBytes(length: Integer): TBytes; begin SetLength(Result, length); Read(Result[0], length) end; function TStreamHelper.ReadAnsi(length: Integer): String; var data: TBytes; begin SetLength(data, length); Read(data, length); Result := TEncoding.ANSI.GetString(data); end; function TStreamHelper.ReadAnsi(offset, length: Integer): String; var currentOffset: Int64; begin currentOffset := Position; Position := offset; Result := ReadAnsi(length); Position := currentOffset; end; function TStreamHelper.ReadString: String; begin Result := ReadString(ReadWord); end; function TStreamHelper.ReadString(length: Integer): String; begin SetLength(Result, length); if length = 0 then Exit; {$IFDEF DELPHIXE3} Read(Result[Low(String)], 2*length) {$ELSE} Read(Result[1], 2*length) {$ENDIF} end; function TStreamHelper.ReadString(offset, length: Integer): String; var currentOffset: Int64; begin currentOffset := Position; Position := offset; Result := ReadString(length); Position := currentOffset; end; function TStreamHelper.ReadWord: Word; begin Read(Result, SizeOf(Result)); end; function TStreamHelper.ReadInt32: Int32; begin Read(Result, SizeOf(Result)); end; function Translate( const original: String; const id: String = ''; const group: String = ''; const language: String = ''): String; begin Result := _T(original, id, group, language); end; function _TG( const original, group: String; const language: String = ''): String; begin if language <> '' then Result := NtResources.GetStringInLanguage(language, original, '', group) else Result := NtResources.GetString(original, '', group); end; function TranslateGroup( const original, group: String; const language: String = ''): String; begin Result := _TG(original, group, language); end; // TNtResourceLanguage function TNtResourceLanguage.AddImage(const value: String): TNtResourceLanguage; begin FImage := value; Result := Self; end; // TNtDelphiResource function Convert(const bytes: TBytes): String; var b: Byte; begin Result := ''; for b in bytes do begin if b = 0 then Exit; Result := Result + Char(b) end; end; procedure TNtDelphiResource.ReadHeader; var header: TBytes; begin header := FStream.ReadBytes(Length(NTLANG1_MAGIC_C)); if CompareMem(@NTLANG1_MAGIC_C, @header[0], Length(NTLANG1_MAGIC_C)) then begin FVersion := nr1; FLangId := ''; FFormCount := FStream.ReadInt32; FStringGroupCount := FStream.ReadInt32; FResourceCount := FStream.ReadInt32; FFormNameOffset := FStream.Position; FStringGroupNameOffset := FFormNameOffset + 16*FFormCount; FResourceNameOffset := FStringGroupNameOffset + 16*FStringGroupCount; end else if CompareMem(@NTLANG2_MAGIC_C, @header[0], Length(NTLANG2_MAGIC_C)) then begin FVersion := TNtResourceVersion(FStream.ReadInt32); FLangId := Convert(FStream.ReadBytes(LANG_ID_LENGTH_C)); FWin32StringCount := FStream.ReadInt32; FWin64StringCount := FStream.ReadInt32; FSymbolStringCount := FStream.ReadInt32; FStringCount := FStream.ReadInt32; FFormCount := FStream.ReadInt32; FResourceCount := FStream.ReadInt32; FWin32IndexOffset := FStream.Position; FWin64IndexOffset := FWin32IndexOffset + 4*FWin32StringCount; FSymbolIndexOffset := FWin64IndexOffset + 4*FWin64StringCount; FFormIndexOffset := FSymbolIndexOffset + 4*FSymbolStringCount; FResourceIndexOffset := FFormIndexOffset + 4*FFormCount; end else raise EInvalidImage.CreateRes(@SInvalidImage); end; procedure TNtDelphiResource.CheckStream; begin if (FStream = nil) and FileExists(FFileName) then begin FStream := TFileStream.Create(FFileName, fmOpenRead or fmShareDenyWrite); ReadHeader; end; end; procedure TNtDelphiResource.SetOffset(value: Integer); var position: Integer; begin position := FStream.Position; FOffset := value; FStream.Position := FOffset; ReadHeader; FStream.Position := position; end; function TNtDelphiResource.FindForm(const name: String): TStream; var i, offsetValue, len: Integer; left, right, mid: Integer; formOffset, formSize: Integer; formData: TBytes; str: String; begin CheckStream; if FVersion = nr1 then begin FStream.Position := FFormNameOffset; for i := 0 to FFormCount - 1 do begin offsetValue := FStream.ReadInt32; len := FStream.ReadInt32 div 2; str := FStream.ReadString(FOffset + offsetValue, len); if str = name then begin FStream.Position := FFormNameOffset + 8*FFormCount + 8*i; formOffset := FOffset + FStream.ReadInt32; formSize := FStream.ReadInt32; FStream.Position := formOffset; formData := FStream.ReadBytes(formSize); Result := TMemoryStream.Create; Result.Write(formData[0], formSize); Result.Position := 0; Exit; end; end; end else begin // Use the binary search to find the form left := 0; right := FFormCount - 1; while left <= right do begin mid := (left + right) div 2; FStream.Position := FFormIndexOffset + 4*mid; formOffset := FOffset + FStream.ReadInt32; FStream.Position := formOffset; str := FStream.ReadString; if str = name then begin FStream.Position := formOffset; FStream.ReadString; formSize := FStream.ReadInt32; formData := FStream.ReadBytes(formSize); Result := TMemoryStream.Create; Result.Write(formData[0], formSize); Result.Position := 0; Exit; end else if str < name then left := mid + 1 else right := mid - 1; end; end; Result := nil; end; function TNtDelphiResource.FindResource(const id: String): TStream; var i, offsetValue, len: Integer; left, right, mid: Integer; resourceOffset, resourceSize: Integer; resourceData: TBytes; str: String; begin CheckStream; if FVersion = nr1 then begin FStream.Position := FResourceNameOffset; for i := 0 to FResourceCount - 1 do begin offsetValue := FStream.ReadInt32; len := FStream.ReadInt32 div 2; str := FStream.ReadString(FOffset + offsetValue, len); if str = id then begin FStream.Position := FResourceNameOffset + 8*FResourceCount + 8*i; resourceOffset := FOffset + FStream.ReadInt32; resourceSize := FStream.ReadInt32; FStream.Position := resourceOffset; resourceData := FStream.ReadBytes(resourceSize); Result := TMemoryStream.Create; Result.Write(resourceData[0], resourceSize); Result.Position := 0; Exit; end; end; end else begin // Use the binary search to find the resource left := 0; right := FResourceCount - 1; while left <= right do begin mid := (left + right) div 2; FStream.Position := FResourceIndexOffset + 4*mid; resourceOffset := FOffset + FStream.ReadInt32; FStream.Position := resourceOffset; str := FStream.ReadString; if str = id then begin FStream.Position := resourceOffset; FStream.ReadString; resourceSize := FStream.ReadInt32; resourceData := FStream.ReadBytes(resourceSize); Result := TMemoryStream.Create; Result.Write(resourceData[0], resourceSize); Result.Position := 0; Exit; end else if str < id then left := mid + 1 else right := mid - 1; end; end; Result := nil; end; class function TNtDelphiResource.ParseKey(name: String; var unitName, itemName: String): Boolean; function IsDigit(c: Char): Boolean; begin Result := (c >= '0') and (c <= '9'); end; function GetNumber(var str: String): Integer; begin Result := 0; while (str <> '') and IsDigit(str[1]) do begin Result := 10*Result + (Ord(str[1]) - Ord('0')); Delete(str, 1, 1); end; end; function Take(var str: String; first, count: Integer): String; var temp: String; begin Result := System.Copy(str, first, count); temp := System.Copy(str, 1, first - 1); if first + count <= Length(str) then temp := temp + System.Copy(str, first + count, Length(str)); str := temp; end; function TakeLeft(var str: String; count: Integer): String; begin Result := Take(str, 1, count); end; function Check(const tag: String): Boolean; var p: Integer; begin p := Pos(tag, name); Result := p > 0; if Result then Delete(name, 1, Length(tag) + p - 1); end; const RSRC_C = '__rsrc_N'; RSTR_ZN_C = '__rstr__ZN'; RSTR_ZZN_C = '__rstr__ZZN'; var ignoreRest: Boolean; len: Integer; str: String; begin // ___rstr__ZN3Fmx6Consts10_SEditCopyE 00AA39A6 // ___rstr__ZN6System9Rtlconsts24_SCentimetersDescriptionE // ___rstr__ZN6System9Rtlconsts24_SConvUnknownDescriptionE // ___rstr__ZN5Unit16_SStr1E // ___rstr__ZZN5Unit13OneEiE5SStr1 // ___rstr__ZZN5Unit13OneEvE5SStr1 // ___rstr__ZZN5Unit13OneEiN6System13UnicodeStringEE5SStr1 // ___rstr__ZZN5Unit16TForm110FormCreateEPN6System7TObjectEE4SStr // ___rstr__ZZN5Unit16TForm110FormCreateEPN6System7TObjectEE13SThisIsSample unitName := ''; itemName := ''; if Check(RSRC_C) then begin Result := True; len := GetNumber(name); unitName := TakeLeft(name, len); itemName := name; Delete(itemName, Length(itemName), 1); end else if Check(RSTR_ZN_C) then begin // ___rstr__ZN5Unit16_SStr1E Result := True; while (name <> '') and (name[1] <> 'E') do begin len := GetNumber(name); str := TakeLeft(name, len); if name[1] = 'E' then begin itemName := str; if (itemName[1] = '_') then Delete(itemName, 1, 1); Break; end else begin if unitName <> '' then unitName := unitName + '.'; unitName := unitName + str; end; end; end else if Check(RSTR_ZZN_C) then begin // ___rstr__ZZN5Unit13OneEiE5SStr1 // ___rstr__ZZN5Unit13OneEvE5SStr1 // ___rstr__ZZN5Unit13OneEiN6System13UnicodeStringEE5SStr1 // ___rstr__ZZN5Unit16TForm110FormCreateEPN6System7TObjectEE4SStr // ___rstr__ZZN5Unit16TForm110FormCreateEPN6System7TObjectEE13SThisIsSample Result := True; str := ''; ignoreRest := False; while (name <> '') do begin if name[1] = 'E' then begin ignoreRest := True; Delete(name, 1, 1); str := ''; while (name <> '') and not IsDigit(name[1]) do begin str := str + name[1]; Delete(name, 1, 1); end; if str = 'E' then str := ''; end else begin len := GetNumber(name); str := TakeLeft(name, len); end; if name = '' then begin itemName := str; if (itemName[1] = '_') then Delete(itemName, 1, 1); Break; end else if (str <> '') and not ignoreRest and (unitName = '') then begin if unitName <> '' then unitName := unitName + '.'; unitName := unitName + str; end; end; end else begin Result := False; end; end; {$IFDEF DELPHIDX4} {$IF defined(EXTERNALLINKER)} function TNtDelphiResource.FindStringSymbol(const unitName, itemName: String): String; var id, thisId: String; left, right, mid: Integer; begin id := unitName + '.' + itemName; // Use the binary search to find the string left := 0; right := FSymbolStringCount - 1; while left <= right do begin mid := (left + right) div 2; FStream.Position := FSymbolIndexOffset + 4*mid; FStream.Position := FOffset + FStream.ReadInt32; thisId := FStream.ReadString; if thisId = id then begin FStream.Position := FOffset + FStream.ReadInt32; Result := FStream.ReadString; Exit; end else if thisId < id then left := mid + 1 else right := mid - 1; end; Result := ''; end; {$ELSE} function TNtDelphiResource.FindStringWin(id: Word): String; var thisId: Word; left, right, mid: Integer; begin // Use the binary search to find the string left := 0; right := {$IFDEF WIN32}FWin32StringCount{$ELSE}FWin64StringCount{$ENDIF} - 1; while left <= right do begin mid := (left + right) div 2; FStream.Position := {$IFDEF WIN32}FWin32IndexOffset{$ELSE}FWin64IndexOffset{$ENDIF} + 4*mid; FStream.Position := FOffset + FStream.ReadInt32; thisId := FStream.ReadWord; if thisId = id then begin FStream.Position := FOffset + FStream.ReadInt32; Result := FStream.ReadString; Exit; end else if thisId < id then left := mid + 1 else right := mid - 1; end; Result := ''; end; {$IFEND} function TNtDelphiResource.FindString(resStringRec: PResStringRec): String; {$IF defined(EXTERNALLINKER)} var unitName, itemName: String; {$IFEND} begin CheckStream; {$IF defined(EXTERNALLINKER)} ParseKey(String(resStringRec.Key), unitName, itemName); Result := FindStringSymbol(unitName, itemName); {$ELSE} Result := FindStringWin(resStringRec.Identifier); {$IFEND} end; {$ENDIF} function TNtDelphiResource.FindString(const original: String; id: String; const group: String): String; //FI:C103 var i, j, stringCount: Integer; offsetValue, len, thisOffset: Integer; groupOffset: Integer; str: String; begin if id = '' then id := original; // Find group CheckStream; FStream.Position := FStringGroupNameOffset; for i := 0 to FStringGroupCount - 1 do begin offsetValue := FStream.ReadInt32; len := FStream.ReadInt32 div 2; str := FStream.ReadString(FOffset + offsetValue, len); if str = group then begin FStream.Position := FStringGroupNameOffset + 8*FStringGroupCount + 8*i; groupOffset := FOffset + FStream.ReadInt32; FStream.Position := groupOffset; stringCount := FStream.ReadInt32; for j := 0 to stringCount - 1 do begin offsetValue := FStream.ReadInt32; len := FStream.ReadInt32 div 2; str := FStream.ReadString(groupOffset + offsetValue, len); if str = id then begin FStream.Position := groupOffset + 4 + 8*stringCount + 8*j; thisOffset := FStream.ReadInt32; len := FStream.ReadInt32 div 2; FStream.Position := groupOffset + thisOffset; Result := FStream.ReadString(len); Exit; end; end; end; end; Result := original; end; // TNtDelphiResources constructor TNtDelphiResources.Create; begin inherited; FLanguages := TList<TNtDelphiResource>.Create; FLanguageNames := TList<TNtResourceLanguage>.Create; FLanguageIndex := -1; FResourceName := NTRES_RESOURCE_NAME_C; FLoaded := False; end; destructor TNtDelphiResources.Destroy; begin {$IFNDEF AUTOREFCOUNT} while FLanguages.Count > 0 do begin FLanguages[0].Free; FLanguages.Delete(0); end; {$ENDIF} FLanguages.Free; {$IFNDEF AUTOREFCOUNT} while FLanguageNames.Count > 0 do begin FLanguageNames[0].Free; FLanguageNames.Delete(0); end; {$ENDIF} FLanguageNames.Free; FStream.Free; inherited; end; function TNtDelphiResources.FindLanguage(const id: String): TNtResourceLanguage; var i: Integer; begin for i := 0 to FLanguageNames.Count - 1 do begin Result := FLanguageNames[i]; if Result.Id = id then Exit; end; Result := nil; end; function TNtDelphiResources.GetOriginal(const id: String): String; var language: TNtResourceLanguage; begin language := FindLanguage(id); if language <> nil then Result := language.Original else Result := ''; end; function TNtDelphiResources.GetNative(const id: String): String; var language: TNtResourceLanguage; begin language := FindLanguage(id); if language <> nil then Result := language.Native else Result := ''; end; function TNtDelphiResources.GetLocalized(const id: String): String; var language: TNtResourceLanguage; begin language := FindLanguage(id); if language <> nil then Result := language.Localized else Result := ''; end; function TNtDelphiResources.GetLanguageImage(const id: String): String; var i: Integer; language: TNtResourceLanguage; begin for i := 0 to FLanguageNames.Count - 1 do begin language := FLanguageNames[i]; if language.FId = id then begin Result := language.FImage; Exit; end; end; Result := ''; end; function TNtDelphiResources.Translate(const original, id: String): TNtResourceLanguage; begin Result := TNtResourceLanguage.Create; Result.FOriginal := original; Result.FId := id; FLanguageNames.Add(Result); end; function TNtDelphiResources.Add(const original, native, localized, id: String): TNtResourceLanguage; begin Result := TNtResourceLanguage.Create; Result.FOriginal := original; Result.FNative := native; Result.FLocalized := localized; Result.FId := id; FLanguageNames.Add(Result); end; function TNtDelphiResources.GetCount: Integer; begin CheckLoad; Result := FLanguages.Count; end; function TNtDelphiResources.GetEnabled: Boolean; begin Result := Count > 0; end; function TNtDelphiResources.GetLanguage(i: Integer): TNtDelphiResource; begin Result := FLanguages[i]; end; function TNtDelphiResources.GetCurrent: TNtDelphiResource; begin CheckLoad; if FLanguageIndex >= 0 then Result := Languages[FLanguageIndex] else Result := nil end; function TNtDelphiResources.GetLanguageId: String; begin if Current <> nil then Result := Current.FId else Result := ''; end; procedure TNtDelphiResources.SetLanguageId(const value: String); function Process(const id: String): Boolean; var i: Integer; language: TNtDelphiResource; begin for i := 0 to Count - 1 do begin language := Languages[i]; if language.FId = id then begin FLanguageIndex := i; LoadedResourceLocale := language.FId; Result := True; Exit; end; end; Result := False; end; var id, language, script, country, variant: String; begin if Process(value) then Exit; TNtBase.ParseLocaleId(value, language, script, country, variant); if country <> '' then begin id := language; if script <> '' then id := id + '-' + script; if Process(id) then Exit; end; if script <> '' then begin if Process(language) then Exit; end; FLanguageIndex := -1; end; procedure TNtDelphiResources.CheckLoad; begin if not FLoaded then Load; end; function TNtDelphiResources.GetResourceDirectories: TStringDynArray; var values: TStringList; function Add(dir: String): Boolean; begin Result := (dir <> '') and DirectoryExists(dir); if Result then values.Add(dir); end; var i: Integer; applicationName: String; begin values := TStringList.Create; try Add(FResourcePath); applicationName := ParamStr(0); {$IFDEF MSWINDOWS} Add(ExtractFileDir(applicationName)); {$ENDIF} {$IFDEF DELPHIXE4} applicationName := TPath.GetFileNameWithoutExtension(applicationName); if (applicationName = '') or not Add(TPath.GetDocumentsPath + PathDelim + applicationName) then Add(TPath.GetDocumentsPath); {$ENDIF} SetLength(Result, values.Count); for i := 0 to values.Count - 1 do Result[i] := values[i]; finally values.Free; end; end; procedure TNtDelphiResources.Load; function FindResourceFile(directories: TStringDynArray; var fileName: String): Boolean; var i: Integer; begin // If a resource file is specified and it exists use it. // Otherwise try to find the resource file from the default directories if FileExists(FResourcePath) then begin fileName := FResourcePath; Result := True; end else begin for i := 0 to Length(directories) - 1 do begin fileName := directories[i] + PathDelim + ResourceName + '.ntres'; Result := FileExists(fileName); if Result then Exit; end; Result := False; end; end; {$IFDEF DELPHIXE2} function FindLanguagesFiles(directories: TStringDynArray; var files: TStringDynArray): Boolean; var i: Integer; begin for i := 0 to Length(directories) - 1 do begin files := TDirectory.GetFiles(directories[i], '*.ntlang'); Result := Length(files) > 0; if Result then Exit; end; Result := False; end; {$ENDIF} procedure LoadResourceFile(stream: TStream); var i, idCount: Integer; offsetValue, len: Integer; header: TBytes; item: TNtDelphiResource; begin FStream.Free; FStream := stream; header := FStream.ReadBytes(Length(NTRES_MAGIC_C)); if not CompareMem(@NTRES_MAGIC_C, @header[0], Length(NTRES_MAGIC_C)) then raise EInvalidImage.CreateRes(@SInvalidImage); FVersion := TNtResourceVersion(FStream.ReadInt32); // Read language ids idCount := FStream.ReadInt32; for i := 0 to idCount - 1 do //FI:W528 begin offsetValue := FStream.ReadInt32; len := FStream.ReadInt32; item := TNtDelphiResource.Create; item.FId := FStream.ReadAnsi(offsetValue, len); item.FStream := FStream; FLanguages.Add(item); end; // Read language data offsets for i := 0 to idCount - 1 do begin Languages[i].Offset := FStream.ReadInt32; FStream.ReadInt32; end; end; {$IFDEF DELPHIXE2} procedure LoadLanguageFiles(languageFileNames: TStringDynArray); var i: Integer; languageFileName: String; item: TNtDelphiResource; begin for i := 0 to Length(languageFileNames) - 1 do begin languageFileName := languageFileNames[i]; item := TNtDelphiResource.Create; item.FId := TPath.GetFileNameWithoutExtension(languageFileName); item.FFileName := languageFileName; FLanguages.Add(item); end; end; {$ENDIF} var resourceFileName: String; directories: TStringDynArray; {$IFDEF DELPHIXE2} languageFileNames: TStringDynArray; {$ENDIF} begin FLoaded := True; directories := GetResourceDirectories; {$IFDEF DELPHIXE2} if FindLanguagesFiles(directories, languageFileNames) then begin // Load translations from local .ntlang files LoadLanguageFiles(languageFileNames); FTranslationSource := tsDirectory; FTranslationSourceValue := ExtractFileDir(languageFileNames[0]); end else {$ENDIF} if FindResourceFile(directories, resourceFileName) then begin // Load translations from a local .ntres file LoadResourceFile(TFileStream.Create(resourceFileName, fmOpenRead or fmShareDenyWrite)); FTranslationSource := tsFile; FTranslationSourceValue := resourceFileName; end else if FindResource(HInstance, PChar(FResourceName), RT_RCDATA) > 0 then begin // Load translations from an embedded .ntres resource LoadResourceFile(TResourceStream.Create(HInstance, FResourceName, RT_RCDATA)); FTranslationSource := tsResource; FTranslationSourceValue := FResourceName; end else begin // No translation file or resource found if not SameText(FResourceName, NTRES_RESOURCE_NAME_C) then raise EReadError.CreateResFmt(@SResNotFound, [FResourceName]); Exit; end; if DefaultLocale <> '' then LanguageId := DefaultLocale else FLanguageIndex := -1; end; function TNtDelphiResources.Find(const id: String): Integer; begin for Result := 0 to Count - 1 do if Languages[Result].Id = id then Exit; Result := -1; end; function TNtDelphiResources.FormExists(const name: String): Boolean; var thisStream: TStream; begin thisStream := FindForm(name); Result := thisStream <> nil; thisStream.Free; end; function TNtDelphiResources.FindForm(const name: String): TStream; begin CheckLoad; if Current <> nil then Result := Current.FindForm(name) else Result := nil; end; {$IFDEF DELPHIDX4} function TNtDelphiResources.GetString(resStringRec: PResStringRec): String; begin CheckLoad; if Current <> nil then Result := Current.FindString(resStringRec) else Result := ''; end; {$ENDIF} function TNtDelphiResources.GetString(const original, id, group: String): String; begin CheckLoad; if Current <> nil then Result := Current.FindString(original, id, group) else Result := original; end; {$IFDEF DELPHIDX4} function TNtDelphiResources.GetStringInLanguage( const language: String; resStringRec: PResStringRec): String; var index: Integer; begin CheckLoad; index := Find(language); if index >= 0 then Result := Languages[index].FindString(resStringRec) else Result := ''; end; {$ENDIF} function TNtDelphiResources.GetStringInLanguage( const language: String; const original, id, group: String): String; var index: Integer; begin CheckLoad; index := Find(language); if index >= 0 then Result := Languages[index].FindString(original, id, group) else Result := original; end; function TNtDelphiResources.GetResource(const id: String; resType: PChar): TStream; begin CheckLoad; if Current <> nil then Result := Current.FindResource(id) else Result := TResourceStream.Create(HInstance, id, resType); end; class function TNtDelphiResources.GetResources: TNtDelphiResources; begin if NtResources = nil then NtResources := TNtDelphiResources.Create; Result := NtResources; end; {$IFDEF DELPHIDX4} function TranslateResourceString(resStringRec: PResStringRec): String; begin Result := NtResourceEx._T(resStringRec); end; procedure InitializeResourceStringTranslation; begin LoadResStringFunc := TranslateResourceString; end; {$ENDIF} initialization TNtDelphiResources.GetResources; finalization NtResources.Free; end.
{ Laz-Model Copyright (C) 2002 Eldean AB, Peter Söderman, Ville Krumlinde Portions (C) 2016 Peter Dyson. Initial Lazarus port This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } unit uCodeParser; {$mode objfpc}{$H+} interface uses Classes, uModel, Sysutils; type // TNeedPackageEvent = procedure(const AName: string; var AStream: TStream; OnlyLookUp: Boolean = False) of object; TNeedPackageEvent = function(const AName: string; var AStream: TStream; OnlyLookUp: Boolean = False): String of object; { Baseclass for a code parser. } TCodeParser = class(TObject) private FNeedPackage: TNeedPackageEvent; protected FModel: TAbstractPackage; // Moves data from a stream to a memory stream and aadds aterminating #0 for codeparsers. function StreamToMemory(AStream : TStream) : TMemoryStream; public // Parse the given stream into the AOM model with AModel as a 'dump' for unresolved objects. procedure ParseStream(AStream: TStream; AModel: TAbstractPackage; AOM: TObjectModel); virtual; abstract; // Used to call the providers function to retrieve a package in a stream. property NeedPackage: TNeedPackageEvent read FNeedPackage write FNeedPackage; end; EParseError = Exception; implementation { TCodeParser } function TCodeParser.StreamToMemory(AStream: TStream): TMemoryStream; begin Result := TMemoryStream.Create; Result.LoadFromStream(AStream); FreeAndNil(AStream); Result.SetSize(Result.Size + 1); PChar(Result.Memory)[Result.Size - 1] := #0; end; end.
Uses sysutils; Procedure TestIt (S1,S2 : String); Var R : Longint; begin R:=AnsiCompareStr(S1,S2); Write ('"',S1,'" is '); If R<0 then write ('less than ') else If R=0 then Write ('equal to ') else Write ('larger than '); Writeln ('"',S2,'"'); end; Begin Testit('One string','One smaller string'); Testit('One string','one string'); Testit('One string','One string'); Testit('One string','One tall string'); End.
unit Unit3; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Math, diagnostics; type TForm3 = class(TForm) Button1: TButton; Button2: TButton; Edit1: TEdit; procedure Button2Click(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form3: TForm3; implementation {$R *.dfm} procedure TForm3.Button1Click(Sender: TObject); var Timer : TStopwatch; i : integer; begin Timer := TStopwatch.Create; Timer.Start; i := StrToInt(Edit1.Text); if i = 1 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 2 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 3 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 4 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 5 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 6 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 7 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 8 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 9 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 10 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 11 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 12 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 13 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 14 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 15 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 16 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 17 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 18 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 19 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 20 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 21 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 22 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 23 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 24 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 25 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 26 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 27 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 28 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 29 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 30 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 31 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 32 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 33 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 34 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 35 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end else if i = 36 then begin Timer.Stop; Button1.Caption := Timer.Elapsed.ToString; end; end; procedure TForm3.Button2Click(Sender: TObject); var Timer : TStopwatch; begin Timer := TStopwatch.Create; Timer.Start; case StrToInt(Edit1.Text) of 1 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 2 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 3 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 4 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 5 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 6 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 7 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 8 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 9 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 10 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 11 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 12 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 13 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 14 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 15 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 16 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 17 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 18 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 19 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 20 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 21 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 22 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 23 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 24 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 25 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 26 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 27 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 28 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 29 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 30 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 31 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 32 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 33 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 34 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 35 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; 36 : Begin Timer.Stop; Button2.Caption := Timer.Elapsed.ToString; end; end; end; end.
unit TDlgSourceTree; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, AnimationSeekBarImpl1; type TDlgSourceView = class(TForm) Button1: TButton; FileTree: TTreeView; Button_OK: TButton; procedure Button1Click(Sender: TObject); procedure FileTreeChange(Sender: TObject; Node: TTreeNode); procedure Button_OKClick(Sender: TObject); private { Private declarations } m_strStartDir : string; m_Suffix : TList; m_AnimationSeekBar : TAnimationSeekBar; procedure FindFileInSubDir(strDirName : string; Node : TTreeNode); function GetNodeFullPathName(Node : TTreeNode) : string; public { Public declarations } m_strSelectedFilePath : string; procedure OnInitDialog(AnimationSeekBar : TAnimationSeekBar; strDir : string; Suffix : TList); end; var DlgSourceView: TDlgSourceView; implementation {$R *.dfm} var g_nDirectory : Integer = 0; g_nFile : Integer = 1; procedure TDlgSourceView.OnInitDialog(AnimationSeekBar : TAnimationSeekBar; strDir : string; Suffix : TList); begin m_Suffix := TList.Create(); m_Suffix := Suffix; m_strStartDir := strDir; m_AnimationSeekBar := AnimationSeekBar; Button1Click(nil); end; function TDlgSourceView.GetNodeFullPathName(Node : TTreeNode) : string; var strFullPath : string; ParentNode : TTreeNode; begin strFullPath := Node.Text; ParentNode := Node.Parent; while ParentNode <> nil do begin strFullPath := ParentNode.Text + '\' + strFullPath; ParentNode := ParentNode.Parent; end; GetNodeFullPathName := m_strStartDir + strFullPath; end; procedure TDlgSourceView.FindFileInSubDir(strDirName : string; Node : TTreeNode); var SRecFile, SRecDir : TSearchRec; CurNode : TTreeNode; nFound : Integer; i : Integer; begin //Find directories nFound := FindFirst(strDirName + '\*.*', faDirectory, SRecDir); while nFound = 0 do begin if (SRecDir.Attr = faDirectory) and (CompareText(SRecDir.Name, '.') <> 0) and (CompareText(SRecDir.Name, '..') <> 0) and (CompareText(SRecDir.Name, '.svn') <> 0) then begin CurNode := FileTree.Items.AddChild(Node, SRecDir.Name); CurNode.SelectedIndex := g_nDirectory; CurNode.ImageIndex := g_nDirectory; FindFileInSubDir(strDirName + '\' + SRecDir.Name, CurNode); end; nFound := FindNext(SRecDir); end; //Find files for i := 0 to m_Suffix.Count - 1 do begin nFound := FindFirst(strDirName + '\*.' + string(m_Suffix[i]), faReadOnly and faArchive, SRecFile); while nFound = 0 do begin CurNode := FileTree.Items.AddChild(Node, SRecFile.Name); CurNode.SelectedIndex := g_nFile; CurNode.ImageIndex := g_nFile; nFound := FindNext(SRecFile); end; end; end; procedure TDlgSourceView.Button1Click(Sender: TObject); begin FileTree.Items.Clear(); FindFileInSubDir(m_strStartDir, nil); end; procedure TDlgSourceView.FileTreeChange(Sender: TObject; Node: TTreeNode); begin if Node.SelectedIndex = g_nFile then begin if m_AnimationSeekBar.FEvents <> nil then begin m_strSelectedFilePath := WideString(GetNodeFullPathName(Node)); m_AnimationSeekBar.FEvents.OnSoundFileSelection(m_strSelectedFilePath); end; end; end; procedure TDlgSourceView.Button_OKClick(Sender: TObject); begin ModalResult := mrOK; end; end.
unit notes; {$V-} interface uses control; const count64: array['0'..'9'] of integer = ( 64, 4, 32, 2, 16, 0, 1, 0, 8, 128 ); procedure processNote(var note, xnote: string; dur1: char; var dur: char; var count: integer); function durationCode (note: string): char; function octaveCode (note: string): char; procedure removeOctaveCode(code: char; var note: string); procedure insertOctaveCode(code: char; var note: string); procedure translateSolfa(var nt: char); implementation uses strings, globals; type parsedNote = record name: char; duration: string[1]; octave: string[8]; accidental, whatever, dotgroup, xtuplet: string[16]; shortcut: string[32]; end; procedure printNote(n: parsedNote); begin with n do writeln(name,'|',duration,'|',octave,'|',accidental,'|', whatever,'|',dotgroup,'|',xtuplet,'|',shortcut) end; { If rearrangeNote is TRUE, translate original note to the following form: 1. Note name. 2. Duration. 3. Octave adjustments. 4. Everything except the other six items. 5. Accidental with adjustments (rest: height adjustment) 6. Dot with adjustments. 7. Xtuplet group. } procedure translateSolfa(var nt: char); var k: integer; begin if solfaNoteNames then begin k:=pos1(nt,solfa_names); if k>0 then nt:=has_duration[k] end end; function durationCode (note: string): char; var code: char; begin durationCode:=unspecified; if length(note)>1 then begin code:=note[2]; if pos1(code,durations)>0 then durationCode:=code end end; function half ( dur: char ) : char; var k: integer; begin k:= pos1 (dur, durations ); half := dur; if k=0 then error ('Invalid duration '+dur,print) else if k>ndurs then error (dur+' is too short to halve',print) else half := durations[k+1]; end; procedure addDuration ( var note: string; dur: char); begin if insertDuration then insertchar(dur,note,2); end; { Extract procedures. All of these remove part of "note" (sometimes the part is empty) and put it somewhere else. The part may be anywhere in "note", except when otherwise specified.} { Unconditionally extracts the first character. } procedure extractFirst(var note: string; var first: char); begin first:=note[1]; predelete(note,1) end; { Extracts at most one of the characters in "hits". } procedure extractOneOf(var note: string; hits: string; var hit: string); var i, l: integer; begin l:=length(note); hit:=''; for i:=1 to l do if pos1(note[i],hits)>0 then begin hit:=note[i]; delete1(note,i); exit; end; end; { Extracts contiguous characters in "hits" until no more are found. There may be more later. } procedure extractContiguous(var note: string; hits: string; var hit: string); var i, l, len: integer; begin l:=length(note); len:=l; hit:=''; for i:=1 to l do if pos1(note[i],hits)>0 then begin repeat if pos1(note[i],hits)=0 then exit; hit:=hit+note[i]; delete1(note,i); dec(len) until len<i; exit; end; end; { Extracts the specified character and everything after it. } procedure extractAfter(var note: string; delim: char; var tail: string); var newlen: integer; begin newlen:=pos1(delim,note); tail:=''; if newlen=0 then exit; dec(newlen); tail:=note; predelete(tail,newlen); note[0]:=char(newlen); end; { Extracts the dot shortcut part of a note: comma shortcut is no problem because a comma cannot be part of a number. } procedure extractDotShortcut(var note: string; var tail: string); var names, tail2: string; l, lt: integer; ch: char; begin extractAfter(note,'.',tail); l:=1; lt:=length(tail); if (l<lt) and (tail[2]='.') then l:=2; if solfaNoteNames then names:=solfa_names else names:=has_duration; if (l<lt) and (pos1(tail[l+1],names)>0) then begin translateSolfa(tail[l+1]); exit end; if l=2 then error('".." followed by non-note',print); if l>=lt then begin note:=note+tail; tail:=''; exit end; ch:=tail[1]; predelete(tail,1); extractDotShortcut(tail,tail2); note:=note+ch+tail; tail:=tail2; end; { Extracts a signed number. } procedure extractSignedNumber(var note, number: string); var k: integer; note0: string; begin k:=pos1('+',note); if k=0 then k:=pos1('-',note); number:=''; if k=0 then exit; note0:=note; repeat number:=number+note[k]; delete1(note,k) until (k>length(note)) or (note[k]<>'0') and (pos1(note[k],digits)=0); if length(number)=1 then begin note:=note0; number:='' end end; { Extracts a symbol followed by optional +- or <> shift indicators } procedure extractGroup(var note: string; delim: char; var group: string); var gl, k, k0: integer; probe, nonumber: boolean; tail: string; procedure tryMore; begin while (k<=gl) and (group[k]=group[1]) do inc(k) end; procedure try(s: string); begin probe:=(k<gl) and (pos1(group[k],s)>0); if probe then inc(k) end; procedure tryNumber; var dot: boolean; begin nonumber:=true; dot:=false; while (k<=gl) and (pos1(group[k],digitsdot)>0) do begin inc(k); if group[k]='.' then if dot then error('Extra dot in number',print) else dot:=true else nonumber:=false end end; begin extractAfter(note,delim,group); if group='' then exit; gl:=length(group); k:=2; if (gl>1) and (group[2]=':') then k:=3 else begin tryMore; k0:=k; try('+-<>'); if probe then tryNumber; if nonumber then k:=k0; k0:=k; try('+-<>'); if probe then tryNumber; if nonumber then k:=k0; end; tail:=group; dec(k); group[0]:=char(k); predelete(tail,k); note:=note+tail end; procedure parseNote(note: string; var pnote: parsedNote); var onlymidi: string; begin with pnote do begin shortcut:=''; xtuplet:=''; accidental:=''; dotgroup:=''; duration:=''; octave:=''; onlymidi:=''; extractFirst(note,name); extractAfter(note,'x',xtuplet); extractAfter(note,',',shortcut); if shortcut='' then extractDotShortcut(note,shortcut); if name<>rest then begin extractGroup(note,'s',accidental); if accidental='' then extractGroup(note,'f',accidental); if accidental='' then extractGroup(note,'n',accidental); end; { Look for 'i' or 'c' anywhere in what is left of note.} if accidental<>'' then begin extractOneOf(note,'ic',onlymidi); accidental:=accidental+onlymidi end; extractGroup(note,'d',dotgroup); if name=rest then extractSignedNumber(note,accidental); extractOneOf(note,durations,duration); if note<>rest then extractContiguous(note,'=+-',octave); if (length(note)>0) and (note[1]>='0') and (note[1]<='9') then begin octave:=note[1]+octave; delete1(note,1) end; whatever := note end end; { On input: "note" is a note word; "dur1" is the default duration. On output: "note" has possibly been modified; possibly been split into two parts, the second being "shortcut"; "dur" is the suggested new default duration; "count" is the count of the total of "note" and "shortcut" } procedure processNote(var note, xnote: string; dur1: char; var dur: char; var count: integer); var sc, origdur: string[2]; multiplicity, l: integer; pnote: parsedNote; begin xnote:=''; dur:=dur1; if (note='') or not isNoteOrRest(note) or isPause(note) then exit; parseNote(note, pnote); if debugMode then begin write(note,' => '); printNote(pnote) end; with pnote do begin if pos1('.',whatever)>0 then warning('Suspicious dot in word '+note,print); origdur := duration; if duration='' then dur:=dur1 else dur:=duration[1]; count:=count64[dur]; if dotgroup<>'' then begin inc(count,count div 2); if startswith(dotgroup,'dd') then inc(count,count div 6) end; duration:=dur; if shortcut<>'' then begin if dotgroup<>'' then error('You may not explicitly dot a note with a shortcut',print); sc:=shortcut[1]; predelete(shortcut,1); if sc='.' then begin multiplicity:=1; if shortcut[1]='.' then begin inc(multiplicity); predelete(shortcut,1); sc:=sc+'.' end; inc(count,count); dur1:=duration[1]; for l:=1 to multiplicity do begin dotgroup:=dotgroup+dotcode; dur1:=half(dur1) end; addDuration(shortcut,dur1); end else begin addDuration(shortcut,half(duration[1])); inc(count,count div 2) end end; if not insertDuration then duration := origdur; if rearrangeNote then note := name + duration + octave + whatever + accidental + dotgroup + xtuplet else shortcut:=' '; if not insertDuration and (shortcut<>'') then shortcut:=sc+shortcut; xnote:=shortcut end end; function octaveCode (note: string): char; var pnote: parsedNote; begin {if debugMode then write('Octave code in note "',note,'" is ');} parseNote(note,pnote); with pnote do begin {if debugMode then writeln('"',octave,'"');} if octave='' then octaveCode:=' ' else octaveCode:=octave[1]; end end; procedure removeOctaveCode(code: char; var note: string); var k, l: integer; begin {if debugMode then writeln('remove ',code,' from ',note);} l:=length(note); for k:=1 to l do if note[k]=code then if (k=l) or (note[k+1]<'0') or (note[k+1]>'9') then begin delete1(note,k); exit end; fatalError('Code not found in note') end; procedure insertOctaveCode(code: char; var note: string); var l: integer; begin {if debugMode then writeln('insert ',code,' into ',note); } l:=length(note); if (l<2) or (note[2]<'0') or (note[2]>'9') then fatalError('Trying to insert octave into note without duration'); if (l<=2) or (note[3]<'0') or (note[3]>'9') then insertChar(code,note,3) else writeln('Not inserting "',code,'", note already has octave code"') end; end.
unit uDialogUtils; interface uses Vcl.Graphics, Vcl.Imaging.JPEG, UnitDBFileDialogs, uConstants, uMemory, uAssociations, uDBEntities, uImageLoader; procedure LoadNickJpegImage(Image: TPicture; JpegCompressionQuality: TJPEGQualityRange); function GetImageFromUser(var Bitmap: TBitmap; MaxWidth, MaxHeight: Integer): Boolean; function DBLoadImage(FileName: string; var Bitmap: TBitmap; MaxWidth, MaxHeight: Integer): Boolean; implementation function DBLoadImage(FileName: string; var Bitmap: TBitmap; MaxWidth, MaxHeight: Integer): Boolean; var Info: TMediaItem; ImageInfo: ILoadImageInfo; begin Result := False; Info := TMediaItem.CreateFromFile(FileName); try if LoadImageFromPath(Info, -1, '', [ilfGraphic, ilfICCProfile, ilfEXIF, ilfPassword, ilfAskUserPassword], ImageInfo, MaxWidth, MaxHeight) then begin Bitmap := ImageInfo.GenerateBitmap(Info, MaxWidth, MaxHeight, pf24Bit, clBlack, [ilboFreeGraphic, ilboRotate, ilboApplyICCProfile, ilboQualityResize]); Result := Bitmap <> nil; end; finally F(Info); end; end; function GetImageFromUser(var Bitmap: TBitmap; MaxWidth, MaxHeight: Integer): Boolean; var OpenPictureDialog: DBOpenPictureDialog; FileName: string; begin Result := False; OpenPictureDialog := DBOpenPictureDialog.Create; try OpenPictureDialog.Filter := TFileAssociations.Instance.FullFilter; if OpenPictureDialog.Execute then begin FileName := OpenPictureDialog.FileName; Result := DBLoadImage(FileName, Bitmap, MaxWidth, MaxHeight); end; finally F(OpenPictureDialog); end; end; procedure LoadNickJpegImage(Image: TPicture; JpegCompressionQuality: TJPEGQualityRange); var Bitmap: TBitmap; FJPG: TJpegImage; begin Bitmap := TBitmap.Create; try if GetImageFromUser(Bitmap, 48, 48) then begin FJPG := TJPegImage.Create; try FJPG.CompressionQuality := JpegCompressionQuality; FJPG.Assign(Bitmap); FJPG.JPEGNeeded; Image.Graphic := FJPG; finally F(FJPG); end; end; finally F(Bitmap); end; end; end.
{***************************************************************************} { } { Delphi Package Manager - DPM } { } { Copyright © 2019 Vincent Parrett and contributors } { } { vincent@finalbuilder.com } { https://www.finalbuilder.com } { } { } {***************************************************************************} { } { Licensed under the Apache License, Version 2.0 (the "License"); } { you may not use this file except in compliance with the License. } { You may obtain a copy of the License at } { } { http://www.apache.org/licenses/LICENSE-2.0 } { } { Unless required by applicable law or agreed to in writing, software } { distributed under the License is distributed on an "AS IS" BASIS, } { WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. } { See the License for the specific language governing permissions and } { limitations under the License. } { } {***************************************************************************} unit DPM.Core.Init; interface uses Spring.Container, DPM.Core.Types; //register types with the DI container. procedure InitCore(const container : TContainer; const overrideProc : TConstProc<TContainer> = nil); implementation uses System.TypInfo, Spring.Container.Registration, Spring.Container.Common, DPM.Core.Utils.Enum, DPM.Core.Packaging, DPM.Core.Packaging.Writer, DPM.Core.Packaging.Archive, DPM.Core.Packaging.Archive.Reader, DPM.Core.Packaging.Archive.Writer, DPM.Core.Spec.Interfaces, DPM.Core.Spec, DPM.Core.Spec.Reader, DPM.Core.Package.Interfaces, DPM.Core.Package.Installer.Interfaces, DPM.Core.Package.Installer, DPM.Core.Package.InstallerContext, DPM.Core.Sources.Interfaces, DPM.Core.Sources.Manager, DPM.Core.Configuration.Interfaces, DPM.Core.Configuration.Manager, DPM.Core.Repository.Interfaces, DPM.Core.Repository.Manager, DPM.Core.Repository.Factory, DPM.Core.Repository.Directory, DPM.Core.Repository.Http, DPM.Core.Cache.Interfaces, DPM.Core.Cache, DPM.Core.Dependency.Interfaces, DPM.Core.Dependency.Resolver, DPM.Core.Compiler.Interfaces, DPM.Core.Compiler.Factory, DPM.Core.Compiler.EnvironmentProvider; procedure InitCore(const container : TContainer; const overrideProc : TConstProc<TContainer>); begin // Container.RegisterType<IPackageArchiveReader, TZipFileArchiveReader>('file.archive'); // Container.RegisterType<IPackageArchiveReader, TFolderArchiveReader>('folder.archive'); Container.RegisterType<IPackageArchiveWriter, TPackageArchiveWriter>; Container.RegisterType<IPackageWriter, TPackageWriter>; Container.RegisterType<IPackageSpecReader, TPackageSpecReader>; Container.RegisterType<ICompilerEnvironmentProvider, TCompilerEnvironmentProvider>; Container.RegisterType<ICompilerFactory, TCompilerFactory>().AsSingleton(); if Assigned(overrideProc) then //allow IDE plugin to register it's own implementations. overrideProc(container) else begin Container.RegisterType<IPackageInstallerContext, TCorePackageInstallerContext>; end; Container.RegisterType<IPackageInstaller, TPackageInstaller>; Container.RegisterType<IConfigurationManager, TConfigurationManager>; Container.RegisterType<ISourcesManager, TSourcesManager>; Container.RegisterType<IPackageRepositoryFactory, TPackageRepositoryFactory>; Container.RegisterType<IPackageRepositoryManager, TPackageRepositoryManager>().AsSingleton(); Container.RegisterType<IPackageRepository, TDirectoryPackageRepository>(TEnumUtils.EnumToString<TSourceType>(TSourceType.Folder)); Container.RegisterType<IPackageRepository, TDPMServerPackageRepository>(TEnumUtils.EnumToString<TSourceType>(TSourceType.DPMServer)); Container.RegisterType<IPackageCache, TPackageCache>.AsSingleton(); Container.RegisterType<IDependencyResolver, TDependencyResolver>; Container.RegisterInstance<TContainer>(Container); end; end.
namespace BadgeContent; interface uses Windows.UI.Notifications, Windows.Data.Xml.Dom; type /// <summary> /// Base notification content interface to retrieve notification Xml as a string. /// </summary> INotificationContent = public interface /// <summary> /// Retrieves the notification Xml content as a string. /// </summary> /// <returns>The notification Xml content as a string.</returns> method GetContent: String; /// <summary> /// Retrieves the notification Xml content as a WinRT Xml document. /// </summary> /// <returns>The notification Xml content as a WinRT Xml document.</returns> method GetXml: XmlDocument; end; /// <summary> /// A type contained by the tile and toast notification content objects that /// represents a text field in the template. /// </summary> INotificationContentText = public interface /// <summary> /// The text value that will be shown in the text field. /// </summary> property Text: String read write; /// <summary> /// The language of the text field. This proprety overrides the language provided in the /// containing notification object. The language should be specified using the /// abbreviated language code as defined by BCP 47. /// </summary> property Lang: String read write; end; /// <summary> /// A type contained by the tile and toast notification content objects that /// represents an image in a template. /// </summary> INotificationContentImage = public interface /// <summary> /// The location of the image. Relative image paths use the BaseUri provided in the containing /// notification object. If no BaseUri is provided, paths are relative to ms-appx:///. /// Only png and jpg images are supported. Images must be 800x800 pixels or less, and smaller than /// 150 kB in size. /// </summary> property Src: String read write; /// <summary> /// Alt text that describes the image. /// </summary> property Alt: String read write; end; type /// <summary> /// Base tile notification content interface. /// </summary> ITileNotificationContent = public interface(INotificationContent) /// <summary> /// Whether strict validation should be applied when the Xml or notification object is created, /// and when some of the properties are assigned. /// </summary> property StrictValidation: Boolean read write; /// <summary> /// The language of the content being displayed. The language should be specified using the /// abbreviated language code as defined by BCP 47. /// </summary> property Lang: String read write; /// <summary> /// The BaseUri that should be used for image locations. Relative image locations use this /// field as their base Uri. The BaseUri must begin with http://, https://, ms-appx:///, or /// ms-appdata:///local/. /// </summary> property BaseUri: String read write; /// <summary> /// Determines the application branding when tile notification content is displayed on the tile. /// </summary> property Branding: TileBranding read write; /// <summary> /// Creates a WinRT TileNotification object based on the content. /// </summary> /// <returns>The WinRT TileNotification object</returns> method CreateNotification: TileNotification; end; /// <summary> /// Base square tile notification content interface. /// </summary> ISquareTileNotificationContent = public interface(ITileNotificationContent) end; /// <summary> /// Base wide tile notification content interface. /// </summary> IWideTileNotificationContent = public interface(ITileNotificationContent) /// <summary> /// Corresponding square tile notification content should be a part of every wide tile notification. /// </summary> property SquareContent: ISquareTileNotificationContent read write; /// <summary> /// Whether square tile notification content needs to be added to pass /// validation. Square content is required by default. /// </summary> property RequireSquareContent: Boolean read write; end; /// <summary> /// A square tile template that displays two text captions. /// </summary> ITileSquareBlock = public interface(ISquareTileNotificationContent) /// <summary> /// A large block text field. /// </summary> property TextBlock: INotificationContentText read; /// <summary> /// The description under the large block text field. /// </summary> property TextSubBlock: INotificationContentText read; end; /// <summary> /// A square tile template that displays an image. /// </summary> ITileSquareImage = public interface(ISquareTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; end; /// <summary> /// A square tile template that displays an image, then transitions to show /// four text fields. /// </summary> ITileSquarePeekImageAndText01 = public interface(ISquareTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; end; /// <summary> /// A square tile template that displays an image, then transitions to show /// two text fields. /// </summary> ITileSquarePeekImageAndText02 = public interface(ISquareTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A square tile template that displays an image, then transitions to show /// four text fields. /// </summary> ITileSquarePeekImageAndText03 = public interface(ISquareTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; end; /// <summary> /// A square tile template that displays an image, then transitions to /// show a text field. /// </summary> ITileSquarePeekImageAndText04 = public interface(ISquareTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A square tile template that displays four text fields. /// </summary> ITileSquareText01 = public interface(ISquareTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; end; /// <summary> /// A square tile template that displays two text fields. /// </summary> ITileSquareText02 = public interface(ISquareTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A square tile template that displays four text fields. /// </summary> ITileSquareText03 = public interface(ISquareTileNotificationContent) /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; end; /// <summary> /// A square tile template that displays a text field. /// </summary> ITileSquareText04 = public interface(ISquareTileNotificationContent) /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A square tile template that displays six text fields. /// </summary> ITileWideBlockAndText01 = public interface(IWideTileNotificationContent) /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; /// <summary> /// A large block text field. /// </summary> property TextBlock: INotificationContentText read; /// <summary> /// The description under the large block text field. /// </summary> property TextSubBlock: INotificationContentText read; end; /// <summary> /// A square tile template that displays three text fields. /// </summary> ITileWideBlockAndText02 = public interface(IWideTileNotificationContent) /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; /// <summary> /// A large block text field. /// </summary> property TextBlock: INotificationContentText read; /// <summary> /// The description under the large block text field. /// </summary> property TextSubBlock: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image. /// </summary> ITileWideImage = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; end; /// <summary> /// A wide tile template that displays an image and a text caption. /// </summary> ITileWideImageAndText01 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A caption for the image. /// </summary> property TextCaptionWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image and two text captions. /// </summary> ITileWideImageAndText02 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// The first caption for the image. /// </summary> property TextCaption1: INotificationContentText read; /// <summary> /// The second caption for the image. /// </summary> property TextCaption2: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five images - one main image, /// and four square images in a grid. /// </summary> ITileWideImageCollection = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property ImageMain: INotificationContentImage read; /// <summary> /// A small square image on the tile. /// </summary> property ImageSmallColumn1Row1: INotificationContentImage read; /// <summary> /// A small square image on the tile. /// </summary> property ImageSmallColumn2Row1: INotificationContentImage read; /// <summary> /// A small square image on the tile. /// </summary> property ImageSmallColumn1Row2: INotificationContentImage read; /// <summary> /// A small square image on the tile. /// </summary> property ImageSmallColumn2Row2: INotificationContentImage read; end; /// <summary> /// A wide tile template that displays an image, then transitions to show /// two text fields. /// </summary> ITileWidePeekImage01 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image, then transitions to show /// five text fields. /// </summary> ITileWidePeekImage02 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image, then transitions to show /// a text field. /// </summary> ITileWidePeekImage03 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image, then transitions to show /// a text field. /// </summary> ITileWidePeekImage04 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image, then transitions to show /// another image and two text fields. /// </summary> ITileWidePeekImage05 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property ImageMain: INotificationContentImage read; /// <summary> /// The secondary image on the tile. /// </summary> property ImageSecondary: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image, then transitions to show /// another image and a text field. /// </summary> ITileWidePeekImage06 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property ImageMain: INotificationContentImage read; /// <summary> /// The secondary image on the tile. /// </summary> property ImageSecondary: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image and a portion of a text field, /// then transitions to show all of the text field. /// </summary> ITileWidePeekImageAndText01 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image and a text field, /// then transitions to show the text field and four other text fields. /// </summary> ITileWidePeekImageAndText02 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody5: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five images - one main image, /// and four square images in a grid, then transitions to show two /// text fields. /// </summary> ITileWidePeekImageCollection01 = public interface(ITileWideImageCollection) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five images - one main image, /// and four square images in a grid, then transitions to show five /// text fields. /// </summary> ITileWidePeekImageCollection02 = public interface(ITileWideImageCollection) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five images - one main image, /// and four square images in a grid, then transitions to show a /// text field. /// </summary> ITileWidePeekImageCollection03 = public interface(ITileWideImageCollection) /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five images - one main image, /// and four square images in a grid, then transitions to show a /// text field. /// </summary> ITileWidePeekImageCollection04 = public interface(ITileWideImageCollection) /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five images - one main image, /// and four square images in a grid, then transitions to show an image /// and two text fields. /// </summary> ITileWidePeekImageCollection05 = public interface(ITileWideImageCollection) /// <summary> /// The secondary image on the tile. /// </summary> property ImageSecondary: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five images - one main image, /// and four square images in a grid, then transitions to show an image /// and a text field. /// </summary> ITileWidePeekImageCollection06 = public interface(ITileWideImageCollection) /// <summary> /// The secondary image on the tile. /// </summary> property ImageSecondary: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image and a text field. /// </summary> ITileWideSmallImageAndText01 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image and 5 text fields. /// </summary> ITileWideSmallImageAndText02 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image and a text field. /// </summary> ITileWideSmallImageAndText03 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays an image and two text fields. /// </summary> ITileWideSmallImageAndText04 = public interface(IWideTileNotificationContent) /// <summary> /// The main image on the tile. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five text fields. /// </summary> ITileWideText01 = public interface(IWideTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; end; /// <summary> /// A wide tile template that displays nine text fields - a heading and two columns /// of four text fields. /// </summary> ITileWideText02 = public interface(IWideTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row4: INotificationContentText read; end; /// <summary> /// A wide tile template that displays a text field. /// </summary> ITileWideText03 = public interface(IWideTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays a text field. /// </summary> ITileWideText04 = public interface(IWideTileNotificationContent) /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays five text fields. /// </summary> ITileWideText05 = public interface(IWideTileNotificationContent) /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody3: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody4: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody5: INotificationContentText read; end; /// <summary> /// A wide tile template that displays ten text fields - two columns /// of five text fields. /// </summary> ITileWideText06 = public interface(IWideTileNotificationContent) /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn1Row5: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row5: INotificationContentText read; end; /// <summary> /// A wide tile template that displays nine text fields - a heading and two columns /// of four text fields. /// </summary> ITileWideText07 = public interface(IWideTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row4: INotificationContentText read; end; /// <summary> /// A wide tile template that displays ten text fields - two columns /// of five text fields. /// </summary> ITileWideText08 = public interface(IWideTileNotificationContent) /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextShortColumn1Row5: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row5: INotificationContentText read; end; /// <summary> /// A wide tile template that displays two text fields. /// </summary> ITileWideText09 = public interface(IWideTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A wide tile template that displays nine text fields - a heading and two columns /// of four text fields. /// </summary> ITileWideText10 = public interface(IWideTileNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row4: INotificationContentText read; end; /// <summary> /// A wide tile template that displays ten text fields - two columns /// of five text fields. /// </summary> ITileWideText11 = public interface(IWideTileNotificationContent) /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row1: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row2: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row3: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row4: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextPrefixColumn1Row5: INotificationContentText read; /// <summary> /// A text field displayed in a column and row. /// </summary> property TextColumn2Row5: INotificationContentText read; end; /// <summary> /// The types of behavior that can be used for application branding when /// tile notification content is displayed on the tile. /// </summary> TileBranding = public enum(/// <summary> /// No application branding will be displayed on the tile content. /// </summary> None = 0, /// <summary> /// The application logo will be displayed with the tile content. /// </summary> Logo, /// <summary> /// The application name will be displayed with the tile content. /// </summary> Name ); type /// <summary> /// Type representing the toast notification audio properties which is contained within /// a toast notification content object. /// </summary> IToastAudio = public interface /// <summary> /// The audio content that should be played when the toast is shown. /// </summary> property Content: ToastAudioContent read write; /// <summary> /// Whether the audio should loop. If this property is set to true, the toast audio content /// must be a looping sound. /// </summary> property &Loop: Boolean read write; end; /// <summary> /// Base toast notification content interface. /// </summary> IToastNotificationContent = public interface(INotificationContent) /// <summary> /// Whether strict validation should be applied when the Xml or notification object is created, /// and when some of the properties are assigned. /// </summary> property StrictValidation: Boolean read write; /// <summary> /// The language of the content being displayed. The language should be specified using the /// abbreviated language code as defined by BCP 47. /// </summary> property Lang: String read write; /// <summary> /// The BaseUri that should be used for image locations. Relative image locations use this /// field as their base Uri. The BaseUri must begin with http://, https://, ms-appx:///, or /// ms-appdata:///local/. /// </summary> property BaseUri: String read write; /// <summary> /// The launch parameter passed into the metro application when the toast is activated. /// </summary> property Launch: String read write; /// <summary> /// The audio that should be played when the toast is displayed. /// </summary> property Audio: IToastAudio read; /// <summary> /// The length that the toast should be displayed on screen. /// </summary> property Duration: ToastDuration read write; /// <summary> /// Creates a WinRT ToastNotification object based on the content. /// </summary> /// <returns>A WinRT ToastNotification object based on the content.</returns> method CreateNotification: ToastNotification; end; /// <summary> /// The audio options that can be played while the toast is on screen. /// </summary> ToastAudioContent = public enum( /// <summary> /// The default toast audio sound. /// </summary> &Default = 0, /// <summary> /// Audio that corresponds to new mail arriving. /// </summary> Mail, /// <summary> /// Audio that corresponds to a new SMS message arriving. /// </summary> SMS, /// <summary> /// Audio that corresponds to a new IM arriving. /// </summary> IM, /// <summary> /// Audio that corresponds to a reminder. /// </summary> Reminder, /// <summary> /// The default looping sound. Audio that corresponds to a call. /// Only valid for toasts that are have the duration set to "Long". /// </summary> LoopingCall, /// <summary> /// Audio that corresponds to a call. /// Only valid for toasts that are have the duration set to "Long". /// </summary> LoopingCall2, /// <summary> /// Audio that corresponds to an alarm. /// Only valid for toasts that are have the duration set to "Long". /// </summary> LoopingAlarm, /// <summary> /// Audio that corresponds to an alarm. /// Only valid for toasts that are have the duration set to "Long". /// </summary> LoopingAlarm2, /// <summary> /// No audio should be played when the toast is displayed. /// </summary> Silent ); /// <summary> /// The duration the toast should be displayed on screen. /// </summary> ToastDuration = public enum( /// <summary> /// Default behavior. The toast will be on screen for a short amount of time. /// </summary> Short = 0, /// <summary> /// The toast will be on screen for a longer amount of time. /// </summary> Long ); /// <summary> /// A toast template that displays an image and a text field. /// </summary> IToastImageAndText01 = public interface(IToastNotificationContent) /// <summary> /// The main image on the toast. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A toast template that displays an image and two text fields. /// </summary> IToastImageAndText02 = public interface(IToastNotificationContent) /// <summary> /// The main image on the toast. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A toast template that displays an image and two text fields. /// </summary> IToastImageAndText03 = public interface(IToastNotificationContent) /// <summary> /// The main image on the toast. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody: INotificationContentText read; end; /// <summary> /// A toast template that displays an image and three text fields. /// </summary> IToastImageAndText04 = public interface(IToastNotificationContent) /// <summary> /// The main image on the toast. /// </summary> property Image: INotificationContentImage read; /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; end; /// <summary> /// A toast template that displays a text fields. /// </summary> IToastText01 = public interface(IToastNotificationContent) /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A toast template that displays two text fields. /// </summary> IToastText02 = public interface(IToastNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBodyWrap: INotificationContentText read; end; /// <summary> /// A toast template that displays two text fields. /// </summary> IToastText03 = public interface(IToastNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeadingWrap: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody: INotificationContentText read; end; /// <summary> /// A toast template that displays three text fields. /// </summary> IToastText04 = public interface(IToastNotificationContent) /// <summary> /// A heading text field. /// </summary> property TextHeading: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody1: INotificationContentText read; /// <summary> /// A body text field. /// </summary> property TextBody2: INotificationContentText read; end; type /// <summary> /// Base badge notification content interface. /// </summary> IBadgeNotificationContent = public interface(INotificationContent) /// <summary> /// Creates a WinRT BadgeNotification object based on the content. /// </summary> /// <returns>A WinRT BadgeNotification object based on the content.</returns> method CreateNotification: BadgeNotification; end; /// <summary> /// The types of glyphs that can be placed on a badge. /// </summary> GlyphValue = public enum( /// <summary> /// No glyph. If there is a numeric badge, or a glyph currently on the badge, /// it will be removed. /// </summary> None = 0, /// <summary> /// A glyph representing application activity. /// </summary> Activity, /// <summary> /// A glyph representing an alert. /// </summary> Alert, /// <summary> /// A glyph representing availability status. /// </summary> Available, /// <summary> /// A glyph representing away status /// </summary> Away, /// <summary> /// A glyph representing busy status. /// </summary> Busy, /// <summary> /// A glyph representing that a new message is available. /// </summary> NewMessage, /// <summary> /// A glyph representing that media is paused. /// </summary> Paused, /// <summary> /// A glyph representing that media is playing. /// </summary> Playing, /// <summary> /// A glyph representing unavailable status. /// </summary> Unavailable, /// <summary> /// A glyph representing an error. /// </summary> Error ); implementation end.
unit uCargoDAOClient; interface uses DBXCommon, DBXClient, DBXJSON, DSProxy, Classes, SysUtils, DB, SqlExpr, DBXDBReaders, Generics.Collections, DBXJSONReflect, Cargo; type TCargoDAOClient = class(TDSAdminClient) private FListCommand: TDBXCommand; FInsertCommand: TDBXCommand; FUpdateCommand: TDBXCommand; FDeleteCommand: TDBXCommand; FFindByIdCommand: TDBXCommand; public constructor Create(ADBXConnection: TDBXConnection); overload; constructor Create(ADBXConnection: TDBXConnection; AInstanceOwner: Boolean); overload; destructor Destroy; override; function List: TDBXReader; function Insert(Cargo: TCargo): Boolean; function Update(Cargo: TCargo): Boolean; function Delete(Cargo: TCargo): Boolean; function FindById(Id: Integer): TCargo; end; implementation function TCargoDAOClient.List: TDBXReader; begin if FListCommand = nil then begin FListCommand := FDBXConnection.CreateCommand; FListCommand.CommandType := TDBXCommandTypes.DSServerMethod; FListCommand.Text := 'TCargoDAO.List'; FListCommand.Prepare; end; FListCommand.ExecuteUpdate; Result := FListCommand.Parameters[0].Value.GetDBXReader(FInstanceOwner); end; function TCargoDAOClient.Insert(Cargo: TCargo): Boolean; begin if FInsertCommand = nil then begin FInsertCommand := FDBXConnection.CreateCommand; FInsertCommand.CommandType := TDBXCommandTypes.DSServerMethod; FInsertCommand.Text := 'TCargoDAO.Insert'; FInsertCommand.Prepare; end; if not Assigned(Cargo) then FInsertCommand.Parameters[0].Value.SetNull else begin FMarshal := TDBXClientCommand(FInsertCommand.Parameters[0].ConnectionHandler).GetJSONMarshaler; try FInsertCommand.Parameters[0].Value.SetJSONValue(FMarshal.Marshal(Cargo), True); if FInstanceOwner then Cargo.Free finally FreeAndNil(FMarshal) end end; FInsertCommand.ExecuteUpdate; Result := FInsertCommand.Parameters[1].Value.GetBoolean; end; function TCargoDAOClient.Update(Cargo: TCargo): Boolean; begin if FUpdateCommand = nil then begin FUpdateCommand := FDBXConnection.CreateCommand; FUpdateCommand.CommandType := TDBXCommandTypes.DSServerMethod; FUpdateCommand.Text := 'TCargoDAO.Update'; FUpdateCommand.Prepare; end; if not Assigned(Cargo) then FUpdateCommand.Parameters[0].Value.SetNull else begin FMarshal := TDBXClientCommand(FUpdateCommand.Parameters[0].ConnectionHandler).GetJSONMarshaler; try FUpdateCommand.Parameters[0].Value.SetJSONValue(FMarshal.Marshal(Cargo), True); if FInstanceOwner then Cargo.Free finally FreeAndNil(FMarshal) end end; FUpdateCommand.ExecuteUpdate; Result := FUpdateCommand.Parameters[1].Value.GetBoolean; end; function TCargoDAOClient.Delete(Cargo: TCargo): Boolean; begin if FDeleteCommand = nil then begin FDeleteCommand := FDBXConnection.CreateCommand; FDeleteCommand.CommandType := TDBXCommandTypes.DSServerMethod; FDeleteCommand.Text := 'TCargoDAO.Delete'; FDeleteCommand.Prepare; end; if not Assigned(Cargo) then FDeleteCommand.Parameters[0].Value.SetNull else begin FMarshal := TDBXClientCommand(FDeleteCommand.Parameters[0].ConnectionHandler).GetJSONMarshaler; try FDeleteCommand.Parameters[0].Value.SetJSONValue(FMarshal.Marshal(Cargo), True); if FInstanceOwner then Cargo.Free finally FreeAndNil(FMarshal) end end; FDeleteCommand.ExecuteUpdate; Result := FDeleteCommand.Parameters[1].Value.GetBoolean; end; function TCargoDAOClient.FindById(Id: Integer): TCargo; begin if FFindByIdCommand = nil then begin FFindByIdCommand := FDBXConnection.CreateCommand; FFindByIdCommand.CommandType := TDBXCommandTypes.DSServerMethod; FFindByIdCommand.Text := 'TCargoDAO.FindById'; FFindByIdCommand.Prepare; end; FFindByIdCommand.Parameters[0].Value.SetInt32(Id); FFindByIdCommand.ExecuteUpdate; if not FFindByIdCommand.Parameters[1].Value.IsNull then begin FUnMarshal := TDBXClientCommand(FFindByIdCommand.Parameters[1].ConnectionHandler).GetJSONUnMarshaler; try Result := TCargo(FUnMarshal.UnMarshal(FFindByIdCommand.Parameters[1].Value.GetJSONValue(True))); if FInstanceOwner then FFindByIdCommand.FreeOnExecute(Result); finally FreeAndNil(FUnMarshal) end end else Result := nil; end; constructor TCargoDAOClient.Create(ADBXConnection: TDBXConnection); begin inherited Create(ADBXConnection); end; constructor TCargoDAOClient.Create(ADBXConnection: TDBXConnection; AInstanceOwner: Boolean); begin inherited Create(ADBXConnection, AInstanceOwner); end; destructor TCargoDAOClient.Destroy; begin FreeAndNil(FListCommand); FreeAndNil(FInsertCommand); FreeAndNil(FUpdateCommand); FreeAndNil(FDeleteCommand); FreeAndNil(FFindByIdCommand); inherited; end; end.
program Hern; uses GraphABC; type Point = record x,y: Integer; end; const px = 0; py = 0; pz = 0; ppx = 100; ppy = 100; m = 100; var x,y,z,x1,y1,z1: array [1..4] of Real; a,b,g: Real; i: Integer; procedure Rotate(var x,y,z: Real; const a,b,g: Real); var nx,ny,nz,t: Real; begin nx:=(x-px)*cos(g)-(y-py)*sin(g); ny:=(x-px)*sin(g)+(y-py)*cos(g); nz:=z-pz; t:=x*cos(b)-z*sin(b); nz:=x*sin(b)+z*cos(b); x:=px+t; y:=py+ny*cos(a)-nz*sin(a); z:=pz+ny*sin(a)+nz*cos(a); end; procedure SetPoint(xx,yy,zz: Real; n: Integer); begin x[n]:=xx; y[n]:=yy; z[n]:=zz; end; function PPoint(x,y: Real): Point; begin result.x:=Round(x); result.y:=Round(y); end; procedure PolygonF(n1,n2,n3,n4: Integer); var a: array [1..4] of Point; begin a[1]:=PPoint(x1[n1]*m+ppx,y1[n1]+ppy); a[2]:=PPoint(x1[n2]*m+ppx,y1[n2]+ppy); a[3]:=PPoint(x1[n3]*m+ppx,y1[n3]+ppy); a[4]:=PPoint(x1[n4]*m+ppx,y1[n4]+ppy); Polygon(a,4); end; begin a:=0; b:=0; g:=0; SetPoint(0,0,0,1); SetPoint(1,0,0,2); SetPoint(1,1,0,3); SetPoint(0,1,0,4); LockDrawing; while true do begin ClearWindow; for i:=1 to 4 do begin x1[i]:=x[i]; y1[i]:=y[i]; z1[i]:=z[i]; Rotate(x1[i],y1[i],z1[i],a,b,g); end; PolygonF(1,2,3,4); Redraw; a:=a+0.01; //b:=b+0.01; g:=g+0.01; If a>=2*pi then a:=0; //sleep(100); end; end.
unit Validador.UI.FormBase; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs; type TFormBase = class(TForm) procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); private function GetDiretorioBase: string; protected function PodeFecharForm: Boolean; virtual; procedure ESCPressionado(Sender: TObject; var Key: Word; Shift: TShiftState); public property DiretorioBase: string read GetDiretorioBase; end; var FormBase: TFormBase; implementation {$R *.dfm} procedure TFormBase.ESCPressionado(Sender: TObject; var Key: Word; Shift: TShiftState); begin Close; end; procedure TFormBase.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose := PodeFecharForm; end; procedure TFormBase.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = VK_ESCAPE then ESCPressionado(Sender, Key, Shift); end; function TFormBase.GetDiretorioBase: string; const PARAMETRO_PATH_EXECUTAVEL = 0; PARAMETRO_DIRETORIO_BASE = 1; begin Result := ParamStr(1); if Result.Trim.IsEmpty then Result := ExtractFilePath(ParamStr(0)); Result := IncludeTrailingPathDelimiter(Result); end; function TFormBase.PodeFecharForm: Boolean; begin Result := True; end; end.
unit svm_core; //{$define WindowsSEH} {$mode objfpc} {$H+} interface uses Classes, SysUtils, svm_grabber, svm_mem, svm_utils, svm_common, svm_opcodes, svm_res, svm_imports, svm_callbacks, svm_stack, svm_exceptions; type TSVM = object public ip, end_ip: TInstructionPointer; mainclasspath: string; mem, local_mem: PMemory; grabber: TGrabber; stack, rstack: TStack; cbstack: TCallBackStack; bytes: PByteArr; consts: PConstSection; extern_methods: PImportSection; try_blocks: TTRBlocks; isMainThread, CustomArgsMode: boolean; pVM_NULL: TSVMMem; procedure Run; procedure RunThread; procedure LoadByteCodeFromFile(fn: string); procedure LoadByteCodeFromMem(buf: PByte; sz: Cardinal); procedure LoadContext(Ctx: TObject); end; PSVM = ^TSVM; implementation uses svm_threads; procedure TSVM.Run; var c: cardinal; r: TSVMMem; s: string; begin self.ip := 0; self.end_ip := length(self.bytes^); self.grabber := TGrabber.Create; if not self.CustomArgsMode then begin c := ParamCount; while c > 1 do begin r := NewSVMM_FS(ParamStr(c), Grabber); r.m_rcnt := 1; self.stack.push(r); Dec(c); end; end; s := ParamStr(1); if pos(':', s) < 0 then s := ExtractFilePath(ParamStr(0)) + ParamStr(1); r := NewSVMM_FS(s, Grabber); r.m_rcnt := 1; self.stack.push(r); r := NewSVMM_FW(self.stack.i_pos, Grabber); r.m_rcnt := 1; self.stack.push(r); self.RunThread; self.grabber.Term; FreeAndNil(self.grabber); end; procedure TSVM.LoadByteCodeFromFile(fn: string); var f: file of byte; begin Self.MainClassPath := fn; AssignFile(f, fn); Reset(f); SetLength(self.bytes^, 0); while not EOF(f) do begin SetLength(self.bytes^, Length(self.bytes^) + 1); Read(f, self.bytes^[Length(self.bytes^) - 1]); end; CloseFile(f); end; procedure TSVM.LoadByteCodeFromMem(buf: PByte; sz: Cardinal); var i: cardinal; begin setlength(self.bytes^, sz); for i := 0 to sz do self.bytes^[i] := PByte(LongWord(buf) + i)^; end; procedure TSVM.LoadContext(Ctx: TObject); var p: pointer; c, l: cardinal; begin p := self.mem; self.mem := TSVMThreadContext(Ctx).CtxMemory; TSVMThreadContext(Ctx).CtxMemory := p; self.stack.drop; l := TSVMThreadContext(Ctx).CtxStack.i_pos; c := 0; while c < l do begin self.stack.push(TSVMThreadContext(Ctx).CtxStack.items[c]); Inc(c); end; end; procedure TSVM.RunThread; var p, p2: pointer; r: TSVMMem; s: string; c, j: cardinal; {$IfDef WindowsSEH} lst: TList; {$EndIf} begin repeat try while self.ip < self.end_ip do begin {if isMainThread and (GrabbersInStorage > 0) then GlobalGC;} {$IfDef DebugVer} writeln('IP: ', self.ip, ', Op: ', GetEnumName(TypeInfo(TComand), self.bytes^[self.ip])); {$EndIf} {$IfDef WindowsSEH} if VEHExceptions_Count > 0 then try lst := VEHExceptions.LockList; p := Pointer(GetCurrentThreadId); if lst.IndexOf(p) <> -1 then begin while lst.IndexOf(p) <> -1 do lst.Delete(lst.IndexOf(p)); VEHExceptions_Count := lst.Count; p2 := NewSVMM_FS('Unknown exception.', Grabber); TSVMMem(p2).m_refc := 1; self.stack.push(p2); p2 := NewSVMM_FS('EUnknownException', Grabber); TSVMMem(p2).m_refc := 1; self.stack.push(p2); p := EUnknownException.Create('Unknown exception.'); self.ip := try_blocks.TR_Catch(Exception(p)); FreeAndNil(p); end; finally VEHExceptions.UnlockList; end; {$EndIf} case TInstruction(self.bytes^[self.ip]) of bcPH: begin c := cardinal((self.bytes^[self.ip + 4] shl 24) + (self.bytes^[self.ip + 3] shl 16) + (self.bytes^[self.ip + 2] shl 8) + self.bytes^[self.ip + 1]); p := self.mem^[c]; InterlockedIncrement(TSVMMem(p).m_rcnt); self.stack.push(p); Inc(self.ip, 5); end; bcPK: begin c := cardinal((self.bytes^[self.ip + 4] shl 24) + (self.bytes^[self.ip + 3] shl 16) + (self.bytes^[self.ip + 2] shl 8) + self.bytes^[self.ip + 1]); p := self.mem^[c]; InterlockedDecrement(TSVMMem(p).m_rcnt); p2 := self.stack.peek; self.mem^[c] := p2; InterlockedIncrement(TSVMMem(p2).m_rcnt); Inc(self.ip, 5); end; bcPHL: begin c := cardinal((self.bytes^[self.ip + 4] shl 24) + (self.bytes^[self.ip + 3] shl 16) + (self.bytes^[self.ip + 2] shl 8) + self.bytes^[self.ip + 1]); p := self.local_mem^[c]; InterlockedIncrement(TSVMMem(p).m_rcnt); self.stack.push(p); Inc(self.ip, 5); end; bcPKL: begin c := cardinal((self.bytes^[self.ip + 4] shl 24) + (self.bytes^[self.ip + 3] shl 16) + (self.bytes^[self.ip + 2] shl 8) + self.bytes^[self.ip + 1]); p := self.local_mem^[c]; InterlockedDecrement(TSVMMem(p).m_rcnt); p2 := self.stack.peek; self.local_mem^[c] := p2; InterlockedIncrement(TSVMMem(p2).m_rcnt); Inc(self.ip, 5); end; bcPP: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); Inc(self.ip); end; bcSDP: begin self.stack.drop; Inc(self.ip); {$IfDef BuildInLibrary} if DbgCallBack <> nil then TDbgCallBack(DbgCallBack)(@self); {$EndIf} end; bcSWP: begin self.stack.swp; Inc(self.ip); end; bcJP: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); self.ip := TSVMMem(p).GetW; end; bcJZ: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); if TSVMMem(p).GetI = 0 then begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); self.ip := TSVMMem(p).GetW; end else Inc(self.ip); end; bcJN: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); if TSVMMem(p).GetI <> 0 then begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); self.ip := TSVMMem(p).GetW; end else Inc(self.ip); end; bcJC: begin self.cbstack.push(self.ip + 1); {$IfDef DebugVer} writeln(' - Point to jump: ', TSVMMem(self.stack.peek).GetW); {$EndIf} p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); self.ip := TSVMMem(p).GetW; {$IfDef BuildInLibrary} if DbgCallBack <> nil then TDbgCallBack(DbgCallBack)(@self); {$EndIf} end; bcJR: begin self.ip := Self.cbstack.popv; {$IfDef BuildInLibrary} if DbgCallBack <> nil then TDbgCallBack(DbgCallBack)(@self); {$EndIf} end; bcJRP: begin self.cbstack.pop; Inc(self.ip); end; bcEQ: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); InterlockedDecrement(TSVMMem(p2).m_rcnt); if p = p2 then begin r := NewSVMM(self.grabber); r.SetB(true); r.m_rcnt := 1; self.stack.push(r); end else begin if (TSVMMem(p).m_type = svmtNull) or (TSVMMem(p2).m_type = svmtNull) then begin r := NewSVMM(self.grabber); r.m_rcnt := 1; r.SetB((TSVMMem(p).m_type = svmtNull) and (TSVMMem(p2).m_type = svmtNull)); self.stack.push(r); end else begin r := CreateSVMMemCopy(TSVMMem(p), Grabber); r.m_rcnt := 1; self.stack.push(r); r.OpEq(TSVMMem(p2)); end; end; Inc(self.ip); end; bcBG: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := CreateSVMMemCopy(TSVMMem(p), Grabber); p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r.m_rcnt := 1; self.stack.push(r); r.OpBg(TSVMMem(p)); Inc(self.ip); end; bcBE: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := CreateSVMMemCopy(TSVMMem(p), Grabber); p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r.m_rcnt := 1; self.stack.push(r); r.OpBe(TSVMMem(p)); Inc(self.ip); end; bcNOT: begin TSVMMem(self.stack.peek).OpNot; Inc(self.ip); end; bcAND: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpAnd(TSVMMem(p2)); Inc(self.ip); end; bcOR: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpOr(TSVMMem(p2)); Inc(self.ip); end; bcXOR: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpXor(TSVMMem(p2)); Inc(self.ip); end; bcSHR: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpSHR(TSVMMem(p2)); Inc(self.ip); end; bcSHL: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpSHL(TSVMMem(p2)); Inc(self.ip); end; bcNEG: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := NewSVMM_F(TSVMMem(p).m_val^, TSVMMem(p).m_type, Grabber); r.OpNeg; r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcINC: begin TSVMMem(self.stack.peek).OpInc; Inc(self.ip); end; bcDEC: begin TSVMMem(self.stack.peek).OpDec; Inc(self.ip); end; bcADD: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpAdd(TSVMMem(p2)); Inc(self.ip); end; bcSUB: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpSub(TSVMMem(p2)); Inc(self.ip); end; bcMUL: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpMul(TSVMMem(p2)); Inc(self.ip); end; bcDIV: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpDiv(TSVMMem(p2)); Inc(self.ip); end; bcMOD: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpMod(TSVMMem(p2)); Inc(self.ip); end; bcIDIV: begin p := self.stack.popv; p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); self.stack.push(p); TSVMMem(p).OpIDiv(TSVMMem(p2)); Inc(self.ip); end; bcMV: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); if (p = pointer(VM_NULL)) or (p2 = pointer(VM_NULL)) then raise ENullPointer.Create('Null pointer exception'); TSVMMem(p).SetM(TSVMMem(p2)); Inc(self.ip); end; bcMVBP: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); {$HINTS OFF} TSVMMem(Pointer(TSVMMem(p).GetW)).SetM(TSVMMem(p2)); {$HINTS ON} Inc(self.ip); end; bcGVBP: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); {$HINTS OFF} r := TSVMMem(Pointer(TSVMMem(p).GetW)); self.stack.push(r); Inc(r.m_rcnt); {$HINTS ON} Inc(self.ip); end; bcMVP: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); {$HINTS OFF} p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); TSVMMem(p).SetW(longword(p2)); {$HINTS ON} Inc(self.ip); end; bcMS: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); c := Length(self.mem^); j := TSVMMem(p).GetW; SetLength(self.mem^, j); SetLength(self.local_mem^, j); while c < j do begin self.mem^[c] := VM_NULL; self.local_mem^[c] := VM_NULL; inc(c); end; {$IfDef DebugVer} writeln(' - Mem size: ', Length(self.mem^)); {$EndIf} Inc(self.ip); end; bcNW: begin r := NewSVMM(Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcMC: begin p := self.stack.peek; r := CreateSVMMemCopy(TSVMMem(p), Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcMD: begin p := self.stack.peek; InterlockedIncrement(TSVMMem(p).m_rcnt); self.stack.push(p); Inc(self.ip); end; bcGC: begin grabber.Run; if isMainThread then GlobalGC; //writeln('GC stack: ', grabber.Stack.i_pos, ', Safe stack: ', rstack.i_pos); Inc(self.ip); end; bcNA: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := NewArr(@self.stack, cardinal(TSVMMem(p).GetW), self.Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcTF: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := NewSVMM_FW(byte(TSVMMem(p).m_type), Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcTMC: begin TSVMMem(self.stack.peek).m_type := svmtClass; Inc(self.ip); end; bcSF: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := NewSVMM_FW(TSVMMem(p).GetSize, Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcAL: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := NewSVMM_FW(TSVMMem(p).ArrGetSize, Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcSL: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); TSVMMem(self.stack.peek).ArrSetSize(TSVMMem(p).GetW); Inc(self.ip); end; bcPA: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); p2 := TSVMMem(p).ArrGet(r.GetW, Grabber); InterlockedIncrement(TSVMMem(p2).m_rcnt); self.stack.push(p2); Inc(self.ip); end; bcSA: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); TSVMMem(p).ArrSet(r.GetW, self.stack.popv); Inc(self.ip); end; bcPHC: begin r := CreateSVMMemCopy(TSVMMem(self.consts^.GetConst( cardinal((self.bytes^[self.ip + 4] shl 24) + (self.bytes^[self.ip + 3] shl 16) + (self.bytes^[self.ip + 2] shl 8) + self.bytes^[self.ip + 1]))), Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip, 5); end; bcPHCP: begin self.stack.push(TSVMMem(self.consts^.GetConst( cardinal((self.bytes^[self.ip + 4] shl 24) + (self.bytes^[self.ip + 3] shl 16) + (self.bytes^[self.ip + 2] shl 8) + self.bytes^[self.ip + 1])))); Inc(self.ip, 5); end; bcINV: begin r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); Inc(self.ip); TExternalFunction(self.extern_methods^.GetFunc(r.GetW))(@self); {$IfDef BuildInLibrary} if DbgCallBack <> nil then TDbgCallBack(DbgCallBack)(@self); {$EndIf} end; bcPHN: begin self.stack.push(VM_NULL); Inc(self.ip); end; bcCTHR: begin r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); p := self.stack.popv; // don't touch ref cnt because new thread will have it in stack. //InterlockedDecrement(TSVMMem(p).m_rcnt); p2 := NewSVMM_Ref(TSVMThread.Create(self.bytes, self.consts, self.extern_methods, self.mem, self.local_mem, r.GetW, p), self.grabber); TSVMMem(p2).m_rcnt := 1; TSVMMem(p2).m_dcbp := PDestructorCallBack(@ThreadDestructor); self.stack.push(p2); Inc(self.ip); end; bcSTHR: begin {$WARNINGS OFF} r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); TSVMThread(r.m_val).Suspend; {$WARNINGS ON} Inc(self.ip); end; bcRTHR: begin {$WARNINGS OFF} r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); TSVMThread(r.m_val).Resume; {$WARNINGS ON} Inc(self.ip); end; bcTTHR: begin r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); TSVMThread(r.m_val).Terminate; //PushTerminatedThread(TSVMThread(r.m_val)); Inc(self.ip); end; bcTHSP: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); TSVMThread(TSVMMem(p).m_val).Priority := TThreadPriority(r.GetW); Inc(self.ip); end; bcPLC: begin r := NewSVMM_FW(self.cbstack.peek, Grabber); r.m_rcnt := 1; self.stack.push(r); Inc(self.ip); end; bcPCT: begin self.stack.push(TSVMThreadContext.Create(self.mem, @self.stack)); Inc(self.ip); end; bcLCT: begin self.LoadContext(TSVMThreadContext(self.stack.popv)); Inc(self.ip); end; bcJRX: begin Self.cbstack.pop; self.ip := Self.cbstack.popv; end; bcTR: begin p := self.stack.popv; InterlockedDecrement(TSVMMem(p).m_rcnt); r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); try_blocks.add(TSVMMem(p).GetW, r.GetW); Inc(self.ip); end; bcTRS: begin self.ip := try_blocks.TR_Finally; end; bcTRR: begin p := EUnhandledVirtualRaisedException.Create('At point 0x' + IntToHex(self.ip, 8)); self.ip := try_blocks.TR_Catch(Exception(p)); FreeAndNil(p); end; {** for string's **} bcSTRD: begin// strdel; p := self.stack.popv; r := TSVMMem(p); InterlockedDecrement(r.m_rcnt); S := string(r.GetS); r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); p2 := self.stack.popv; InterlockedDecrement(TSVMMem(p2).m_rcnt); System.Delete(s, TSVMMem(p2).GetW + 1, r.GetW); TSVMMem(p).SetS(s); S := ''; Inc(self.ip); end; bcCHORD: begin r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); p := NewSVMM_FW(Ord(r.GetS[1]), Grabber); TSVMMem(p).m_rcnt := 1; self.stack.push(p); Inc(self.ip); end; bcORDCH: begin r := TSVMMem(self.stack.popv); InterlockedDecrement(r.m_rcnt); p := NewSVMM_FS(Chr(r.GetW), Grabber); TSVMMem(p).m_rcnt := 1; self.stack.push(p); Inc(self.ip); end; bcTHREXT: begin self.ip := self.end_ip; break; end; bcDBP: begin if DbgCallBack <> nil then TDbgCallBack(DbgCallBack)(@self); Inc(self.ip); end; bcRST: begin rstack.push(stack.popv); Inc(self.ip); end; bcRLD: begin stack.push(rstack.popv); Inc(self.ip); end; bcRDP: begin rstack.drop; Inc(self.ip); end; else VMError('Error: not supported operation, byte 0x' + IntToHex(self.bytes^[self.ip], 2) + ', at #' + IntToStr(self.ip)); end; end; except on E: Exception do begin p := NewSVMM_FS(E.Message, Grabber); TSVMMem(p).m_rcnt := 1; self.stack.push(p); p := NewSVMM_FS(E.ClassName, Grabber); TSVMMem(p).m_rcnt := 1; self.stack.push(p); p := NewSVMM_FW(self.ip, Grabber); TSVMMem(p).m_rcnt := 1; self.stack.push(p); self.ip := self.try_blocks.TR_Catch(E); end; end; until self.ip >= self.end_ip; self.stack.drop; self.rstack.drop; end; end.
(********************************************************) (* *) (* Bare Game Library *) (* http://www.baregame.org *) (* 0.5.0.0 Released under the LGPL license 2013 *) (* *) (********************************************************) { <include docs/bare.graphics.txt> } unit Bare.Graphics; {$i bare.inc} interface {TODO: Write 2d vector drawing system} {TODO: Write sprite class possibly in another namespace} {TODO: Include per pixel collision detection in sprite class} uses Bare.System, Bare.Types, Bare.Animation, Bare.Geometry, Bare.Graphics.Imaging, Bare.Text, Bare.Interop.OpenGL; {doc off} const clAliceBlue: TColorF = (R: $F0 / $FF; G: $F8 / $FF; B: $FF / $FF; A: 1.0); clAntiqueWhite: TColorF = (R: $FA / $FF; G: $EB / $FF; B: $D7 / $FF; A: 1.0); clAqua: TColorF = (R: $00 / $FF; G: $FF / $FF; B: $FF / $FF; A: 1.0); clAquamarine: TColorF = (R: $7F / $FF; G: $FF / $FF; B: $D4 / $FF; A: 1.0); clAzure: TColorF = (R: $F0 / $FF; G: $FF / $FF; B: $FF / $FF; A: 1.0); clBeige: TColorF = (R: $F5 / $FF; G: $F5 / $FF; B: $DC / $FF; A: 1.0); clBisque: TColorF = (R: $FF / $FF; G: $E4 / $FF; B: $C4 / $FF; A: 1.0); clBlack: TColorF = (R: $00 / $FF; G: $00 / $FF; B: $00 / $FF; A: 1.0); clBlanchedAlmond: TColorF = (R: $FF / $FF; G: $EB / $FF; B: $CD / $FF; A: 1.0); clBlue: TColorF = (R: $00 / $FF; G: $00 / $FF; B: $FF / $FF; A: 1.0); clBlueViolet: TColorF = (R: $8A / $FF; G: $2B / $FF; B: $E2 / $FF; A: 1.0); clBrown: TColorF = (R: $A5 / $FF; G: $2A / $FF; B: $2A / $FF; A: 1.0); clBurlyWood: TColorF = (R: $DE / $FF; G: $B8 / $FF; B: $87 / $FF; A: 1.0); clCadetBlue: TColorF = (R: $5F / $FF; G: $9E / $FF; B: $A0 / $FF; A: 1.0); clChartreuse: TColorF = (R: $7F / $FF; G: $FF / $FF; B: $00 / $FF; A: 1.0); clChocolate: TColorF = (R: $D2 / $FF; G: $69 / $FF; B: $1E / $FF; A: 1.0); clCoral: TColorF = (R: $FF / $FF; G: $7F / $FF; B: $50 / $FF; A: 1.0); clCornflowerBlue: TColorF = (R: $64 / $FF; G: $95 / $FF; B: $ED / $FF; A: 1.0); clCornsilk: TColorF = (R: $FF / $FF; G: $F8 / $FF; B: $DC / $FF; A: 1.0); clCrimson: TColorF = (R: $DC / $FF; G: $14 / $FF; B: $3C / $FF; A: 1.0); clCyan: TColorF = (R: $00 / $FF; G: $FF / $FF; B: $FF / $FF; A: 1.0); clDarkBlue: TColorF = (R: $00 / $FF; G: $00 / $FF; B: $8B / $FF; A: 1.0); clDarkCyan: TColorF = (R: $00 / $FF; G: $8B / $FF; B: $8B / $FF; A: 1.0); clDarkGoldenrod: TColorF = (R: $B8 / $FF; G: $86 / $FF; B: $0B / $FF; A: 1.0); clDarkGray: TColorF = (R: $A9 / $FF; G: $A9 / $FF; B: $A9 / $FF; A: 1.0); clDarkGreen: TColorF = (R: $00 / $FF; G: $64 / $FF; B: $00 / $FF; A: 1.0); clDarkKhaki: TColorF = (R: $BD / $FF; G: $B7 / $FF; B: $6B / $FF; A: 1.0); clDarkMagenta: TColorF = (R: $8B / $FF; G: $00 / $FF; B: $8B / $FF; A: 1.0); clDarkOliveGreen: TColorF = (R: $55 / $FF; G: $6B / $FF; B: $2F / $FF; A: 1.0); clDarkOrange: TColorF = (R: $FF / $FF; G: $8C / $FF; B: $00 / $FF; A: 1.0); clDarkOrchid: TColorF = (R: $99 / $FF; G: $32 / $FF; B: $CC / $FF; A: 1.0); clDarkRed: TColorF = (R: $8B / $FF; G: $00 / $FF; B: $00 / $FF; A: 1.0); clDarkSalmon: TColorF = (R: $E9 / $FF; G: $96 / $FF; B: $7A / $FF; A: 1.0); clDarkSeaGreen: TColorF = (R: $8F / $FF; G: $BC / $FF; B: $8B / $FF; A: 1.0); clDarkSlateBlue: TColorF = (R: $48 / $FF; G: $3D / $FF; B: $8B / $FF; A: 1.0); clDarkSlateGray: TColorF = (R: $2F / $FF; G: $4F / $FF; B: $4F / $FF; A: 1.0); clDarkTurquoise: TColorF = (R: $00 / $FF; G: $CE / $FF; B: $D1 / $FF; A: 1.0); clDarkViolet: TColorF = (R: $94 / $FF; G: $00 / $FF; B: $D3 / $FF; A: 1.0); clDeepPink: TColorF = (R: $FF / $FF; G: $14 / $FF; B: $93 / $FF; A: 1.0); clDeepSkyBlue: TColorF = (R: $00 / $FF; G: $BF / $FF; B: $FF / $FF; A: 1.0); clDimGray: TColorF = (R: $69 / $FF; G: $69 / $FF; B: $69 / $FF; A: 1.0); clDodgerBlue: TColorF = (R: $1E / $FF; G: $90 / $FF; B: $FF / $FF; A: 1.0); clFirebrick: TColorF = (R: $B2 / $FF; G: $22 / $FF; B: $22 / $FF; A: 1.0); clFloralWhite: TColorF = (R: $FF / $FF; G: $FA / $FF; B: $F0 / $FF; A: 1.0); clForestGreen: TColorF = (R: $22 / $FF; G: $8B / $FF; B: $22 / $FF; A: 1.0); clFuchsia: TColorF = (R: $FF / $FF; G: $00 / $FF; B: $FF / $FF; A: 1.0); clGainsboro: TColorF = (R: $DC / $FF; G: $DC / $FF; B: $DC / $FF; A: 1.0); clGhostWhite: TColorF = (R: $F8 / $FF; G: $F8 / $FF; B: $FF / $FF; A: 1.0); clGold: TColorF = (R: $FF / $FF; G: $D7 / $FF; B: $00 / $FF; A: 1.0); clGoldenrod: TColorF = (R: $DA / $FF; G: $A5 / $FF; B: $20 / $FF; A: 1.0); clGray: TColorF = (R: $80 / $FF; G: $80 / $FF; B: $80 / $FF; A: 1.0); clGreen: TColorF = (R: $00 / $FF; G: $80 / $FF; B: $00 / $FF; A: 1.0); clGreenYellow: TColorF = (R: $AD / $FF; G: $FF / $FF; B: $2F / $FF; A: 1.0); clHoneydew: TColorF = (R: $F0 / $FF; G: $FF / $FF; B: $F0 / $FF; A: 1.0); clHotPink: TColorF = (R: $FF / $FF; G: $69 / $FF; B: $B4 / $FF; A: 1.0); clIndianRed: TColorF = (R: $CD / $FF; G: $5C / $FF; B: $5C / $FF; A: 1.0); clIndigo: TColorF = (R: $4B / $FF; G: $00 / $FF; B: $82 / $FF; A: 1.0); clIvory: TColorF = (R: $FF / $FF; G: $FF / $FF; B: $F0 / $FF; A: 1.0); clKhaki: TColorF = (R: $F0 / $FF; G: $E6 / $FF; B: $8C / $FF; A: 1.0); clLavender: TColorF = (R: $E6 / $FF; G: $E6 / $FF; B: $FA / $FF; A: 1.0); clLavenderBlush: TColorF = (R: $FF / $FF; G: $F0 / $FF; B: $F5 / $FF; A: 1.0); clLawnGreen: TColorF = (R: $7C / $FF; G: $FC / $FF; B: $00 / $FF; A: 1.0); clLemonChiffon: TColorF = (R: $FF / $FF; G: $FA / $FF; B: $CD / $FF; A: 1.0); clLightBlue: TColorF = (R: $AD / $FF; G: $D8 / $FF; B: $E6 / $FF; A: 1.0); clLightCoral: TColorF = (R: $F0 / $FF; G: $80 / $FF; B: $80 / $FF; A: 1.0); clLightCyan: TColorF = (R: $E0 / $FF; G: $FF / $FF; B: $FF / $FF; A: 1.0); clLightGoldenrodYellow: TColorF = (R: $FA / $FF; G: $FA / $FF; B: $D2 / $FF; A: 1.0); clLightGray: TColorF = (R: $D3 / $FF; G: $D3 / $FF; B: $D3 / $FF; A: 1.0); clLightGreen: TColorF = (R: $90 / $FF; G: $EE / $FF; B: $90 / $FF; A: 1.0); clLightPink: TColorF = (R: $FF / $FF; G: $B6 / $FF; B: $C1 / $FF; A: 1.0); clLightSalmon: TColorF = (R: $FF / $FF; G: $A0 / $FF; B: $7A / $FF; A: 1.0); clLightSeaGreen: TColorF = (R: $20 / $FF; G: $B2 / $FF; B: $AA / $FF; A: 1.0); clLightSkyBlue: TColorF = (R: $87 / $FF; G: $CE / $FF; B: $FA / $FF; A: 1.0); clLightSlateGray: TColorF = (R: $77 / $FF; G: $88 / $FF; B: $99 / $FF; A: 1.0); clLightSteelBlue: TColorF = (R: $B0 / $FF; G: $C4 / $FF; B: $DE / $FF; A: 1.0); clLightYellow: TColorF = (R: $FF / $FF; G: $FF / $FF; B: $E0 / $FF; A: 1.0); clLime: TColorF = (R: $00 / $FF; G: $FF / $FF; B: $00 / $FF; A: 1.0); clLimeGreen: TColorF = (R: $32 / $FF; G: $CD / $FF; B: $32 / $FF; A: 1.0); clLinen: TColorF = (R: $FA / $FF; G: $F0 / $FF; B: $E6 / $FF; A: 1.0); clMagenta: TColorF = (R: $FF / $FF; G: $00 / $FF; B: $FF / $FF; A: 1.0); clMaroon: TColorF = (R: $80 / $FF; G: $00 / $FF; B: $00 / $FF; A: 1.0); clMediumAquamarine: TColorF = (R: $66 / $FF; G: $CD / $FF; B: $AA / $FF; A: 1.0); clMediumBlue: TColorF = (R: $00 / $FF; G: $00 / $FF; B: $CD / $FF; A: 1.0); clMediumOrchid: TColorF = (R: $BA / $FF; G: $55 / $FF; B: $D3 / $FF; A: 1.0); clMediumPurple: TColorF = (R: $93 / $FF; G: $70 / $FF; B: $DB / $FF; A: 1.0); clMediumSeaGreen: TColorF = (R: $3C / $FF; G: $B3 / $FF; B: $71 / $FF; A: 1.0); clMediumSlateBlue: TColorF = (R: $7B / $FF; G: $68 / $FF; B: $EE / $FF; A: 1.0); clMediumSpringGreen: TColorF = (R: $00 / $FF; G: $FA / $FF; B: $9A / $FF; A: 1.0); clMediumTurquoise: TColorF = (R: $48 / $FF; G: $D1 / $FF; B: $CC / $FF; A: 1.0); clMediumVioletRed: TColorF = (R: $C7 / $FF; G: $15 / $FF; B: $85 / $FF; A: 1.0); clMidnightBlue: TColorF = (R: $19 / $FF; G: $19 / $FF; B: $70 / $FF; A: 1.0); clMintCream: TColorF = (R: $F5 / $FF; G: $FF / $FF; B: $FA / $FF; A: 1.0); clMistyRose: TColorF = (R: $FF / $FF; G: $E4 / $FF; B: $E1 / $FF; A: 1.0); clMoccasin: TColorF = (R: $FF / $FF; G: $E4 / $FF; B: $B5 / $FF; A: 1.0); clNavajoWhite: TColorF = (R: $FF / $FF; G: $DE / $FF; B: $AD / $FF; A: 1.0); clNavy: TColorF = (R: $00 / $FF; G: $00 / $FF; B: $80 / $FF; A: 1.0); clOldLace: TColorF = (R: $FD / $FF; G: $F5 / $FF; B: $E6 / $FF; A: 1.0); clOlive: TColorF = (R: $80 / $FF; G: $80 / $FF; B: $00 / $FF; A: 1.0); clOliveDrab: TColorF = (R: $6B / $FF; G: $8E / $FF; B: $23 / $FF; A: 1.0); clOrange: TColorF = (R: $FF / $FF; G: $A5 / $FF; B: $00 / $FF; A: 1.0); clOrangeRed: TColorF = (R: $FF / $FF; G: $45 / $FF; B: $00 / $FF; A: 1.0); clOrchid: TColorF = (R: $DA / $FF; G: $70 / $FF; B: $D6 / $FF; A: 1.0); clPaleGoldenrod: TColorF = (R: $EE / $FF; G: $E8 / $FF; B: $AA / $FF; A: 1.0); clPaleGreen: TColorF = (R: $98 / $FF; G: $FB / $FF; B: $98 / $FF; A: 1.0); clPaleTurquoise: TColorF = (R: $AF / $FF; G: $EE / $FF; B: $EE / $FF; A: 1.0); clPaleVioletRed: TColorF = (R: $DB / $FF; G: $70 / $FF; B: $93 / $FF; A: 1.0); clPapayaWhip: TColorF = (R: $FF / $FF; G: $EF / $FF; B: $D5 / $FF; A: 1.0); clPeachPuff: TColorF = (R: $FF / $FF; G: $DA / $FF; B: $B9 / $FF; A: 1.0); clPeru: TColorF = (R: $CD / $FF; G: $85 / $FF; B: $3F / $FF; A: 1.0); clPink: TColorF = (R: $FF / $FF; G: $C0 / $FF; B: $CB / $FF; A: 1.0); clPlum: TColorF = (R: $DD / $FF; G: $A0 / $FF; B: $DD / $FF; A: 1.0); clPowderBlue: TColorF = (R: $B0 / $FF; G: $E0 / $FF; B: $E6 / $FF; A: 1.0); clPurple: TColorF = (R: $80 / $FF; G: $00 / $FF; B: $80 / $FF; A: 1.0); clRed: TColorF = (R: $FF / $FF; G: $00 / $FF; B: $00 / $FF; A: 1.0); clRosyBrown: TColorF = (R: $BC / $FF; G: $8F / $FF; B: $8F / $FF; A: 1.0); clRoyalBlue: TColorF = (R: $41 / $FF; G: $69 / $FF; B: $E1 / $FF; A: 1.0); clSaddleBrown: TColorF = (R: $8B / $FF; G: $45 / $FF; B: $13 / $FF; A: 1.0); clSalmon: TColorF = (R: $FA / $FF; G: $80 / $FF; B: $72 / $FF; A: 1.0); clSandyBrown: TColorF = (R: $F4 / $FF; G: $A4 / $FF; B: $60 / $FF; A: 1.0); clSeaGreen: TColorF = (R: $2E / $FF; G: $8B / $FF; B: $57 / $FF; A: 1.0); clSeaShell: TColorF = (R: $FF / $FF; G: $F5 / $FF; B: $EE / $FF; A: 1.0); clSienna: TColorF = (R: $A0 / $FF; G: $52 / $FF; B: $2D / $FF; A: 1.0); clSilver: TColorF = (R: $C0 / $FF; G: $C0 / $FF; B: $C0 / $FF; A: 1.0); clSkyBlue: TColorF = (R: $87 / $FF; G: $CE / $FF; B: $EB / $FF; A: 1.0); clSlateBlue: TColorF = (R: $6A / $FF; G: $5A / $FF; B: $CD / $FF; A: 1.0); clSlateGray: TColorF = (R: $70 / $FF; G: $80 / $FF; B: $90 / $FF; A: 1.0); clSnow: TColorF = (R: $FF / $FF; G: $FA / $FF; B: $FA / $FF; A: 1.0); clSpringGreen: TColorF = (R: $00 / $FF; G: $FF / $FF; B: $7F / $FF; A: 1.0); clSteelBlue: TColorF = (R: $46 / $FF; G: $82 / $FF; B: $B4 / $FF; A: 1.0); clTan: TColorF = (R: $D2 / $FF; G: $B4 / $FF; B: $8C / $FF; A: 1.0); clTeal: TColorF = (R: $00 / $FF; G: $80 / $FF; B: $80 / $FF; A: 1.0); clThistle: TColorF = (R: $D8 / $FF; G: $BF / $FF; B: $D8 / $FF; A: 1.0); clTomato: TColorF = (R: $FF / $FF; G: $63 / $FF; B: $47 / $FF; A: 1.0); clTransparent: TColorF = (R: $FF / $FF; G: $FF / $FF; B: $FF / $FF; A: 1.0); clTurquoise: TColorF = (R: $40 / $FF; G: $E0 / $FF; B: $D0 / $FF; A: 1.0); clViolet: TColorF = (R: $EE / $FF; G: $82 / $FF; B: $EE / $FF; A: 1.0); clWheat: TColorF = (R: $F5 / $FF; G: $DE / $FF; B: $B3 / $FF; A: 1.0); clWhite: TColorF = (R: $FF / $FF; G: $FF / $FF; B: $FF / $FF; A: 1.0); clWhiteSmoke: TColorF = (R: $F5 / $FF; G: $F5 / $FF; B: $F5 / $FF; A: 1.0); clYellow: TColorF = (R: $FF / $FF; G: $FF / $FF; B: $00 / $FF; A: 1.0); clYellowGreen: TColorF = (R: $9A / $FF; G: $CD / $FF; B: $32 / $FF; A: 1.0); {doc on} { Returns true if a value is a power of two } function IsPowerOfTwo(Value: Integer): Boolean; { Returns true if both w and h are powers of two } function IsPowerOfTwos(W, H: Integer): Boolean; { Returns the next lowest power given a value } function PowerOfTwo(Value: Integer): Integer; type { Specifies if textures edges are clamped or if they wrap } TTextureWrap = (wrapNone, wrapS, wrapT, wrapST); { Specifies how texture pixels are interpolated } TTextureFilter = (filterNearest, filterLinear); { TTextures is a simple container which can manage OpenGL texture units Remarks Texture units must be allocated with generate before loading data or binding See also <link Overview.Bare.Graphics.TTextures, TTextures members> } TTextures = class private FData: TArray<GLuint>; function GetCount: Integer; function GetTexture(Index: Integer): GLuint; function GetWrap(Index: Integer): TTextureWrap; procedure SetWrap(Index: Integer; Value: TTextureWrap); function GetMinify(Index: Integer): TTextureFilter; procedure SetMinify(Index: Integer; Value: TTextureFilter); function GetMagnify(Index: Integer): TTextureFilter; procedure SetMagnify(Index: Integer; Value: TTextureFilter); public { Create storage and optionally allocated count number of OpenGL texture unit slots } constructor Create(Count: Integer = 0); destructor Destroy; override; { Allocate slots containing count number of OpenGL texture units } procedure Generate(Count: Integer); { Generate mipmaps for OpenGL texture unit stored at index See also <exref target="http://en.wikipedia.org/wiki/mipmap">External: Mipmaps on wikipedia</exref> } procedure GenerateMipmaps(Index: Integer); { Delete slots releasing OpenGL texture units and setting count to zero } procedure Delete; { Make texture unit in slot index current } procedure Bind(Index: Integer); { Load pixels into a texture unit slot } function Load(Width, Height: Integer; Pixels: Pointer; Index: Integer): Boolean; overload; { Load a bitmap into a texture unit slot <link Bare.Graphics.IsPowerOfTwos, IsPowerOfTwos function> <link Bare.Graphics.Imaging.IBitmap.Resample, IBitmap.Resample method> } function Load(Bitmap: IBitmap; Index: Integer): Boolean; overload; { Load a stream contain bitmap data into a texture unit slot } function Load(Stream: TStream; Index: Integer): Boolean; overload; { Load a bitmap from the file system into a texture unit slot } function Load(const FileName: string; Index: Integer): Boolean; overload; { The number of texture unit slots } property Count: Integer read GetCount; { Get the OpenGL texture unit } property Texture[Index: Integer]: GLuint read GetTexture; default; { Specify wrapping mode for OpenGL texture unit stored at index } property Wrap[Index: Integer]: TTextureWrap read GetWrap write SetWrap; { Specify minification filter for OpenGL texture unit stored at index } property Minify[Index: Integer]: TTextureFilter read GetMinify write SetMinify; { Specify magnification filter for OpenGL texture unit stored at index } property Magnify[Index: Integer]: TTextureFilter read GetMagnify write SetMagnify; end; { TWorld manages a viewport and translates vertices between 2d world coordinates and 3d space coordinates See also <link Overview.Bare.Graphics.TWorld, TWorld members> } TWorld = class private FWindow: IWindow; FFieldOfView: Float; FDepth: Float; FRatio: Float; FNearPlane: Float; FFarPlane: Float; FWidth: Float; FHeight: Float; FHalfWidth: Float; FHalfHeight: Float; FTangent: Float; public { Create a 2d world based on a rectangular area } constructor Create(Window: IWindow); { Capture a snapshot the of the 2d world into an IBitmap } function Snapshot: IBitmap; { Clears the drawing buffers, update the viewport and perspective } procedure Update(FieldOfView: Float = 60; Depth: Float = -10; NearPlane: Float = 0.1; FarPlane: Float = 1000); { Convert x and y from 2d world coordinates to 3d space coordinates } function WorldToSpace(X, Y: Float): TVec3; overload; { Convert a vec2 from 2d world coordinates to 3d space coordinates } function WorldToSpace(const V: TVec2): TVec3; overload; { Convert x, y, and z from 3d space coordinates to 2d world coordinates } function SpaceToWorld(X, Y, Z: Float): TVec2; overload; { Convert a vec3 from 3d space coordinates to 2d world coordinates } function SpaceToWorld(const V: TVec3): TVec2; overload; { Set the current drawing color } procedure Color(R, G, B: Float; A: Float = 1.0); overload; { Set the current drawing color } procedure Color(const Color: TColorF); overload; { Begin a series of vertex quad commands } procedure BeginQuads; { End a series of vertex quad commands } procedure EndQuads; { Begin a series of vertex point sprite commands } procedure BeginPoints(Size: Float); { End a series of vertex point sprite commands } procedure EndPoints; { Bind a texture to the current render context saving the previous state } procedure BindTex(Texture: GLuint); { Unbind a texture restoring the previous state } procedure UnbindTex; { Add a 2d textured vertex to the current drawing command with texture coordinates s and t } procedure TexVertex(X, Y, S, T: Float); overload; { Add a 2d textured vertex to the current drawing command with texture coordinates contained in t } procedure TexVertex(const V, T: TVec2); overload; { Add a 3d textured vertex to the current drawing command with texture coordinates contained in t } procedure TexVertex(const V: TVec3; const T: TVec2); overload; { Add a 2d vertex to the current drawing command } procedure Vertex(X, Y: Float); overload; { Add a 2d vertex to the current drawing command } procedure Vertex(const V: TVec2); overload; { Add a 3d vertex to the current drawing command } procedure Vertex(const V: TVec3); overload; { The z distance in space units of the 2d plane } property Depth: Float read FDepth; { The ratio of world pixels to space units } property Ratio: Float read FRatio; { The width of the world in pixels } property Width: Float read FWidth; { The height of the world in pixels } property Height: Float read FHeight; end; { TGraphicObject\<T\> is an abstract class related to graphics See also <link Overview.Bare.Graphics.TGraphicObject, TGraphicObject\<T\> members> } TGraphicObject<T> = class(TPersistsObject, ICloneable<T>) public { Creates a copy of the object } function Clone: T; virtual; abstract; end; {doc ignore} TCustomSprite = class; { TCustomSprite is a class for defining 2d sprites Remarks You may derive a sprite from this class to define your own sprite logic See also <link Overview.Bare.Graphics.TCustomSprite, TCustomSprite members> } TCustomSprite = class(TGraphicObject<TCustomSprite>) private FWorld: TWorld; FTexture: GLuint; FMatrixChanged: Boolean; FGeometryChanged: Boolean; FColor: TVec4Prop; FTexCoords: TVec4Prop; { Causes geometry to change } FOrigin: TVec2Prop; FSize: TVec2Prop; { Causes matrix to change } FPosition: TVec3Prop; FRotation: TVec3Prop; FScale: TVec2Prop; procedure GeometryChange(Prop: IDependencyProperty; Index: Integer); procedure MatrixChange(Prop: IDependencyProperty; Index: Integer); procedure SetColor(const Value: TVec4Prop); procedure SetOrigin(const Value: TVec2Prop); procedure SetPosition(const Value: TVec3Prop); procedure SetRotation(const Value: TVec3Prop); procedure SetScale(const Value: TVec2Prop); procedure SetSize(const Value: TVec2Prop); procedure SetTexCoords(const Value: TVec4Prop); procedure SetTexture(Value: GLuint); protected { Provide a default transform matrix based on orientation } procedure DefaultMatrix(out Matrix: TMatrix); { Provide four default vertices given a matrix } procedure DefaultTransform(var Matrix: TMatrix; out Quad: TQuad); { Calculate a new transform matrix } procedure UpdateMatrix; virtual; { Calculate new vertices } procedure UpdateGeometry; virtual; { Calculate texture details } procedure UpdateTexture; virtual; { Renders the sprite to the screen } procedure Render; virtual; { Copy the source into the custom sprite } function AssignFrom(Source: TObject): Boolean; override; { The color of the sprite, defaults to white } property Color: TVec4Prop read FColor write SetColor; { The origin of the sprite, defaults to the center } property Origin: TVec2Prop read FOrigin write SetOrigin; { The size in pixels of the sprite, defaults to 32 } property Size: TVec2Prop read FSize write SetSize; { The position of the sprite, defaults to 0 } property Position: TVec3Prop read FPosition write SetPosition; { The rotation angles of the sprite, defaults to 0 } property Rotation: TVec3Prop read FRotation write SetRotation; { The scale of the sprite, defaults to 1 } property Scale: TVec2Prop read FScale write SetScale; { The texture coords of the sprite, defaults to (S0: 0; T0 0; S1: 1; T1: 1)) } property TexCoords: TVec4Prop read FTexCoords write SetTexCoords; { The texure unit associated with the sprite } property Texture: GLuint read FTexture write SetTexture; { The 2d worldin which the sprite exists } property World: TWorld read FWorld; public { Create a sprite in a 2d world } constructor Create(World: TWorld); virtual; { Create a copy of the sprite } function Clone: TCustomSprite; override; { Draw the sprite by updating and rendering } procedure Draw; { Update the sprite matrix and geometry } procedure Update; end; { Class of custom sprite } TSpriteClass = class of TCustomSprite; { TSprite is a simple sprite class See also <link Overview.Bare.Graphics.TSprite, TSprite members> } TSprite = class(TCustomSprite) private FMatrix: TMatrix; FQuads: TQuad; FPolygon: TPolygon; protected { Recreate the matrix } procedure UpdateMatrix; override; { Recreate the geometry } procedure UpdateGeometry; override; { Render the sprite into the 2d world } procedure Render; override; public { Get a 3d copy of the transformed geometry } procedure GetGeometry(out Quad: TQuad); { Get a flattened 2d copy of the transformed geometry } procedure GetPolygon(out Polygon: TPolygon); { Size of the sprite } property Size; { Color of the sprite } property Color; { Origin which effects positioning, scaling, and rotation } property Origin; { Position of the sprite including z distance } property Position; { Rotation of the sprite } property Rotation; { Scale of the sprite } property Scale; { Texture coordinates defining the sprite image } property TexCoords; { The OpenGL texture unit from which a sprite is taken } property Texture; end; { TTileMode describes if a background should be stretched or repeated } TTileMode = (tileStretch, tileRepeat); { TBackgroudSprite draws tiled backgrounds See also <link Overview.Bare.Graphics.TBackgroudSprite, TBackgroudSprite members> } TBackgroudSprite = class(TCustomSprite) private FWidth: GLuint; FHeight: GLuint; FTileMode: TTileMode; function GetAngle: TVec1Prop; procedure SetAngle(const Value: TVec1Prop); function GetPosition: TVec2Prop; procedure SetPosition(const Value: TVec2Prop); protected { Update texture details } procedure UpdateTexture; override; { Render the background into the 2d world } procedure Render; override; public { Tile mode controls switches between background stretching or repeating modes } property TileMode: TTileMode read FTileMode write FTileMode; { The color of the background } property Color; { The top left position of the bacground in pixels } property Position: TVec2Prop read GetPosition write SetPosition; { The width and height of the background in pixels } property Size; { The angle of the texture } property Angle: TVec1Prop read GetAngle write SetAngle; { The origin of the texture } property Origin; { The scale of the texture } property Scale; { The OpenGL texture unit which is stretched or repeated in the background } property Texture; end; { Horizontal alignment of a font } TFontJustify = (justifyLeft, justifyCenter, justifyRight); { Texture coordinates of a font character } TFontCoord = TVec2; { Information about a font character } TFontChar = record Left: Float; Top: Float; Right: Float; Bottom: Float; Width: Float; Height: Float; A: TFontCoord; B: TFontCoord; end; PFontChar = ^TFontChar; { Character mapping } TFontMap = array[$20..$7D] of TFontChar; { Information about a font } TFontStore = record Face: string[50]; Size: Integer; Kerning: Integer; Map: TFontMap; end; { TFontWriter writes text using textured quads } TFontWriter = class private FWorld: TWorld; FStore: TFontStore; FTextures: TTextures; FBlendedState: GLboolean; FCulledState: GLboolean; FDepthState: GLboolean; FColorState: TVec4; FLines: TStringList; FOpacity: TVec1Prop; FOrigin: TVec2Prop; FShadows: Boolean; FLeadColor: TVec4Prop; FBaseColor: TVec4Prop; FShadowColor: TVec4Prop; FShadowOffset: TVec2Prop; procedure SaveState; procedure RestoreState; procedure InternalWrite(const Line: string; Scale, Col, Row: Float); function GetFace: string; function GetKerning: Integer; function GetSize: Integer; function GetTextHeight: Float; procedure SetOpacity(const Value: TVec1Prop); procedure SetOrigin(const Value: TVec2Prop); procedure SetLeadColor(const Value: TVec4Prop); procedure SetBaseColor(const Value: TVec4Prop); procedure SetShadowColor(const Value: TVec4Prop); procedure SetShadowOffset(const Value: TVec2Prop); public constructor Create(World: TWorld); destructor Destroy; override; procedure LoadFromStore(var Store: TFontStore; Bits: Pointer); procedure LoadFromResource(const Resource: string); procedure LoadFromStream(Stream: TStream); procedure LoadFromFile(const FileName: string); function Measure(const S: string; Scale: Float): TVec2; procedure Write(const S: string; Scale, Col, Row: Float); overload; procedure Write(const S: string; Scale, X, Y: Float; Justify: TFontJustify); overload; property Face: string read GetFace; property Kerning: Integer read GetKerning; property Size: Integer read GetSize; property TextHeight: Float read GetTextHeight; property Opacity: TVec1Prop read FOpacity write SetOpacity; property Origin: TVec2Prop read FOrigin write SetOrigin; property LeadColor: TVec4Prop read FLeadColor write SetLeadColor; property BaseColor: TVec4Prop read FBaseColor write SetBaseColor; property Shadows: Boolean read FShadows write FShadows; property ShadowColor: TVec4Prop read FShadowColor write SetShadowColor; property ShadowOffset: TVec2Prop read FShadowOffset write SetShadowOffset; end; function FontToBitmap(const FileName: string): IBitmap; function FontToStr(const FileName: string): string; procedure FontLoadDefault(Font: TFontWriter); implementation function IsPowerOfTwo(Value: Integer): Boolean; var T: Integer; begin T := $1; repeat Result := Value = T; T := T shl 1; until Result or (T = $10000000); end; function IsPowerOfTwos(W, H: Integer): Boolean; begin Result := IsPowerOfTwo(W) and IsPowerOfTwo(H); end; function PowerOfTwo(Value: Integer): Integer; begin Result := Value; if IsPowerOfTwo(Result) then Exit; Result := $1; while Value > Result do Result := Result shl 1; Result := Result shr 1; end; { TTextures } constructor TTextures.Create(Count: Integer = 0); begin inherited Create; Generate(Count); end; destructor TTextures.Destroy; begin Delete; inherited Destroy; end; procedure TTextures.Generate(Count: Integer); begin Delete; if Count > 0 then begin SetLength(FData, Count); glGenTextures(Count, FData[0]); end; end; procedure TTextures.GenerateMipmaps(Index: Integer); begin Bind(Index); if @glGenerateMipmap <> nil then glGenerateMipmap(GL_TEXTURE_2D) else glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); end; procedure TTextures.Delete; begin if Length(FData) > 0 then glDeleteTextures(Length(FData), FData[0]); FData := nil; end; procedure TTextures.Bind(Index: Integer); begin glBindTexture(GL_TEXTURE_2D, FData[Index]); end; function TTextures.Load(Width, Height: Integer; Pixels: Pointer; Index: Integer): Boolean; begin Bind(Index); glGetError; glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, Width, Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, Pixels); if glGetError = GL_NO_ERROR then begin glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); end else Result := False; end; function TTextures.Load(Bitmap: IBitmap; Index: Integer): Boolean; begin if (Bitmap = nil) or Bitmap.Empty then Exit(False); Result := Load(Bitmap.Width, Bitmap.Height, Bitmap.Pixels, Index); end; function TTextures.Load(Stream: TStream; Index: Integer): Boolean; begin Result := Load(CreateBitmap(Stream), Index); end; function TTextures.Load(const FileName: string; Index: Integer): Boolean; begin if FileExists(FileName) then Result := Load(CreateBitmap(FileName), Index) else Result := False; end; function TTextures.GetCount: Integer; begin Result := Length(FData); end; function TTextures.GetTexture(Index: Integer): GLuint; begin Result := FData[Index]; end; function TTextures.GetWrap(Index: Integer): TTextureWrap; var S, T: GLuint; begin Bind(Index); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, S); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, T); if S and T and GL_REPEAT = GL_REPEAT then Result := wrapST else if S and GL_REPEAT = GL_REPEAT then Result := wrapS else if T and GL_REPEAT = GL_REPEAT then Result := wrapT else Result := wrapNone; end; procedure TTextures.SetWrap(Index: Integer; Value: TTextureWrap); var S, T: GLuint; begin Bind(Index); if (Value = wrapS) or (Value = wrapST)then glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) else glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); if (Value = wrapT) or (Value = wrapST)then glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) else glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); end; function TTextures.GetMinify(Index: Integer): TTextureFilter; var M: GLuint; begin Bind(Index); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, M); if M and GL_NEAREST = GL_NEAREST then Result := filterNearest else Result := filterLinear; end; procedure TTextures.SetMinify(Index: Integer; Value: TTextureFilter); begin Bind(Index); if Value = filterNearest then glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) else glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); end; function TTextures.GetMagnify(Index: Integer): TTextureFilter; var M: GLuint; begin Bind(Index); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, M); if M and GL_NEAREST = GL_NEAREST then Result := filterNearest else Result := filterLinear; end; procedure TTextures.SetMagnify(Index: Integer; Value: TTextureFilter); begin Bind(Index); if Value = filterNearest then glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) else glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); end; { TWorld } constructor TWorld.Create(Window: IWindow); begin inherited Create; FWindow := Window; end; function TWorld.Snapshot: IBitmap; procedure Flip(P: PPixel; W, H: Integer); var Pixel: PPixel; Stride: LongWord; Line: PByte; function Scanline(I: Integer): PByte; begin Result := PByte(P); Inc(Result, I * Stride); end; var I, J: Integer; begin Pixel := P; Stride := W * SizeOf(TPixel); GetMem(Line, Stride); try I := 0; J := H - 1; while I < J do begin Move(Scanline(I)^, Line^, Stride); Move(Scanline(J)^, Scanline(I)^, Stride); Move(Line^, Scanline(J)^, Stride); Inc(I); Dec(J); end; finally FreeMem(Line); end; end; var W, H: Integer; P: PPixel; begin W := Round(FWidth); H := Round(FHeight); Result := CreateBitmap(W, H); if Result.Empty then Exit; P := Result.Pixels; glReadPixels(0, 0, W, H, GL_RGBA, GL_UNSIGNED_BYTE, P); Flip(P, W, H); end; procedure TWorld.Update(FieldOfView: Float = 60; Depth: Float = -10; NearPlane: Float = 0.1; FarPlane: Float = 1000); var Changed: Boolean; W, H: Integer; begin W := FWindow.Width; H := FWindow.Height; Changed := (W <> FWidth) or (H <> FHeight); Changed := Changed or (FieldOfView <> FFieldOfView) or (Depth <> FDepth) or (NearPlane <> FNearPlane) or (FarPlane <> FFarPlane); if Changed then begin FWidth := W; FHeight := H; FFieldOfView := FieldOfView; FDepth := Depth; FNearPlane := NearPlane; FFarPlane := FarPlane; FTangent := Tan(FFieldOfView / 360 * Pi); FHalfWidth := W / 2; FHalfHeight := H / 2; if FHalfHeight > 0 then FRatio := (Abs(FDepth) * FTangent) / FHalfHeight else FRatio := 0; glMatrixMode(GL_PROJECTION); glLoadIdentity; glViewport(0, 0, W, H); gluPerspective(FFieldOfView, W / H, FNearPlane, FFarPlane); end; glMatrixMode(GL_MODELVIEW); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); glLoadIdentity; end; function TWorld.WorldToSpace(X, Y: Float): TVec3; begin Result := Vec3(X - FHalfWidth, FHalfHeight - Y, FDepth); Result.X := Result.X * FRatio; Result.Y := Result.Y * FRatio; end; { Convert 2d window coordinates to 3d world coordinates } function TWorld.WorldToSpace(const V: TVec2): TVec3; begin Result := WorldToSpace(V.X, V.Y); end; function TWorld.SpaceToWorld(X, Y, Z: Float): TVec2; begin if (Z < 0) and (FTangent > 0) then begin Result.X := (X / Z / FTangent) * FHalfHeight; Result.X := FHalfWidth - Result.X; Result.Y := (Y / Z / FTangent) * FHalfHeight; Result.Y := FHalfHeight + Result.Y; end else begin Result.X := 0; Result.Y := 0; end; end; { Convert 3d world coordinates to 2d window coordinates } function TWorld.SpaceToWorld(const V: TVec3): TVec2; begin Result := SpaceToWorld(V.X, V.Y, V.Z); end; procedure TWorld.Color(R, G, B: Float; A: Float = 1.0); begin glColor4f(R, G, B, A); end; procedure TWorld.Color(const Color: TColorF); begin with Color do glColor4f(R, G, B, A); end; procedure TWorld.BeginQuads; begin { Abstracting quads in preparation for OpenGL ES } glBegin(GL_QUADS); end; procedure TWorld.EndQuads; begin glEnd; end; procedure TWorld.BeginPoints(Size: Float); begin glEnable(GL_POINT_SPRITE); glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE); glDepthMask(False); glPointSize(Size); glBegin(GL_POINTS); end; procedure TWorld.EndPoints; begin glEnd; glDepthMask(True); glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE); glDisable(GL_POINT_SPRITE); end; procedure TWorld.BindTex(Texture: GLuint); begin glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, Texture); end; procedure TWorld.UnbindTex; begin glDisable(GL_TEXTURE_2D); end; procedure TWorld.TexVertex(X, Y, S, T: Float); begin { Abstracting textured verticies verticies. May use VBOs soon. } TexVertex(Vec(X, Y), Vec(S, T)); end; procedure TWorld.TexVertex(const V, T: TVec2); begin glTexCoord2d(T.S, T.T); with WorldToSpace(V) do glVertex3f(X, Y, Z); end; procedure TWorld.TexVertex(const V: TVec3; const T: TVec2); begin glTexCoord2d(T.S, T.T); with V do glVertex3f(X, Y, Z); end; procedure TWorld.Vertex(X, Y: Float); begin { Abstracting verticies in preparation for OpenGL ES } Vertex(Vec(X, Y)); end; procedure TWorld.Vertex(const V: TVec2); begin with WorldToSpace(V) do glVertex3f(X, Y, Z); end; procedure TWorld.Vertex(const V: TVec3); begin with V do glVertex3f(X, Y, Z); end; { TCustomSprite } constructor TCustomSprite.Create(World: TWorld); begin inherited Create; FWorld := World; FColor := TVec4Prop.Create(GeometryChange); FColor.Value := clWhite; FTexCoords := TVec4Prop.Create; FTexCoords.Value := Vec4(0, 0, 1, 1); FSize := TVec2Prop.Create(GeometryChange); FSize.Value := Vec2(32, 32); FOrigin := TVec2Prop.Create(GeometryChange); FOrigin.Value := Vec2(0.5, 0.5); FGeometryChanged := True; FPosition := TVec3Prop.Create(MatrixChange); FRotation := TVec3Prop.Create(MatrixChange); FScale := TVec2Prop.Create(MatrixChange); FScale.Value := Vec2(1, 1); FMatrixChanged := True; end; function TCustomSprite.AssignFrom(Source: TObject): Boolean; var Sprite: TCustomSprite; begin if Source is TCustomSprite then begin Sprite := Source as TCustomSprite; FWorld := Sprite.FWorld; FColor.Value := Sprite.FColor.Value; FOrigin.Value := Sprite.FOrigin.Value; FPosition.Value := Sprite.FPosition.Value; FRotation.Value := Sprite.FRotation.Value; FScale.Value := Sprite.FScale.Value; FSize.Value := Sprite.FSize.Value; FTexCoords.Value := Sprite.FTexCoords.Value; Result := True; end else Result := inherited AssignFrom(Source); end; function TCustomSprite.Clone: TCustomSprite; var SpriteClass: TSpriteClass; begin SpriteClass := TSpriteClass(ClassType); Result := SpriteClass.Create(FWorld); Assign(Self, Result); end; procedure TCustomSprite.DefaultMatrix(out Matrix: TMatrix); var V: TVec3; begin Matrix := StockMatrix; V := FWorld.WorldToSpace(Vec2(FPosition.X, FPosition.Y)); V.Z := FWorld.Depth + FPosition.Z; Matrix.Translate(V.X, V.Y, V.Z); Matrix.Rotate(FRotation.X, FRotation.Y, FRotation.Z); Matrix.Scale(FScale.X, FScale.Y, 1); end; procedure TCustomSprite.DefaultTransform(var Matrix: TMatrix; out Quad: TQuad); var I: Integer; begin Quad[0].X := -FOrigin.X * FSize.X * FWorld.Ratio; Quad[0].Y := -FOrigin.Y * FSize.Y * -FWorld.Ratio; Quad[0].Z := 0; Quad[2].X := (1 - FOrigin.X) * FSize.X * FWorld.Ratio; Quad[2].Y := (1 - FOrigin.Y) * FSize.Y * -FWorld.Ratio; Quad[2].Z := 0; Quad[1].X := Quad[0].X; Quad[1].Y := Quad[2].Y; Quad[1].Z := 0; Quad[3].X := Quad[2].X; Quad[3].Y := Quad[0].Y; Quad[3].Z := 0; for I := Low(Quad) to High(Quad) do Quad[I] := Matrix * Quad[I]; end; procedure TCustomSprite.GeometryChange(Prop: IDependencyProperty; Index: Integer); begin FGeometryChanged := True; end; procedure TCustomSprite.MatrixChange(Prop: IDependencyProperty; Index: Integer); begin FMatrixChanged := True; end; procedure TCustomSprite.UpdateMatrix; begin end; procedure TCustomSprite.UpdateGeometry; begin end; procedure TCustomSprite.UpdateTexture; begin end; procedure TCustomSprite.Render; begin end; procedure TCustomSprite.Draw; begin Update; Render; end; procedure TCustomSprite.Update; begin if FMatrixChanged then begin UpdateMatrix; UpdateGeometry; FMatrixChanged := False; FGeometryChanged := False; end else if FGeometryChanged then begin UpdateGeometry; FGeometryChanged := False; end; end; procedure TCustomSprite.SetColor(const Value: TVec4Prop); begin FColor.Value := Value; end; procedure TCustomSprite.SetTexCoords(const Value: TVec4Prop); begin FTexCoords.Value := Value; end; procedure TCustomSprite.SetOrigin(const Value: TVec2Prop); begin FOrigin.Value := Value; end; procedure TCustomSprite.SetSize(const Value: TVec2Prop); begin FSize.Value := Value; end; procedure TCustomSprite.SetPosition(const Value: TVec3Prop); begin FPosition.Value := Value; end; procedure TCustomSprite.SetRotation(const Value: TVec3Prop); begin FRotation.Value := Value; end; procedure TCustomSprite.SetScale(const Value: TVec2Prop); begin FScale.Value := Value; end; procedure TCustomSprite.SetTexture(Value: GLuint); begin FTexture := Value; UpdateTexture; end; { TSprite } procedure TSprite.UpdateMatrix; begin DefaultMatrix(FMatrix); end; procedure TSprite.UpdateGeometry; var I: Integer; begin DefaultTransform(FMatrix, FQuads); if FPolygon = nil then SetLength(FPolygon, 4); for I := Low(FPolygon) to High(FPolygon) do FPolygon[I] := FWorld.SpaceToWorld(FQuads[I]); end; procedure TSprite.Render; var T: TVec4; begin T := FTexCoords; FWorld.BindTex(FTexture); FWorld.Color(Color); FWorld.BeginQuads; FWorld.TexVertex(FQuads[0], Vec2(T.S0, T.T0)); FWorld.TexVertex(FQuads[1], Vec2(T.S0, T.T1)); FWorld.TexVertex(FQuads[2], Vec2(T.S1, T.T1)); FWorld.TexVertex(FQuads[3], Vec2(T.S1, T.T0)); FWorld.EndQuads; FWorld.UnbindTex; end; procedure TSprite.GetGeometry(out Quad: TQuad); begin Quad := FQuads; end; procedure TSprite.GetPolygon(out Polygon: TPolygon); begin Polygon := FPolygon; SetLength(Polygon, Length(FPolygon)); end; { TBackgroudSprite } procedure TBackgroudSprite.UpdateTexture; begin World.BindTex(FTexture); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, FWidth); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, FHeight); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); World.UnbindTex; end; procedure TBackgroudSprite.Render; const Sigma = 0.001; var P, S, O: TVec2; Q: TQuad; begin if (FWidth < 1) or (FHeight < 1) then Exit; P := Position; S := Size; O := Origin; if (Abs(S.X) < Sigma) or (Abs(S.Y) < Sigma) then Exit; glDisable(GL_DEPTH_TEST); glMatrixMode(GL_TEXTURE); if FTileMode = tileRepeat then begin glRotatef(-Angle.Value, 0, 0, 1); glScalef(1 / Scale.X, 1 / Scale.Y, 1); glTranslatef(S.X / FWidth * -O.X, S.Y / FHeight * -O.Y, 0); glScalef(S.X / FWidth, S.Y / FHeight, 1); end else begin glRotatef(-Angle.Value, 0, 0, 1); glScalef(1 / Scale.X, 1 / Scale.Y, 1); glTranslatef(-O.X, -O.Y, 0); end; glMatrixMode(GL_MODELVIEW); Q[0] := World.WorldToSpace(P); Q[1] := World.WorldToSpace(P.X, P.Y + S.Y); Q[2] := World.WorldToSpace(P + S); Q[3] := World.WorldToSpace(P.X + S.X, P.Y); FWorld.BindTex(FTexture); FWorld.Color(Color); FWorld.BeginQuads; FWorld.TexVertex(Q[0], Vec2(0, 0)); FWorld.TexVertex(Q[1], Vec2(0, 1)); FWorld.TexVertex(Q[2], Vec2(1, 1)); FWorld.TexVertex(Q[3], Vec2(1, 0)); FWorld.EndQuads; FWorld.UnbindTex; glMatrixMode(GL_TEXTURE); glLoadIdentity; glMatrixMode(GL_MODELVIEW); glEnable(GL_DEPTH_TEST); end; function TBackgroudSprite.GetPosition: TVec2Prop; begin Result := (inherited Position).AsVec2; end; procedure TBackgroudSprite.SetPosition(const Value: TVec2Prop); begin (inherited Position).AsVec2 := Value; end; function TBackgroudSprite.GetAngle: TVec1Prop; begin Result := Rotation.Z; end; procedure TBackgroudSprite.SetAngle(const Value: TVec1Prop); begin Rotation.Z := Value; end; { TFontWriter } const FontTexDim = 256; FontTexSize = FontTexDim * FontTexDim * SizeOf(TRGBA); constructor TFontWriter.Create(World: TWorld); begin inherited Create; FWorld := World; FLines := TStringList.Create; FTextures := TTextures.Create(1); FShadows := True; FOpacity := TVec1Prop.Create; FLeadColor := TVec4Prop.Create; FBaseColor := TVec4Prop.Create; FShadowColor := TVec4Prop.Create; FShadowOffset := TVec2Prop.Create; Opacity := 1; LeadColor := clWhite; BaseColor := clSilver; ShadowColor := clBlack; ShadowOffset := Vec2(1, 1); end; destructor TFontWriter.Destroy; begin FTextures.Free; FLines.Free; inherited Destroy;; end; procedure TFontWriter.LoadFromStore(var Store: TFontStore; Bits: Pointer); begin FStore := Store; FTextures.Load(FontTexDim, FontTexDim, Bits, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); end; procedure BitmapTransparent(Bitmap: IBitmap); var RGBA: PRGBA; I: Integer; begin RGBA := Bitmap.Pixels; I := Bitmap.Width * Bitmap.Height; while I > 0 do begin RGBA.A := RGBA.R; RGBA.R := $FF; RGBA.G := $FF; RGBA.B := $FF; Inc(RGBA); Dec(I); end; end; procedure TFontWriter.LoadFromResource(const Resource: string); var Buffer: TBuffer; Bits: PByte; BitSize: Integer; Stream: TMemoryStream; Store: TFontStore; Bitmap: IBitmap; begin Buffer := Base64Decode(Resource); Bits := Buffer.Data; BitSize := Buffer.Size; if BitSize < SizeOf(Store) then Exit; Move(Bits^, Store, SizeOf(Store)); Inc(Bits, SizeOf(Store)); Dec(BitSize, SizeOf(Store)); Stream := TMemoryStream.Create(BitSize); try Move(Bits^, Stream.Memory^, BitSize); Bitmap := CreateBitmap(Stream); if (Bitmap.Width <> FontTexDim) or (Bitmap.Width <> FontTexDim) then Exit; BitmapTransparent(Bitmap); LoadFromStore(Store, Bitmap.Pixels); finally Stream.Free; end; end; procedure TFontWriter.LoadFromStream(Stream: TStream); var Bits: Pointer; procedure SaveBits; var B: IBitmap; begin B := CreateBitmap($100, $100); Move(Bits^, B.Pixels^, $100 * $100 * $04); B.SaveToFile('font.png'); end; begin if Stream.Cancelled then Exit; Stream.Read(FStore, SizeOf(FStore)); if Stream.Cancelled then Exit; GetMem(Bits, FontTexSize); try Stream.Read(Bits^, FontTexSize); if Stream.Cancelled then Exit; SaveBits; FTextures.Load(FontTexDim, FontTexDim, Bits, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); finally FreeMem(Bits); end; end; procedure TFontWriter.LoadFromFile(const FileName: string); var S: TStream; begin if not FileExists(FileName) then Exit; S := TFileStream.Create(FileName, fmOpen); try LoadFromStream(S); finally S.Free; end; end; function TFontWriter.Measure(const S: string; Scale: Float): TVec2; var T, W: Float; I, J: Integer; begin if (Scale = 0) or (S = '') then begin Result.X := 0; Result.Y := 0; Exit; end; T := 0; W := 0; J := 1; for I := 1 to Length(S) do if S[I] = #10 then begin if T > W then W := T; Inc(J); Continue; end else if S[I] = #13 then Continue else if (S[I] < '!') or (S[I] > '}') then T := T + FStore.Map[$20].Width * Scale else T := T + FStore.Map[Ord(S[I])].Width * Scale; if T > W then Result.X:= T else Result.X:= W; Result.Y := FStore.Map[$20].Height * Scale * J; end; procedure TFontWriter.SaveState; begin glGetBooleanv(GL_BLEND, FBlendedState); glEnable(GL_BLEND); glGetBooleanv(GL_CULL_FACE, FCulledState); glDisable(GL_CULL_FACE); glGetBooleanv(GL_DEPTH_TEST, FDepthState); glDisable(GL_DEPTH_TEST); glGetFloatv(GL_CURRENT_COLOR, FColorState.V[0]); end; procedure TFontWriter.RestoreState; begin if FCulledState then glEnable(GL_CULL_FACE); if not FBlendedState then glDisable(GL_BLEND); if FDepthState then glEnable(GL_DEPTH_TEST); glColor3fv(FColorState.V[0]) end; procedure TFontWriter.InternalWrite(const Line: string; Scale, Col, Row: Float); procedure Draw(const Lead, Base: TColorF; OX, OY: Float); var O, K, CX, CY: Float; I: Integer; begin O := Opacity; K := (FStore.Kerning * Scale) / 2; OX := OX * Scale + Origin.X; OY := OY * Scale + Origin.Y; CX := Col * FStore.Map[$20].Width * Scale + OX; CY := Row * FStore.Map[$20].Height * Scale + OY; for I := 1 to Length(Line) do begin if CY > FWorld.Height then Break; if (Line[I] < '!') or (Line[I] > '}') then begin CX := CX + FStore.Map[$20].Width * Scale; Continue; end; with FStore.Map[Ord(Line[I])] do begin if CY + Height * Scale < 0 then Continue; if CY * Scale > FWorld.Height + CY then Continue; if CX + Width * Scale < 0 then begin CX := CX + Width * Scale; Continue; end; if CX + Width * Scale > FWorld.Width + CX then Continue; FWorld.Color(Lead.Red, Lead.Green, Lead.Blue, Lead.Alpha * O); FWorld.TexVertex(CX + Width * Scale + K, CY, B.X, A.Y); FWorld.TexVertex(CX - K, CY, A.X, A.Y); FWorld.Color(Base.Red, Base.Green, Base.Blue, Base.Alpha * O); FWorld.TexVertex(CX - K, CY + Height * Scale, A.X, B.Y); FWorld.TexVertex(CX + Width * Scale + K, CY + Height * Scale, B.X, B.Y); CX := CX + Width * Scale; end; end; end; begin if (Scale = 0) or (Line = '') then Exit; if FShadows then Draw(ShadowColor, ShadowColor, ShadowOffset.X, ShadowOffset.Y); Draw(LeadColor, BaseColor, 0, 0); end; procedure TFontWriter.Write(const S: string; Scale, Col, Row: Float); var I: Integer; begin if (Scale = 0) or (S = '') then Exit; FLines.Text := S; SaveState; FWorld.BindTex(FTextures[0]); FWorld.BeginQuads; for I := 0 to FLines.Count - 1 do InternalWrite(FLines[I], Scale, Col, Row + I); FWorld.EndQuads; FWorld.UnbindTex; RestoreState; end; procedure TFontWriter.Write(const S: string; Scale, X, Y: Float; Justify: TFontJustify); var CX, CY, Col, Row: Float; Line: string; Size: TVec2; I: Integer; begin if (Scale = 0) or (S = '') then Exit; FLines.Text := S; SaveState; FWorld.BindTex(FTextures[0]); FWorld.BeginQuads; CX := FStore.Map[$20].Width * Scale; CY := FStore.Map[$20].Height * Scale; for I := 0 to FLines.Count - 1 do begin Line := FLines[I]; Size := Measure(Line, Scale); Row := Y - Size.Y / 2 + CY * I; case Justify of justifyLeft: Col := X; justifyCenter: Col := X - Size.X / 2; justifyRight: Col := X - Size.X; else Col := 1; end; InternalWrite(Line, Scale, Col / CX, Row / CY); end; FWorld.EndQuads; FWorld.UnbindTex; RestoreState; end; function TFontWriter.GetFace: string; begin Result := FStore.Face; end; function TFontWriter.GetKerning: Integer; begin Result := FStore.Kerning; end; function TFontWriter.GetSize: Integer; begin Result := FStore.Size; end; function TFontWriter.GetTextHeight: Float; begin Result := FStore.Map[$20].Height; end; procedure TFontWriter.SetOpacity(const Value: TVec1Prop); begin FOpacity.Value := Value; end; procedure TFontWriter.SetOrigin(const Value: TVec2Prop); begin FOrigin.Value := Value.Value; end; procedure TFontWriter.SetLeadColor(const Value: TVec4Prop); begin FLeadColor.Value := Value.Value; end; procedure TFontWriter.SetBaseColor(const Value: TVec4Prop); begin FBaseColor.Value := Value.Value; end; procedure TFontWriter.SetShadowColor(const Value: TVec4Prop); begin FShadowColor.Value := Value.Value; end; procedure TFontWriter.SetShadowOffset(const Value: TVec2Prop); begin FShadowOffset.Value := Value.Value; end; procedure BitmapOpaque(Bitmap: IBitmap); var RGBA: PRGBA; I: Integer; begin RGBA := Bitmap.Pixels; I := Bitmap.Width * Bitmap.Height; while I > 0 do begin RGBA.R := RGBA.A; RGBA.G := RGBA.A; RGBA.B := RGBA.A; RGBA.A := $FF; Inc(RGBA); Dec(I); end; end; function FontToBitmap(const FileName: string): IBitmap; var Source: TStream; Store: TFontStore; Bitmap: IBitmap; begin Result := nil; Source := TFileStream.Create(FileName, fmOpen); try if Source.Read(Store, SizeOf(Store)) <> SizeOf(Store) then Exit; Bitmap := CreateBitmap(FontTexDim, FontTexDim); if Source.Read(Bitmap.Pixels^, FontTexSize) <> FontTexSize then Exit; BitmapOpaque(Bitmap); Bitmap.Format := fmPng; finally Source.Free; end; Result := Bitmap; end; function FontToStr(const FileName: string): string; const ColumnWidth = 80; var Source: TStream; Dest, Buffer: TMemoryStream; Store: TFontStore; Bitmap: IBitmap; S: string; I: Integer; begin Result := ''; Source := TFileStream.Create(FileName, fmOpen); Dest := TMemoryStream.Create; try if Source.Read(Store, SizeOf(Store)) <> SizeOf(Store) then Exit; Bitmap := CreateBitmap(FontTexDim, FontTexDim); if Source.Read(Bitmap.Pixels^, FontTexSize) <> FontTexSize then Exit; BitmapOpaque(Bitmap); Bitmap.Format := fmPng; Bitmap.SaveToStream(Dest); Buffer := TMemoryStream.Create; try Buffer.Write(Store, SizeOf(Store)); Buffer.Write(Dest.Memory, Dest.Size); S := Base64Encode(Buffer.Memory, Buffer.Size); finally Buffer.Free; end; Result := ''; I := 1; while I < Length(S) + 1 do begin Result := Result + StrCopy(S, I, ColumnWidth) + LineEnding; Inc(I, ColumnWidth); end; finally Dest.Free; Source.Free; end; end; procedure FontLoadDefault(Font: TFontWriter); const Resource = {$i resources/font.res}; begin Font.LoadFromResource(Resource); end; end.
(* Category: SWAG Title: DATE & TIME ROUTINES Original name: 0004.PAS Description: DATE3.PAS Author: SWAG SUPPORT TEAM Date: 05-28-93 13:37 *) Program Gregorian; { Julian day to Gregorian date } Uses Crt; { Turbo/Quick Pascal } Type String3 = String[3]; String9 = String[9]; Const MonthName : Array [1..12] of String3 = ('Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep','Oct','Nov','Dec'); DayName : Array [1..7] of String9 = ('Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday'); Var Day, JulianDay, F : Real; Month : Byte; Year : Integer; A, B, C, D, E, G, Z : LongInt; LeapYear : Boolean; Function DayofWeek( Month : Byte; Day : Real; Year : Integer ): Byte; Var iVar1, iVar2 : Integer; begin iVar1 := Year MOD 100; iVar2 := TRUNC( Day ) + iVar1 + iVar1 div 4; Case Month of 4, 7 : iVar1 := 0; 1, 10 : iVar1 := 1; 5 : iVar1 := 2; 8 : iVar1 := 3; 2,3,11 : iVar1 := 4; 6 : iVar1 := 5; 9,12 : iVar1 := 6; end; {Case} iVar2 := ( iVar1 + iVar2 ) MOD 7; if ( iVar2 = 0 ) then iVar2 := 7; DayofWeek := Byte( iVar2 ); end; {DayofWeek} Function DayofTheYear( Month : Byte; DAY : Real ): Integer; Var N : Integer; begin if LeapYear then N := 1 else N := 2; N := 275 * Month div 9 - N * (( Month + 9 ) div 12) + TRUNC( Day ) - 30; DayofTheYear := N; end; {DayofTheYear} begin {Gregorian} ClrScr; WriteLn('Gregorian dates v0.0 Dec.91 Greg Vigneault'); WriteLn('[Enter Julian day values]'); Repeat WriteLn; Write('Enter (positive) Julian day number: '); ReadLn( JulianDay ); Until ( JulianDay >= 706.0 ); JulianDay := JulianDay + 0.5; Z := TRUNC( JulianDay ); F := FRAC( JulianDay ); if ( Z < 2299161 ) then A := Z else begin G := TRUNC( ( Z - 1867216.25 ) / 36524.25); A := Z + 1 + G - G div 4; end; {if} B := A + 1524; C := TRUNC( ( B - 122.1 ) / 365.25 ); D := TRUNC( 365.25 * C ); E := TRUNC( ( B - D ) / 30.6001 ); Day := B - D - TRUNC( 30.6001 * E ) + F; if ( E < 13.5 ) then Month := Byte( E - 1 ) else if ( E > 13.5 ) then Month := Byte( E - 13 ); if ( Month > 2.5 ) then Year := Integer( C - 4716 ) else if ( Month < 2.5 ) then Year := Integer( C - 4715 ); if ((Year MOD 100)<>0) and ((Year MOD 4)=0) then LeapYear := True else LeapYear := False; Write(#10,'Gregorian '); if LeapYear then Write('LeapYear '); WriteLn('date is ',DayName[DayofWeek(Month,Day,Year)], ', ',MonthName[ Month ],' ',Day:2:2,',',Year:4, ' (day of year= ',DayofTheYear(Month,Day),')',#10); end. {Gregorian}
unit Unit2; interface uses unit3, // TTRProject type Vcl.Graphics, // TBitmap System.Generics.Collections; // TList<...> type TFloorType = (Floor,door,tilt,roof,trigger,lava,climb,split1,split2,split3,split4, nocol1,nocol2,nocol3,nocol4,nocol5,nocol6,nocol7,nocol8,monkey,trigtrig,beetle); type TParsedFloorData = record tipo : TFloorType; case TFloorType of Floor,trigger,lava,monkey,trigtrig,beetle:(); door:(toRoom:UInt16); tilt,roof:(addX,addZ:int8); climb:(n,s,e,w:Boolean); split1,split2,split3,split4,nocol1,nocol2,nocol3,nocol4, nocol5,nocol6,nocol7,nocol8:(triH1,triH2:integer;corners:array[0..3] of UInt16); end; type TSector = packed record FDindex,BoxIndex :UInt16; RoomBelow :UInt8; Floor :Int8; RoomAbove:UInt8; Ceiling:int8; floorInfo : TList<TParsedFloorData>; hasFD : Boolean; end; type TVertex = packed record x,y,z : Int16; end; type TPortal = packed record toRoom : UInt16; normal : TVertex; vertices : array[0..3] of TVertex; end; type TRoomColour = packed record b,g,r,a : UInt8; end; type TRoom = record x,z,yBottom,yTop : Int32; numZ,numX : UInt16; Sectors:array of TSector; num_portals : UInt16; Portals:array of TPortal; colour : TRoomColour; altroom : Int16; flags:UInt16; waterscheme,reverb,altgroup:UInt8; end; type TTRLevel = class private procedure parseFloorData(FDindex:UInt16;out list:TList<TParsedFloorData>); public bmp : TBitmap; file_version: uint32; num_room_textiles, num_obj_textiles, num_bump_textiles: uint16; num_sounds: uint32; num_rooms: uint16; num_animations, num_state_changes, num_anim_dispatches, num_anim_commands, num_meshtrees, size_keyframes, num_moveables, num_statics: uint32; num_floordata : UInt32; floordata : array of UInt16; rooms : array of TRoom; constructor Create; destructor Destroy;override; function Load(filename: string): uint8; function ConvertToPRJ(const filename:string): TTRProject; end; implementation uses System.SysUtils, Vcl.Dialogs, System.Classes, //TMemoryStream, TBinaryReader System.ZLib, // ZDecompressStream() - decompress TR4 data Imaging, ImagingTypes, ImagingComponents, // Vampyre Imaging Library for .TGA support System.Math; // MaxIntValue() procedure TTRLevel.parseFloorData(FDindex:UInt16;out list:TList<TParsedFloorData>); procedure parseFloorType(arg:UInt16;out f,sub,e:uint16); begin f:=(arg and $001f); sub:=(arg and $7f00) shr 8; e:=(arg and $8000) shr 15; end; var fd:TParsedFloorData; data : UInt16; f,sub,e :UInt16; k:integer; begin if FDindex=0 then begin fd.tipo:=Floor; list.Add(fd); Exit; end; e := 0; k :=0; while (e=0) and (FDIndex+k < num_floordata) do begin data:= floordata[FDindex+k]; Inc(k); parseFloorType(data,f,sub,e); fd.tipo:=TFloorType(f); if fd.tipo = door then begin fd.toRoom:=floordata[FDindex+k]; Inc(k); end else if (fd.tipo = tilt) or (fd.tipo=roof) then begin fd.addX:= int8((floordata[FDindex+k] and $ff00) shr 8); fd.addZ:= int8(floordata[FDindex+k] and $00ff); Inc(k); end else if fd.tipo = trigger then begin repeat data := floordata[FDIndex+k]; Inc(k); until ((data and $8000) = $8000); end else if fd.tipo = climb then begin if (sub and $0001) = $0001 then fd.e :=True else fd.e :=False; if (sub and $0002) = $0002 then fd.s :=True else fd.s :=False; if (sub and $0004) = $0004 then fd.w :=True else fd.w :=False; if (sub and $0008) = $0008 then fd.n :=True else fd.n :=False; end else if fd.tipo in [split1..nocol8] then begin fd.triH1 := (data and $03e0) shr 4; fd.triH2 := (data and $7c00) shr 8; data := floordata[FDindex+k]; Inc(k); fd.corners[0]:=data and $000f; fd.corners[1]:=(data and $00f0) shr 4; fd.corners[2]:=(data and $0f00) shr 8; fd.corners[3]:=(data and $f000) shr 12; end; list.Add(fd); end; end; constructor TTRLevel.Create; begin inherited; file_version := 0; end; destructor TTRLevel.Destroy; var i,j : Integer; begin bmp.Free; for i:=0 to High(rooms) do begin for j:=0 to High(rooms[i].Sectors) do begin if Assigned(rooms[i].Sectors[j].floorInfo) then rooms[i].Sectors[j].floorInfo.Free; end; end; inherited; end; function TTRLevel.Load(filename: string): uint8; const spr = 'spr'; tex = 'tex'; var version: uint32; resultado: uint8; f: file; memfile: TMemoryStream; br, br2,br3: TBinaryReader; size, size2, size3: uint32; geometry1: TMemoryStream; geometry: TMemoryStream; tex32 : TMemoryStream; i, j: integer; s: string; r:TRoom; b:TBitmap; col :TColor; rd,gr,bl,al:UInt8; success:Boolean; sectorFD:TList<TParsedFloorData>; begin resultado := 0; if FileExists(filename) then begin FileMode := 0; assignfile(f, filename); Reset(f, 1); BlockRead(f, version, 4); CloseFile(f); if (version <> $00345254) and (version <> $63345254) then begin version := 0; resultado := 2; end; end else begin version := 0; resultado := 1; end; if version = $63345254 then begin resultado := 3; version := 0; end; if resultado <> 0 then begin Result := resultado; Exit; end; success:=False; memfile := TMemoryStream.Create; try memfile.LoadFromFile(filename); br := TBinaryReader.Create(memfile); try file_version := br.ReadUInt32; num_room_textiles := br.ReadUInt16; num_obj_textiles := br.ReadUInt16; num_bump_textiles := br.ReadUInt16; memfile.seek(4, soCurrent); size := br.ReadUInt32; geometry1 := TMemoryStream.Create; geometry1.CopyFrom(memfile,size); geometry1.Position:=0; tex32:=TMemoryStream.Create; ZDecompressStream(geometry1,tex32); tex32.Position:=0; geometry1.Free; if Assigned(bmp) then bmp.Free; b:=TBitmap.Create; b.PixelFormat:=pf24bit; b.Width:=256; b.Height:=num_room_textiles * 256; //tex32.Size div 256 div 4; br3:=TBinaryReader.Create(tex32); for i:=0 to b.Height-1 do begin for j := 0 to 255 do begin bl:=br3.ReadByte; gr:=br3.ReadByte; rd:=br3.ReadByte; al:=br3.ReadByte; if al=0 then begin bl:=255; rd:=255; gr:=0; end; col := 0; col := col or (bl shl 16); col := col or (gr shl 8); col := col or rd; b.Canvas.Pixels[j,i]:= col; end; end; br3.Free; bmp:=b; memfile.Seek(4, soCurrent); size := br.ReadUInt32; memfile.Seek(size, soCurrent); //skip the textiles16 memfile.Seek(4, soCurrent); size := br.ReadUInt32; memfile.Seek(size, soCurrent); //skip the font and sky size2 := br.ReadUInt32; size := br.ReadUInt32; geometry1 := TMemoryStream.Create; geometry1.CopyFrom(memfile, size); geometry1.Position := 0; geometry := TMemoryStream.Create; ZDecompressStream(geometry1, geometry); geometry.Position := 0; geometry1.Free; num_sounds := br.ReadUInt32; br2 := TBinaryReader.Create(geometry); geometry.Seek(4, soCurrent); num_rooms := br2.ReadUInt16; SetLength(rooms,num_rooms); for i := 0 to High(rooms) do begin r.z := br2.ReadInt32; r.x := br2.ReadInt32; r.yBottom := br2.ReadInt32; r.yTop := br2.ReadInt32; size := br2.ReadUInt32; //num room mesh data words geometry.Seek(size * 2, soCurrent); //skip verts, quads, tris, sprites r.num_portals := br2.ReadUInt16; //num portals SetLength(r.Portals,r.num_portals); for j := 1 to r.num_portals do begin geometry.ReadBuffer(r.Portals[j-1],32); end; r.numX := br2.ReadUInt16; // X is east west in RoomEdit - opposite of what TRosetta stone says! r.numZ := br2.ReadUInt16; // Z is north south as per RoomEdit grid SetLength(r.Sectors, r.numX*r.numZ); for j := 1 to r.numX * r.numZ do begin geometry.ReadBuffer(r.Sectors[j-1],8); // X columns, Z rows r.Sectors[j-1].hasFD:=False; end; geometry.ReadBuffer(r.colour,4); size := br2.ReadUInt16; //num lights for j := 1 to size do begin geometry.Seek(46, soCurrent); //skip lights end; size := br2.ReadUInt16; //num static meshes for j := 1 to size do begin geometry.Seek(20, soCurrent); //skip static meshes end; r.altroom := br2.ReadInt16; r.flags := br2.ReadUInt16; r.waterscheme := br2.ReadByte; r.reverb := br2.ReadByte; r.altgroup := br2.ReadByte; rooms[i] := r; end; num_floordata := br2.ReadUInt32; SetLength(floordata,num_floordata); geometry.ReadBuffer(floordata[0],num_floordata*2); size := br2.ReadUInt32; //num object mesh data words geometry.Seek(size * 2, soCurrent); //skip object meshes size := br2.ReadUInt32; //num mesh pointers geometry.Seek(size * 4, soCurrent); //skip mesh pointers num_animations := br2.ReadUInt32; geometry.Seek(num_animations * 40, soCurrent); num_state_changes := br2.ReadUInt32; geometry.Seek(num_state_changes * 6, soCurrent); num_anim_dispatches := br2.ReadUInt32; geometry.Seek(num_anim_dispatches * 8, soCurrent); num_anim_commands := br2.ReadUInt32; geometry.Seek(num_anim_commands * 2, soCurrent); num_meshtrees := br2.ReadUInt32; geometry.Seek(num_meshtrees * 4, soCurrent); size_keyframes := br2.ReadUInt32; geometry.Seek(size_keyframes * 2, soCurrent); num_moveables := br2.ReadUInt32; geometry.Seek(num_moveables * 18, soCurrent); num_statics := br2.ReadUInt32; geometry.Seek(num_statics * 32, soCurrent); s := br2.ReadChar; s := s + br2.ReadChar; s := s + br2.ReadChar; s := LowerCase(s); if s <> spr then MessageDlg('SPR landmark not read correctly!',mtError,[mbOK],0); size := br2.ReadUInt32; // num sprite tex geometry.Seek(size * 16, soCurrent); //skip sprite tex size := br2.ReadUInt32; // num sprite seq geometry.Seek(size * 8, soCurrent); //skip sprite seq size := br2.ReadUInt32; // num cameras geometry.Seek(size * 16, soCurrent); //skip cameras size := br2.ReadUInt32; // num flyby cams geometry.Seek(size * 40, soCurrent); //skip flyby cams size := br2.ReadUInt32; // num sound sources geometry.Seek(size * 16, soCurrent); //skip sound sources size2 := br2.ReadUInt32; // num Boxes geometry.Seek(size2 * 8, soCurrent); //skip boxes size := br2.ReadUInt32; // num overlaps geometry.Seek(size * 2, soCurrent); //skip overlaps geometry.Seek(size2 * 20, soCurrent); //skip zones size := br2.ReadUInt32; // num anim tex words geometry.Seek(size * 2, soCurrent); //skip anim tex words geometry.Seek(1,soCurrent); // skip uv ranges s := br2.ReadChar; s := s + br2.ReadChar; s := s + br2.ReadChar; s := LowerCase(s); if s <> tex then MessageDlg('TEX landmark not read correctly!',mtError,[mbOK],0); size := br2.ReadUInt32; // num textures geometry.Seek(size * 38, soCurrent); //skip textures br2.Free; geometry.Free; success:=True; finally br.Free; end; finally memfile.Free; end; if success then begin for i:=0 to High(rooms) do begin for j:=0 to High(rooms[i].Sectors) do begin if rooms[i].Sectors[j].FDindex =0 then Continue; sectorFD := TList<TParsedFloorData>.Create; rooms[i].Sectors[j].hasFD:=True; parseFloorData(rooms[i].Sectors[j].FDindex,sectorFD); rooms[i].Sectors[j].floorInfo:=sectorFD; end; end; end; end; function TTRLevel.ConvertToPRJ(const filename :string): TTRProject; var p:TTRProject; slots:uint32; i,j,k,ii,jj:Integer; r1:TRoom; sector:TSector; s:string; img:TImageData; b:Integer; fd:TParsedFloorData; maxCorner:Word; a:array[0..3]of integer; po:TPortal; isHorizontalDoor : Boolean; begin if (num_rooms <= 100) then slots:=100 else if ((num_rooms>100) and (num_rooms<=200)) then slots:=200 else slots := 300; p := TTRProject.Create(num_rooms,slots); s := ChangeFileExt(filename,'.tga'); InitImage(img); img.Format := ifR8G8B8; ConvertBitmapToData(bmp,img); // make sure bitmap's pixelformat was set to 24!! SaveImageToFile(s,img); FreeImage(img); p.TGAFilePath := ExtractShortPathName(s); if LowerCase(p.TGAFilePath)='.tga' then MessageDlg('PRJ TGA filename error',mtError,[mbOK],0); p.TGAFilePath := p.TGAFilePath+' '; // don't forget space for i:=0 to High(rooms) do begin r1:=rooms[i]; p.Rooms[i].x := r1.x; // p.Rooms[i].y := r1.yBottom; p.Rooms[i].z := r1.z; p.Rooms[i].xsize := r1.numX; p.Rooms[i].zsize := r1.numZ; p.Rooms[i].xoffset := (20 - r1.numX) div 2; p.Rooms[i].zoffset := (20 - r1.numZ) div 2; p.Rooms[i].xpos := r1.x div 1024; p.Rooms[i].zpos := r1.z div 1024; p.Rooms[i].ambient.r := r1.colour.r; p.Rooms[i].ambient.g := r1.colour.g; p.Rooms[i].ambient.b := r1.colour.b; p.Rooms[i].ambient.a := r1.colour.a; p.Rooms[i].fliproom := r1.altroom; p.rooms[i].flags1 := r1.flags; // TODO: check they're the same SetLength(p.Rooms[i].blocks,r1.numZ*r1.numX); for j:=0 to r1.numZ-1 do // rows begin for k:=0 to r1.numX-1 do // columns begin b := j*r1.numX+k; // index to block array and sector array sector := r1.Sectors[b]; p.Rooms[i].blocks[b].id := $1; // default is floor type p.Rooms[i].blocks[b].Floor := -sector.Floor; p.Rooms[i].blocks[b].ceiling := -sector.Ceiling; // corner grey blocks can be any heights I guess since never seen // aktrekker makes them same as corner blocks of inner blocks // floor and ceil heights for grey blocks/walls are division lines if ((k=0)and(j=0)) or ((k=r1.numX-1)and(j=0)) or ((k=0)and(j=r1.numZ-1)) or ((k=r1.numX-1)and(j=r1.numZ-1)) then begin p.Rooms[i].blocks[b].id := $1e; p.Rooms[i].blocks[b].Floor := 0; p.Rooms[i].blocks[b].ceiling := 20; end // other grey outer blocks else if (j=0) or (j=r1.numZ-1) or (k=0) or (k=r1.numX-1) then begin p.Rooms[i].blocks[b].id := $1e; p.Rooms[i].blocks[b].Floor := -r1.yBottom div 256; p.Rooms[i].blocks[b].ceiling := -r1.yTop div 256; end // green wall blocks except those with door FloorData else if (sector.Floor = -127) then begin p.Rooms[i].blocks[b].id := $e; p.Rooms[i].blocks[b].Floor := -r1.yBottom div 256; p.Rooms[i].blocks[b].ceiling := -r1.yTop div 256; end // black door blocks - no good without door arrays implemented else if (sector.RoomBelow<>255) and (sector.RoomAbove<>255) then begin // p.Rooms[i].blocks[b].id := $7; end else if (sector.RoomBelow<>255) then begin // p.Rooms[i].blocks[b].id := $3; end else if (sector.RoomAbove<>255) then begin // p.Rooms[i].blocks[b].id := $5; end; if sector.hasFD then // need to check since no list of floordata for FDindex=0 sectors begin for ii :=0 to sector.floorInfo.Count-1 do begin fd:=sector.floorInfo[ii]; if fd.tipo in [trigger] then Continue; // not implemented if fd.tipo = door then // not implemented begin isHorizontalDoor:=True; for jj := 0 to High(r1.Portals) do begin po:=r1.Portals[jj]; // check if door toRoom is above by checking portals // if it's not a vertical door then it is a horizontal one if po.normal.y = 0 then // check vertical portals begin if po.toRoom = fd.toRoom then begin isHorizontalDoor := False; Break; end; end; end; if isHorizontalDoor then // it's a green wall block not a floor block begin if p.Rooms[i].blocks[b].id = $1 then p.Rooms[i].blocks[b].id := $e; if p.Rooms[i].blocks[b].id = $1e then begin p.Rooms[i].blocks[b].Floor := -sector.Floor; p.Rooms[i].blocks[b].ceiling := -sector.Ceiling; end; end; // if p.Rooms[i].blocks[b].id = $1e then p.Rooms[i].blocks[b].id := $6 Continue; end; if fd.tipo=beetle then begin p.Rooms[i].blocks[b].flags2:= p.Rooms[i].blocks[b].flags2 or $0040; Continue; end; if fd.tipo=trigtrig then begin p.Rooms[i].blocks[b].flags2:= p.Rooms[i].blocks[b].flags2 or $0020; Continue; end; if fd.tipo=climb then begin if fd.n then p.Rooms[i].blocks[b].flags1:=p.Rooms[i].blocks[b].flags1 or $0200; if fd.s then p.Rooms[i].blocks[b].flags1:=p.Rooms[i].blocks[b].flags1 or $0080; if fd.w then p.Rooms[i].blocks[b].flags1:=p.Rooms[i].blocks[b].flags1 or $0100; if fd.e then p.Rooms[i].blocks[b].flags1:=p.Rooms[i].blocks[b].flags1 or $0040; Continue; end; if fd.tipo=monkey then begin p.Rooms[i].blocks[b].flags1:=p.Rooms[i].blocks[b].flags1 or $4000; Continue; end; if fd.tipo=lava then begin p.Rooms[i].blocks[b].flags1:=p.Rooms[i].blocks[b].flags1 or $0010; Continue; end; if fd.tipo=tilt then begin // can have both X and Z tilt if fd.addX>=0 then begin p.Rooms[i].blocks[b].floorcorner[2]:=fd.addX; p.Rooms[i].blocks[b].floorcorner[3]:=fd.addX; end else begin p.Rooms[i].blocks[b].floorcorner[0]:= -fd.addX; p.Rooms[i].blocks[b].floorcorner[1]:= -fd.addX; end; if fd.addZ>=0 then begin p.Rooms[i].blocks[b].floorcorner[0]:=p.Rooms[i].blocks[b].floorcorner[0]+fd.addZ; p.Rooms[i].blocks[b].floorcorner[3]:=p.Rooms[i].blocks[b].floorcorner[3]+fd.addZ; end else begin p.Rooms[i].blocks[b].floorcorner[2]:=p.Rooms[i].blocks[b].floorcorner[2]+Abs(fd.addZ); p.Rooms[i].blocks[b].floorcorner[1]:=p.Rooms[i].blocks[b].floorcorner[1]+Abs(fd.addZ); end; p.Rooms[i].blocks[b].Floor := p.Rooms[i].blocks[b].Floor-(Abs(fd.addX)+abs(fd.addZ)); Continue; end; // tilt if fd.tipo=roof then begin // can have both X and Z roof if fd.addX>=0 then begin p.Rooms[i].blocks[b].ceilcorner[0]:=-fd.addX; p.Rooms[i].blocks[b].ceilcorner[1]:=-fd.addX; end else begin p.Rooms[i].blocks[b].ceilcorner[2]:=fd.addX; p.Rooms[i].blocks[b].ceilcorner[3]:=fd.addX; end; if fd.addZ>=0 then begin p.Rooms[i].blocks[b].ceilcorner[1]:=p.Rooms[i].blocks[b].ceilcorner[1]-fd.addZ; p.Rooms[i].blocks[b].ceilcorner[2]:=p.Rooms[i].blocks[b].ceilcorner[2]-fd.addZ; end else begin p.Rooms[i].blocks[b].ceilcorner[0]:=p.Rooms[i].blocks[b].ceilcorner[0]+fd.addZ; p.Rooms[i].blocks[b].ceilcorner[3]:=p.Rooms[i].blocks[b].ceilcorner[3]+fd.addZ; end; p.Rooms[i].blocks[b].Ceiling := p.Rooms[i].blocks[b].ceiling+Abs(fd.addX)+abs(fd.addZ); Continue; end; // roof if fd.tipo in [split1,split2,nocol1..nocol4] then // floor splits begin // no good for corner heights > 15!!! maybe need to check geometry vertices p.Rooms[i].blocks[b].floorcorner[0]:=fd.corners[0]; p.Rooms[i].blocks[b].floorcorner[1]:=fd.corners[1]; p.Rooms[i].blocks[b].floorcorner[2]:=fd.corners[2]; p.Rooms[i].blocks[b].floorcorner[3]:=fd.corners[3]; a[0]:=fd.corners[0]; a[1]:=fd.corners[1]; a[2]:=fd.corners[2]; a[3]:=fd.corners[3]; maxCorner:=maxIntvalue(a); p.Rooms[i].blocks[b].Floor := p.Rooms[i].blocks[b].Floor-maxCorner; Continue; end; //floor splits if fd.tipo in [split3,split4,nocol5..nocol8] then // ceiling splits begin // no good for corner heights > 15!!! maybe need to check geometry vertices p.Rooms[i].blocks[b].ceilcorner[0]:=-fd.corners[0]; p.Rooms[i].blocks[b].ceilcorner[1]:=-fd.corners[1]; p.Rooms[i].blocks[b].ceilcorner[2]:=-fd.corners[2]; p.Rooms[i].blocks[b].ceilcorner[3]:=-fd.corners[3]; a[0]:=fd.corners[0]; a[1]:=fd.corners[1]; a[2]:=fd.corners[2]; a[3]:=fd.corners[3]; maxCorner:=maxIntvalue(a); p.Rooms[i].blocks[b].ceiling := p.Rooms[i].blocks[b].ceiling+maxCorner; Continue; end; // ceiling splits end; // loop thru FData end; // has FData end; // loop thru X block columns end; // loop thru Z block rows end; // loop thru rooms Result := p; end; end.
{ Библиотека дополнительных утилит Дополнительные процедуры и функции для работы со строками © Роман М. Мочалов, 1997-2001 E-mail: roman@sar.nnov.ru } unit ExtStrUtils; interface {$I EX.INC} uses SysUtils, Classes, Math; type TCharSet = set of Char; { Поиск подстроки Substr в строке S. Если параметр MatchCase выставлен в False, то поиск производится без зависимости от регистра. } function CasePos(Substr: string; S: string; MatchCase: Boolean): Integer; { Замена в строке S символа C1 на символ C2. } function ReplaceChar(const S: string; C1, C2: Char): string; { Замена в строке S всех символов, указанных в массиве C1 на символ C2. } function ReplaceChars(const S: string; C1: array of Char; C2: Char): string; { Замена в строке S первой найденной подстроки S1 на подстроку S2. Замена производится без зависимости от регистра символов. } function ReplaceStr(const S: string; S1, S2: string): string; { Расширенный вариант функции замены в строке S подстроки S1 на подстроку S2. Возможна замена всех втречающихся подстрок S1 с указанием зависимости от регистра символов. } function ReplaceStrEx(const S: string; S1, S2: string; ReplaceAll, MatchCase: Boolean): string; { Удаление из строки S всех симовлов, указанных в массиве C или строке C. } function RemoveChars(const S: string; C: TCharSet): string; function ExtractChars(const S: string; const C: string): string; { Удаление символов переноса из строки. Сиволы переноса заменяются на пробел. } function RemoveLineBreaks(const S: string): string; { Удаление двойных пробелов из строки. } function RemoveDoubleSpace(const S: string): string; { Отсечение слева и справа от строки S указанного символа C. } function TrimChar(const S: string; C: Char): string; function TrimChars(const S: string; C: TCharSet): string; { Отсечение слева от строки S указанного символа C. } function TrimCharLeft(const S: string; C: Char): string; { Отсечение справа от строки S указанного символа C. } function TrimCharRight(const S: string; C: Char): string; { Дополнение строки S слева символами C до длины Len. } function InsertCharLeft(const S: string; C: Char; Len: Integer): string; { Дополнение строки S справа символами C до длины Len. } function InsertCharRight(const S: string; C: Char; Len: Integer): string; { Усечение строки S слева до длины MaxLen. Если длина строки менее указанной длины, то строка возвращается без изменения. } function TruncLeft(const S: string; MaxLen: Integer): string; { Усечение строки S справа до длины MaxLen. Если длина строки менее указанной длины, то строка возвращается без изменения. } function TruncRight(const S: string; MaxLen: Integer): string; { Функции для определения имени параметра и значения строки вида Параметр=значение. Используются для быстрого определения параметра и значения из списка StringList. } function ExtractParamName(const S: string; Delimiter: Char): string; function ExtractParamValue(const S: string; Delimiter: Char): string; { Определение равенства набора строк. } function StringsEqual(List: array of string; MatchCase: Boolean): Boolean; { Определение наличия хотябы одной пустрой строки в указанном наборе. } function StringsEmpty(List: array of string): Boolean; { Определение количества строк в соотвествии с переносами. } function GetLineCount(const S: string): Integer; {$IFDEF EX_D2} { Returns the smallest and largest value in the data array (MIN/MAX) } function MinIntValue(const Data: array of Integer): Integer; function MaxIntValue(const Data: array of Integer): Integer; type TIdentMapEntry = record Value: Integer; Name: String; end; function IdentToInt(const Ident: string; var Int: Longint; const Map: array of TIdentMapEntry): Boolean; function IntToIdent(Int: Longint; var Ident: string; const Map: array of TIdentMapEntry): Boolean; {$ENDIF} { Перевод идентификатора Ident в значение в соотвествием с указанным списком возможных соотвествий Map. Если указанного идентификатора нет в списке, возвращается значение по умолчанию Default. } function IdentToIntDef(const Ident: string; Default: Longint; const Map: array of TIdentMapEntry): Longint; { Перевод Значения Int в идентификатор в соотвествием с указанным списком возможных соотвествий Map. Если указанного значения нет в списке, возвращается значение по умолчанию Default. } function IntToIdentDef(Int: Longint; const Default: string; const Map: array of TIdentMapEntry): string; { Получение индекса идентификатора Name в списке Map. Если идентификатора в списке нет, возвращается индекс по умолчанию. } function GetIdentNameIndex(const Name: string; const Map: array of TIdentMapEntry): Integer; function GetIdentNameIndexDef(const Name: string; DefIndex: Integer; const Map: array of TIdentMapEntry): Integer; { Получение индекса значения Value в списке Map. Если значения в списке нет, возвращается индекс по умолчанию. } function GetIdentValueIndex(Value: Longint; const Map: array of TIdentMapEntry): Integer; function GetIdentValueIndexDef(Value: Longint; DefIndex: Integer; const Map: array of TIdentMapEntry): Integer; { Заполненине произвольного списка идентификаторами списка Map. Заполнение производится в путем вызова процедуры Proc в ходе перебора списка Map. Возвращает количество элементов в списке. } function GetIdentsList(const Map: array of TIdentMapEntry; Proc: TGetStrProc): Integer; { Заполненине списка Strings идентификаторами из списка Map. } function GetIdentsStringList(const Map: array of TIdentMapEntry; Strings: TStrings): Integer; {$IFNDEF EX_D4_UP} { Перевод строки значений, разделенных указанным символом, в список строк. } type TSysCharSet = set of Char; function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings): Integer; {$ENDIF} { Перевод списка строк в одну строку с использование указанного разделителя. } function ExpandStrings(Strings: TStrings; const Separator: string): string; { Сравнение двух строк с учетом условий поиска. } function CompareStrEx(const S1, S2: string; WholeWord, MatchCase: Boolean): Boolean; implementation { Поиск подстроки Substr в строке S } function CasePos(Substr: string; S: string; MatchCase: Boolean): Integer; begin if not MatchCase then begin { все в верхний регистр } Substr := AnsiUpperCase(Substr); S := AnsiUpperCase(S); end; { ищем } {$IFDEF EX_D2} Result := Pos(Substr, S); {$ELSE} Result := AnsiPos(Substr, S); {$ENDIF} end; { Замена в строке S символа C1 на символ C2 } function ReplaceChar(const S: string; C1, C2: Char): string; var I: Integer; begin { устанавливаем результат в исходную строку } Result := S; { меняем символ } for I := 1 to Length(Result) do if Result[I] = C1 then Result[I] := C2; end; { Замена в строке S всех символов, указанных в массиве C1 на символ C2 } function ReplaceChars(const S: string; C1: array of Char; C2: Char): string; var I, J: Integer; begin { устанавливаем результат в исходную строку } Result := S; { меняем символ } for I := 1 to Length(Result) do for J := Low(C1) to High(C1) do if Result[I] = C1[J] then Result[I] := C2; end; { Замена в строке S первой найденной подстроки S1 на подстроку S2 } function ReplaceStr(const S: string; S1, S2: string): string; begin Result := ReplaceStrEx(S, S1, S2, False, False); end; { Расширенный вариант функции замены в строке S подстроки S1 на подстроку S2 } function ReplaceStrEx(const S: string; S1, S2: string; ReplaceAll, MatchCase: Boolean): string; var P: Integer; begin Result := S; P := CasePos(S1, Result, MatchCase); while P <> 0 do begin Delete(Result, P, Length(S1)); Insert(S2, Result, P); P := CasePos(S1, Result, MatchCase); end; end; { Удаление из строки S всех симовлов, указанных в массиве C } function RemoveChars(const S: string; C: TCharSet): string; var I, L, N: Integer; begin { длина строки } L := Length(S); { устанавливаем длину результата в длину строки } SetString(Result, nil, L); N := 0; { перебираем символы строки } for I := 1 to L do { есть ли текущий символ среди удаляемых } if not (S[I] in C) then begin Inc(N); Result[N] := S[I]; end; { устанавливаем реальную длину строки результата } SetLength(Result, N); end; function ExtractChars(const S: string; const C: string): string; var I, J, K, L, N: Integer; begin { длина строки } L := Length(S); { устанавливаем длину результата в длину строки } SetString(Result, nil, L); N := 0; { перебираем символы строки } for I := 1 to L do begin K := 0; { ищем текущий символ среди удаляемых } for J := 1 to Length(C) do if S[I] = C[J] then begin Inc(K); Break; end; { если не было - добавляем в результат } if K = 0 then begin Inc(N); Result[N] := S[I]; end; end; { устанавливаем реальную длину строки результата } SetLength(Result, N); end; { Удаление символов переноса из строки } function RemoveLineBreaks(const S: string): string; var I, L, N: Integer; begin { длина строки } L := Length(S); { устанавливаем длину результата в длину строки } SetString(Result, nil, L); N := 0; { перебираем символы строки } I := 1; while I <= L do begin Inc(N); { является ли текущий символ символом переноса строки } if S[I] in [#13, #10] then begin { да - меняем его на пробел } Result[N] := ' '; { следующие символы переноса игнорируем } while (I < L) and (S[I + 1] in [#13, #10]) do Inc(I); end else { нет - берем его } Result[N] := S[I]; { следующий символ } Inc(I); end; { устанавливаем реальную длину строки результата } SetLength(Result, N); end; { Удаление двойных пробелов из строки } function RemoveDoubleSpace(const S: string): string; var I, L, N: Integer; begin { длина строки } L := Length(S); { устанавливаем длину результата в длину строки } SetString(Result, nil, L); N := 0; { перебираем символы строки } I := 1; while I <= L do begin Inc(N); { является ли текущий символ пробелом } if S[I] = ' ' then begin { да - оставляем его } Result[N] := ' '; { следующие пробелы игнорируем } while (I < L) and (S[I + 1] = ' ') do Inc(I); end else { нет - берем его } Result[N] := S[I]; { следующий символ } Inc(I); end; { устанавливаем реальную длину строки результата } SetLength(Result, N); end; { Отсечение слева и справа от строки S указанного символа C } function TrimChar(const S: string; C: Char): string; begin Result := TrimChars(S, [C]); end; function TrimChars(const S: string; C: TCharSet): string; var I, L: Integer; begin L := Length(S); I := 1; while (I <= L) and (S[I] in C) do Inc(I); if I > L then begin Result := ''; Exit; end; while S[L] in C do Dec(L); Result := Copy(S, I, L - I + 1); end; { Отсечение слева от строки S указанного символа C. } function TrimCharLeft(const S: string; C: Char): string; var I, L: Integer; begin L := Length(S); I := 1; while (I <= L) and (S[I] = C) do Inc(I); Result := Copy(S, I, Maxint); end; { Отсечение справа от строки S указанного символа C. } function TrimCharRight(const S: string; C: Char): string; var I: Integer; begin I := Length(S); while (I > 0) and (S[I] = C) do Dec(I); if I <> 0 then Result := Copy(S, 1, I) else Result := ''; end; { Дополнение строки S слева символами C до длины Len } function InsertCharLeft(const S: string; C: Char; Len: Integer): string; var L: Integer; A: string; begin L := Length(S); { прверяем длину } if L >= Len then begin Result := S; Exit; end; { формируем добавок } SetString(A, nil, Len - L); FillChar(Pointer(A)^, Len - L, Byte(C)); { результат } Result := A + S; end; { Дополнение строки S справа символами C до длины Len. } function InsertCharRight(const S: string; C: Char; Len: Integer): string; var L: Integer; A: string; begin { получаем длину строки } L := Length(S); { проверяем длину } if L >= Len then begin Result := S; Exit; end; { формируем добавок } SetString(A, nil, Len - L); FillChar(Pointer(A)^, Len - L, Byte(C)); { результат } Result := S + A; end; { Усечение строки S слева до длины MaxLen } function TruncLeft(const S: string; MaxLen: Integer): string; var L: Integer; begin { получаем длину строки } L := Length(S); { если длина больше - отрезаем сколько нужно } if L > MaxLen then begin Result := Copy(S, MaxIntValue([1, L - MaxLen]), MaxLen); Exit; end; { возвращаем строку без изменения } Result := S; end; { Усечение строки S справа до длины MaxLen } function TruncRight(const S: string; MaxLen: Integer): string; var L: Integer; begin { получаем длину строки } L := Length(S); { если длина больше - отрезаем сколько нужно } if L > MaxLen then begin Result := Copy(S, 1, MaxLen); Exit; end; { возвращаем строку без изменения } Result := S; end; { Функции для определения имени параметра и значения строки } function ExtractParamName(const S: string; Delimiter: Char): string; var P: Integer; begin Result := S; {$IFDEF EX_D2} P := Pos(Delimiter, Result); {$ELSE} P := AnsiPos(Delimiter, Result); {$ENDIF} if P <> 0 then SetLength(Result, P - 1); end; function ExtractParamValue(const S: string; Delimiter: Char): string; begin Result := Copy(S, Length(ExtractParamName(S, Delimiter)) + 2, MaxInt); end; { Определение равенства набора строк. } function StringsEqual(List: array of string; MatchCase: Boolean): Boolean; var I: Integer; S1, S2: string; begin Result := False; { получаем первую строку } S1 := List[Low(List)]; if not MatchCase then S1 := AnsiUpperCase(S1); { преребираем } for I := Low(List) + 1 to High(List) do begin { получаем вторую строку } S2 := List[I]; if not MatchCase then S2 := AnsiUpperCase(S2); { сравниваем } if AnsiCompareStr(S1, S2) <> 0 then Exit; end; { все равны } Result := True; end; { Определение наличия хотябы одной пустрой строки в указанном наборе } function StringsEmpty(List: array of string): Boolean; var I: Integer; begin { преребираем } for I := Low(List) to High(List) do { определяем длину } if Length(List[I]) = 0 then begin Result := False; Exit; end; { все пусты } Result := True; end; { Определение количество строк в соотвествии с переносами } function GetLineCount(const S: string): Integer; var P: PChar; begin Result := 0; { ищем перенос строки } P := Pointer(S); while P^ <> #0 do begin while not (P^ in [#0, #10, #13]) do Inc(P); { была строка } Inc(Result); { учитываем символы переноса } if P^ = #13 then Inc(P); if P^ = #10 then Inc(P); end; end; {$IFDEF EX_D2} { Returns the smallest and largest value in the data array (MIN/MAX) } function MinIntValue(const Data: array of Integer): Integer; var I: Integer; begin Result := Data[Low(Data)]; for I := Low(Data) + 1 to High(Data) do if Result > Data[I] then Result := Data[I]; end; function MaxIntValue(const Data: array of Integer): Integer; var I: Integer; begin Result := Data[Low(Data)]; for I := Low(Data) + 1 to High(Data) do if Result < Data[I] then Result := Data[I]; end; function IdentToInt(const Ident: string; var Int: Longint; const Map: array of TIdentMapEntry): Boolean; var I: Integer; begin for I := Low(Map) to High(Map) do if CompareText(Map[I].Name, Ident) = 0 then begin Result := True; Int := Map[I].Value; Exit; end; Result := False; end; function IntToIdent(Int: Longint; var Ident: string; const Map: array of TIdentMapEntry): Boolean; var I: Integer; begin for I := Low(Map) to High(Map) do if Map[I].Value = Int then begin Result := True; Ident := Map[I].Name; Exit; end; Result := False; end; {$ENDIF} { Перевод идентификатора Ident в значение в соотвествием со списком Map } function IdentToIntDef(const Ident: string; Default: Longint; const Map: array of TIdentMapEntry): Longint; begin if not IdentToInt(Ident, Result, Map) then Result := Default; end; { Перевод значения Int в идентификатор в соотвествием со списком Map } function IntToIdentDef(Int: Longint; const Default: string; const Map: array of TIdentMapEntry): string; begin if not IntToIdent(Int, Result, Map) then Result := Default; end; { Получение индекса идентификатора Name в списке Map } function GetIdentNameIndex(const Name: string; const Map: array of TIdentMapEntry): Integer; begin Result := GetIdentNameIndexDef(Name, -1, Map); end; function GetIdentNameIndexDef(const Name: string; DefIndex: Integer; const Map: array of TIdentMapEntry): Integer; var I: Integer; begin for I := Low(Map) to High(Map) do if CompareText(Map[I].Name, Name) = 0 then begin Result := I; Exit; end; Result := DefIndex; end; { Получение индекса значения Value в списке Map } function GetIdentValueIndex(Value: Longint; const Map: array of TIdentMapEntry): Integer; begin Result := GetIdentValueIndexDef(Value, -1, Map); end; function GetIdentValueIndexDef(Value: Longint; DefIndex: Integer; const Map: array of TIdentMapEntry): Integer; var I: Integer; begin for I := Low(Map) to High(Map) do if Map[I].Value = Value then begin Result := I; Exit; end; Result := DefIndex; end; { Заполненине произвольного списка идентификаторами списка Map. Заполнение производится в путем вызова процедуры Proc в ходе перебора списка Map. } function GetIdentsList(const Map: array of TIdentMapEntry; Proc: TGetStrProc): Integer; var I: Integer; begin Result := 0; for I := Low(Map) to High(Map) do begin Proc(Map[I].Name); Inc(Result); end; end; { Заполненине списка Strings идентификаторами списка Map. } function GetIdentsStringList(const Map: array of TIdentMapEntry; Strings: TStrings): Integer; type TGetStrFunc = function(const S: string): Integer of object; var Proc: TGetStrFunc; begin { очищием список } Strings.Clear; { заполняем } Proc := Strings.Add; Result := GetIdentsList(Map, TGetStrProc(Proc)); end; {$IFNDEF EX_D4_UP} { Перевод строки значений, разделенных указанным символом, в список строк. } function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings): Integer; var Head, Tail: PChar; EOS, InQuote: Boolean; QuoteChar: Char; Item: string; begin Result := 0; if (Content = nil) or (Content^=#0) or (Strings = nil) then Exit; Tail := Content; InQuote := False; QuoteChar := #0; Strings.BeginUpdate; try repeat while Tail^ in WhiteSpace + [#13, #10] do Inc(Tail); Head := Tail; while True do begin while (InQuote and not (Tail^ in ['''', '"', #0])) or not (Tail^ in Separators + [#0, #13, #10, '''', '"']) do Inc(Tail); if Tail^ in ['''', '"'] then begin if (QuoteChar <> #0) and (QuoteChar = Tail^) then QuoteChar := #0 else QuoteChar := Tail^; InQuote := QuoteChar <> #0; Inc(Tail); end else Break; end; EOS := Tail^ = #0; if (Head <> Tail) and (Head^ <> #0) then begin if Strings <> nil then begin SetString(Item, Head, Tail - Head); Strings.Add(Item); end; Inc(Result); end; Inc(Tail); until EOS; finally Strings.EndUpdate; end; end; {$ENDIF} { Перевод списка строк в одну строку с использование указанного разделителя } function ExpandStrings(Strings: TStrings; const Separator: string): string; var I: Integer; begin Result := ''; if Strings.Count > 0 then begin Result := Strings[0]; for I := 1 to Strings.Count - 1 do Result := Result + Separator + Strings[I]; end; end; { Сравнение двух строк с учетом условий поиска. } function CompareStrEx(const S1, S2: string; WholeWord, MatchCase: Boolean): Boolean; begin if WholeWord then if MatchCase then Result := AnsiCompareStr(S1, S2) = 0 else Result := AnsiCompareText(S1, S2) = 0 else Result := CasePos(S1, S2, MatchCase) <> 0; end; end.
unit frameScreenObjectObsMf6Unit; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.CheckLst, UndoItemsScreenObjects, Vcl.ExtCtrls, Vcl.ComCtrls, ArgusDataEntry, framePestObsUnit, framePestObsMf6Unit; type TFlowObsRows = (forCHD, forDRN, forEVT, forGHB, forRCH, forRIV, forWEL, forToMvr); // Head //well flow rate (maw) //well cell flow rates (maw + icon) //pumping rate //flowing well flow rate //storage flow rate //constant-flow rate //well conductance (conductance) //individual well cell conductances (conductance + icon //flowing well conductance TframeScreenObjectObsMf6 = class(TFrame) pnlCaption: TPanel; pgcMain: TPageControl; tabBasic: TTabSheet; tabMAW: TTabSheet; lblTypesOfFlowObservation: TLabel; lblBoundaryFlowObservations: TLabel; cbHeadObservation: TCheckBox; cbDrawdownObservation: TCheckBox; cbGroundwaterFlowObservation: TCheckBox; chklstFlowObs: TCheckListBox; chklstBoundaryFlow: TCheckListBox; chklstMAW: TCheckListBox; pnlName: TPanel; edObsName: TLabeledEdit; tabSFR: TTabSheet; chklstSFR: TCheckListBox; tabLAK: TTabSheet; chklstLAK: TCheckListBox; rgStreamObsLocation: TRadioGroup; tabUZF: TTabSheet; chklstUZF: TCheckListBox; rdeDepthFraction: TRbwDataEntry; lblDepthFraction: TLabel; tabCSUB: TTabSheet; chklstCSUB: TCheckListBox; pnlDelayBeds: TPanel; chklstDelayBeds: TCheckListBox; lblDelayInterbedNumber: TLabel; splCSub: TSplitter; tabCalibration: TTabSheet; framePestObs: TframePestObsMf6; procedure cbGroundwaterFlowObservationClick(Sender: TObject); procedure cbHeadObservationClick(Sender: TObject); procedure chklstFlowObsClick(Sender: TObject); procedure edObsNameChange(Sender: TObject); procedure chklstBoundaryFlowClickCheck(Sender: TObject); procedure chklstMAWClickCheck(Sender: TObject); procedure chklstSFRClickCheck(Sender: TObject); procedure chklstLAKClick(Sender: TObject); procedure chklstUZFClick(Sender: TObject); procedure chklstCSUBClick(Sender: TObject); procedure frameObservationsseNumberChange(Sender: TObject); private FOnChangeProperties: TNotifyEvent; FInitializing: Boolean; FActiveObs: Boolean; procedure Initialize; procedure DoOnChangeProperties; procedure UpdateEdObsNameColor; procedure SetActiveObs(const Value: Boolean); procedure EnableDepthFraction; procedure SetOnChangeProperties(const Value: TNotifyEvent); { Private declarations } public procedure GetData(List: TScreenObjectEditCollection); procedure SetData(List: TScreenObjectEditCollection; SetAll: boolean; ClearAll: boolean); property OnChangeProperties: TNotifyEvent read FOnChangeProperties write SetOnChangeProperties; property ActiveObs: Boolean read FActiveObs write SetActiveObs; { Public declarations } end; implementation uses Modflow6ObsUnit, ScreenObjectUnit, ModflowMawUnit, ModflowSfr6Unit, ModflowLakMf6Unit, ModflowUzfMf6Unit, ModflowCsubUnit, frmGoPhastUnit; {$R *.dfm} procedure TframeScreenObjectObsMf6.cbGroundwaterFlowObservationClick(Sender: TObject); begin chklstFlowObs.Enabled := cbGroundwaterFlowObservation.Checked; DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.cbHeadObservationClick(Sender: TObject); begin DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.chklstBoundaryFlowClickCheck( Sender: TObject); begin DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.chklstCSUBClick(Sender: TObject); begin DoOnChangeProperties end; procedure TframeScreenObjectObsMf6.chklstFlowObsClick(Sender: TObject); begin DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.chklstLAKClick(Sender: TObject); begin DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.chklstMAWClickCheck(Sender: TObject); begin DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.chklstSFRClickCheck(Sender: TObject); begin DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.chklstUZFClick(Sender: TObject); begin DoOnChangeProperties; EnableDepthFraction; end; procedure TframeScreenObjectObsMf6.DoOnChangeProperties; begin UpdateEdObsNameColor; if Assigned(OnChangeProperties) and not FInitializing then begin OnChangeProperties(Self); end; end; procedure TframeScreenObjectObsMf6.GetData(List: TScreenObjectEditCollection); var ScreenObjectIndex: Integer; AScreenObject: TScreenObject; Mf6Obs: TModflow6Obs; FoundFirst: Boolean; AnObsChoice: TGwFlowOb; MawOb: TMawOb; SfrOb: TSfrOb; LakOb: TLakOb; UzfOb: TUzfOb; CSubOb: TCSubOb; DelayArray: array of Boolean; DelayIndex: Integer; Position: Integer; begin FActiveObs := False; FInitializing := True; try Initialize; SetLength(DelayArray, chklstDelayBeds.Items.Count); for DelayIndex := 0 to chklstDelayBeds.Items.Count - 1 do begin DelayArray[DelayIndex] := False; end; If List.Count = 1 then begin AScreenObject := List[0].ScreenObject; if AScreenObject.Modflow6Obs <> nil then begin Mf6Obs := AScreenObject.Modflow6Obs; framePestObs.GetData(Mf6Obs.CalibrationObservations); end; end; FoundFirst := False; for ScreenObjectIndex := 0 to List.Count - 1 do begin AScreenObject := List[ScreenObjectIndex].ScreenObject; if AScreenObject.Modflow6Obs <> nil then begin FActiveObs := True; Mf6Obs := AScreenObject.Modflow6Obs; if not FoundFirst then begin edObsName.Text := Mf6Obs.Name; cbHeadObservation.Checked := ogHead in Mf6Obs.General; cbDrawdownObservation.Checked := ogDrawdown in Mf6Obs.General; cbGroundwaterFlowObservation.Checked := Mf6Obs.GroundwaterFlowObs; if Mf6Obs.GroundwaterFlowObs then begin for AnObsChoice := Low(TGwFlowOb) to High(TGwFlowOb) do begin chklstFlowObs.Checked[Ord(AnObsChoice)] := AnObsChoice in Mf6Obs.GwFlowObsChoices; end; end; chklstBoundaryFlow.Checked[Ord(forCHD)] := ogCHD in Mf6Obs.General; chklstBoundaryFlow.Checked[Ord(forDRN)] := ogDrain in Mf6Obs.General; chklstBoundaryFlow.Checked[Ord(forEVT)] := ogEVT in Mf6Obs.General; chklstBoundaryFlow.Checked[Ord(forGHB)] := ogGHB in Mf6Obs.General; chklstBoundaryFlow.Checked[Ord(forRCH)] := ogRch in Mf6Obs.General; chklstBoundaryFlow.Checked[Ord(forRIV)] := ogRiv in Mf6Obs.General; chklstBoundaryFlow.Checked[Ord(forWEL)] := ogWell in Mf6Obs.General; chklstBoundaryFlow.Checked[Ord(forToMvr)] := ogMvr in Mf6Obs.General; for MawOb := Low(TMawOb) to High(TMawOb) do begin chklstMAW.Checked[Ord(MawOb)] := MawOb in Mf6Obs.MawObs; end; for SfrOb := Low(TSfrOb) to High(TSfrOb) do begin chklstSFR.Checked[Ord(SfrOb)] := SfrOb in Mf6Obs.SfrObs; end; rgStreamObsLocation.ItemIndex := Ord(Mf6Obs.SfrObsLocation); for LakOb := Low(TLakOb) to High(TLakOb) do begin chklstLAK.Checked[Ord(LakOb)] := LakOb in Mf6Obs.LakObs; end; for UzfOb := Low(TUzfOb) to High(TUzfOb) do begin chklstUZF.Checked[Ord(UzfOb)] := UzfOb in Mf6Obs.UzfObs; end; rdeDepthFraction.RealValue := Mf6Obs.UzfObsDepthFraction; for CSubOb := Low(TCSubOb) to High(TCSubOb) do begin chklstCSUB.Checked[Ord(CSubOb)] := CSubOb in Mf6Obs.CSubObs.CSubObsSet; end; for DelayIndex := 0 to Mf6Obs.CSubDelayCells.Count - 1 do begin Position := Mf6Obs.CSubDelayCells[DelayIndex].Value - 1; if (Position >= 0) and (Position < chklstDelayBeds.Items.Count) then begin chklstDelayBeds.Checked[Position] := True; DelayArray[Position] := True; end; end; FoundFirst := True; end else begin edObsName.Enabled := False; if cbHeadObservation.State <> TCheckBoxState(ogHead in Mf6Obs.General) then begin cbHeadObservation.State := cbGrayed; end; if cbDrawdownObservation.State <> TCheckBoxState(ogDrawdown in Mf6Obs.General) then begin cbDrawdownObservation.State := cbGrayed; end; if cbGroundwaterFlowObservation.State <> TCheckBoxState(Mf6Obs.GroundwaterFlowObs) then begin cbGroundwaterFlowObservation.State := cbGrayed; end; for AnObsChoice := Low(TGwFlowOb) to High(TGwFlowOb)do begin if chklstFlowObs.State[Ord(AnObsChoice)] <> TCheckBoxState(AnObsChoice in Mf6Obs.GwFlowObsChoices) then begin chklstFlowObs.State[Ord(AnObsChoice)] := cbGrayed; end; end; for MawOb := Low(TMawOb) to High(TMawOb) do begin if chklstMAW.State[Ord(MawOb)] <> TCheckBoxState(MawOb in Mf6Obs.MawObs) then begin chklstMAW.State[Ord(MawOb)] := cbGrayed; end; end; for SfrOb := Low(TSfrOb) to High(TSfrOb) do begin if chklstSFR.State[Ord(SfrOb)] <> TCheckBoxState(SfrOb in Mf6Obs.SfrObs) then begin chklstSFR.State[Ord(SfrOb)] := cbGrayed; end; end; for LakOb := Low(TLakOb) to High(TLakOb) do begin if chklstLAK.State[Ord(LakOb)] <> TCheckBoxState(LakOb in Mf6Obs.LakObs) then begin chklstLAK.State[Ord(LakOb)] := cbGrayed; end; end; for UzfOb := Low(TUzfOb) to High(TUzfOb) do begin if chklstUZF.State[Ord(UzfOb)] <> TCheckBoxState(UzfOb in Mf6Obs.UzfObs) then begin chklstUZF.State[Ord(UzfOb)] := cbGrayed; end; end; for CSubOb := Low(TCSubOb) to High(TCSubOb) do begin if chklstCSUB.State[Ord(CSubOb)] <> TCheckBoxState(CSubOb in Mf6Obs.CSubObs.CSubObsSet) then begin chklstCSUB.State[Ord(CSubOb)] := cbGrayed; end; end; for DelayIndex := 0 to Mf6Obs.CSubDelayCells.Count - 1 do begin Position := Mf6Obs.CSubDelayCells[DelayIndex].Value - 1; if (Position >= 0) and (Position < chklstDelayBeds.Items.Count) then begin if not DelayArray[Position] then begin chklstDelayBeds.State[Position] := cbGrayed; end; end; end; if chklstBoundaryFlow.State[Ord(forCHD)] <> TCheckBoxState(ogCHD in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forCHD)] := cbGrayed; end; if chklstBoundaryFlow.State[Ord(forDRN)] <> TCheckBoxState(ogDrain in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forDRN)] := cbGrayed; end; if chklstBoundaryFlow.State[Ord(forEVT)] <> TCheckBoxState(ogEVT in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forEVT)] := cbGrayed; end; if chklstBoundaryFlow.State[Ord(forGHB)] <> TCheckBoxState(ogGHB in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forGHB)] := cbGrayed; end; if chklstBoundaryFlow.State[Ord(forRCH)] <> TCheckBoxState(ogRch in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forRCH)] := cbGrayed; end; if chklstBoundaryFlow.State[Ord(forRIV)] <> TCheckBoxState(ogRiv in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forRIV)] := cbGrayed; end; if chklstBoundaryFlow.State[Ord(forWEL)] <> TCheckBoxState(ogWell in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forWEL)] := cbGrayed; end; if chklstBoundaryFlow.State[Ord(forToMvr)] <> TCheckBoxState(ogMvr in Mf6Obs.General) then begin chklstBoundaryFlow.State[Ord(forToMvr)] := cbGrayed; end; if rgStreamObsLocation.ItemIndex <> Ord(Mf6Obs.SfrObsLocation) then begin rgStreamObsLocation.ItemIndex := -1; end; if rdeDepthFraction.RealValue <> Mf6Obs.UzfObsDepthFraction then begin rdeDepthFraction.Text := ''; end; end; end; end; EnableDepthFraction; UpdateEdObsNameColor; finally FInitializing := False; end; end; procedure TframeScreenObjectObsMf6.Initialize; var GWChoice: TGwFlowOb; MawIndex: Integer; SfrIndex: Integer; UzfIndex: Integer; CSubIndex: Integer; IbIndex: Integer; begin pgcMain.ActivePageIndex := 0; edObsName.Enabled := True; edObsName.Text := ''; cbHeadObservation.Checked := False; cbDrawdownObservation.Checked := False; cbGroundwaterFlowObservation.Checked := False; for GWChoice := Low(TGwFlowOb) to HIgh(TGwFlowOb) do begin chklstFlowObs.State[Ord(GWChoice)] := cbUnchecked; end; chklstFlowObs.Checked[Ord(gfoNearestNeighbor)] := True; for MawIndex := 0 to chklstMAW.Items.Count - 1 do begin chklstMAW.State[MawIndex] := cbUnchecked; end; for SfrIndex := 0 to chklstSFR.Items.Count - 1 do begin chklstSFR.State[SfrIndex] := cbUnchecked; end; for UzfIndex := 0 to chklstUZF.Items.Count - 1 do begin chklstUZF.State[UzfIndex] := cbUnchecked; end; for CSubIndex := 0 to chklstCSUB.Items.Count - 1 do begin chklstCSUB.State[CSubIndex] := cbUnchecked; end; chklstDelayBeds.Items.Clear; if frmGoPhast.PhastModel.ModflowPackages.CSubPackage.IsSelected then begin for IbIndex := 1 to frmGoPhast.PhastModel.ModflowPackages.CSubPackage.NumberOfDelayCells do begin chklstDelayBeds.Items.Add(IntToStr(IbIndex)); end; end; tabCalibration.tabVisible := frmGoPhast.PhastModel.PestUsed; framePestObs.InitializeControls; framePestObs.OnControlsChange := OnChangeProperties; DoOnChangeProperties; end; procedure TframeScreenObjectObsMf6.edObsNameChange(Sender: TObject); begin DoOnChangeProperties end; procedure TframeScreenObjectObsMf6.SetActiveObs(const Value: Boolean); begin FActiveObs := Value; UpdateEdObsNameColor; end; procedure TframeScreenObjectObsMf6.SetData(List: TScreenObjectEditCollection; SetAll, ClearAll: boolean); var Index: Integer; Item: TScreenObjectEditItem; Mf6Obs: TModflow6Obs; BoundaryUsed: Boolean; NewChoices: TGwFlowObs; AnObsChoice: TGwFlowOb; NewMawObs: TMawObs; MawOb: TMawOb; NewSfrObs: TSfrObs; SfrOb: TSfrOb; NewLakObs: TLakObs; LakOb: TLakOb; NewUzfObs: TUzfObs; UzfOb: TUzfOb; CSubOb: TCSubOb; NewCSubObs: TSubObsSet; DelayArray: array of Boolean; DelayIndex: Integer; Position: Integer; NewGeneral: TObGenerals; begin SetLength(DelayArray, chklstDelayBeds.Items.Count); for Index := 0 to List.Count - 1 do begin Item := List.Items[Index]; Mf6Obs := Item.ScreenObject.Modflow6Obs; BoundaryUsed := (Mf6Obs <> nil) and Mf6Obs.Used; if ClearAll then begin if BoundaryUsed then begin Mf6Obs.Clear; end; end else if SetAll or BoundaryUsed then begin if Mf6Obs = nil then begin Item.ScreenObject.CreateMf6Obs; Mf6Obs := Item.ScreenObject.Modflow6Obs; end; // Mf6Obs.Used := True; if List.Count = 1 then begin Mf6Obs.Name := edObsName.Text; framePestObs.SetData(Mf6Obs.CalibrationObservations); end; NewGeneral := Mf6Obs.General; if cbHeadObservation.State <> cbGrayed then begin if cbHeadObservation.Checked then begin Include(NewGeneral, ogHead); end else begin Exclude(NewGeneral, ogHead); end; // Mf6Obs.HeadObs := cbHeadObservation.Checked; end; if cbDrawdownObservation.State <> cbGrayed then begin if cbDrawdownObservation.Checked then begin Include(NewGeneral, ogDrawdown); end else begin Exclude(NewGeneral, ogDrawdown); end; // Mf6Obs.DrawdownObs := cbDrawdownObservation.Checked; end; if cbGroundwaterFlowObservation.State <> cbGrayed then begin Mf6Obs.GroundwaterFlowObs := cbGroundwaterFlowObservation.Checked; end; NewChoices := Mf6Obs.GwFlowObsChoices; for AnObsChoice := Low(TGwFlowOb) to High(TGwFlowOb) do begin if chklstFlowObs.State[Ord(AnObsChoice)] <> cbGrayed then begin if chklstFlowObs.Checked[Ord(AnObsChoice)] then begin Include(NewChoices, AnObsChoice); end else begin Exclude(NewChoices, AnObsChoice); end; end; end; Mf6Obs.GwFlowObsChoices := NewChoices; NewMawObs := Mf6Obs.MawObs; for MawOb := Low(TMawOb) to High(TMawOb) do begin if chklstMAW.State[Ord(MawOb)] <> cbGrayed then begin if chklstMAW.Checked[Ord(MawOb)] then begin Include(NewMawObs, MawOb); end else begin Exclude(NewMawObs, MawOb); end; end; end; Mf6Obs.MawObs := NewMawObs; NewSfrObs := Mf6Obs.SfrObs; for SfrOb := Low(TSfrOb) to High(TSfrOb) do begin if chklstSFR.State[Ord(SfrOb)] <> cbGrayed then begin if chklstSFR.Checked[Ord(SfrOb)] then begin Include(NewSfrObs, SfrOb); end else begin Exclude(NewSfrObs, SfrOb); end; end; end; Mf6Obs.SfrObs := NewSfrObs; NewLakObs := Mf6Obs.LakObs; for LakOb := Low(TLakOb) to High(TLakOb) do begin if chklstLAK.State[Ord(LakOb)] <> cbGrayed then begin if chklstLAK.Checked[Ord(LakOb)] then begin Include(NewLakObs, LakOb); end else begin Exclude(NewLakObs, LakOb); end; end; end; Mf6Obs.LakObs := NewLakObs; NewUzfObs := Mf6Obs.UzfObs; for UzfOb := Low(TUzfOb) to High(TUzfOb) do begin if chklstUzf.State[Ord(UzfOb)] <> cbGrayed then begin if chklstUzf.Checked[Ord(UzfOb)] then begin Include(NewUzfObs, UzfOb); end else begin Exclude(NewUzfObs, UzfOb); end; end; end; Mf6Obs.UzfObs := NewUzfObs; NewCSubObs := Mf6Obs.CSubObs.CSubObsSet; for CSubOb := Low(TCSubOb) to High(TCSubOb) do begin if chklstCSUB.State[Ord(CSubOb)] <> cbGrayed then begin if chklstCSUB.Checked[Ord(CSubOb)] then begin Include(NewCSubObs, CSubOb); end else begin Exclude(NewCSubObs, CSubOb); end; end; end; Mf6Obs.CSubObs.CSubObsSet := NewCSubObs; for DelayIndex := 0 to Length(DelayArray) - 1 do begin DelayArray[DelayIndex] := False; end; for DelayIndex := 0 to Mf6Obs.CSubDelayCells.Count - 1 do begin Position := Mf6Obs.CSubDelayCells[DelayIndex].Value -1; DelayArray[Position] := True; end; for DelayIndex := 0 to chklstDelayBeds.Items.Count -1 do begin if chklstDelayBeds.State[DelayIndex] <> cbGrayed then begin DelayArray[DelayIndex] := chklstDelayBeds.Checked[DelayIndex]; end; end; Mf6Obs.CSubDelayCells.Clear; for DelayIndex := 0 to Length(DelayArray) - 1 do begin if DelayArray[DelayIndex] then begin Mf6Obs.CSubDelayCells.Add.Value := DelayIndex + 1; end; end; if chklstBoundaryFlow.State[Ord(forCHD)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forCHD)] then begin Include(NewGeneral, ogCHD); end else begin Exclude(NewGeneral, ogCHD); end; // Mf6Obs.ChdFlowObs := chklstBoundaryFlow.Checked[Ord(forCHD)]; end; if chklstBoundaryFlow.State[Ord(forDRN)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forDRN)] then begin Include(NewGeneral, ogDrain); end else begin Exclude(NewGeneral, ogDrain); end; // Mf6Obs.DrnFlowObs := chklstBoundaryFlow.Checked[Ord(forDRN)]; end; if chklstBoundaryFlow.State[Ord(forEVT)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forEVT)] then begin Include(NewGeneral, ogEVT); end else begin Exclude(NewGeneral, ogEVT); end; // Mf6Obs.EvtFlowObs := chklstBoundaryFlow.Checked[Ord(forEVT)]; end; if chklstBoundaryFlow.State[Ord(forGHB)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forGHB)] then begin Include(NewGeneral, ogGHB); end else begin Exclude(NewGeneral, ogGHB); end; // Mf6Obs.GhbFlowObs := chklstBoundaryFlow.Checked[Ord(forGHB)]; end; if chklstBoundaryFlow.State[Ord(forRCH)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forRCH)] then begin Include(NewGeneral, ogRch); end else begin Exclude(NewGeneral, ogRch); end; // Mf6Obs.RchFlowObs := chklstBoundaryFlow.Checked[Ord(forRCH)]; end; if chklstBoundaryFlow.State[Ord(forRIV)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forRIV)] then begin Include(NewGeneral, ogRiv); end else begin Exclude(NewGeneral, ogRiv); end; // Mf6Obs.RivFlowObs := chklstBoundaryFlow.Checked[Ord(forRIV)]; end; if chklstBoundaryFlow.State[Ord(forWEL)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forWEL)] then begin Include(NewGeneral, ogWell); end else begin Exclude(NewGeneral, ogWell); end; // Mf6Obs.WelFlowObs := chklstBoundaryFlow.Checked[Ord(forWEL)]; end; if chklstBoundaryFlow.State[Ord(forToMvr)] <> cbGrayed then begin if chklstBoundaryFlow.Checked[Ord(forToMvr)] then begin Include(NewGeneral, ogMvr); end else begin Exclude(NewGeneral, ogMvr); end; // Mf6Obs.ToMvrFlowObs := chklstBoundaryFlow.Checked[Ord(forToMvr)]; end; Mf6Obs.General := NewGeneral; if rgStreamObsLocation.ItemIndex >= 0 then begin Mf6Obs.SfrObsLocation := TSfrObsLocation(rgStreamObsLocation.ItemIndex); end; if rdeDepthFraction.Text <> '' then begin Mf6Obs.UzfObsDepthFraction := rdeDepthFraction.RealValue; end; end; end; end; procedure TframeScreenObjectObsMf6.SetOnChangeProperties( const Value: TNotifyEvent); begin FOnChangeProperties := Value; if framePestObs <> nil then begin framePestObs.OnControlsChange := Value; end; end; procedure TframeScreenObjectObsMf6.EnableDepthFraction; begin rdeDepthFraction.Enabled := chklstUZF.State[Ord(uoWaterContent)] <> cbUnchecked; end; procedure TframeScreenObjectObsMf6.frameObservationsseNumberChange( Sender: TObject); begin framePestObs.frameObservationsseNumberChange(Sender); UpdateEdObsNameColor; end; procedure TframeScreenObjectObsMf6.UpdateEdObsNameColor; var ObsUsed: Boolean; ItemIndex: Integer; begin ObsUsed := cbHeadObservation.Checked or cbDrawdownObservation.Checked or cbGroundwaterFlowObservation.Checked; if not ObsUsed then begin for ItemIndex := 0 to chklstBoundaryFlow.Items.Count - 1 do begin if chklstBoundaryFlow.State[ItemIndex] <> cbUnchecked then begin ObsUsed := True; break; end; end; end; if not ObsUsed then begin for ItemIndex := 0 to chklstMAW.Items.Count - 1 do begin if chklstMAW.State[ItemIndex] <> cbUnchecked then begin ObsUsed := True; break; end; end; end; if not ObsUsed then begin for ItemIndex := 0 to chklstSFR.Items.Count - 1 do begin if chklstSFR.State[ItemIndex] <> cbUnchecked then begin ObsUsed := True; break; end; end; end; if not ObsUsed then begin for ItemIndex := 0 to chklstUZF.Items.Count - 1 do begin if chklstUZF.State[ItemIndex] <> cbUnchecked then begin ObsUsed := True; break; end; end; end; if not ObsUsed then begin for ItemIndex := 0 to chklstCSUB.Items.Count - 1 do begin if chklstCSUB.State[ItemIndex] <> cbUnchecked then begin ObsUsed := True; break; end; end; end; if not ObsUsed then begin ObsUsed := framePestObs.frameObservations.seNumber.asInteger > 0 end; if ObsUsed and ActiveObs and (edObsName.Text = '') then begin edObsName.Color := clRed; end else begin edObsName.Color := clWindow; end; end; end.
unit uFileReader; interface uses Classes, SysUtils; type TExplorerFileStream = class (TFileStream) private FXORVal: byte; FXORValWORD: word; FXORValDWORD: longword; procedure SetXORVal(const Value: byte); public function ReadByte: byte; inline; function ReadWord: word; inline; function ReadWordBE: word; inline; function ReadDWord: longword; inline; function ReadDWordBE: longword; inline; function ReadBlockName: string; inline; function ReadString(Length: integer): string; function ReadNullTerminatedString(MaxLength: integer): string; function Read(var Buffer; Count: integer): integer; override; constructor Create(FileName: string); destructor Destroy; override; property XORVal: byte read FXORVal write SetXORVal; end; implementation function TExplorerFileStream.Read(var Buffer; Count: Integer): Longint; var n: longint; P: PByteArray; begin result:=inherited Read(Buffer,Count); P:=@Buffer; // The following takes care of XORing all input (unless XORVal is 0) if FXORVal=0 then Exit; for n:=0 to result-1 do begin P^[n]:=P^[n] xor FXORVal; end; end; function TExplorerFileStream.ReadByte: byte; begin Read(result,1); end; function TExplorerFileStream.ReadWord: word; begin Read(result,2); end; function TExplorerFileStream.ReadWordBE: word; begin result:=ReadByte shl 8 +ReadByte; end; procedure TExplorerFileStream.SetXORVal(const Value: byte); begin if FXORVal<>Value then begin FXORVal := Value; FXORValWORD:=(FXORVal shl 8) or FXORVal; FXORValDWORD:=(FXORValWORD shl 16) or FXORValWORD; end; end; function TExplorerFileStream.ReadDWord: longword; begin Read(result,4); end; function TExplorerFileStream.ReadDWordBE: longword; begin result:=ReadByte shl 24 +ReadByte shl 16 +ReadByte shl 8 +ReadByte; end; function TExplorerFileStream.ReadBlockName: string; begin result:=chr(ReadByte)+chr(ReadByte)+chr(ReadByte)+chr(ReadByte); end; function TExplorerFileStream.ReadString(Length: integer): string; var n: longword; begin SetLength(result,length); for n:=1 to length do begin result[n]:=Chr(ReadByte); end; end; function TExplorerFileStream.ReadNullTerminatedString(MaxLength: integer): string; var n: longword; RChar: char; begin result:=''; for n:=1 to MaxLength do begin RChar:=Chr(ReadByte); if RChar=#0 then Exit; result:=result+RChar; end; end; constructor TExplorerFileStream.Create(FileName: string); begin inherited Create(Filename, fmopenread); end; destructor TExplorerFileStream.Destroy; begin inherited; end; end.
(* ----------------------------------------------------------- Name: $File: //depot/Reporting/Mainline/sdk/VCL/Delphi/SampleApp/UnitMain.pas $ Version: $Revision: #5 $ Last Modified Date: $Date: 2004/01/27 $ Copyright (c) 1995-2003 Crystal Decisions, Inc. 895 Emerson St., Palo Alto, California, USA 94301. All rights reserved. This file contains confidential, proprietary information, trade secrets and copyrighted expressions that are the property of Crystal Decisions, Inc., 895 Emerson St., Palo Alto, California, USA 94301. Any disclosure, reproduction, sale or license of all or any part of the information or expression contained in this file is prohibited by California law and the United States copyright law, and may be subject to criminal penalties. If you are not an employee of Crystal Decisions or otherwise authorized in writing by Crystal Decisions to possess this file, please contact Crystal Decisions immediately at the address listed above. ----------------------------------------------------------- Crystal VCL Sample Application Main Unit *) unit UnitMain; {$I UCRPEDEF.INC} interface uses Windows, Forms, Classes, ExtCtrls, Menus, Buttons, Dialogs, Messages, Printers, StdCtrls, Graphics, Controls, ComCtrls, UCrpe32, UCrpeClasses; type TfrmMain = class(TForm) pnlBBar: TPanel; {SpeedButton} sbOpen: TSpeedButton; sbClose: TSpeedButton; sbSave: TSpeedButton; sbQuickPreview: TSpeedButton; sbPreview: TSpeedButton; sbPrint: TSpeedButton; sbExport: TSpeedButton; {Menu} MainMenu1: TMainMenu; menuFile: TMenuItem; miOpen: TMenuItem; miReopen: TMenuItem; miClose: TMenuItem; miSaveAs: TMenuItem; miPreview: TMenuItem; miPrint: TMenuItem; miWindow: TMenuItem; miPrinter: TMenuItem; miExport: TMenuItem; miPrinterSetup: TMenuItem; miPageMargins: TMenuItem; LineF1: TMenuItem; LineF2: TMenuItem; miLogOnServer: TMenuItem; miSummaryInfo: TMenuItem; miVersion: TMenuItem; miReportOptions: TMenuItem; LineF4: TMenuItem; miExit: TMenuItem; menuEdit: TMenuItem; miFormulaFields: TMenuItem; miParameterFields: TMenuItem; miSpecialFields: TMenuItem; LineE2: TMenuItem; miSectionFormat: TMenuItem; miAreaFormat: TMenuItem; miSectionFont: TMenuItem; miSectionSize: TMenuItem; miDetailCopies: TMenuItem; LineE5: TMenuItem; miGraphs: TMenuItem; menuView: TMenuItem; miToolbar: TMenuItem; miStatusBar: TMenuItem; menuDatabase: TMenuItem; miTables: TMenuItem; LineD1: TMenuItem; miLogOnServer2: TMenuItem; miLogOnInfo: TMenuItem; miConnect: TMenuItem; LineD4: TMenuItem; miSQLQuery: TMenuItem; miParams: TMenuItem; LineD2: TMenuItem; miVerifyDatabase: TMenuItem; miVerifyOnEveryPrint: TMenuItem; miSQLExpressions: TMenuItem; miSessionInfo: TMenuItem; menuReport: TMenuItem; miEditSelectionFormula: TMenuItem; miSelection: TMenuItem; miGroupSelection: TMenuItem; LineR1: TMenuItem; miGroupSortFields: TMenuItem; miSortFields: TMenuItem; LineR2: TMenuItem; miPrintDate2: TMenuItem; menuHelp: TMenuItem; miAboutVCL: TMenuItem; miAbout: TMenuItem; {StatusBar} StatusBar: TStatusBar; {Dialog} OpenDialog1: TOpenDialog; ColorDialog1: TColorDialog; FontDialog1: TFontDialog; SaveDialog1: TSaveDialog; PrintDialog1: TPrintDialog; miCloseEngine: TMenuItem; pnlScrollBox: TPanel; ScrollBox1: TScrollBox; btnLogOnServer: TBitBtn; btnConnect: TBitBtn; btnLogOnInfo: TBitBtn; btnSessionInfo: TBitBtn; btnSQLQuery: TBitBtn; btnTables: TBitBtn; btnSelection: TBitBtn; btnGroupSelection: TBitBtn; btnParamFields: TBitBtn; btnPrintDate: TBitBtn; btnMargins: TBitBtn; miDiscardSavedData: TMenuItem; pnlSub: TPanel; pnlReports: TPanel; imgReport: TImage; lblOutput: TLabel; lblSection: TLabel; lblNLinks: TLabel; lbSubNames: TListBox; rbMain: TRadioButton; rbSub: TRadioButton; cbSubExecute: TCheckBox; cbOutput: TComboBox; cbLoadEngineOnUse: TCheckBox; editNLinks: TEdit; editSection: TEdit; pnlLeftTop: TPanel; pnlLeftRight: TPanel; pnlLeftBottom: TPanel; btnFormulas: TBitBtn; btnSectionFormat: TBitBtn; btnAreaFormat: TBitBtn; btnSortFields: TBitBtn; btnGroupSortFields: TBitBtn; btnSQLExpressions: TBitBtn; btnSectionFont: TBitBtn; btnSectionSize: TBitBtn; btnReportOptions: TBitBtn; btnPages: TBitBtn; btnVersion: TBitBtn; btnSummaryInfo: TBitBtn; btnGraphType: TBitBtn; btnDiscardSavedData: TButton; btnLines: TBitBtn; btnBoxes: TBitBtn; btnCrossTabs: TBitBtn; btnDatabaseFields: TBitBtn; btnGroupNameFields: TBitBtn; btnMaps: TBitBtn; btnOleObjects: TBitBtn; btnPictures: TBitBtn; btnRunningTotals: TBitBtn; btnSpecialFields: TBitBtn; btnSummaryFields: TBitBtn; btnSubreports: TBitBtn; btnTextObjects: TBitBtn; miSummaryFields: TMenuItem; miRunningTotals: TMenuItem; miMaps: TMenuItem; miDatabaseFields: TMenuItem; miTextObjects: TMenuItem; LineE1: TMenuItem; LineE3: TMenuItem; miGroupNameFields: TMenuItem; LineE4: TMenuItem; miCrossTabs: TMenuItem; miSubreports: TMenuItem; miGroups: TMenuItem; miSections: TMenuItem; miLines: TMenuItem; miBoxes: TMenuItem; miPictures: TMenuItem; miOleObjects: TMenuItem; ConvertDatabaseDriver1: TMenuItem; LineD3: TMenuItem; miNew: TMenuItem; miSave: TMenuItem; miReportTitle: TMenuItem; btnGroups: TBitBtn; btnOLAPCubes: TBitBtn; miOLAPCubes: TMenuItem; BitBtn1: TBitBtn; LineR3: TMenuItem; miPages: TMenuItem; LineH1: TMenuItem; miCloseAndSend: TMenuItem; miVCLHelp: TMenuItem; LineH2: TMenuItem; miVCLTechnicalSupport: TMenuItem; cbIgnoreKnownProblems: TCheckBox; Bevel1: TBevel; miDetailCopies2: TMenuItem; miReportStyle: TMenuItem; LineR4: TMenuItem; miCrpePath: TMenuItem; btnRecords: TBitBtn; sbCancel: TSpeedButton; sbHelp: TSpeedButton; sbModifyReport: TSpeedButton; sbFieldBrowser: TSpeedButton; Crpe1: TCrpe; ProgressDialog1: TMenuItem; LineF3: TMenuItem; miGlobalOptions: TMenuItem; {MainForm} procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure UpdateReopenList; procedure ReadIni(Section: string); procedure WriteIni(Section: string); procedure miToolbarClick(Sender: TObject); procedure miStatusBarClick(Sender: TObject); {Open} procedure miOpenClick(Sender: TObject); procedure ReopenMenuClick(Sender: TObject); procedure LoadReport; procedure InitializeControls(OnOff: boolean); {Close} procedure miCloseClick(Sender: TObject); procedure miExitClick(Sender: TObject); {Save} procedure miSaveClick(Sender: TObject); {Preview} procedure cbSubExecuteClick(Sender: TObject); procedure cbOutputChange(Sender: TObject); {SubList} procedure rbMainClick(Sender: TObject); procedure rbSubClick(Sender: TObject); procedure lbSubNamesClick(Sender: TObject); {LogOnServer} procedure miLogOnServer2Click(Sender: TObject); {About} procedure miAboutVCLClick(Sender: TObject); procedure miAboutClick(Sender: TObject); procedure ShowAboutBox; {Errors} procedure Crpe1Error(Sender: TObject; const ErrorNum: Smallint; const ErrorString: String; var IgnoreError: TCrErrorResult); procedure miFormulaFieldsClick(Sender: TObject); procedure miParameterFieldsClick(Sender: TObject); procedure miTablesClick(Sender: TObject); procedure miLogOnInfoClick(Sender: TObject); procedure miConnectClick(Sender: TObject); procedure miSQLQueryClick(Sender: TObject); procedure miSelectionClick(Sender: TObject); procedure miGroupSelectionClick(Sender: TObject); procedure miSectionFormatClick(Sender: TObject); procedure miAreaFormatClick(Sender: TObject); procedure miSectionFontClick(Sender: TObject); procedure miSectionSizeClick(Sender: TObject); procedure miSortFieldsClick(Sender: TObject); procedure miGroupSortFieldsClick(Sender: TObject); procedure miGroupsClick(Sender: TObject); procedure miSummaryInfoClick(Sender: TObject); procedure miPrintDateClick(Sender: TObject); procedure miReportTitleClick(Sender: TObject); procedure miPageMarginsClick(Sender: TObject); procedure miVersionClick(Sender: TObject); procedure miPrinterSetupClick(Sender: TObject); procedure DoUpdates; procedure RemoveObsoleteClick(Sender: TObject); procedure RemoveAllClick(Sender: TObject); procedure Crpe1wOnDrillDetail(WindowHandle: HWnd; NSelectedField, NFields: Smallint; FieldNames, FieldValues: TStringList; var Cancel: Boolean); procedure Crpe1wOnShowGroup(WindowHandle: HWnd; NGroupLevel: Word; GroupList: TStringList; var Cancel: Boolean); procedure Crpe1wOnDrillGroup(WindowHandle: HWnd; NGroupLevel: Word; DrillType: TCrDrillDownType; GroupList: TStringList; var Cancel: Boolean); procedure Crpe1wOnActivateWindow(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnCancelBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnCloseBtnClick(WindowHandle: HWnd; ViewIndex: Word; var Cancel: Boolean); procedure Crpe1wOnCloseWindow(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnDeActivateWindow(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnExportBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnFirstPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnGroupTreeBtnClick(WindowHandle: HWnd; Visible: Boolean; var Cancel: Boolean); procedure Crpe1wOnLastPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnNextPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnPreviousPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnPrintBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnPrintSetupBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnRefreshBtnClick(WindowHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnSearchBtnClick(WindowHandle: HWnd; SearchString: String; var Cancel: Boolean); procedure Crpe1wOnZoomLevelChange(WindowHandle: HWnd; ZoomLevel: Word; var Cancel: Boolean); procedure Crpe1wOnMouseClick(WindowHandle: Hwnd; MouseInfo: TCrMouseInfo; FieldValue: String; FieldType: TCrParamFieldType; Section: String; ObjectHandle: HWnd; var Cancel: Boolean); procedure Crpe1wOnDrillHyperLink(WindowHandle: HWND; HyperLinkText: String; var Cancel: Boolean); procedure Crpe1wOnLaunchSeagateAnalysis(WindowHandle: HWND; FilePath: String; var Cancel: Boolean); procedure Crpe1wOnReadingRecords(Cancelled: Boolean; RecordsRead, RecordsSelected: LongInt; Done: Boolean; var Cancel: Boolean); procedure Crpe1wOnStartEvent(Destination: TCrStartEventDestination; var Cancel: Boolean); procedure Crpe1wOnStopEvent(Destination: TCrStartEventDestination; JobStatus: TCrStopEventJobStatus; var Cancel: Boolean); procedure miReportOptionsClick(Sender: TObject); procedure cbLoadEngineOnUseClick(Sender: TObject); procedure miVerifyDatabaseClick(Sender: TObject); procedure miVerifyOnEveryPrintClick(Sender: TObject); procedure miSQLExpressionsClick(Sender: TObject); procedure Crpe1OnFieldMapping(var ReportFields, DatabaseFields: TList; var Cancel: Boolean); procedure miSessionInfoClick(Sender: TObject); procedure miCloseEngineClick(Sender: TObject); procedure miDiscardSavedDataClick(Sender: TObject); procedure btnDiscardSavedDataClick(Sender: TObject); procedure miSpecialFieldsClick(Sender: TObject); procedure miSummaryFieldsClick(Sender: TObject); procedure miRunningTotalsClick(Sender: TObject); procedure miNewClick(Sender: TObject); procedure miDatabaseFieldsClick(Sender: TObject); procedure miTextObjectsClick(Sender: TObject); procedure miGroupNameFieldsClick(Sender: TObject); procedure miOLAPCubesClick(Sender: TObject); procedure miCrossTabsClick(Sender: TObject); procedure miSubreportsClick(Sender: TObject); procedure miLinesClick(Sender: TObject); procedure miBoxesClick(Sender: TObject); procedure miPicturesClick(Sender: TObject); procedure miMapsClick(Sender: TObject); procedure miOleObjectsClick(Sender: TObject); procedure miSaveAsClick(Sender: TObject); procedure miPreviewClick(Sender: TObject); procedure miWindowClick(Sender: TObject); procedure miPrinterClick(Sender: TObject); procedure miExportClick(Sender: TObject); procedure miGraphsClick(Sender: TObject); procedure miCloseAndSendClick(Sender: TObject); procedure miVCLHelpClick(Sender: TObject); procedure miVCLTechnicalSupportClick(Sender: TObject); procedure cbIgnoreKnownProblemsClick(Sender: TObject); procedure miPagesClick(Sender: TObject); procedure btnRecordsClick(Sender: TObject); procedure sbCancelClick(Sender: TObject); procedure lbSubNamesDblClick(Sender: TObject); procedure sbFieldBrowserClick(Sender: TObject); procedure ProgressDialog1Click(Sender: TObject); procedure menuViewClick(Sender: TObject); procedure miGlobalOptionsClick(Sender: TObject); private { Private declarations } procedure WMDROPFILES(var Message: TWMDROPFILES); message WM_DROPFILES; procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; public { Public declarations } end; const {Maximum # of files listed in Reopen Submenu} MaxReopenFiles = 9; {Month array for PrintDate calendar} MonthArray: array[1..12] of string = ('January','February', 'March','April','May','June','July','August','September', 'October','November','December'); var frmMain : TfrmMain; RptLoaded : boolean; {Report is Loaded} Report : string; {Report Name} ExeName : string; {EXE Name} AppDir : string; {Application directory} OpenDir : string; {Report Open directory} SaveDir : string; {Report Save directory} ExportPath : string; {Export Path} PrevFiles : TStringList; {Previous Files stringlist} RptMenu : TMenuItem; {Previous Files submenu} SubNameIndex : smallint; {Keeps track of selected item in Sub list} Present : TDateTime; {Date variables for PrintDate screen} Year, Month, Day : Word; prevYear, prevMonth, prevDay : string; prevDCopies : string; strMain : string; strSub : string; {Store Checkbox state in Retrieve Options form} MX,MY : integer; implementation {$R *.DFM} uses ShellApi, TypInfo, SysUtils, Registry, UCrpeUtl, {Dialogs specific to Sample App} USError1, USError2, USAbout, USPreview, USWinEvents, {Dialogs shared between Sample App and VCL} UDAbout, UDAreaFormat, UDBoxes, UDConnect, UDCrossTabs, UDDatabaseFields, UDExportOptions, UDFieldMapping, UDFieldSelect, UDFormulas, UDGlobalOptions, UDGraphs, UDGroupNameFields, UDGroups, UDGroupSelection, UDGroupSortFields, UDLines, UDLogOnInfo, UDLogOnServer, UDMaps, UDMargins, UDMiscellaneous, UDOLAPCubes, UDOleObjects, UDPages, UDParamFields, UDPictures, UDPrintDate, UDPrinter, UDPrintOptions, UDRecords, UDRunningTotals, UDReportOptions, UDSectionFormat, UDSectionFont, UDSectionSize, UDSelection, UDSessionInfo, UDSortFields, UDSpecialFields, UDSubreports, UDSummaryInfo, UDSummaryFields, UDSQLExpressions, UDSQLQuery, UDTables, UDTextObjects, UDVersion, UDWindowButtonBar, UDWindowCursor, UDWindowSize, UDWindowStyle, UDWindowZoom, UDWindowParent; {------------------------------------------------------------------------------} { FormCreate procedure } {------------------------------------------------------------------------------} procedure TfrmMain.FormCreate(Sender: TObject); var s1 : string; begin ExeName := Application.ExeName; Application.HelpFile := 'Ucrpe32.hlp'; if not FileExists(Application.HelpFile) then begin s1 := ExtractFilePath(ExeName); if s1[Length(s1)] = '\' then s1 := Copy(s1, 1, Length(s1)-1); s1 := s1 + '.EXE'; s1 := ExtractFilePath(s1); s1 := AddBackSlash(s1); Application.HelpFile := s1 + 'UCrpe32.hlp'; end; {Initialize the buttons & menu items} InitializeControls(False); RptLoaded := False; {Set up the PreviousFiles StringList} PrevFiles := TStringlist.Create; ReadIni('Reopen'); DragAcceptFiles(Handle, True); {Set Width/Height} Width := (3437 * PixelsPerInch) div 1000; {330} Height := (4625 * PixelsPerInch) div 1000; {444} {Set Position} LoadFormPos(Self); {Set Events} Crpe1.OnError := Crpe1Error; Crpe1.OnFieldMapping := Crpe1OnFieldMapping; {Set the WindowEvents} if Crpe1.WindowEvents then begin Crpe1.wOnCloseWindow := Crpe1wOnCloseWindow; Crpe1.wOnPrintBtnClick := Crpe1wOnPrintBtnClick; Crpe1.wOnExportBtnClick := Crpe1wOnExportBtnClick; Crpe1.wOnFirstPageBtnClick := Crpe1wOnFirstPageBtnClick; Crpe1.wOnPreviousPageBtnClick := Crpe1wOnPreviousPageBtnClick; Crpe1.wOnNextPageBtnClick := Crpe1wOnNextPageBtnClick; Crpe1.wOnLastPageBtnClick := Crpe1wOnLastPageBtnClick; Crpe1.wOnCancelBtnClick := Crpe1wOnCancelBtnClick; Crpe1.wOnActivateWindow := Crpe1wOnActivateWindow; Crpe1.wOnDeActivateWindow := Crpe1wOnDeActivateWindow; Crpe1.wOnPrintSetupBtnClick := Crpe1wOnPrintSetupBtnClick; Crpe1.wOnRefreshBtnClick := Crpe1wOnRefreshBtnClick; Crpe1.wOnZoomLevelChange := Crpe1wOnZoomLevelChange; Crpe1.wOnCloseBtnClick := Crpe1wOnCloseBtnClick; Crpe1.wOnSearchBtnClick := Crpe1wOnSearchBtnClick; Crpe1.wOnGroupTreeBtnClick := Crpe1wOnGroupTreeBtnClick; Crpe1.wOnReadingRecords := Crpe1wOnReadingRecords; Crpe1.wOnStartEvent := Crpe1wOnStartEvent; Crpe1.wOnStopEvent := Crpe1wOnStopEvent; Crpe1.wOnShowGroup := Crpe1wOnShowGroup; Crpe1.wOnDrillGroup := Crpe1wOnDrillGroup; Crpe1.wOnDrillDetail := Crpe1wOnDrillDetail; Crpe1.wOnMouseClick := Crpe1wOnMouseClick; Crpe1.wOnDrillHyperLink := Crpe1wOnDrillHyperLink; Crpe1.wOnLaunchSeagateAnalysis := Crpe1wOnLaunchSeagateAnalysis; end else begin Crpe1.wOnCloseWindow := nil; Crpe1.wOnPrintBtnClick := nil; Crpe1.wOnExportBtnClick := nil; Crpe1.wOnFirstPageBtnClick := nil; Crpe1.wOnPreviousPageBtnClick := nil; Crpe1.wOnNextPageBtnClick := nil; Crpe1.wOnLastPageBtnClick := nil; Crpe1.wOnCancelBtnClick := nil; Crpe1.wOnActivateWindow := nil; Crpe1.wOnDeActivateWindow := nil; Crpe1.wOnPrintSetupBtnClick := nil; Crpe1.wOnRefreshBtnClick := nil; Crpe1.wOnZoomLevelChange := nil; Crpe1.wOnCloseBtnClick := nil; Crpe1.wOnSearchBtnClick := nil; Crpe1.wOnGroupTreeBtnClick := nil; Crpe1.wOnReadingRecords := nil; Crpe1.wOnStartEvent := nil; Crpe1.wOnStopEvent := nil; Crpe1.wOnShowGroup := nil; Crpe1.wOnDrillGroup := nil; Crpe1.wOnDrillDetail := nil; Crpe1.wOnMouseClick := nil; Crpe1.wOnDrillHyperLink := nil; Crpe1.wOnLaunchSeagateAnalysis := nil; end; ScrollBox1.ScrollInView(btnLogOnServer); end; {------------------------------------------------------------------------------} { WMDROPFILES procedure } {------------------------------------------------------------------------------} procedure TfrmMain.WMDROPFILES(var Message: TWMDROPFILES); var Buffer: array[0..255] of char; begin {If a file was dragged on the open Form, load it} DragQueryFile(Message.Drop, 0, Buffer, SizeOf(Buffer)); Report := StrPas(Buffer); {Update the 'Reopen' menu and PrevFile stringlist} UpdateReopenList; {Load the Report} LoadReport; end; {------------------------------------------------------------------------------} { FormShow procedure } {------------------------------------------------------------------------------} procedure TfrmMain.FormShow(Sender: TObject); begin {Get the app directory} AppDir := ExtractFilePath(Application.ExeName); OpenDir := AppDir; SaveDir := AppDir; {Change to application directory} ChDir(AppDir); if IOResult <> 0 then OpenDir := 'C:\'; pnlBBar.SetFocus; {LoadEngineOnUse} cbLoadEngineOnUse.OnClick := nil; cbLoadEngineOnUse.Checked := Crpe1.LoadEngineOnUse; cbLoadEngineOnUse.OnClick := cbLoadEngineOnUseClick; {IgnoreKnownProblems} cbIgnoreKnownProblems.OnClick := nil; cbIgnoreKnownProblems.Checked := Crpe1.IgnoreKnownProblems; cbIgnoreKnownProblems.OnClick := cbIgnoreKnownProblemsClick; {ProgressDialog} ProgressDialog1.Checked := Crpe1.ProgressDialog; {Engine Status} miCloseEngine.Enabled := Crpe1.EngineOpen; {Check if a Reportname was passed on the commandline} if (ParamStr(1) <> '') and FileExists(ParamStr(1)) then begin Report := ParamStr(1); {Update the 'Reopen' menu and PrevFile stringlist} UpdateReopenList; {Load the Report} LoadReport; end; end; {------------------------------------------------------------------------------} { ReadIni procedure } { - Loads settings from the INI file } {------------------------------------------------------------------------------} procedure TfrmMain.ReadIni(Section: string); var str1 : string; i : integer; RegIni : TRegIniFile; {INI file for Program settings} begin {Open the INI file} RegIni := nil; try RegIni := TRegIniFile.Create('Software\Business Objects\Suite 11.0\CrystalVCL'); except if RegIni <> nil then RegIni.Free; Exit; end; {Read 'Reopen' section of the INI file} if Section = 'Reopen' then begin {Clear the PreviousFiles StringList} PrevFiles.Clear; {Read the INI file into the StringList} for i := 0 to MaxReopenFiles - 1 do begin str1 := RegIni.ReadString('Reopen', IntToStr(i + 1), ''); if str1 <> '' then PrevFiles.Add(str1); end; {Clear the Reopen submenu} for i := miReopen.Count-1 downto 0 do miReopen.Delete(i); {Read the StringList into the Reopen submenu} for i := 0 to PrevFiles.Count - 1 do begin RptMenu := TMenuItem.Create(miReopen); RptMenu.Caption := '&' + IntToStr(i + 1) + ' ' + PrevFiles[i]; RptMenu.OnClick := ReopenMenuClick; miReopen.Insert(i,RptMenu); end; {Line} RptMenu := TMenuItem.Create(miReopen); RptMenu.Caption := '-'; miReopen.Insert(miReopen.Count,RptMenu); {Remove Obsolete} RptMenu := TMenuItem.Create(miReopen); RptMenu.Caption := 'Remove Obsolete'; RptMenu.OnClick := RemoveObsoleteClick; miReopen.Insert(miReopen.Count,RptMenu); {Remove All} RptMenu := TMenuItem.Create(miReopen); RptMenu.Caption := 'Remove All'; RptMenu.OnClick := RemoveAllClick; miReopen.Insert(miReopen.Count,RptMenu); end; RegIni.Free; end; {------------------------------------------------------------------------------} { WriteIni procedure } {------------------------------------------------------------------------------} procedure TfrmMain.WriteIni(Section: string); var cnt1 : integer; RegIni : TRegIniFile; {INI file for Program settings} begin {Open the INI file} RegIni := nil; try RegIni := TRegIniFile.Create('Software\Business Objects\Suite 11.0\CrystalVCL'); except if RegIni <> nil then RegIni.Free; Exit; end; {Write 'Reopen' section of the INI file} if Section = 'Reopen' then begin {Erase the Reopen section of the INI file} RegIni.EraseSection('Reopen'); {Write the INI file from the PrevFiles stringlist} for cnt1 := 0 to PrevFiles.Count - 1 do begin RegIni.WriteString('Reopen', IntToStr(cnt1 + 1), PrevFiles[cnt1]); end; end; RegIni.Free; end; {------------------------------------------------------------------------------} { UpdateReopenList procedure } {------------------------------------------------------------------------------} procedure TfrmMain.UpdateReopenList; var cnt1: integer; begin {Update the PrevFiles stringlist...} {Check to see if the file exists in the list} cnt1 := PrevFiles.IndexOf(Report); {If it exists, delete it} if cnt1 > -1 then PrevFiles.Delete(cnt1); {Add the new filename to the beginning of PrevList} PrevFiles.Insert(0, Report); {If there are more than 8 items, remove from end of list} if PrevFiles.Count > MaxReopenFiles then begin for cnt1 := MaxReopenFiles to PrevFiles.Count - 1 do PrevFiles.Delete(MaxReopenFiles); end; {Update the INI file and 'Reopen' Menu...} WriteIni('Reopen'); ReadIni('Reopen'); end; {------------------------------------------------------------------------------} { LoadReport procedure } {------------------------------------------------------------------------------} procedure TfrmMain.LoadReport; var cnt1 : integer; VerX : boolean; begin {Cause Form to be redrawn after Open Dialog} Refresh; {Set Cursor to busy} Screen.Cursor := crHourGlass; {Store Paths} OpenDir := ExtractFilePath(Report); SaveDir := OpenDir; ExportPath := OpenDir; try {If a Report was previously loaded, close it} if RptLoaded = True then miCloseClick(self); {Get RPT Information} Crpe1.ReportName := Report; RptLoaded := True; StatusBar.Hint := Report; {Activate the controls} InitializeControls(True); miCloseEngine.Enabled := True; lbSubNames.Clear; for cnt1 := 1 to (Crpe1.Subreports.Count - 1) do lbSubNames.Items.Add(Crpe1.Subreports[cnt1].Name); Crpe1.Subreports[0]; {Check for SCR 8+ features} {Check for SCR 7+ features} VerX := Crpe1.Version.Crpe.Major > 6; miSQLExpressions.Enabled := VerX; btnSQLExpressions.Enabled := VerX; miMaps.Enabled := VerX; btnMaps.Enabled := VerX; miOLAPCubes.Enabled := VerX; btnOLAPCubes.Enabled := VerX; miOleObjects.Enabled := VerX; btnOleObjects.Enabled := VerX; miSummaryInfo.Enabled := VerX; btnSummaryInfo.Enabled := VerX; miSummaryFields.Enabled := VerX; btnSummaryFields.Enabled := VerX; miVerifyOnEveryPrint.Enabled := VerX; miVerifyDatabase.Enabled := VerX; {Update the caption with the Report name & path} StatusBar.Panels[0].Text := Report + ' '; StatusBar.Panels[1].Text := 'JobNumber: ' + IntToStr(Crpe1.JobNumber); {Main/Sub radio buttons} rbMain.Checked := True; rbMainClick(Self); rbSub.Enabled := (Crpe1.Subreports.Count > 1); {Various Report property checkboxes} cbSubExecute.Checked := Crpe1.Subreports.SubExecute; {Output combobox} cbOutput.Clear; cbOutput.Items.Add('toWindow'); cbOutput.Items.Add('toPrinter'); cbOutput.Items.Add('toExport'); cbOutput.ItemIndex := Ord(Crpe1.Output); {SavedData} btnDiscardSavedData.Enabled := Crpe1.HasSavedData; finally Screen.Cursor := crDefault; pnlBBar.SetFocus; end; end; {------------------------------------------------------------------------------} { InitializeControls } {------------------------------------------------------------------------------} procedure TfrmMain.InitializeControls(OnOff: boolean); var i : integer; begin {Enable/Disable the Form Controls} for i := 0 to ComponentCount - 1 do begin if TComponent(Components[i]).Tag = 0 then begin if Components[i] is TButton then TButton(Components[i]).Enabled := OnOff; if Components[i] is TSpeedButton then TSpeedButton(Components[i]).Enabled := OnOff; if Components[i] is TRadioButton then TRadioButton(Components[i]).Enabled := OnOff; if Components[i] is TCheckBox then TCheckBox(Components[i]).Enabled := OnOff; if Components[i] is TMenuItem then TMenuItem(Components[i]).Visible := OnOff; if Components[i] is TRadioGroup then TRadioGroup(Components[i]).Enabled := OnOff; if Components[i] is TComboBox then begin TComboBox(Components[i]).Color := ColorState(OnOff); TComboBox(Components[i]).Enabled := OnOff; end; if Components[i] is TMemo then begin TMemo(Components[i]).Clear; TMemo(Components[i]).Color := ColorState(OnOff); TMemo(Components[i]).Enabled := OnOff; end; if Components[i] is TListBox then begin TListBox(Components[i]).Clear; TListBox(Components[i]).Color := ColorState(OnOff); TListBox(Components[i]).Enabled := OnOff; end; if Components[i] is TEdit then begin TEdit(Components[i]).Text := ''; if TEdit(Components[i]).ReadOnly = False then TEdit(Components[i]).Color := ColorState(OnOff); TEdit(Components[i]).Enabled := OnOff; end; end; end; miLogOnServer2.Visible := not OnOff; SubNameIndex := 0; lbSubNames.Clear; lbSubNames.Color := ColorState(False); lbSubNames.Enabled := False; rbSub.Enabled := False; end; {------------------------------------------------------------------------------} { cbOutputChange procedure } {------------------------------------------------------------------------------} procedure TfrmMain.cbOutputChange(Sender: TObject); begin Crpe1.Output := TCrOutput(cbOutput.ItemIndex); pnlBBar.SetFocus; end; {------------------------------------------------------------------------------} { sbSubExecuteClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.cbSubExecuteClick(Sender: TObject); begin Crpe1.Subreports.SubExecute := cbSubExecute.Checked; if cbSubExecute.Checked and rbSub.Checked then sbSave.Enabled := False; end; {------------------------------------------------------------------------------} { cbLoadEngineOnUseClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.cbLoadEngineOnUseClick(Sender: TObject); begin if (cbLoadEngineOnUse.Checked <> Crpe1.LoadEngineOnUse) then begin if (Crpe1.JobNumber > 0) then MessageDlg('Changes will take place when the current Report is closed.', mtInformation, [mbOk], 0) else begin Crpe1.LoadEngineOnUse := cbLoadEngineOnUse.Checked; Crpe1.CloseEngine; if cbLoadEngineOnUse.Checked = False then Crpe1.OpenEngine; end; end; end; {------------------------------------------------------------------------------} { cbIgnoreKnownProblemsClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.cbIgnoreKnownProblemsClick(Sender: TObject); begin Crpe1.IgnoreKnownProblems := cbIgnoreKnownProblems.Checked; if cbIgnoreKnownProblems.Checked then begin MessageDlg('Selecting this option will cause the Crystal VCL' + Chr(10) + 'to ignore known problems with certain' + Chr(10) + 'Crystal Reports Print Engine calls.', mtInformation, [mbOk], 0); end else begin MessageDlg('De-selecting this option will cause the Crystal VCL' + Chr(10) + 'to report all error messages, even those dealing with' + Chr(10) + 'known problems in certain Crystal Reports Print Engine calls.', mtInformation, [mbOk], 0); end; end; {------------------------------------------------------------------------------} { rbMainClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.rbMainClick(Sender: TObject); begin rbSub.Checked := False; rbMain.Checked := True; lbSubNames.Enabled := False; lbSubNames.Color := ColorState(False); cbSubExecute.Enabled := False; editSection.Text := ''; editNLinks.Text := ''; Crpe1.Subreports[0]; StatusBar.Panels[1].Text := 'JobNumber: ' + IntToStr(Crpe1.JobNumber); DoUpdates; end; {------------------------------------------------------------------------------} { rbSubClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.rbSubClick(Sender: TObject); begin rbMain.Checked := False; rbSub.Checked := True; lbSubNames.Enabled := True; lbSubNames.Color := ColorState(True); cbSubExecute.Enabled := True; cbSubExecute.Checked := Crpe1.Subreports.SubExecute; {set the List Box to the first item} lbSubNames.SetFocus; lbSubNames.ItemIndex := SubNameIndex; lbSubNamesClick(Self); end; {------------------------------------------------------------------------------} { lbSubNamesClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.lbSubNamesClick(Sender: TObject); begin rbSub.Checked := True; SubNameIndex := lbSubNames.ItemIndex; Crpe1.Subreports[SubNameIndex + 1]; StatusBar.Panels[1].Text := 'JobNumber: ' + IntToStr(Crpe1.JobNumber); editSection.Text := Crpe1.Subreports.Item.Section; editNLinks.Text := IntToStr(Crpe1.Subreports.Item.NLinks); DoUpdates; end; {------------------------------------------------------------------------------} { lbSubNamesDblClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.lbSubNamesDblClick(Sender: TObject); begin lbSubNamesClick(Self); miSubreportsClick(Self); end; {------------------------------------------------------------------------------} { btnDiscardSavedDataClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.btnDiscardSavedDataClick(Sender: TObject); begin Crpe1.DiscardSavedData; btnDiscardSavedData.Enabled := Crpe1.HasSavedData; end; {------------------------------------------------------------------------------} { DoUpdates procedure } {------------------------------------------------------------------------------} procedure TfrmMain.DoUpdates; begin if bAreaFormat then CrpeAreaFormatDlg.FormShow(Self); if bConnect then CrpeConnectDlg.FormShow(Self); if bExportOptions then CrpeExportOptionsDlg.FormShow(Self); if bGroups then CrpeGroupsDlg.FormShow(Self); if bGraphs then CrpeGraphsDlg.FormShow(Self); if bGroupSelection then CrpeGroupSelectionDlg.FormShow(Self); if bGroupSortFields then CrpeGroupSortFieldsDlg.FormShow(Self); if bLogOnInfo then CrpeLogOnInfoDlg.FormShow(Self); if bLogOnServer then CrpeLogOnServerDlg.FormShow(Self); if bMargins then CrpeMarginsDlg.FormShow(Self); if bPages then CrpePagesDlg.FormShow(Self); if bRecords then CrpeRecordsDlg.FormShow(Self); if bMiscellaneous then CrpeMiscellaneousDlg.FormShow(Self); if bPrintDate then CrpePrintDateDlg.FormShow(Self); if bPrinter then CrpePrinterDlg.FormShow(Self); if bPrintOptions then CrpePrintOptionsDlg.FormShow(Self); if bSQLQuery then CrpeSQLQueryDlg.FormShow(Self); if bReportOptions then CrpeReportOptionsDlg.FormShow(Self); if bGlobalOptions then CrpeGlobalOptionsDlg.FormShow(Self); if bSectionFormat then CrpeSectionFormatDlg.FormShow(Self); if bSectionFont then CrpeSectionFontDlg.FormShow(Self); if bSectionSize then CrpeSectionSizeDlg.FormShow(Self); if bSelection then CrpeSelectionDlg.FormShow(Self); if bSessionInfo then CrpeSessionInfoDlg.FormShow(Self); if bSortFields then CrpeSortFieldsDlg.FormShow(Self); if bSummaryInfo then CrpeSummaryInfoDlg.FormShow(Self); if bTables then CrpeTablesDlg.FormShow(Self); if bVersion then CrpeVersionDlg.FormShow(Self); if bWindowButtonBar then CrpeWindowButtonBarDlg.FormShow(Self); if bWindowCursor then CrpeWindowCursorDlg.FormShow(Self); if bWindowSize then CrpeWindowSizeDlg.FormShow(Self); if bWindowStyle then CrpeWindowStyleDlg.FormShow(Self); if bWindowZoom then CrpeWindowZoomDlg.FormShow(Self); if bPreview then CrpePreviewDlg.FormShow(Self); {Field Objects} if bDatabaseFields then CrpeDatabaseFieldsDlg.FormShow(Self); if bFormulas then CrpeFormulasDlg.FormShow(Self); if bSummaryFields then CrpeSummaryFieldsDlg.FormShow(Self); if bSpecialFields then CrpeSpecialFieldsDlg.FormShow(Self); if bGroupNameFields then CrpeGroupNameFieldsDlg.FormShow(Self); if bParamFields then CrpeParamFieldsDlg.FormShow(Self); if bSQLExpressions then CrpeSQLExpressionsDlg.FormShow(Self); if bRunningTotals then CrpeRunningTotalsDlg.FormShow(Self); {Objects} if bTextObjects then CrpeTextObjectsDlg.FormShow(Self); if bLines then CrpeLinesDlg.FormShow(Self); if bBoxes then CrpeBoxesDlg.FormShow(Self); if bSubreports then CrpeSubreportsDlg.FormShow(Self); if bOleObjects then CrpeOleObjectsDlg.FormShow(Self); {graphs...} if bCrossTabs then CrpeCrossTabsDlg.FormShow(Self); if bPictures then CrpePicturesDlg.FormShow(Self); if bMaps then CrpeMapsDlg.FormShow(Self); if bOLAPCubes then CrpeOLAPCubesDlg.FormShow(Self); end; {******************************************************************************} { MenuItem Clicks } {******************************************************************************} {******************************************************************************} { File Menu } {******************************************************************************} {------------------------------------------------------------------------------} { miNewClick } {------------------------------------------------------------------------------} procedure TfrmMain.miNewClick(Sender: TObject); begin // end; {------------------------------------------------------------------------------} { miOpenClick } {------------------------------------------------------------------------------} procedure TfrmMain.miOpenClick(Sender: TObject); begin {Set the dialog default filename, filter and title} OpenDialog1.FileName := '*.rpt'; OpenDialog1.Filter := 'Crystal Report (*.RPT)|*.rpt'; OpenDialog1.Title := 'Load Report...'; OpenDialog1.InitialDir := OpenDir; if OpenDialog1.Execute then begin Refresh; Report := OpenDialog1.FileName; {Update the 'Reopen' menu and PrevFile stringlist} UpdateReopenList; {Load the Report} LoadReport; end; end; {------------------------------------------------------------------------------} { ReopenMenuClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.ReopenMenuClick(Sender: TObject); var str1 : string; i : integer; begin if Sender is TMenuItem then begin {Get the filename from the menu item} str1 := TMenuItem(Sender).Caption; i := Pos(' ', str1); str1 := Copy(str1, i+1, Length(str1)); if str1 = 'Open' then Exit; {Check to make sure it exists} if FileExists(str1) then begin Report := str1; UpdateReopenList; LoadReport; end else begin i := PrevFiles.IndexOf(Str1); if i > -1 then begin miReopen.Delete(i); PrevFiles.Delete(i); UpdateReopenList; end; CrpeLoadErrorDlg := TCrpeLoadErrorDlg.Create(Application); CrpeLoadErrorDlg.ShowModal; if CrpeLoadErrorDlg.ModalResult = mrOk then miOpenClick(self); end; end; end; {------------------------------------------------------------------------------} { RemoveObsoleteClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.RemoveObsoleteClick(Sender: TObject); var str1 : string; i,j : integer; begin {Clear the obsolete items in the Reopen submenu} for i := miReopen.Count-4 downto 0 do begin {Get the filename from the menu item} str1 := miReopen.Items[i].Caption; j := Pos(' ', str1); str1 := Copy(str1, j+1, Length(str1)); {Check to make sure it exists} if not FileExists(str1) then begin miReopen.Delete(i); PrevFiles.Delete(i); end; end; end; {------------------------------------------------------------------------------} { RemoveAllClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.RemoveAllClick(Sender: TObject); var i : integer; begin {Clear the Reopen submenu} for i := miReopen.Count-4 downto 0 do miReopen.Delete(i); {Clear the Previous Files list} PrevFiles.Clear; end; {------------------------------------------------------------------------------} { miCloseClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miCloseClick(Sender: TObject); begin Crpe1.ReportName := ''; StatusBar.Panels[0].Text := 'No Report Loaded '; StatusBar.Panels[1].Text := ''; RptLoaded := False; miCloseEngine.Tag := 1; InitializeControls(False); if cbLoadEngineOnUse.Checked <> Crpe1.LoadEngineOnUse then Crpe1.LoadEngineOnUse := cbLoadEngineOnUse.Checked; miCloseEngine.Enabled := Crpe1.EngineOpen; DoUpdates; end; {------------------------------------------------------------------------------} { miSaveClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSaveClick(Sender: TObject); begin {Set the dialog default filename, filter and title} SaveDialog1.FileName := '*.rpt'; SaveDialog1.Filter := 'Crystal Report (*.RPT)|*.rpt'; SaveDialog1.Title := 'Save Report As...'; SaveDialog1.InitialDir := OpenDir; if SaveDialog1.Execute then begin Refresh; Crpe1.Save(SaveDialog1.FileName); btnDiscardSavedData.Enabled := Crpe1.HasSavedData; end; end; {------------------------------------------------------------------------------} { miSaveAsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSaveAsClick(Sender: TObject); begin {Set the dialog default filename, filter and title} SaveDialog1.FileName := '*.rpt'; SaveDialog1.Filter := 'Crystal Report (*.RPT)|*.rpt'; SaveDialog1.Title := 'Save Report As...'; SaveDialog1.InitialDir := OpenDir; if SaveDialog1.Execute then begin Refresh; Crpe1.SaveAs(SaveDialog1.FileName); btnDiscardSavedData.Enabled := Crpe1.HasSavedData; end; end; {------------------------------------------------------------------------------} { miDiscardDataClick } {------------------------------------------------------------------------------} procedure TfrmMain.miDiscardSavedDataClick(Sender: TObject); begin Crpe1.DiscardSavedData; btnDiscardSavedData.Enabled := Crpe1.HasSavedData; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miPreviewClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miPreviewClick(Sender: TObject); begin if Crpe1.ReportWindowHandle > 0 then begin Crpe1.Refresh; btnDiscardSavedData.Enabled := True; Exit; end; if Crpe1.Output = toWindow then begin Crpe1.WindowStyle.BorderStyle := bsSizeable; Crpe1.WindowStyle.SystemMenu := True; end; {Run the Report} if Crpe1.Execute then begin {WindowEvents} if Crpe1.WindowEvents = True then begin if not bWindowEventsDlg then CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; btnDiscardSavedData.Enabled := Crpe1.HasSavedData; end; end; {------------------------------------------------------------------------------} { miWindowClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miWindowClick(Sender: TObject); begin if not bPreview then begin CrpePreviewDlg := TCrpePreviewDlg.Create(Application); CrpePreviewDlg.Cr := Crpe1; end; CrpePreviewDlg.Show; end; {------------------------------------------------------------------------------} { miPrinterClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miPrinterClick(Sender: TObject); begin if not bPrinter then begin Application.CreateForm(TCrpePrinterDlg, CrpePrinterDlg); CrpePrinterDlg.Cr := Crpe1; end; CrpePrinterDlg.Show; end; {------------------------------------------------------------------------------} { miExportClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miExportClick(Sender: TObject); begin if not bExportOptions then begin Application.CreateForm(TCrpeExportOptionsDlg, CrpeExportOptionsDlg); CrpeExportOptionsDlg.Cr := Crpe1; end; CrpeExportOptionsDlg.Show; end; {------------------------------------------------------------------------------} { miPrinterSetupClick } {------------------------------------------------------------------------------} procedure TfrmMain.miPrinterSetupClick(Sender: TObject); begin {This routine does the same thing as Printer.ShowPrintDlg} {Set the PrintDialog options from the PrinterOptions} PrintDialog1.Options := [poPageNums, poWarning]; PrintDialog1.FromPage := Crpe1.PrintOptions.StartPage; {If you want "All" to be selected for PageRange, set StopPage to 65535} PrintDialog1.ToPage := Crpe1.PrintOptions.StopPage; PrintDialog1.Copies := Crpe1.PrintOptions.Copies; PrintDialog1.MaxPage := 65535; {PE_MAXPAGEN} PrintDialog1.Collate := Crpe1.PrintOptions.Collation; {Show the Print Dialog} if PrintDialog1.Execute then begin {Set the PrinterOptions from the PrintDialog} Crpe1.PrintOptions.StartPage := PrintDialog1.FromPage; Crpe1.PrintOptions.StopPage := PrintDialog1.ToPage; Crpe1.PrintOptions.Copies := PrintDialog1.Copies; Crpe1.PrintOptions.Collation := PrintDialog1.Collate; Crpe1.Printer.GetCurrent(True); end; end; {------------------------------------------------------------------------------} { miPageMarginsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miPageMarginsClick(Sender: TObject); begin if not bMargins then begin Application.CreateForm(TCrpeMarginsDlg, CrpeMarginsDlg); CrpeMarginsDlg.Cr := Crpe1; end; CrpeMarginsDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { ReportOptions1Click procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miReportOptionsClick(Sender: TObject); begin if not bReportOptions then begin Application.CreateForm(TCrpeReportOptionsDlg, CrpeReportOptionsDlg); CrpeReportOptionsDlg.Cr := Crpe1; end; CrpeReportOptionsDlg.Show; end; {------------------------------------------------------------------------------} { miGlobalOptionsClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miGlobalOptionsClick(Sender: TObject); begin if not bGlobalOptions then begin Application.CreateForm(TCrpeGlobalOptionsDlg, CrpeGlobalOptionsDlg); CrpeGlobalOptionsDlg.Cr := Crpe1; end; CrpeGlobalOptionsDlg.Show; end; {------------------------------------------------------------------------------} { SummaryInfo1Click procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miSummaryInfoClick(Sender: TObject); begin if not bSummaryInfo then begin Application.CreateForm(TCrpeSummaryInfoDlg, CrpeSummaryInfoDlg); CrpeSummaryInfoDlg.Cr := Crpe1; end; CrpeSummaryInfoDlg.Show; end; {------------------------------------------------------------------------------} { miVersionClick } {------------------------------------------------------------------------------} procedure TfrmMain.miVersionClick(Sender: TObject); begin if not bVersion then begin Application.CreateForm(TCrpeVersionDlg, CrpeVersionDlg); CrpeVersionDlg.Cr := Crpe1; end; CrpeVersionDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miCloseEngineClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miCloseEngineClick(Sender: TObject); begin miCloseClick(Self); Crpe1.CloseEngine; miCloseEngine.Enabled := False; end; {------------------------------------------------------------------------------} { miExitClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miExitClick(Sender: TObject); begin Close; end; {******************************************************************************} { Edit Menu } {******************************************************************************} {------------------------------------------------------------------------------} { miDatabaseFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miDatabaseFieldsClick(Sender: TObject); begin if not bDatabaseFields then begin Application.CreateForm(TCrpeDatabaseFieldsDlg, CrpeDatabaseFieldsDlg); CrpeDatabaseFieldsDlg.Cr := Crpe1; end; CrpeDatabaseFieldsDlg.Show; end; {------------------------------------------------------------------------------} { miTextObjectsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miTextObjectsClick(Sender: TObject); begin if not bTextObjects then begin Application.CreateForm(TCrpeTextObjectsDlg, CrpeTextObjectsDlg); CrpeTextObjectsDlg.Cr := Crpe1; end; CrpeTextObjectsDlg.Show; end; {------------------------------------------------------------------------------} { miFormulaFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miFormulaFieldsClick(Sender: TObject); begin if not bFormulas then begin Application.CreateForm(TCrpeFormulasDlg, CrpeFormulasDlg); CrpeFormulasDlg.Cr := Crpe1; end; CrpeFormulasDlg.Show; end; {------------------------------------------------------------------------------} { miParameterFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miParameterFieldsClick(Sender: TObject); begin if not bParamFields then begin Application.CreateForm(TCrpeParamFieldsDlg, CrpeParamFieldsDlg); CrpeParamFieldsDlg.Cr := Crpe1; end; CrpeParamFieldsDlg.Show; end; {------------------------------------------------------------------------------} { miSpecialFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSpecialFieldsClick(Sender: TObject); begin if not bSpecialFields then begin Application.CreateForm(TCrpeSpecialFieldsDlg, CrpeSpecialFieldsDlg); CrpeSpecialFieldsDlg.Cr := Crpe1; end; CrpeSpecialFieldsDlg.Show; end; {------------------------------------------------------------------------------} { miRunningTotalsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miRunningTotalsClick(Sender: TObject); begin if not bRunningTotals then begin Application.CreateForm(TCrpeRunningTotalsDlg, CrpeRunningTotalsDlg); CrpeRunningTotalsDlg.Cr := Crpe1; end; CrpeRunningTotalsDlg.Show; end; {------------------------------------------------------------------------------} { miSQLExpressionsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSQLExpressionsClick(Sender: TObject); begin if not bSQLExpressions then begin Application.CreateForm(TCrpeSQLExpressionsDlg, CrpeSQLExpressionsDlg); CrpeSQLExpressionsDlg.Cr := Crpe1; end; CrpeSQLExpressionsDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miSummaryFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSummaryFieldsClick(Sender: TObject); begin if not bSummaryFields then begin Application.CreateForm(TCrpeSummaryFieldsDlg, CrpeSummaryFieldsDlg); CrpeSummaryFieldsDlg.Cr := Crpe1; end; CrpeSummaryFieldsDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miSectionFormatClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSectionFormatClick(Sender: TObject); begin if not bSectionFormat then begin Application.CreateForm(TCrpeSectionFormatDlg, CrpeSectionFormatDlg); CrpeSectionFormatDlg.Cr := Crpe1; end; CrpeSectionFormatDlg.Show; end; {------------------------------------------------------------------------------} { miAreaFormatClick } {------------------------------------------------------------------------------} procedure TfrmMain.miAreaFormatClick(Sender: TObject); begin if not bAreaFormat then begin Application.CreateForm(TCrpeAreaFormatDlg, CrpeAreaFormatDlg); CrpeAreaFormatDlg.Cr := Crpe1; end; CrpeAreaFormatDlg.Show; end; {------------------------------------------------------------------------------} { miSectionFontClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSectionFontClick(Sender: TObject); begin if not bSectionFont then begin Application.CreateForm(TCrpeSectionFontDlg, CrpeSectionFontDlg); CrpeSectionFontDlg.Cr := Crpe1; end; CrpeSectionFontDlg.Show; end; {------------------------------------------------------------------------------} { miSectionSizeClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSectionSizeClick(Sender: TObject); begin if not bSectionSize then begin Application.CreateForm(TCrpeSectionSizeDlg, CrpeSectionSizeDlg); CrpeSectionSizeDlg.Cr := Crpe1; end; CrpeSectionSizeDlg.Show; end; {------------------------------------------------------------------------------} { miGroupNameFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miGroupNameFieldsClick(Sender: TObject); begin if not bGroupNameFields then begin Application.CreateForm(TCrpeGroupNameFieldsDlg, CrpeGroupNameFieldsDlg); CrpeGroupNameFieldsDlg.Cr := Crpe1; end; CrpeGroupNameFieldsDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miOLAPCubesClick } {------------------------------------------------------------------------------} procedure TfrmMain.miOLAPCubesClick(Sender: TObject); begin if not bOLAPCubes then begin Application.CreateForm(TCrpeOLAPCubesDlg, CrpeOLAPCubesDlg); CrpeOLAPCubesDlg.Cr := Crpe1; end; CrpeOLAPCubesDlg.Show; end; {------------------------------------------------------------------------------} { miCrossTabsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miCrossTabsClick(Sender: TObject); begin if not bCrossTabs then begin Application.CreateForm(TCrpeCrossTabsDlg, CrpeCrossTabsDlg); CrpeCrossTabsDlg.Cr := Crpe1; end; CrpeCrossTabsDlg.Show; end; {------------------------------------------------------------------------------} { miSubreportsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSubreportsClick(Sender: TObject); begin Application.CreateForm(TCrpeSubreportsDlg, CrpeSubreportsDlg); CrpeSubreportsDlg.Cr := Crpe1; CrpeSubreportsDlg.ShowModal; {Update in case Subreport.Add was used...} if (Crpe1.Subreports.Count-1) > lbSubNames.Items.Count then begin lbSubNames.Clear; lbSubNames.Items.AddStrings(Crpe1.Subreports.Names); end; if Crpe1.Subreports.ItemIndex > 0 then begin SubNameIndex := Crpe1.Subreports.ItemIndex-1; rbSubClick(Self); end else rbMainClick(Self); CrpeSubreportsDlg.Release; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miLinesClick } {------------------------------------------------------------------------------} procedure TfrmMain.miLinesClick(Sender: TObject); begin if not bLines then begin Application.CreateForm(TCrpeLinesDlg, CrpeLinesDlg); CrpeLinesDlg.Cr := Crpe1; end; CrpeLinesDlg.Show; end; {------------------------------------------------------------------------------} { miBoxesClick } {------------------------------------------------------------------------------} procedure TfrmMain.miBoxesClick(Sender: TObject); begin if not bBoxes then begin Application.CreateForm(TCrpeBoxesDlg, CrpeBoxesDlg); CrpeBoxesDlg.Cr := Crpe1; end; CrpeBoxesDlg.Show; end; {------------------------------------------------------------------------------} { miPicturesClick } {------------------------------------------------------------------------------} procedure TfrmMain.miPicturesClick(Sender: TObject); begin if not bPictures then begin Application.CreateForm(TCrpePicturesDlg, CrpePicturesDlg); CrpePicturesDlg.Cr := Crpe1; end; CrpePicturesDlg.Show; end; {------------------------------------------------------------------------------} { miGraphsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miGraphsClick(Sender: TObject); begin if not bGraphs then begin Application.CreateForm(TCrpeGraphsDlg, CrpeGraphsDlg); CrpeGraphsDlg.Cr := Crpe1; end; CrpeGraphsDlg.Show; end; {------------------------------------------------------------------------------} { miMapsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miMapsClick(Sender: TObject); begin if not bMaps then begin Application.CreateForm(TCrpeMapsDlg, CrpeMapsDlg); CrpeMapsDlg.Cr := Crpe1; end; CrpeMapsDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miOleObjectsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miOleObjectsClick(Sender: TObject); begin if not bOleObjects then begin Application.CreateForm(TCrpeOleObjectsDlg, CrpeOleObjectsDlg); CrpeOleObjectsDlg.Cr := Crpe1; end; CrpeOleObjectsDlg.Show; end; {******************************************************************************} { View Menu } {******************************************************************************} {------------------------------------------------------------------------------} { menuViewClick } {------------------------------------------------------------------------------} procedure TfrmMain.menuViewClick(Sender: TObject); begin ProgressDialog1.Checked := Crpe1.ProgressDialog; end; {------------------------------------------------------------------------------} { Toolbar1Click } {------------------------------------------------------------------------------} procedure TfrmMain.miToolbarClick(Sender: TObject); begin miToolbar.Checked := not miToolbar.Checked; pnlBBar.Visible := miToolbar.Checked; if pnlBBar.Visible then Height := Height + pnlBBar.Height else Height := Height - pnlBBar.Height; end; {------------------------------------------------------------------------------} { StatusBar1Click } {------------------------------------------------------------------------------} procedure TfrmMain.miStatusBarClick(Sender: TObject); begin miStatusBar.Checked := not miStatusBar.Checked; StatusBar.Visible := miStatusBar.Checked; if StatusBar.Visible then Height := Height + StatusBar.Height else Height := Height - StatusBar.Height; end; {------------------------------------------------------------------------------} { ProgressDialog1Click } {------------------------------------------------------------------------------} procedure TfrmMain.ProgressDialog1Click(Sender: TObject); begin ProgressDialog1.Checked := not ProgressDialog1.Checked; Crpe1.ProgressDialog := ProgressDialog1.Checked; end; {******************************************************************************} { Database Menu } {******************************************************************************} {------------------------------------------------------------------------------} { miTablesClick } {------------------------------------------------------------------------------} procedure TfrmMain.miTablesClick(Sender: TObject); begin if not bTables then begin Application.CreateForm(TCrpeTablesDlg, CrpeTablesDlg); CrpeTablesDlg.Cr := Crpe1; end; CrpeTablesDlg.Show; end; {------------------------------------------------------------------------------} { miSessionInfoClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSessionInfoClick(Sender: TObject); begin if not bSessionInfo then begin Application.CreateForm(TCrpeSessionInfoDlg, CrpeSessionInfoDlg); CrpeSessionInfoDlg.Cr := Crpe1; end; CrpeSessionInfoDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miVerifyDatabaseClick } {------------------------------------------------------------------------------} procedure TfrmMain.miVerifyDatabaseClick(Sender: TObject); begin if Crpe1.Tables.Verify then MessageDlg('The Database is up to date.', mtInformation, [mbOk], 0) else MessageDlg('An Error occured during Verify.', mtError, [mbOk], 0); end; {------------------------------------------------------------------------------} { miVerifyOnEveryPrintClick } {------------------------------------------------------------------------------} procedure TfrmMain.miVerifyOnEveryPrintClick(Sender: TObject); begin miVerifyOnEveryPrint.Checked := not miVerifyOnEveryPrint.Checked; Crpe1.ReportOptions.VerifyOnEveryPrint := miVerifyOnEveryPrint.Checked; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miLogOnServer2Click } {------------------------------------------------------------------------------} procedure TfrmMain.miLogOnServer2Click(Sender: TObject); begin if not bLogOnServer then begin Application.CreateForm(TCrpeLogOnServerDlg, CrpeLogOnServerDlg); CrpeLogOnServerDlg.Cr := Crpe1; end; CrpeLogOnServerDlg.Show; end; {------------------------------------------------------------------------------} { miLogOnInfoClick } {------------------------------------------------------------------------------} procedure TfrmMain.miLogOnInfoClick(Sender: TObject); begin if not bLogOnInfo then begin Application.CreateForm(TCrpeLogOnInfoDlg, CrpeLogOnInfoDlg); CrpeLogOnInfoDlg.Cr := Crpe1; end; CrpeLogOnInfoDlg.Show; end; {------------------------------------------------------------------------------} { miConnectClick } {------------------------------------------------------------------------------} procedure TfrmMain.miConnectClick(Sender: TObject); begin if not bConnect then begin Application.CreateForm(TCrpeConnectDlg, CrpeConnectDlg); CrpeConnectDlg.Cr := Crpe1; end; CrpeConnectDlg.Show; end; {------------------------------------------------------------------------------} { miSQLQueryClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSQLQueryClick(Sender: TObject); begin if not bSQLQuery then begin Application.CreateForm(TCrpeSQLQueryDlg, CrpeSQLQueryDlg); CrpeSQLQueryDlg.Cr := Crpe1; end; CrpeSQLQueryDlg.Show; end; {******************************************************************************} { Report Menu } {******************************************************************************} {------------------------------------------------------------------------------} { miSelectionClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSelectionClick(Sender: TObject); begin if not bSelection then begin Application.CreateForm(TCrpeSelectionDlg, CrpeSelectionDlg); CrpeSelectionDlg.Cr := Crpe1; end; CrpeSelectionDlg.Show; end; {------------------------------------------------------------------------------} { miGroupSelectionClick } {------------------------------------------------------------------------------} procedure TfrmMain.miGroupSelectionClick(Sender: TObject); begin if not bGroupSelection then begin Application.CreateForm(TCrpeGroupSelectionDlg, CrpeGroupSelectionDlg); CrpeGroupSelectionDlg.Cr := Crpe1; end; CrpeGroupSelectionDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miGroupsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miGroupsClick(Sender: TObject); begin if not bGroups then begin Application.CreateForm(TCrpeGroupsDlg, CrpeGroupsDlg); CrpeGroupsDlg.Cr := Crpe1; end; CrpeGroupsDlg.Show; end; {------------------------------------------------------------------------------} { miGroupSortFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miGroupSortFieldsClick(Sender: TObject); begin if not bGroupSortFields then begin Application.CreateForm(TCrpeGroupSortFieldsDlg, CrpeGroupSortFieldsDlg); CrpeGroupSortFieldsDlg.Cr := Crpe1; end; CrpeGroupSortFieldsDlg.Show; end; {------------------------------------------------------------------------------} { miSortFieldsClick } {------------------------------------------------------------------------------} procedure TfrmMain.miSortFieldsClick(Sender: TObject); begin if not bSortFields then begin Application.CreateForm(TCrpeSortFieldsDlg, CrpeSortFieldsDlg); CrpeSortFieldsDlg.Cr := Crpe1; end; CrpeSortFieldsDlg.Show; end; { Line ************************************************************************} {------------------------------------------------------------------------------} { miPrintDateClick } {------------------------------------------------------------------------------} procedure TfrmMain.miPrintDateClick(Sender: TObject); begin if not bPrintDate then begin Application.CreateForm(TCrpePrintDateDlg, CrpePrintDateDlg); CrpePrintDateDlg.Cr := Crpe1; end; CrpePrintDateDlg.Show; end; {------------------------------------------------------------------------------} { miReportTitleClick } {------------------------------------------------------------------------------} procedure TfrmMain.miReportTitleClick(Sender: TObject); begin if not bMiscellaneous then begin Application.CreateForm(TCrpeMiscellaneousDlg, CrpeMiscellaneousDlg); CrpeMiscellaneousDlg.Cr := Crpe1; end; CrpeMiscellaneousDlg.Show; end; {------------------------------------------------------------------------------} { miPagesClick } {------------------------------------------------------------------------------} procedure TfrmMain.miPagesClick(Sender: TObject); begin if not bPages then begin Application.CreateForm(TCrpePagesDlg, CrpePagesDlg); CrpePagesDlg.Cr := Crpe1; end; CrpePagesDlg.Show; end; {------------------------------------------------------------------------------} { btnRecordsClick } {------------------------------------------------------------------------------} procedure TfrmMain.btnRecordsClick(Sender: TObject); begin if not bRecords then begin Application.CreateForm(TCrpeRecordsDlg, CrpeRecordsDlg); CrpeRecordsDlg.Cr := Crpe1; end; CrpeRecordsDlg.Show; end; {******************************************************************************} { Help Menu } {******************************************************************************} {------------------------------------------------------------------------------} { miVCLHelpClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miVCLHelpClick(Sender: TObject); begin Application.HelpContext(1); end; {------------------------------------------------------------------------------} { miVCLTechnicalSupportClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miVCLTechnicalSupportClick(Sender: TObject); begin Application.HelpContext(20); end; {------------------------------------------------------------------------------} { miCloseAndSendClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miCloseAndSendClick(Sender: TObject); var RegIni : TRegIniFile; sCRW : string; CmdStr : string; ShortPath : array[0..255] of char; StartupInfo : TStartupInfo; ProcessInfo : TProcessInformation; function GetCRWPath: string; var s1 : string; Reg1 : TRegistry; begin Result := ''; Reg1 := TRegistry.Create; try Reg1.RootKey := HKEY_LOCAL_MACHINE; if not Reg1.OpenKey('\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports', False) then Exit; s1 := Reg1.ReadString('Path'); if not IsStrEmpty(s1) then Result := s1 + '\Crw32.exe'; except Reg1.Free; end; Reg1.Free; end; begin {Check that Report file is specified} if not FileExists(Report) then begin if MessageDlg('Cannot locate the Report.' + chr(13) + 'Load another one now?', mtError, [mbOk, mbCancel], 0) = mrOk then miOpenClick(Self); if not FileExists(Report) then Exit; end; {Get CRW Path from Registry} sCRW := GetCRWPath; if IsStrEmpty(sCRW) then begin RegIni := TRegIniFile.Create('Software\Business Objects\Suite 11.0\'); try {Read the CRWPath from CrystalVCL Registry entries} RegIni.ReadString('CrystalVCL','CRWPath',sCRW); except RegIni.Free; end; RegIni.Free; end; if not FileExists(sCRW) then begin if MessageDlg('Cannot locate Crystal Reports Designer.' + chr(13) + 'Locate it now?', mtWarning, mbOkCancel, 0) = mrOk then begin OpenDialog1.FileName := '*.exe'; OpenDialog1.Filter := 'Crystal Reports Designer (CRW32.EXE)|*.exe'; OpenDialog1.Title := 'Locate Crystal Reports Designer...'; OpenDialog1.InitialDir := OpenDir; if OpenDialog1.Execute then begin sCRW := OpenDialog1.FileName; {Update the Registry} RegIni := TRegIniFile.Create('Software\Business Objects\Suite 11.0\'); try {Write the CRWPath into the Registry} RegIni.WriteString('CrystalVCL','CRWPath',sCRW); except RegIni.Free; end; RegIni.Free; end else Exit; end else Exit; end; {Close Report so CRW can open it for editing} miCloseClick(Self); {Setup the startup information for the application } FillChar(StartupInfo, SizeOf(TStartupInfo), 0); with StartupInfo do begin cb:= SizeOf(TStartupInfo); dwFlags:= STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK; wShowWindow:= SW_SHOWNORMAL; end; GetShortPathName(PChar(Report), ShortPath, 255); CmdStr := sCRW + ' ' + string(ShortPath); CreateProcess(nil,PChar(CmdStr), nil, nil, False, NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo); end; {------------------------------------------------------------------------------} { ShowAboutBox procedure } {------------------------------------------------------------------------------} procedure TfrmMain.ShowAboutBox; var AboutBox : TCrpeAboutBox; begin AboutBox := TCrpeAboutBox.Create(frmMain); AboutBox.Caption := 'VCL Version'; AboutBox.lblLanguage.Caption := TCRPE_LANGUAGE; AboutBox.lblCopyright.Caption := TCRPE_COPYRIGHT; AboutBox.lblVersion.Caption := 'Version ' + TCRPE_VERSION; AboutBox.lblCompany.Caption := TCRPE_COMPANY_NAME; AboutBox.lblAddress1.Caption := TCRPE_COMPANY_ADDRESS1; AboutBox.lblAddress2.Caption := TCRPE_COMPANY_ADDRESS2; AboutBox.lblVCLEmail.Caption := TCRPE_VCL_EMAIL; AboutBox.lblVCLWebSite.Caption := TCRPE_VCL_WEBSITE; AboutBox.lblCRPhone.Caption := TCRPE_CR_PHONE; AboutBox.lblCREmail.Caption := TCRPE_CR_EMAIL; AboutBox.lblCRWebSite.Caption := TCRPE_CR_WEBSITE; AboutBox.ShowModal; end; {------------------------------------------------------------------------------} { AboutVCLComponent1Click procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miAboutVCLClick(Sender: TObject); begin ShowAboutBox; end; {------------------------------------------------------------------------------} { AboutCrystalSampleApp1Click procedure } {------------------------------------------------------------------------------} procedure TfrmMain.miAboutClick(Sender: TObject); begin CrpeAboutBoxSA := TCrpeAboutBoxSA.Create(Application); CrpeAboutBoxSA.ShowModal; end; {------------------------------------------------------------------------------} { sbCancelClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.sbCancelClick(Sender: TObject); begin Crpe1.CancelJob; end; {------------------------------------------------------------------------------} { sbFieldBrowserClick procedure } {------------------------------------------------------------------------------} procedure TfrmMain.sbFieldBrowserClick(Sender: TObject); begin if not bFieldSelect then begin CrpeFieldSelectDlg := TCrpeFieldSelectDlg.Create(Self); CrpeFieldSelectDlg.Cr := Crpe1; end; CrpeFieldSelectDlg.Show; end; {------------------------------------------------------------------------------} { WMGetMinMaxInfo method } {------------------------------------------------------------------------------} procedure TfrmMain.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); var MinMax : PMinMaxInfo; i1,i2 : integer; begin inherited; MinMax := Message.MinMaxInfo; {Sizing Minimum} i1 := (3437 * PixelsPerInch) div 1000; {330} i2 := (4635 * PixelsPerInch) div 1000; {445} if MinMax^.ptMinTrackSize.X < i1 then MinMax^.ptMinTrackSize.X := i1; if MinMax^.ptMaxTrackSize.X > i1 then MinMax^.ptMaxTrackSize.X := i1; if MinMax^.ptMinTrackSize.Y < i2 then MinMax^.ptMinTrackSize.Y := i2; end; {------------------------------------------------------------------------------} { FormClose procedure } {------------------------------------------------------------------------------} procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction); var i : integer; begin SaveFormPos(Self); {If a Report is Loaded, clear it} if RptLoaded then miCloseClick(Self); {Free the Previous Reports stringlist} if PrevFiles <> nil then PrevFiles.Free; {Free the Load Previous Reports submenu} {Clear the Reopen submenu} for i := miReopen.Count-1 downto 0 do miReopen.Delete(i); {Release the Form memory} Release; end; {------------------------------------------------------------------------------} { Crpe1Error procedure } {------------------------------------------------------------------------------} procedure TfrmMain.Crpe1Error(Sender: TObject; const ErrorNum: Smallint; const ErrorString: String; var IgnoreError: TCrErrorResult); begin CrpeErrorDlg := TCrpeErrorDlg.Create(Application); {Dialog Title} if ErrorNum < 500 then CrpeErrorDlg.lblTitle.Caption := 'Crystal Reports Component Error' else CrpeErrorDlg.lblTitle.Caption := 'Crystal Reports Engine Error'; {Error Number} if ErrorNum > 0 then CrpeErrorDlg.lblErrorNumber.Caption := 'Error #: ' + IntToStr(ErrorNum) else CrpeErrorDlg.lblErrorNumber.Caption := 'Error Number Undefined'; {Error String} CrpeErrorDlg.memoErrorString.Text := ErrorString; {Show Dialog} CrpeErrorDlg.ShowModal; case CrpeErrorDlg.ModalResult of mrIgnore : IgnoreError := errIgnore; mrAbort : IgnoreError := errAbort; mrOk : IgnoreError := errRaise; else IgnoreError := errAbort; end; end; {------------------------------------------------------------------------------} { FieldMapping Event } {------------------------------------------------------------------------------} procedure TfrmMain.Crpe1OnFieldMapping(var ReportFields, DatabaseFields: TList; var Cancel: Boolean); begin CrpeFieldMappingDlg := TCrpeFieldMappingDlg.Create(Application); CrpeFieldMappingDlg.ReportFields1 := ReportFields; CrpeFieldMappingDlg.DataBaseFields1 := DatabaseFields; CrpeFieldMappingDlg.ShowModal; Cancel := (CrpeFieldMappingDlg.ModalResult = mrCancel); end; {------------------------------------------------------------------------------} { WindowEvents } {------------------------------------------------------------------------------} procedure TfrmMain.Crpe1wOnActivateWindow(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnActivateWindow Event:'); Add(' - Window was Activated '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnCancelBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnCancelBtnClick Event:'); Add(' - Cancel Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnCloseBtnClick(WindowHandle: HWnd; ViewIndex: Word; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnCloseBtnClick Event:'); Add(' - Close Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - ViewIndex: ' + IntToStr(ViewIndex)); Add(''); end; end; procedure TfrmMain.Crpe1wOnCloseWindow(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnCloseWindow Event:'); Add(' - Window is being Closed '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnDeActivateWindow(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnDeActivateWindow Event:'); Add(' - Window was DeActivated '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnDrillDetail(WindowHandle: HWnd; NSelectedField, NFields: Smallint; FieldNames, FieldValues: TStringList; var Cancel: Boolean); var cnt : integer; begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnDrillDetail Event:'); Add(' - Detail Section was drilled '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - Number of Fields in Details area: ' + IntToStr(NFields)); Add(' - Number of Selected Field: ' + IntToStr(NSelectedField)); Add(' - Field Names: '); for cnt := 0 to (FieldNames.Count - 1) do Add(' ' + IntToStr(cnt) + '. ' + FieldNames[cnt]); Add(' - Field Values: '); for cnt := 0 to (FieldValues.Count - 1) do Add(' ' + IntToStr(cnt) + '. ' + FieldValues[cnt]); Add(''); end; end; procedure TfrmMain.Crpe1wOnDrillGroup(WindowHandle: HWnd; NGroupLevel: Word; DrillType: TCrDrillDownType; GroupList: TStringList; var Cancel: Boolean); var cnt: integer; begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnDrillGroup Event:'); Add(' - Group Section was drilled '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); case DrillType of ddOnGroup : Add(' - DrillDown Type: OnGroup'); ddOnGroupTree : Add(' - DrillDown Type: OnGroupTree'); ddOnGraph : Add(' - DrillDown Type: OnGraph'); ddOnMap : Add(' - DrillDown Type: OnMap'); ddOnSubreport : Add(' - DrillDown Type: OnSubreport'); end; Add(' - GroupLevel: ' + IntToStr(NGroupLevel)); Add(' - GroupList: '); for cnt := 0 to (GroupList.Count - 1) do Add(' ' + IntToStr(cnt) + '. ' + GroupList[cnt]); Add(''); end; end; procedure TfrmMain.Crpe1wOnExportBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnExportBtnClick Event:'); Add(' - Export Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnFirstPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnFirstPageBtnClick Event:'); Add(' - First Page Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnGroupTreeBtnClick(WindowHandle: HWnd; Visible: Boolean; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnGroupTreeBtnClick Event:'); Add(' - GroupTree Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - GroupTree Visible: ' + BooleanToStr(Visible)); Add(''); end; end; procedure TfrmMain.Crpe1wOnLastPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnLastPageBtnClick Event:'); Add(' - Last Page Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnNextPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnNextPageBtnClick Event:'); Add(' - Next Page Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnPreviousPageBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnPreviousPageBtnClick Event:'); Add(' - Previous Page Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnPrintBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnPrintBtnClick Event:'); Add(' - Print Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnPrintSetupBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnPrintSetupBtnClick Event:'); Add(' - Print Setup Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnReadingRecords(Cancelled: Boolean; RecordsRead, RecordsSelected: LongInt; Done: Boolean; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnReadingRecords Event:'); Add(' - Reading Records Event triggered '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - Records Read: ' + IntToStr(RecordsRead)); Add(' - Records Selected: ' + IntToStr(RecordsSelected)); Add(' - Cancelled: ' + BooleanToStr(Cancelled)); Add(' - Done: ' + BooleanToStr(Done)); Add(''); end; end; procedure TfrmMain.Crpe1wOnRefreshBtnClick(WindowHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnRefreshBtnClick Event:'); Add(' - Refresh Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(''); end; end; procedure TfrmMain.Crpe1wOnSearchBtnClick(WindowHandle: HWnd; SearchString: String; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnSearchBtnClick Event:'); Add(' - Search Button clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - Search String: ' + SearchString); Add(''); end; end; procedure TfrmMain.Crpe1wOnShowGroup(WindowHandle: HWnd; NGroupLevel: Word; GroupList: TStringList; var Cancel: Boolean); var cnt: integer; begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnShowGroup Event:'); Add(' - Group Tree was clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - GroupLevel: ' + IntToStr(NGroupLevel)); Add(' - GroupList: '); for cnt := 0 to (GroupList.Count - 1) do Add(' ' + IntToStr(cnt) + '. ' + GroupList[cnt]); Add(''); end; end; procedure TfrmMain.Crpe1wOnStartEvent(Destination: TCrStartEventDestination; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnStartEvent Event:'); Add(' - An Event was Started '); case Destination of seNoWhere : Add(' - Destination: seNoWhere'); seToWindow : Add(' - Destination: seToWindow'); seToPrinter : Add(' - Destination: seToPrinter'); seToExport : Add(' - Destination: seToExport'); seFromQuery : Add(' - Destination: seFromQuery'); end; Add(''); end; end; procedure TfrmMain.Crpe1wOnStopEvent(Destination: TCrStartEventDestination; JobStatus: TCrStopEventJobStatus; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnStopEvent Event:'); Add(' - An Event was Stopped '); case Destination of seNoWhere : Add(' - Destination: seNoWhere'); seToWindow : Add(' - Destination: seToWindow'); seToPrinter : Add(' - Destination: seToPrinter'); seToExport : Add(' - Destination: seToExport'); seFromQuery : Add(' - Destination: seFromQuery'); end; case JobStatus of seUndefined : Add(' - JobStatus: seUndefined'); seNotStarted : Add(' - JobStatus: seNotStarted'); seInProgress : Add(' - JobStatus: seInProgress'); seCompleted : Add(' - JobStatus: seCompleted'); seFailed : Add(' - JobStatus: seFailed'); seCancelled : Add(' - JobStatus: seCancelled'); seHalted : Add(' - JobStatus: seHalted'); end; Add(''); end; end; procedure TfrmMain.Crpe1wOnDrillHyperLink(WindowHandle: HWnd; HyperLinkText: String; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnDrillHyperLink Event:'); Add(' - A HyperLink was Clicked '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - HyperLinkText: ' + HyperLinkText); Add(''); end; end; procedure TfrmMain.Crpe1wOnLaunchSeagateAnalysis(WindowHandle: HWnd; FilePath: String; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnLaunchSeagateAnalysis Event:'); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - FilePath: ' + FilePath); Add(''); end; end; procedure TfrmMain.Crpe1wOnZoomLevelChange(WindowHandle: HWnd; ZoomLevel: Word; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnZoomLevelChange Event:'); Add(' - Zoom Level was changed '); Add(' - WindowHandle: ' + IntToStr(WindowHandle)); Add(' - Zoom Level: ' + IntToStr(ZoomLevel)); Add(''); end; end; procedure TfrmMain.Crpe1wOnMouseClick(WindowHandle: HWnd; MouseInfo: TCrMouseInfo; FieldValue: String; FieldType: TCrParamFieldType; Section: String; ObjectHandle: HWnd; var Cancel: Boolean); begin if not bWindowEventsDlg then begin CrpeWindowEventsDlg := TCrpeWindowEventsDlg.Create(Application); CrpeWindowEventsDlg.Show; end; with CrpeWindowEventsDlg.memoWindowEvents.Lines do begin Add('wOnMouseClick Event:'); case MouseInfo.Button of mcNone : Add(' - Button: None'); mcLeft : Add(' - Button: Left Mouse Click'); mcRight : Add(' - Button: Right Mouse Click'); mcMiddle : Add(' - Button: Middle Mouse Click'); end; case MouseInfo.Action of mbNotSupported : Add(' - Action: Not Supported'); mbDown : Add(' - Action: Mouse Button Down'); mbUp : Add(' - Action: Mouse Button Up'); mbDoubleClick : Add(' - Action: Mouse Button Double Click'); end; if MouseInfo.ShiftKey = True then Add(' - ShiftKey: True') else Add(' - ShiftKey: False'); if MouseInfo.ControlKey = True then Add(' - ControlKey: True') else Add(' - ControlKey: False'); Add(' - X Coordinate: ' + IntToStr(MouseInfo.x)); Add(' - Y Coordinate: ' + IntToStr(MouseInfo.y)); Add(' - FieldValue: ' + FieldValue); case Ord(FieldType) of 0 {pfNumber} : Add(' - FieldType: pfNumber'); 1 {pfCurrency} : Add(' - FieldType: pfCurrency'); 2 {pfBoolean} : Add(' - FieldType: pfBoolean'); 3 {pfDate} : Add(' - FieldType: pfDate'); 4 {pfString} : Add(' - FieldType: pfString'); 5 {pfDateTime} : Add(' - FieldType: pfDateTime'); 6 {pfTime} : Add(' - FieldType: pfTime'); 7 {pfInteger} : Add(' - FieldType: pfInteger'); 8 {pfColor} : Add(' - FieldType: pfColor'); 9 {pfChar} : Add(' - FieldType: pfChar'); 10{pfLong} : Add(' - FieldType: pfLong'); 11{pfStringHandle} : Add(' - FieldType: pfStringHandle'); 12{pfNoValue} : Add(' - FieldType: pfNoValue'); else Add(' - FieldType: Unrecognized: ' + IntToStr(Ord(FieldType))); end; Add(' - Section: ' + Section); Add(' - ObjectHandle: ' + IntToStr(ObjectHandle)); Add(''); end; end; end.
{----------------------------------------------------------------------------- Unit Name: dlgAboutPyScripter Author: Kiriakos Vlahos Date: 09-Mar-2005 Purpose: PyScripter About box History: -----------------------------------------------------------------------------} unit dlgAboutPyScripter; interface uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, Buttons, ComCtrls, JvLinkLabel, JvExControls, JvComponent, ExtCtrls; type TAboutBox = class(TForm) Panel2: TPanel; PageControl: TPageControl; AboutTab: TTabSheet; Panel1: TPanel; CreditsTab: TTabSheet; ScrollBox: TScrollBox; JvLinkLabel: TJvLinkLabel; ProgramIcon: TImage; Copyright: TLabel; Comments: TLabel; Version: TLabel; ProductName: TLabel; procedure Panel1Click(Sender: TObject); procedure JvLinkLabelLinkClick(Sender: TObject; LinkNumber: Integer; LinkText, LinkParam: String); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var AboutBox: TAboutBox; implementation uses uCommonFunctions, JvJCLUtils; {$R *.dfm} procedure TAboutBox.Panel1Click(Sender: TObject); begin Close; end; procedure TAboutBox.JvLinkLabelLinkClick(Sender: TObject; LinkNumber: Integer; LinkText, LinkParam: String); begin OpenObject('http://'+LinkText); end; procedure TAboutBox.FormCreate(Sender: TObject); begin Version.Caption := 'Version ' + ApplicationVersion; end; end.
{**************************************************} { } { _STRINGS UNIT : supplementary String functions } { } { Copyright (c) 1993-1995 by Yves BORCKMANS } { } {**************************************************} unit _strings; interface uses SysUtils, Classes; Function LTrim (AString : String) : String; Function RTrim (AString : String) : String; Function Trim (AString : String) : String; Function Spaces(TotLen : Integer) : String; Function LPad (AString : String; TotLen : Integer) : String; Function RPad (AString : String; TotLen : Integer) : String; Function IsWhiteSpace(AChar : Char) : Boolean; TYPE TStringParser = class(TStringList) constructor Create(AString : String); end; TStringParserWithColon = class(TStringList) constructor Create(AString : String); end; implementation Function LTrim(AString : String) : String; var i : Integer; getout : Boolean; begin getout := FALSE; if AString = '' then LTrim := '' else begin i := 1; while (i <= Length(AString)) and not getout do if AString[i] = ' ' then Inc(i) else getout := TRUE; LTrim := Copy(AString, i, 999); end; end; Function RTrim(AString : String) : String; var i : Integer; getout : Boolean; begin getout := FALSE; if AString = '' then RTrim := '' else begin i := Length(AString); while (i >= 1) and not getout do if AString[i] = ' ' then Dec(i) else getout := TRUE; RTrim := Copy(AString, 1, i); end; end; Function Trim(AString : String) : String; begin Trim := LTrim(RTrim(AString)); end; Function Spaces(TotLen : Integer) : String; var i : Integer; begin Result := ''; for i := 1 to TotLen do Result := Result + ' '; end; Function LPad(AString : String; TotLen : Integer) : String; begin if TotLen > 255 then TotLen := 255; if TotLen < Length(AString) then LPad := AString else LPad := Spaces(TotLen - Length(AString)) + AString; end; Function RPad (AString : String; TotLen : Integer) : String; begin if TotLen > 255 then TotLen := 255; if TotLen < Length(AString) then RPad := AString else RPad := AString + Spaces(TotLen - Length(AString)); end; Function IsWhiteSpace(AChar : Char) : Boolean; begin if (AChar = ' ') or (AChar = #9 ) or (AChar = #10) or (AChar = #13) then IsWhiteSpace := TRUE else IsWhiteSpace := FALSE; end; constructor TStringParser.Create(AString : string); var i : Integer; s : String; w : Boolean; begin inherited Create; {set the original string as item 0} Add(AString); {parse the string now} if AString <> '' then begin { w := IsWhiteSpace(AString[1]); 1new line below} w := AString[1] in [#10,#13,' ',#9]; s := ''; for i := 1 to Length(AString) do begin if w then { if not IsWhiteSpace(AString[i]) then } if not (AString[i] in [#10,#13,' ',#9]) then begin s := AString[i]; w := FALSE; end else else {if IsWhiteSpace(AString[i]) then } if (AString[i] in [#10,#13,' ',#9]) then begin Add(s); s := ''; w := TRUE; end else begin s := s + AString[i]; end; end; if s <> '' then Add(s); end; end; constructor TStringParserWithColon.Create(AString : string); var i : Integer; s : String; w : Boolean; begin inherited Create; {set the original string as item 0} Add(AString); {parse the string now} if AString <> '' then begin w := AString[1] in [#10,#13,' ',#9]; s := ''; for i := 1 to Length(AString) do begin if w then if not (AString[i] in [#10,#13,' ',#9]) then begin s := AString[i]; w := FALSE; end else else if (AString[i] in [#10,#13,' ',#9]) then begin Add(s); s := ''; w := TRUE; end else begin s := s + AString[i]; if Astring[i] = ':' then if i + 1 < Length(AString) then if not (AString[i+1] in [#10,#13,' ',#9]) then begin Add(s); s := ''; end; end; end; if s <> '' then Add(s); end; end; {Initialization part} begin end.
{ * ------------------------------------------------------------------------ * ♥ * ♥ VCL Command component/class with a factory * ♥ * Components: TCommand, TCommandAction * Classes: TCommandVclFactory * Project: https://github.com/bogdanpolak/command-delphi * Documentation: on the github site * ReleaseDate: ↓ see Signature below ↓ * ReleaseVersion: ↓ see Signature below ↓ * ------------------------------------------------------------------------ } unit Vcl.Pattern.Command; interface uses System.Classes, System.SysUtils, System.Actions, System.TypInfo, Vcl.ActnList; type ICommand = interface procedure Execute(); end; TCommand = class(TComponent, ICommand) const // * -------------------------------------------------------------------- // * Signature ReleaseDate = '2019.09.01'; ReleaseVersion = '0.3.1'; // * -------------------------------------------------------------------- strict private // FReceiver: TReceiver; strict protected // procedure Guard; - assert injections of all required properties procedure Guard; virtual; abstract; public procedure Execute; virtual; // call receiver method(s) or just do the job (merged command) // property Receiver: TReceiver read FReceiver set FReceiver; end; TPropertyInfo = record Kind: TTypeKind; PropertyName: string; ClassName: string; end; TClassPropertyList = class private FPropList: PPropList; FCount: Integer; public constructor Create(c: TComponent); destructor Destroy; override; function Count: Integer; function GetInfo(AIndex: Integer): TPropertyInfo; end; TCommandVclFactory = class(TComponent) private class procedure InjectProperties(ACommand: TCommand; const Injections: array of const); public class function CreateCommand<T: TCommand>(AOwner: TComponent; const Injections: array of const): T; class procedure ExecuteCommand<T: TCommand>(const Injections : array of const); class function CreateCommandAction<T: TCommand>(AOwner: TComponent; const ACaption: string; const Injections: array of const): TAction; end; TCommandAction = class(TAction) strict private FCommand: TCommand; procedure OnExecuteEvent(Sender: TObject); public constructor Create(AOwner: TComponent); override; property Command: TCommand read FCommand write FCommand; end; type TCommandClass = class of TCommand; implementation // ------------------------------------------------------------------------ { TCommand } procedure TCommand.Execute; begin Guard; end; // ------------------------------------------------------------------------ { TCommandAction } constructor TCommandAction.Create(AOwner: TComponent); begin inherited; Self.OnExecute := OnExecuteEvent; end; procedure TCommandAction.OnExecuteEvent(Sender: TObject); begin Assert(Command <> nil); FCommand.Execute; end; // ------------------------------------------------------------------------ { TActionFactory } class procedure TCommandVclFactory.InjectProperties(ACommand: TCommand; const Injections: array of const); var i: Integer; j: Integer; PropertyList: TClassPropertyList; propInfo: TPropertyInfo; UsedInjection: TArray<boolean>; begin // Inject dependencies to the command. // Limitations of this version: // * only TObject and descendants injections is supported // * important is properties order in the command class and // .. in the Injections array (should be the same) // -------------------------------- PropertyList := TClassPropertyList.Create(ACommand); SetLength(UsedInjection, Length(Injections)); try for i := 0 to PropertyList.Count - 1 do begin propInfo := PropertyList.GetInfo(i); if propInfo.Kind = tkClass then begin for j := 0 to High(Injections) do if not(UsedInjection[j]) then begin if (Injections[j].VType = vtObject) then begin if Injections[j].VObject.ClassName = propInfo.ClassName then begin SetObjectProp(ACommand, propInfo.PropertyName, Injections[j].VObject); UsedInjection[j] := True; Break; end; end else Assert(False, 'Not supported yet! Only objects can be injected to a command'); end; end; end; finally PropertyList.Free; end; end; class function TCommandVclFactory.CreateCommand<T>(AOwner: TComponent; const Injections: array of const): T; var AClass: TCommandClass; begin // ----------------------------------------- AClass := T; Result := T(AClass.Create(AOwner)); // 10.3 Rio: just one line: Result := T.Create(AOwner); // ----------------------------------------- InjectProperties(Result, Injections); end; class procedure TCommandVclFactory.ExecuteCommand<T>(const Injections : array of const); var AClass: TCommandClass; Command: T; begin try // ----------------------------------------- AClass := T; Command := T(AClass.Create(nil)); // 10.3 Rio: Command := T.Create(nil); // ----------------------------------------- InjectProperties(Command, Injections); Command.Execute; finally Command.Free; end; end; class function TCommandVclFactory.CreateCommandAction<T>(AOwner: TComponent; const ACaption: string; const Injections: array of const): TAction; var act: TCommandAction; AClass: TCommandClass; begin act := TCommandAction.Create(AOwner); with act do begin // ----------------------------------------- AClass := (T); Command := T(AClass.Create(act)); // 10.3 Rio: Command := T.Create(act); // ----------------------------------------- Caption := ACaption; end; InjectProperties(act.Command, Injections); Result := act; end; // ------------------------------------------------------------------------ { TClassPropertyList } constructor TClassPropertyList.Create(c: TComponent); begin FCount := System.TypInfo.GetPropList(c, FPropList); end; destructor TClassPropertyList.Destroy; begin FreeMem(FPropList); inherited; end; function TClassPropertyList.Count: Integer; begin Result := FCount; end; function TClassPropertyList.GetInfo(AIndex: Integer): TPropertyInfo; begin System.Assert(AIndex < FCount); Result.Kind := FPropList^[AIndex].PropType^.Kind; Result.PropertyName := string(FPropList^[AIndex].Name); Result.ClassName := string(FPropList^[AIndex].PropType^.Name); end; end.
unit RegeditUnit; interface uses Windows, Registry, SysUtils; procedure InitOracle; implementation procedure InitOracle; var reg: Tregistry; begin reg := Tregistry.Create; try reg.RootKey := HKEY_LOCAL_MACHINE; reg.CreateKey('\SOFTWARE\ORACLE'); reg.CreateKey('\SOFTWARE\ORACLE\HOME0'); reg.CreateKey('\SOFTWARE\ORACLE\ALL_HOMES'); reg.CreateKey('\SOFTWARE\ORACLE\ALL_HOMES\ID0'); reg.OpenKey('\SOFTWARE\ORACLE\ALL_HOMES', true); reg.WriteString('DEFAULT_HOME', 'HOME0'); reg.WriteString('HOME_COUNTER', '1'); reg.WriteString('LAST_HOME', '0'); reg.CloseKey; reg.OpenKey('\SOFTWARE\ORACLE\ALL_HOMES\ID0', true); reg.WriteString('NAME', 'OraHomeLYMS'); reg.WriteString('NLS_LANG', 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK'); reg.WriteString('PATH', ExtractFileDir(PARAMSTR(0)) + '\oran;'+ExtractFileDir(PARAMSTR(0)) + '\oran\rdbms\mesg'); reg.CloseKey; reg.OpenKey('\SOFTWARE\ORACLE\HOME0', true); reg.WriteString('ID', '0'); reg.WriteString('NLS_LANG', 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK'); reg.WriteString('ORACLE_BUNDLE_NAME', 'Enterprise'); reg.WriteString('ORACLE_GROUP_NAME', 'Oracle - OraHomeLYMS'); reg.WriteString('ORACLE_HOME', ExtractFileDir(PARAMSTR(0)) + '\oran'); reg.WriteString('ORACLE_HOME_KEY', 'Software\ORACLE\HOME0'); reg.WriteString('ORACLE_HOME_NAME', 'OraHomeLYMS'); reg.WriteString('SQLPATH', ExtractFileDir(PARAMSTR(0)) + '\dbs'); reg.WriteString('NLSRTL33', ExtractFileDir(PARAMSTR(0)) + '\oran\ocommon\nls\ADMIN\DATA'); finally // ÊÍ·Å×ÊÔ´ reg.CloseKey; reg.Free; end; end; end.
unit uAbout; {******************************************************************************* * * * Название модуля : * * * * uAbout * * * * Назначение модуля : * * * * Cоздание информационного окна " О программе " * * * * Copyright © Год 2005, Автор: Найдёнов Е.А * * * *******************************************************************************} interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, uneTypes; type TfmAbout = class(TForm) imgAbout : TImage; sbxAbout : TScrollBox; bbtnAboutOK : TBitBtn; Label4 : TLabel; Label2 : TLabel; Label5 : TLabel; Label7 : TLabel; Label8 : TLabel; Label10 : TLabel; lblCreator : TLabel; lblVersion : TLabel; lblCompany : TLabel; lblAppTitle : TLabel; lblDateCreate : TLabel; lblNameProgram : TLabel; procedure FormClose (Sender: TObject; var Action: TCloseAction); end; procedure GetFmAbout ( const aFMParams: TRec_FMParams ); stdcall; exports GetFmAbout; implementation {$R *.dfm} procedure TfmAbout.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; procedure GetFmAbout ( const aFMParams: TRec_FMParams ); var fmAbout : TfmAbout; begin try fmAbout := TfmAbout.Create( aFMParams.Owner ); fmAbout.ShowModal; finally FreeAndNil( fmAbout ); end; end; end.
unit TpMoreControls; interface uses Classes, Graphics, ThTag, ThWebControl, TpControls; type TMyComponent = class(TTpGraphicControl) private FOnMyPhpEvent: TTpEvent; FMyTpProperty: string; protected procedure Paint; override; procedure Tag(inTag: TThTag); override; published property OnMyPhpEvent: TTpEvent read FOnMyPhpEvent write FOnMyPhpEvent; property Style; property MyTpProperty: string read FMyTpProperty write FMyTpProperty; end; procedure Register; implementation {$R MyTpComponentIcon.res} procedure Register; begin RegisterComponents('My', [ TMyComponent ]); end; procedure TMyComponent.Paint; begin inherited; ThPaintOutline(Canvas, AdjustedClientRect, clGreen, psDashDot); end; procedure TMyComponent.Tag(inTag: TThTag); begin inherited; with inTag do begin Add('tpname', Name); Add('tpclass', 'mycomp'); Add('tponmyphpevent', OnMyPhpEvent); end; end; end.
unit uFuncVB; interface uses SysUtils; function Replace(Expressao,Find,Replace : string): string; implementation function Replace(Expressao, Find, Replace : string) : string; {HPM: Substitui um caractere dentro da string} var n : integer; begin for n := 1 to length(Expressao) do begin if Copy(Expressao, n, 1) = Find then begin Delete(Expressao, n, 1); Insert(Replace, Expressao,n); end; end; Result := Expressao; end; end.
unit uImageViewer; interface uses System.Classes, System.SysUtils, Winapi.Windows, Vcl.Controls, Vcl.Graphics, Vcl.ComCtrls, Dmitry.Utils.System, Dmitry.Controls.LoadingSign, Dmitry.Controls.WebLink, ExplorerTypes, uMemory, uGOM, uTime, uIImageViewer, uImageViewerControl, uFaceDetection, uImageViewerThread, uThreadForm, uGUIDUtils, uTranslate, uInterfaces, uFormInterfaces, uExifInfo, uDBEntities, uSessionPasswords; type TImageViewerOption = (ivoInfo, ivoFaces); TImageViewerOptions = set of TImageViewerOption; type TImageViewer = class(TInterfacedObject, IImageViewer, IFaceResultForm) private FOwnerForm: TThreadForm; FTop: Integer; FLeft: Integer; FWidth: Integer; FHeight: Integer; FOwner: TWinControl; FImageSource: IImageSource; FImageControl: TImageViewerControl; FCurrentFile: string; FFiles: TMediaItemCollection; FIsWaiting: Boolean; FActiveThreadId: TGUID; FItem: TMediaItem; FOnBeginLoadingImage: TBeginLoadingImageEvent; FOnPersonsFoundOnImage: TPersonsFoundOnImageEvent; FOnUpdateButtonsState: TUpdateButtonsStateEvent; FImageViewerOptions: TImageViewerOptions; procedure Resize; procedure LoadFile(FileInfo: TMediaItem; NewImage: Boolean); procedure LoadImage(Sender: TObject; Item: TMediaItem; Width, Height: Integer); procedure NotifyButtonsUpdate; function IsDetectFacesEnabled: Boolean; public constructor Create; destructor Destroy; override; //IObjectSource Implementation function GetObject: TObject; //IObjectSource END procedure RefreshFaceDetestionState; procedure UpdateFaces(FileName: string; Faces: TFaceDetectionResult); procedure FinishDetectionFaces; procedure SetFaceDetectionControls(AWlFaceCount: TWebLink; ALsDetectingFaces: TLoadingSign; ATbrActions: TToolBar); procedure SelectPerson(PersonID: Integer); procedure ResetPersonSelection; procedure StartPersonSelection; procedure StopPersonSelection; procedure CheckFaceIndicatorVisibility; procedure UpdateAvatar(PersonID: Integer); procedure AttachTo(OwnerForm: TThreadForm; Control: TWinControl; X, Y: Integer); procedure LoadFiles(FileList: TMediaItemCollection); procedure LoadPreviousFile; procedure LoadNextFile; procedure ResizeTo(Width, Height: Integer); procedure SetOptions(Options: TImageViewerOptions); procedure SetStaticImage(Image: TBitmap; RealWidth, RealHeight: Integer; Rotation: Integer; ImageScale: Double; Exif: IExifInfo); procedure SetAnimatedImage(Image: TGraphic; RealWidth, RealHeight: Integer; Rotation: Integer; ImageScale: Double; Exif: IExifInfo); procedure FailedToLoadImage(ErrorMessage: string); procedure ZoomOut; procedure ZoomIn; procedure RotateCW; procedure RotateCCW; function GetWidth: Integer; function GetHeight: Integer; function GetTop: Integer; function GetLeft: Integer; function GetActiveThreadId: TGUID; function GetItem: TMediaItem; function GetDisplayBitmap: TBitmap; function GetCurentFile: string; function GetIsAnimatedImage: Boolean; function GetText: string; procedure SetText(Text: string); function GetShowInfo: Boolean; procedure SetShowInfo(Value: Boolean); procedure SetOnBeginLoadingImage(Event: TBeginLoadingImageEvent); function GetOnBeginLoadingImage: TBeginLoadingImageEvent; procedure SetOnRequestNextImage(Event: TNotifyEvent); function GetOnRequestNextImage: TNotifyEvent; procedure SetOnRequestPreviousImage(Event: TNotifyEvent); function GetOnRequestPreviousImage: TNotifyEvent; procedure SetOnDblClick(Event: TNotifyEvent); function GetOnDblClick: TNotifyEvent; procedure SetOnPersonsFoundOnImage(Event: TPersonsFoundOnImageEvent); function GetOnPersonsFoundOnImage: TPersonsFoundOnImageEvent; procedure SetOnStopPersonSelection(Event: TNotifyEvent); function GetOnStopPersonSelection: TNotifyEvent; procedure SetOnUpdateButtonsState(Event: TUpdateButtonsStateEvent); function GetOnUpdateButtonsState: TUpdateButtonsStateEvent; end; implementation { TImageViewer } procedure TImageViewer.AttachTo(OwnerForm: TThreadForm; Control: TWinControl; X, Y: Integer); begin if Control = nil then raise EArgumentNilException.Create('Control is null!'); FOwner := Control; FTop := Y; FLeft := X; FOwnerForm := OwnerForm; FOwnerForm.GetInterface(IImageSource, FImageSource); FImageControl := TImageViewerControl.Create(Control); FImageControl.ImageViewer := Self; FImageControl.Top := Y; FImageControl.Left := X; FImageControl.OnImageRequest := LoadImage; FImageControl.Parent := Control; if FOwnerForm is TCustomExplorerForm then FImageControl.Explorer := TCustomExplorerForm(FOwnerForm); inherited; end; procedure TImageViewer.CheckFaceIndicatorVisibility; begin FImageControl.CheckFaceIndicatorVisibility; end; constructor TImageViewer.Create; begin GOM.AddObj(Self); FFiles := nil; FImageSource := nil; FCurrentFile := ''; FIsWaiting := False; FActiveThreadId := GetEmptyGUID; FItem := TMediaItem.Create; FOnBeginLoadingImage := nil; FOnPersonsFoundOnImage := nil; FImageViewerOptions := [ivoInfo, ivoFaces]; end; destructor TImageViewer.Destroy; begin GOM.RemoveObj(Self); F(FItem); F(FFiles); end; procedure TImageViewer.FinishDetectionFaces; begin FImageControl.FinishDetectingFaces; end; function TImageViewer.GetActiveThreadId: TGUID; begin Result := FActiveThreadId; end; function TImageViewer.GetCurentFile: string; begin Result := FItem.FileName; end; function TImageViewer.GetDisplayBitmap: TBitmap; begin Result := FImageControl.FullImage; end; function TImageViewer.GetHeight: Integer; begin Result := FHeight; end; function TImageViewer.GetIsAnimatedImage: Boolean; begin Result := FImageControl.IsAnimatedImage; end; function TImageViewer.GetItem: TMediaItem; begin Result := FItem; end; function TImageViewer.GetLeft: Integer; begin Result := FLeft; end; {$REGION IObjectSource} function TImageViewer.GetObject: TObject; begin Result := Self; end; function TImageViewer.GetOnBeginLoadingImage: TBeginLoadingImageEvent; begin Result := FOnBeginLoadingImage; end; function TImageViewer.GetOnDblClick: TNotifyEvent; begin Result := FImageControl.OnDblClick; end; function TImageViewer.GetOnPersonsFoundOnImage: TPersonsFoundOnImageEvent; begin Result := FOnPersonsFoundOnImage; end; function TImageViewer.GetOnRequestNextImage: TNotifyEvent; begin Result := FImageControl.OnRequestNextImage; end; function TImageViewer.GetOnRequestPreviousImage: TNotifyEvent; begin Result := FImageControl.OnRequestPreviousImage; end; function TImageViewer.GetOnStopPersonSelection: TNotifyEvent; begin Result := FImageControl.OnStopPersonSelection; end; function TImageViewer.GetOnUpdateButtonsState: TUpdateButtonsStateEvent; begin Result := FOnUpdateButtonsState; end; function TImageViewer.GetShowInfo: Boolean; begin Result := FImageControl.ShowInfo; end; {$ENDREGION} function TImageViewer.GetText: string; begin Result := FImageControl.Text; end; function TImageViewer.GetTop: Integer; begin Result := FTop; end; function TImageViewer.GetWidth: Integer; begin Result := FWidth; end; function TImageViewer.IsDetectFacesEnabled: Boolean; begin Result := ivoFaces in FImageViewerOptions; end; procedure TImageViewer.LoadFile(FileInfo: TMediaItem; NewImage: Boolean); var Width, Height: Integer; Bitmap: TBitmap; begin FActiveThreadId := GetGUID; if FileInfo.Encrypted then begin if SessionPasswords.FindForFile(FileInfo.FileName) = '' then begin SetText(TA('File is encrypted', 'Explorer')); Exit; end; end; if FImageSource <> nil then begin Width := 0; Height := 0; Bitmap := TBitmap.Create; try TW.I.Start('LoadFile - GetImage'); if FImageSource.GetImage(FileInfo.FileName, Bitmap, Width, Height) then begin TW.I.Start('LoadFile - LoadStaticImage'); FImageControl.LoadStaticImage(FileInfo, Bitmap, Width, Height, FileInfo.Rotation, 1, nil); Bitmap := nil; end; finally F(Bitmap); end; end; F(FItem); FItem := FileInfo.Copy; if Assigned(FOnBeginLoadingImage) then FOnBeginLoadingImage(Self, NewImage); TW.I.Start('LoadFile - StartLoadingImage'); FImageControl.StartLoadingImage; LoadImage(Self, FileInfo, FWidth, FHeight); end; procedure TImageViewer.LoadFiles(FileList: TMediaItemCollection); var I, Position: Integer; TheSameFileList: Boolean; begin TheSameFileList := (FFiles <> nil) and (FFiles.Count = FileList.Count) and (FImageControl.Text = ''); if TheSameFileList then begin for I := 0 to FFiles.Count - 1 do begin if AnsiLowerCase(FFiles[I].FileName) <> AnsiLowerCase(FileList[I].FileName) then begin TheSameFileList := False; Break; end; end; if TheSameFileList then TheSameFileList := FFiles.Position = FileList.Position; end; F(FFiles); FFiles := FileList; if not TheSameFileList then begin Position := FFiles.Position; if Position > -1 then LoadFile(FFiles[Position], True); end else begin F(FItem); FItem := FFiles[FFiles.Position].Copy; FImageControl.UpdateItemInfo(FItem); if Assigned (FOnBeginLoadingImage) then FOnBeginLoadingImage(Self, False); end; end; procedure TImageViewer.LoadImage(Sender: TObject; Item: TMediaItem; Width, Height: Integer); var DisplaySize: TSize; begin DisplaySize.cx := Width; DisplaySize.cy := Height; TImageViewerThread.Create(FOwnerForm, Self, FActiveThreadId, Item, DisplaySize, True, -1, IsDetectFacesEnabled); end; procedure TImageViewer.LoadNextFile; begin if FFiles = nil then Exit; FFiles.NextSelected; if FFiles.Position > -1 then LoadFile(FFiles[FFiles.Position], True); end; procedure TImageViewer.LoadPreviousFile; begin if FFiles = nil then Exit; FFiles.PrevSelected; if FFiles.Position > -1 then LoadFile(FFiles[FFiles.Position], True); end; procedure TImageViewer.NotifyButtonsUpdate; var Buttons: TButtonStates; begin if not Assigned(FOnUpdateButtonsState) then Exit; Buttons := TButtonStates.Create; try if FImageControl.Text = '' then begin Buttons[ivbRating].AddState(ivbsVisible).AddState(ivbsEnabled); Buttons[ivbRotateCW].AddState(ivbsVisible).AddState(ivbsEnabled); Buttons[ivbRotateCCW].AddState(ivbsVisible).AddState(ivbsEnabled); Buttons[ivbInfo].AddState(ivbsVisible).AddState(ivbsEnabled); if FImageControl.ShowInfo then Buttons[ivbInfo].AddState(ivbsDown); end; Buttons[ivbPrevious].AddState(ivbsVisible).AddState(ivbsEnabled); Buttons[ivbNext].AddState(ivbsVisible).AddState(ivbsEnabled); FOnUpdateButtonsState(Self, Buttons); finally F(Buttons); end; end; procedure TImageViewer.ResetPersonSelection; begin FImageControl.HightliteReset; end; procedure TImageViewer.Resize; begin //TODO: end; procedure TImageViewer.ResizeTo(Width, Height: Integer); begin FWidth := Width; FHeight := Height; FImageControl.Width := Width; FImageControl.Height := Height; Resize; end; procedure TImageViewer.RotateCCW; begin FImageControl.RotateCCW; end; procedure TImageViewer.RotateCW; begin FImageControl.RotateCW; end; procedure TImageViewer.SelectPerson(PersonID: Integer); begin FImageControl.HightlitePerson(PersonID); end; procedure TImageViewer.FailedToLoadImage(ErrorMessage: string); begin FImageControl.FailedToLoadImage(ErrorMessage); NotifyButtonsUpdate; end; procedure TImageViewer.SetFaceDetectionControls(AWlFaceCount: TWebLink; ALsDetectingFaces: TLoadingSign; ATbrActions: TToolBar); begin FImageControl.SetFaceDetectionControls(AWlFaceCount, ALsDetectingFaces, ATbrActions); end; procedure TImageViewer.SetOnBeginLoadingImage(Event: TBeginLoadingImageEvent); begin FOnBeginLoadingImage := Event; end; procedure TImageViewer.SetOnDblClick(Event: TNotifyEvent); begin FImageControl.OnDblClick := Event; end; procedure TImageViewer.SetOnPersonsFoundOnImage(Event: TPersonsFoundOnImageEvent); begin FOnPersonsFoundOnImage := Event; end; procedure TImageViewer.SetOnRequestNextImage(Event: TNotifyEvent); begin FImageControl.OnRequestNextImage := Event; end; procedure TImageViewer.SetOnRequestPreviousImage(Event: TNotifyEvent); begin FImageControl.OnRequestPreviousImage := Event; end; procedure TImageViewer.SetOnStopPersonSelection(Event: TNotifyEvent); begin FImageControl.OnStopPersonSelection := Event; end; procedure TImageViewer.SetOnUpdateButtonsState(Event: TUpdateButtonsStateEvent); begin FOnUpdateButtonsState := Event; end; procedure TImageViewer.SetOptions(Options: TImageViewerOptions); begin FImageViewerOptions := Options; FImageControl.ShowInfo := ivoInfo in Options; FImageControl.DetectFaces := ivoFaces in Options; end; procedure TImageViewer.SetShowInfo(Value: Boolean); begin FImageControl.ShowInfo := Value; end; procedure TImageViewer.SetStaticImage(Image: TBitmap; RealWidth, RealHeight: Integer; Rotation: Integer; ImageScale: Double; Exif: IExifInfo); begin if FFiles.Position < 0 then Exit; if FFiles.Position > FFiles.Count - 1 then Exit; FImageControl.LoadStaticImage(FFiles[FFiles.Position], Image, RealWidth, RealHeight, Rotation, ImageScale, Exif); NotifyButtonsUpdate; end; procedure TImageViewer.SetAnimatedImage(Image: TGraphic; RealWidth, RealHeight: Integer; Rotation: Integer; ImageScale: Double; Exif: IExifInfo); begin if FFiles.Position < 0 then Exit; if FFiles.Position > FFiles.Count - 1 then Exit; FImageControl.LoadAnimatedImage(FFiles[FFiles.Position], Image, RealWidth, RealHeight, Rotation, ImageScale, Exif); NotifyButtonsUpdate; if Assigned(FOnPersonsFoundOnImage) then FOnPersonsFoundOnImage(Self, '', nil); end; procedure TImageViewer.SetText(Text: string); begin FActiveThreadId := GetGUID; FImageControl.SetText(Text); NotifyButtonsUpdate; end; procedure TImageViewer.StartPersonSelection; begin FImageControl.StartPersonSelection; end; procedure TImageViewer.StopPersonSelection; begin FImageControl.StopPersonSelection; end; procedure TImageViewer.RefreshFaceDetestionState; begin end; procedure TImageViewer.UpdateAvatar(PersonID: Integer); begin FImageControl.UpdateAvatar(PersonID); end; procedure TImageViewer.UpdateFaces(FileName: string; Faces: TFaceDetectionResult); begin if AnsiLowerCase(FItem.FileName) <> AnsiLowerCase(FileName) then Exit; FImageControl.UpdateFaces(FileName, Faces); if Assigned(FOnPersonsFoundOnImage) then FOnPersonsFoundOnImage(Self, FileName, Faces); end; procedure TImageViewer.ZoomIn; begin FImageControl.ZoomIn; end; procedure TImageViewer.ZoomOut; begin FImageControl.ZoomOut; end; end.
// RemObjects CS to Pascal 0.1 namespace UT3Bots.UTItems; interface uses System, System.Collections.Generic, System.Linq, System.Text; type UTPoint = public class(UTObject) protected var _isReachable: Boolean; assembly //Constructor constructor(Id: UTIdentifier; Location: UTVector; IsReachable: Boolean); /// <summary> /// True if the bot can run straight to this point, False if there is something in the way /// </summary> public property IsReachable: Boolean read get_IsReachable; method get_IsReachable: Boolean; end; implementation constructor UTPoint(Id: UTIdentifier; Location: UTVector; IsReachable: Boolean); begin inherited constructor(Id, Location); Self._isReachable := IsReachable end; method UTPoint.get_IsReachable: Boolean; begin Result := Self._isReachable end; end.
PROGRAM Compute_Paths (input, output) ; CONST MAXINT = 65535 ; (* Local definition of MAXINT *) MaxSize = 20 ; (* Maximum size of ComputedPaths Array *) VAR CallCount1, CallCount2 : Integer ; Overflow1, Overflow2 : Boolean ; TotalPaths1, TotalPaths2: Integer ; ComputedPaths : ARRAY [1..MaxSize, 1.. MaxSize] OF Integer ; N : Integer ; Quit : Boolean ; FUNCTION NumPaths1(Row, Column, N : Integer) : Integer ; FUNCTION Paths1(Row, Column, N : Integer) : Integer ; VAR TopPaths, RightPaths : Integer ; BEGIN IF (MAXINT = CallCount1) THEN BEGIN Paths1 := MAXINT ; Overflow1 := true ; END ELSE BEGIN CallCount1 := CallCount1 + 1 ; IF ((Row = N) OR (Column = N)) THEN Paths1 := 1 ELSE BEGIN TopPaths := Paths1(Row + 1, Column, N) ; IF (NOT Overflow1) THEN BEGIN RightPaths := Paths1(Row, Column + 1, N) ; IF (NOT Overflow1) THEN Paths1 := TopPaths + RightPaths ELSE Paths1 := MAXINT ; END ELSE Paths1 := MAXINT ; END ; END ; END ; BEGIN CallCount1 := 0 ; Overflow1 := false ; NumPaths1 := Paths1(Row, Column, N) ; END ; FUNCTION NumPaths2(Row, Column, N : Integer) : Integer ; VAR i, j : Integer ; FUNCTION Paths2(Row, Column, N : Integer) : Integer ; VAR TopPaths, RightPaths : Integer ; BEGIN CallCount2 := CallCount2 + 1 ; IF (ComputedPaths[Row, Column] <> 0) THEN Paths2 := ComputedPaths[Row, Column] ELSE BEGIN TopPaths := Paths2(Row + 1, Column, N) ; IF (NOT Overflow2) THEN BEGIN RightPaths := Paths2(Row, Column + 1, N) ; IF (NOT Overflow2) THEN BEGIN IF (MAXINT - TopPaths < RightPaths) THEN BEGIN Overflow2 := true ; Paths2 := MAXINT ; END ELSE BEGIN ComputedPaths[Row, Column] := TopPaths + RightPaths ; ComputedPaths[Column, Row] := ComputedPaths[Row, Column] ; Paths2 := ComputedPaths[Row, Column] ; END END ELSE Paths2 := MAXINT ; END ; END ; END ; BEGIN CallCount2 := 0 ; Overflow2 := false ; FOR i := 1 TO N DO FOR j := 1 TO N DO IF ((i = N) OR (j = N)) THEN ComputedPaths[i, j] := 1 ELSE ComputedPaths[i, j] := 0 ; NumPaths2 := Paths2(Row, Column, N) ; END ; BEGIN (* Main program *) Quit := false ; WHILE (NOT Quit) DO BEGIN write ('Value of N ? ') ; readln (N) ; IF (N <> 0) THEN BEGIN IF (N <= 20) THEN BEGIN TotalPaths1 := NumPaths1(1, 1, N) ; TotalPaths2 := NumPaths2(1, 1, N) ; IF (NOT Overflow1) THEN writeln ('NumPaths1 = ', TotalPaths1, ' CallCount1 = ', CallCount1) ELSE writeln ('NumPaths1 : CallCount1 exceeded MAXINT') ; IF (NOT Overflow2) THEN writeln ('NumPaths2 = ', TotalPaths2, ' CallCount2 = ', CallCount2) ELSE writeln ('NumPaths2 : NumPaths2 exceeded MAXINT') ; writeln ; writeln ; END ELSE writeln ('N is too big!') ; END ELSE Quit := true ; END ; writeln ; writeln ('AA') ; END.
unit uReminderForm; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, uFControl, uLabeledFControl, uDateControl, FIBQuery, pFIBQuery, FIBDatabase, pFIBDatabase, uBoolControl, uEnumControl, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, cxLabel, DB, FIBDataSet, pFIBDataSet; type TReminderForm = class(TForm) CancelButton: TBitBtn; OkButton: TBitBtn; qFEC_Range: TqFEnumControl; qFBC_Child: TqFBoolControl; qFBC_WC: TqFBoolControl; qFBC_Inval: TqFBoolControl; qFBC_Pension: TqFBoolControl; qFBC_All: TqFBoolControl; qFBC_HospList: TqFBoolControl; DateBeg: TcxDateEdit; DateEnd: TcxDateEdit; cxLabB: TcxLabel; cxLabE: TcxLabel; DB: TpFIBDatabase; DataSet: TpFIBDataSet; Trans: TpFIBTransaction; procedure OkButtonClick(Sender: TObject); procedure CancelButtonClick(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure qFBC_HospListChange(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var ReminderForm: TReminderForm; implementation {$R *.dfm} uses SpCommon, SpFormUnit, qFTools; procedure TReminderForm.OkButtonClick(Sender: TObject); var form: TSpForm; PropParams: TSpParams; begin if VarIsNull(qFEC_Range.Value) and (qFBC_HospList.Value<>-1) then begin MessageDlg('Помилка: необхідно обрати період! ',mtError,[mbYes],0); ModalResult:=0; Exit; end; try if qFBC_Child.Value=-1 then begin form := TSpForm.Create(Self); PropParams := TSpParams.Create; with PropParams do begin Table := 'ASUP_REMINDER_HOLIDAY('+IntToStr(qFEC_Range.Value)+')'; Title := 'Кінець відпустки по догляду за дитиною'; IdField := 'TN'; SpFields := 'FIO, TN, Date_End'; ColumnNames := 'ФИО, ТН, Дата'; SpMode := [spfExt]; end; form.Init(PropParams); form.ShowModal; form.Free; PropParams.Free; end; if qFBC_HospList.Value=-1 then begin if (DateBeg.Date>DateEnd.Date) then begin MessageDlg('Помилка: Дата початку не має бути більше ніж дата кінця! ',mtError,[mbYes],0); Exit; end else begin form := TSpForm.Create(Self); PropParams := TSpParams.Create; with PropParams do begin Table := 'ASUP_REM_HOSP('''+DateToStr(DateBeg.Date)+''','''+DateToStr(DateEnd.Date)+''')'; Title := 'Кінець лікарняних листів'; IdField := 'TN'; SpFields := 'FIO, TN, DATE_END'; ColumnNames := 'ФИО, ТН, Дата'; SpMode := [spfExt]; end; form.Init(PropParams); form.ShowModal; form.Free; PropParams.Free; end; end; if qFBC_WC.Value=-1 then begin form := TSpForm.Create(Self); PropParams := TSpParams.Create; with PropParams do begin Table := 'ASUP_REMINDER_WC('+IntToStr(qFEC_Range.Value)+')'; Title := 'Кінець трудової угоди'; IdField := 'TN'; SpFields := 'FIO, TN, Date_End'; ColumnNames := 'ФИО, ТН, Дата'; SpMode := [spfExt]; end; form.Init(PropParams); form.ShowModal; form.Free; PropParams.Free; end; if qFBC_Inval.Value=-1 then begin form := TSpForm.Create(Self); PropParams := TSpParams.Create; with PropParams do begin Table := 'ASUP_REMINDER_INVAL('+IntToStr(qFEC_Range.Value)+')'; Title := 'Кінець строку інвалідності'; IdField := 'TN'; SpFields := 'FIO, TN, Date_End'; ColumnNames := 'ФИО, ТН, Дата'; SpMode := [spfExt]; end; form.Init(PropParams); form.ShowModal; form.Free; PropParams.Free; end; if qFBC_Pension.Value=-1 then begin form := TSpForm.Create(Self); PropParams := TSpParams.Create; with PropParams do begin Table := 'ASUP_REMINDER_PENSION('+IntToStr(qFEC_Range.Value)+')'; Title := 'Дата настання пенсії за віком'; IdField := 'TN'; SpFields := 'FIO, TN, Date_End'; ColumnNames := 'ФИО, ТН, Дата'; SpMode := [spfExt]; end; form.Init(PropParams); form.ShowModal; form.Free; PropParams.Free; end; // ShowMessage(IntToStr(qFBC_All.Value)); if qFBC_All.Value=-1 then begin form := TSpForm.Create(Self); PropParams := TSpParams.Create; with PropParams do begin Table := 'ASUP_REMINDER_ALL('+IntToStr(qFEC_Range.Value)+')'; Title := 'Перевірка закінчення строків'; IdField := 'TN'; SpFields := 'FIO, TN, Date_End, Name'; ColumnNames := 'ФИО, ТН, Дата, Назва строку'; SpMode := [spfExt]; end; form.Init(PropParams); form.ShowModal; form.Free; PropParams.Free; end; ModalResult := 0; except on e: Exception do begin MessageDlg('Помилка: '+e.Message,mtError,[mbYes],0); ModalResult := 0; end; end; end; procedure TReminderForm.CancelButtonClick(Sender: TObject); begin ModalResult:=mrCancel; end; procedure TReminderForm.FormClose(Sender: TObject; var Action: TCloseAction); begin qFAutoSaveIntoRegistry(Self, nil); end; procedure TReminderForm.FormShow(Sender: TObject); begin qFAutoLoadFromRegistry(Self, nil); end; procedure TReminderForm.qFBC_HospListChange(Sender: TObject); begin if qFBC_HospList.Value=-1 then begin DateBeg.Enabled:=True; DateEnd.Enabled:=True; qFEC_Range.Enabled:=False; end else begin DateBeg.Enabled:=False; DateEnd.Enabled:=False; qFEC_Range.Enabled:=True; end end; procedure TReminderForm.FormCreate(Sender: TObject); begin DateBeg.Enabled:=false; DateEnd.Enabled:=false; DateBeg.Date:=Date; DateEnd.Date:=Date; if qFBC_HospList.Value=-1 then begin DateBeg.Enabled:=True; DateEnd.Enabled:=True; qFEC_Range.Enabled:=False; end else begin DateBeg.Enabled:=False; DateEnd.Enabled:=False; qFEC_Range.Enabled:=True; end end; end.
unit Adapter.MySQL; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ interface uses SysUtils, ZConnection, ZDataset, Cache.Root, Ils.Logger, Ils.Utils; //------------------------------------------------------------------------------ const //------------------------------------------------------------------------------ //! параметры запросов в БД //------------------------------------------------------------------------------ CSQLParamFromDT = 'dt_from'; CSQLParamToDT = 'dt_to'; CSQLParamDT = 'dt'; //------------------------------------------------------------------------------ type TCacheAdapterMySQL = class abstract(TCacheDataAdapterAbstract) protected FReadConnection: TZConnection; FWriteConnection: TZConnection; FInsertQry: TZQuery; FUpdateQry: TZQuery; FReadBeforeQry: TZQuery; FReadAfterQry: TZQuery; FReadRangeQry: TZQuery; FDeleteOneQry: TZQuery; //! заполнить дополнительные параметры из ключа procedure FillParamsFromKey( const AKey: TConnKey; const RQuery: TZQuery ); //! создать объект из данных БД function MakeObjFromReadQuery( const AQuery: TZQuery ): TCacheDataObjectAbstract; virtual; abstract; public constructor Create( const AReadConnection: TZConnection; const AWriteConnection: TZConnection; const AReqInsert: string; const AReqUpdate: string; const AReqReadBefore: string; const AReqReadAfter: string; const AReqReadRange: string; const AReqDeleteOne: string ); destructor Destroy(); override; //! procedure LoadRange( const ACache: TCache; const AFrom: TDateTime; const ATo: TDateTime; var RObjects: TCacheDataObjectAbstractArray ); override; //! function GetDTBefore( const ACache: TCache; const ADT: TDateTime ): TDateTime; override; //! function GetDTAfter( const ACache: TCache; const ADT: TDateTime ): TDateTime; override; //! procedure Delete( const ACache: TCache; const AObj: TCacheDataObjectAbstract ); override; end; //------------------------------------------------------------------------------ implementation //------------------------------------------------------------------------------ // TCacheAdapterMySQL //------------------------------------------------------------------------------ constructor TCacheAdapterMySQL.Create( const AReadConnection: TZConnection; const AWriteConnection: TZConnection; const AReqInsert: string; const AReqUpdate: string; const AReqReadBefore: string; const AReqReadAfter: string; const AReqReadRange: string; const AReqDeleteOne: string ); begin inherited Create(); // FReadConnection := AReadConnection; FWriteConnection := AWriteConnection; // FInsertQry := TZQuery.Create(nil); FInsertQry.Connection := AWriteConnection; FInsertQry.SQL.Text := AReqInsert; FUpdateQry := TZQuery.Create(nil); FUpdateQry.Connection := AWriteConnection; FUpdateQry.SQL.Text := AReqUpdate; FReadBeforeQry := TZQuery.Create(nil); FReadBeforeQry.Connection := AReadConnection; FReadBeforeQry.SQL.Text := AReqReadBefore; FReadAfterQry := TZQuery.Create(nil); FReadAfterQry.Connection := AReadConnection; FReadAfterQry.SQL.Text := AReqReadAfter; FReadRangeQry := TZQuery.Create(nil); FReadRangeQry.Connection := AReadConnection; FReadRangeQry.SQL.Text := AReqReadRange; FDeleteOneQry := TZQuery.Create(nil); FDeleteOneQry.Connection := AWriteConnection; FDeleteOneQry.SQL.Text := AReqDeleteOne; end; destructor TCacheAdapterMySQL.Destroy(); begin FInsertQry.Free(); FUpdateQry.Free(); FReadBeforeQry.Free(); FReadAfterQry.Free(); FReadRangeQry.Free(); FDeleteOneQry.Free(); // inherited Destroy(); end; procedure TCacheAdapterMySQL.LoadRange( const ACache: TCache; const AFrom: TDateTime; const ATo: TDateTime; var RObjects: TCacheDataObjectAbstractArray ); var I: Integer; //------------------------------------------------------------------------------ begin FillParamsFromKey(ACache.Key, FReadRangeQry); FReadRangeQry.ParamByName(CSQLParamFromDT).AsDateTime := AFrom; FReadRangeQry.ParamByName(CSQLParamToDT).AsDateTime := ATo; FReadRangeQry.Active := True; try try I := 0; FReadRangeQry.FetchAll(); SetLength(RObjects, FReadRangeQry.RecordCount); FReadRangeQry.First(); while not FReadRangeQry.Eof do begin RObjects[I] := MakeObjFromReadQuery(FReadRangeQry); Inc(I); FReadRangeQry.Next(); end; finally FReadRangeQry.Active := False; end; except for I := Low(RObjects) to High(RObjects) do begin RObjects[I].Free(); end; raise; end; end; function TCacheAdapterMySQL.GetDTBefore( const ACache: TCache; const ADT: TDateTime ): TDateTime; begin FillParamsFromKey(ACache.Key, FReadBeforeQry); FReadBeforeQry.ParamByName(CSQLParamDT).AsDateTime := ADT; FReadBeforeQry.Active := True; FReadBeforeQry.FetchAll; try if (FReadBeforeQry.RecordCount <> 0) and (not FReadBeforeQry.FieldByName(CSQLParamDT).IsNull) then Result := FReadBeforeQry.FieldByName(CSQLParamDT).AsDateTime else // begin // ToLog(ClassName + ' ' + ACache.Key['imei'] + ' Before ' + DateTimeToIls(ADT)); Result := 0; // end; finally FReadBeforeQry.Active := False; end; end; function TCacheAdapterMySQL.GetDTAfter( const ACache: TCache; const ADT: TDateTime ): TDateTime; begin FillParamsFromKey(ACache.Key, FReadAfterQry); FReadAfterQry.ParamByName(CSQLParamDT).AsDateTime := ADT; FReadAfterQry.Active := True; FReadAfterQry.FetchAll; try if (FReadAfterQry.RecordCount <> 0) and (not FReadAfterQry.FieldByName(CSQLParamDT).IsNull) then Result := FReadAfterQry.FieldByName(CSQLParamDT).AsDateTime else // begin // ToLog(ClassName + ' ' + ACache.Key['imei'] + ' After ' + DateTimeToIls(ADT)); Result := 0; // end; finally FReadAfterQry.Active := False; end; end; procedure TCacheAdapterMySQL.Delete( const ACache: TCache; const AObj: TCacheDataObjectAbstract ); begin FillParamsFromKey(ACache.Key, FDeleteOneQry); FDeleteOneQry.ParamByName(CSQLParamDT).AsDateTime := AObj.DTMark; FDeleteOneQry.ExecSQL(); end; procedure TCacheAdapterMySQL.FillParamsFromKey( const AKey: TConnKey; const RQuery: TZQuery ); var Iter: TConnKeyPair; //------------------------------------------------------------------------------ begin for Iter in AKey do begin RQuery.ParamByName(Iter.Key).AsString := Iter.Value; end; end; end.
{ ------------------------------------------------------------------------------- Unit Name: cGLgridimportfn ------------------------------------------------------------------------------- } unit cGLGridImportFn; interface uses System.Classes, System.SysUtils, {GraphicEx,} Vcl.Graphics, Vcl.Dialogs, Vcl.ExtDlgs, Vcl.Forms, Vcl.Controls, GLGraph, GLVectorGeometry, GLObjects, GLTexture, GLVectorTypes, GLColor, GLMaterial, GLState, // glData cGridImportFn, cUsersSettings, frmSurferImport; type TGLContourGridData = class(TContourGridData) private fAlpha: double; fBaseMapPath: string; fEnableBaseMap: boolean; fDummyCube: TGLDummyCube; fExactBlankSub: boolean; fGrid: TGLHeightField; fGridName: string; fGridOptions: TGridOptions; fOpenTexture: TOpenPictureDialog; fScaleX: double; fScaleY: double; fScaleZ: double; fTileX: integer; fTileY: integer; protected function GetColourMode: integer; procedure SetColourMode(iMode: integer); function GetPolyGonMode: integer; procedure SetPolygonMode(iMode: integer); function GetTriangleCount: integer; function GetVisible: boolean; function GetTwoSided: boolean; procedure SetTwoSided(bTwoSided: boolean); procedure Render(const x, y: Single; var z: Single; var color: TColorVector; var texPoint: TTexPoint); procedure SetVisible(bVisible: boolean); procedure SetAlpha(dAlpha: double); procedure SetScaleX(dScale: double); procedure SetScaleY(dScale: double); procedure SetScaleZ(dScale: double); procedure SetTileX(iTile: integer); procedure SetTileY(iTile: integer); procedure SetBaseMapPath(sBaseMapPath: string); procedure SetEnableBaseMap(bEnableBaseMap: boolean); public constructor Create(aDummyCube: TGLDummyCube); destructor Destroy; override; procedure ConstructGrid; // 0 = surfer, 1 = arcinfo // blank sub is here to allow grids to be (reloaded).... procedure Import(sFileName: TFileName; dBlankSub: double; iType: integer; var bOK: boolean); procedure SilentImport(sFileName: string; dBlankSub: double; iType: integer; var bOK: boolean); property Alpha: double read fAlpha write SetAlpha; property BaseMapPath: string read fBaseMapPath write SetBaseMapPath; property EnableBaseMap: boolean read fEnableBaseMap write SetEnableBaseMap; property DummyCube: TGLDummyCube read fDummyCube write fDummyCube; property ExactBlankSub: boolean read fExactBlankSub write fExactBlankSub; property Grid: TGLHeightField read fGrid write fGrid; property GridName: string read fGridName write fGridName; property GridOptions: TGridOptions read fGridOptions write fGridOptions; property OpenTexture: TOpenPictureDialog read fOpenTexture write fOpenTexture; property ColourMode: integer read GetColourMode write SetColourMode; property PolygonMode: integer read GetPolyGonMode write SetPolygonMode; property TriangleCount: integer read GetTriangleCount; property Visible: boolean read GetVisible write SetVisible; property ScaleX: double read fScaleX write SetScaleX; property ScaleY: double read fScaleY write SetScaleY; property ScaleZ: double read fScaleZ write SetScaleZ; property TileX: integer read fTileX write SetTileX; property TileY: integer read fTileY write SetTileY; property TwoSided: boolean read GetTwoSided write SetTwoSided; end; implementation // ----- TGLContourGridData.SetBaseMapPath ------------------------------------- procedure TGLContourGridData.SetBaseMapPath(sBaseMapPath: string); begin if (fBaseMapPath <> sBaseMapPath) then begin fBaseMapPath := sBaseMapPath; if FileExists(fBaseMapPath) then begin Grid.Material.Texture.Image.LoadFromFile(fBaseMapPath); Grid.StructureChanged; end else EnableBaseMap := false; end; end; // ----- TGLContourGridData.SetEnableBaseMap ----------------------------------- procedure TGLContourGridData.SetEnableBaseMap(bEnableBaseMap: boolean); begin fEnableBaseMap := bEnableBaseMap; Grid.Material.Texture.Disabled := not fEnableBaseMap; if fEnableBaseMap then Grid.Options := Grid.Options + [hfoTextureCoordinates] else Grid.Options := Grid.Options - [hfoTextureCoordinates]; end; // ----- TGLContourGridData.SetScaleX ------------------------------------------ procedure TGLContourGridData.SetScaleX(dScale: double); begin fScaleX := dScale; Grid.Scale.x := dScale; Grid.Position.x := xlo * dScale; end; // ----- TGLContourGridData.SetScaley ------------------------------------------ procedure TGLContourGridData.SetScaleY(dScale: double); begin fScaleY := dScale; Grid.Scale.y := dScale; Grid.Position.y := ylo * dScale; end; // ----- TGLContourGridData.SetScalez ------------------------------------------ procedure TGLContourGridData.SetScaleZ(dScale: double); begin fScaleZ := dScale; Grid.Scale.z := dScale; Grid.Position.z := zlo * dScale; end; // ----- TGLContourGridData.SetTileX ------------------------------------------- procedure TGLContourGridData.SetTileX(iTile: integer); begin fTileX := iTile; Grid.StructureChanged; end; // ----- TGLContourGridData.SetTileY ------------------------------------------- procedure TGLContourGridData.SetTileY(iTile: integer); begin fTileY := iTile; Grid.StructureChanged; end; // ----- TGLContourGridData.GetTwoSided ---------------------------------------- function TGLContourGridData.GetTwoSided: boolean; begin result := (hfoTwoSided in Grid.Options); end; // ----- TGLContourGridData.SetTwoSided ---------------------------------------- procedure TGLContourGridData.SetTwoSided(bTwoSided: boolean); begin if bTwoSided then Grid.Options := Grid.Options + [hfoTwoSided] else Grid.Options := Grid.Options - [hfoTwoSided]; Grid.StructureChanged; end; // ----- TGLContourGridData.GetColourMode -------------------------------------- function TGLContourGridData.GetColourMode: integer; begin if (Grid.ColorMode = hfcmAmbient) then result := 0 else if (Grid.ColorMode = hfcmAmbientAndDiffuse) then result := 1 else if (Grid.ColorMode = hfcmDiffuse) then result := 2 else if (Grid.ColorMode = hfcmEmission) then result := 3 else if (Grid.ColorMode = hfcmNone) then result := 4 else result := 0; end; // ----- TGLContourGridData.SetColourMode -------------------------------------- procedure TGLContourGridData.SetColourMode(iMode: integer); begin case iMode of 0: Grid.ColorMode := hfcmAmbient; 1: Grid.ColorMode := hfcmAmbientAndDiffuse; 2: Grid.ColorMode := hfcmDiffuse; 3: Grid.ColorMode := hfcmEmission; 4: Grid.ColorMode := hfcmNone; end; Grid.StructureChanged; end; // ----- TGLContourGridData.GetPolyGonMode ------------------------------------- function TGLContourGridData.GetPolyGonMode: integer; begin if (Grid.Material.PolygonMode = pmFill) then result := 0 else if (Grid.Material.PolygonMode = pmLines) then result := 1 else result := 2; end; // ----- TGLContourGridData.SetPolygonMode ------------------------------------- procedure TGLContourGridData.SetPolygonMode(iMode: integer); begin case iMode of 0: Grid.Material.PolygonMode := pmFill; 1: Grid.Material.PolygonMode := pmLines; 2: Grid.Material.PolygonMode := pmPoints; end; Grid.StructureChanged; end; // ----- TGLContourGridData.GetTriangleCount ----------------------------------- function TGLContourGridData.GetTriangleCount: integer; begin result := Grid.TriangleCount; end; // ----- TGLContourGridData.GetVisible ----------------------------------------- function TGLContourGridData.GetVisible: boolean; begin result := Grid.Visible; end; // ----- TGLContourGridData.SetVisible ----------------------------------------- procedure TGLContourGridData.SetVisible(bVisible: boolean); begin Grid.Visible := bVisible; end; // ----- TGLContourGridData.SetAlpha ------------------------------------------- procedure TGLContourGridData.SetAlpha(dAlpha: double); begin fAlpha := dAlpha; Grid.StructureChanged; end; // ----- TGLContourGridData.Render --------------------------------------------- procedure TGLContourGridData.Render(const x, y: Single; var z: Single; var color: TColorVector; var texPoint: TTexPoint); const SMALL = 1E-4; var val: Single; begin val := Nodes[Round(y / Dy), Round(x / Dx)]; if ExactBlankSub then begin if (val = blankval) then begin z := blanksub - zlo; if not Grid.Material.Texture.Disabled then begin texPoint.S := x * TileX / xrange; texPoint.T := y * TileY / yrange; end else color := GridOptions.ColsBlank.color; // blank colour; end else begin z := val - zlo; if not Grid.Material.Texture.Disabled then begin texPoint.S := x * TileX / xrange; texPoint.T := y * TileY / yrange; end else color := GridOptions.GetSpectrum((val - zlo) / zrange, val); end; end else begin if (val >= (blankval - SMALL)) then begin z := blanksub - zlo; if not Grid.Material.Texture.Disabled then begin texPoint.S := x * TileX / xrange; texPoint.T := y * TileY / yrange; end else color := GridOptions.ColsBlank.color; // blank colour; end else begin z := val - zlo; if not Grid.Material.Texture.Disabled then begin texPoint.S := x * TileX / xrange; texPoint.T := y * TileY / yrange; end else color := GridOptions.GetSpectrum((val - zlo) / zrange, val); end; end; color.V[3] := fAlpha; end; // ----- TGLContourGridData.Create --------------------------------------------- constructor TGLContourGridData.Create(aDummyCube: TGLDummyCube); begin inherited Create; fAlpha := 1.0; fBaseMapPath := ''; fDummyCube := aDummyCube; // assigned externally fExactBlankSub := false; fGridName := ''; fTileX := 1; fTileY := 1; Grid := TGLHeightField(DummyCube.AddNewChild(TGLHeightField)); Grid.Material.BlendingMode := bmTransparency; OpenTexture := TOpenPictureDialog.Create(nil); OpenTexture.Title := 'Select Basemap Texture' end; // ----- TGLContourGridData.Destroy -------------------------------------------- destructor TGLContourGridData.Destroy; begin fGrid.free; OpenTexture.free; inherited Destroy; end; // ----- TGLContourGridData.ConstructGrid -------------------------------------- procedure TGLContourGridData.ConstructGrid; begin with Grid do begin XSamplingScale.Min := 0; XSamplingScale.Max := xrange + 0.01 * Dx; XSamplingScale.Origin := 0; XSamplingScale.Step := Dx; Position.x := xlo; YSamplingScale.Min := 0.0; YSamplingScale.Origin := 0.0; YSamplingScale.Max := yrange + 0.01 * Dy; YSamplingScale.Step := Dy; Position.y := ylo; Position.z := zlo; OnGetHeight := self.Render; end; end; // ----- TGLContourGridData.Import --------------------------------------------- procedure TGLContourGridData.Import(sFileName: TFileName; dBlankSub: double; iType: integer; var bOK: boolean); var bLoad: boolean; sf: TformSurferImport; begin bOK := false; Application.ProcessMessages; Screen.Cursor := crHourGlass; case iType of 0: bLoad := LoadSurferGrid(sFileName) = 0; 1: bLoad := LoadARCINFOASCII(sFileName) = 0; else bLoad := false; end; // assign the blank value substitution blanksub := dBlankSub; // load data if successful if bLoad then begin sf := TformSurferImport.Create(nil); with sf do begin case iType of 0: Caption := 'Surfer Grid Import Settings'; 1: Caption := 'ARC/INFO ASCII Grid Import Settings'; end; ebMinX.Text := Format('%g', [xlo]); ebMinY.Text := Format('%g', [ylo]); ebMinZ.Text := Format('%g', [zlo]); ebMaxX.Text := Format('%g', [xhi]); ebMaxY.Text := Format('%g', [yhi]); ebMaxZ.Text := Format('%g', [zhi]); ebSpacingX.Text := Format('%g', [Dx]); ebSpacingY.Text := Format('%g', [Dy]); ebNoX.Text := IntToStr(Nx); ebNoY.Text := IntToStr(Ny); ebTotalNo.Text := IntToStr(Nx * Ny); if (nblanks > 0) then begin pnlBlankedNodes.Visible := true; ebNoBlanks.Text := IntToStr(nblanks); geBlankedValue.Value := blanksub; end else // fix to bug reported by Richard Beitelmair begin pnlBlankedNodes.Visible := false; ebNoBlanks.Text := '0'; geBlankedValue.Value := blanksub; end; end; Screen.Cursor := crDefault; if (sf.ShowModal = mrOK) then begin Application.ProcessMessages; Screen.Cursor := crHourGlass; // palette scaling is by data limits - have manual settings at a later stage if zlo < GridOptions.colpalette.MinValue then GridOptions.colpalette.MinValue := zlo; if zhi > GridOptions.colpalette.MaxValue then GridOptions.colpalette.MaxValue := zhi; if GridOptions.PromptTexture then begin if OpenTexture.Execute then begin try BaseMapPath := OpenTexture.FileName; EnableBaseMap := true; except EnableBaseMap := false; end; end else EnableBaseMap := false; end else EnableBaseMap := false; case iType of 0: ExactBlankSub := false; 1: ExactBlankSub := true; end; blanksub := sf.geBlankedValue.Value; GridName := sf.ebGridName.Text; ConstructGrid; bOK := true; Screen.Cursor := crDefault; end; sf.Release; end else begin case iType of 0: MessageDlg('"' + sFileName + '" does not seem to be a valid Surfer grid file!', mtError, [mbOK], 0); 1: MessageDlg('"' + sFileName + '" does not seem to be a valid ArcInfo ASCII grid file!', mtError, [mbOK], 0); end; end; end; // ----- TGLContourGridData.SilentImport --------------------------------------- procedure TGLContourGridData.SilentImport(sFileName: string; dBlankSub: double; iType: integer; var bOK: boolean); var bLoad: boolean; begin bOK := false; case iType of 0: bLoad := LoadSurferGrid(sFileName) = 0; 1: bLoad := LoadARCINFOASCII(sFileName) = 0; else bLoad := false; end; if bLoad then begin blanksub := dBlankSub; // palette scaling is by data limits - have manual settings at a later stage if zlo < GridOptions.colpalette.MinValue then GridOptions.colpalette.MinValue := zlo; if zhi > GridOptions.colpalette.MaxValue then GridOptions.colpalette.MaxValue := zhi; EnableBaseMap := false; // override after import case iType of 0: ExactBlankSub := false; 1: ExactBlankSub := true; end; ConstructGrid; bOK := true; end; end; // ============================================================================= end.
unit feedSPARQL; interface uses eaterReg, MSXML2_TLB; type TSparqlFeedProcessor=class(TFeedProcessorXML) public function Determine(Doc: DOMDocument60): Boolean; override; procedure ProcessFeed(Handler: IFeedHandler; Doc: DOMDocument60); override; end; TSparqlRequestProcessor=class(TRequestProcessor) public function AlternateOpen(const FeedURL: string; var LastMod: string; Request: ServerXMLHTTP60): Boolean; override; end; implementation uses eaterUtils, Variants; { TSparqlFeedProcessor } function TSparqlFeedProcessor.Determine(Doc: DOMDocument60): Boolean; begin Result:=doc.documentElement.nodeName='sparql'; end; procedure TSparqlFeedProcessor.ProcessFeed(Handler: IFeedHandler; Doc: DOMDocument60); var xl:IXMLDOMNodeList; x,y:IXMLDOMElement; itemid,itemurl:string; pubDate:TDateTime; title,content:WideString; begin doc.setProperty('SelectionNamespaces', 'xmlns:s="http://www.w3.org/2005/sparql-results#"'); //feedname:=?? xl:=doc.documentElement.selectNodes('s:results/s:result'); x:=xl.nextNode as IXMLDOMElement; while x<>nil do begin itemid:=x.selectSingleNode('s:binding[@name="news"]/s:uri').text; itemurl:=x.selectSingleNode('s:binding[@name="url"]/s:uri').text; try y:=x.selectSingleNode('s:binding[@name="pubDate"]/s:literal') as IXMLDOMElement; pubDate:=ConvDate1(y.text); except pubDate:=UtcNow; end; if Handler.CheckNewPost(itemid,itemurl,pubDate) then begin title:=x.selectSingleNode('s:binding[@name="headline"]/s:literal').text; y:=x.selectSingleNode('s:binding[@name="description"]/s:literal') as IXMLDOMElement; if (y<>nil) and (y.text<>title) then title:=title+' '#$2014' '+y.text; y:=x.selectSingleNode('s:binding[@name="body"]/s:literal') as IXMLDOMElement; if y=nil then content:='' else content:=y.text; Handler.RegisterPost(title,content); end; x:=xl.nextNode as IXMLDOMElement; end; xl:=nil; Handler.ReportSuccess('SPARQL'); end; { TSparqlRequestProcessor } function TSparqlRequestProcessor.AlternateOpen(const FeedURL: string; var LastMod: string; Request: ServerXMLHTTP60): Boolean; begin if StartsWith(FeedURL,'sparql://') then begin Request.open('GET','https://'+Copy(FeedURL,10,Length(FeedURL)-9)+ '?default-graph-uri=&query=PREFIX+schema%3A+<http%3A%2F%2Fschema.org%2F>%0D%0A'+ 'SELECT+*+WHERE+%7B+%3Fnews+a+schema%3ANewsArticle%0D%0A.+%3Fnews+schema%3Aurl+%3Furl%0D%0A'+ '.+%3Fnews+schema%3AdatePublished+%3FpubDate%0D%0A'+ '.+%3Fnews+schema%3Aheadline+%3Fheadline%0D%0A'+ '.+%3Fnews+schema%3Adescription+%3Fdescription%0D%0A'+ '.+%3Fnews+schema%3AarticleBody+%3Fbody%0D%0A'+ '%7D+ORDER+BY+DESC%28%3FpubDate%29+LIMIT+20' ,false,EmptyParam,EmptyParam); Request.setRequestHeader('Accept','application/sparql-results+xml, application/xml, text/xml'); Request.setRequestHeader('User-Agent','FeedEater/1.1'); Result:=true; end else Result:=false; end; initialization RegisterFeedProcessorXML(TSparqlFeedProcessor.Create); RegisterRequestProcessors(TSparqlRequestProcessor.Create); end.
// // Generated by JavaToPas v1.5 20150830 - 103221 //////////////////////////////////////////////////////////////////////////////// unit java.nio.channels.SelectableChannel; interface uses AndroidAPI.JNIBridge, Androidapi.JNI.JavaTypes, java.nio.channels.Selector, java.nio.channels.spi.AbstractSelector; type JSelectionKey = interface; // merged JSelectableChannel = interface; JSelectableChannelClass = interface(JObjectClass) ['{C221514A-E7FE-4A47-A2E3-ACC570D34FE3}'] function &register(JSelectorparam0 : JSelector; Integerparam1 : Integer; JObjectparam2 : JObject) : JSelectionKey; cdecl; overload;// (Ljava/nio/channels/Selector;ILjava/lang/Object;)Ljava/nio/channels/SelectionKey; A: $401 function &register(selector : JSelector; operations : Integer) : JSelectionKey; cdecl; overload;// (Ljava/nio/channels/Selector;I)Ljava/nio/channels/SelectionKey; A: $11 function blockingLock : JObject; cdecl; // ()Ljava/lang/Object; A: $401 function configureBlocking(booleanparam0 : boolean) : JSelectableChannel; cdecl;// (Z)Ljava/nio/channels/SelectableChannel; A: $401 function isBlocking : boolean; cdecl; // ()Z A: $401 function isRegistered : boolean; cdecl; // ()Z A: $401 function keyFor(JSelectorparam0 : JSelector) : JSelectionKey; cdecl; // (Ljava/nio/channels/Selector;)Ljava/nio/channels/SelectionKey; A: $401 function provider : JSelectorProvider; cdecl; // ()Ljava/nio/channels/spi/SelectorProvider; A: $401 function validOps : Integer; cdecl; // ()I A: $401 end; [JavaSignature('java/nio/channels/SelectableChannel')] JSelectableChannel = interface(JObject) ['{5E1D3486-4676-4A43-B32D-3DBC75E1A1A3}'] function &register(JSelectorparam0 : JSelector; Integerparam1 : Integer; JObjectparam2 : JObject) : JSelectionKey; cdecl; overload;// (Ljava/nio/channels/Selector;ILjava/lang/Object;)Ljava/nio/channels/SelectionKey; A: $401 function blockingLock : JObject; cdecl; // ()Ljava/lang/Object; A: $401 function configureBlocking(booleanparam0 : boolean) : JSelectableChannel; cdecl;// (Z)Ljava/nio/channels/SelectableChannel; A: $401 function isBlocking : boolean; cdecl; // ()Z A: $401 function isRegistered : boolean; cdecl; // ()Z A: $401 function keyFor(JSelectorparam0 : JSelector) : JSelectionKey; cdecl; // (Ljava/nio/channels/Selector;)Ljava/nio/channels/SelectionKey; A: $401 function provider : JSelectorProvider; cdecl; // ()Ljava/nio/channels/spi/SelectorProvider; A: $401 function validOps : Integer; cdecl; // ()I A: $401 end; TJSelectableChannel = class(TJavaGenericImport<JSelectableChannelClass, JSelectableChannel>) end; // Merged from: .\java.nio.channels.SelectionKey.pas JSelectionKeyClass = interface(JObjectClass) ['{0ABB6F06-7458-41C4-AC51-49254A693639}'] function _GetOP_ACCEPT : Integer; cdecl; // A: $19 function _GetOP_CONNECT : Integer; cdecl; // A: $19 function _GetOP_READ : Integer; cdecl; // A: $19 function _GetOP_WRITE : Integer; cdecl; // A: $19 function attach(anObject : JObject) : JObject; cdecl; // (Ljava/lang/Object;)Ljava/lang/Object; A: $11 function attachment : JObject; cdecl; // ()Ljava/lang/Object; A: $11 function channel : JSelectableChannel; cdecl; // ()Ljava/nio/channels/SelectableChannel; A: $401 function interestOps : Integer; cdecl; overload; // ()I A: $401 function interestOps(Integerparam0 : Integer) : JSelectionKey; cdecl; overload;// (I)Ljava/nio/channels/SelectionKey; A: $401 function isAcceptable : boolean; cdecl; // ()Z A: $11 function isConnectable : boolean; cdecl; // ()Z A: $11 function isReadable : boolean; cdecl; // ()Z A: $11 function isValid : boolean; cdecl; // ()Z A: $401 function isWritable : boolean; cdecl; // ()Z A: $11 function readyOps : Integer; cdecl; // ()I A: $401 function selector : JSelector; cdecl; // ()Ljava/nio/channels/Selector; A: $401 procedure cancel ; cdecl; // ()V A: $401 property OP_ACCEPT : Integer read _GetOP_ACCEPT; // I A: $19 property OP_CONNECT : Integer read _GetOP_CONNECT; // I A: $19 property OP_READ : Integer read _GetOP_READ; // I A: $19 property OP_WRITE : Integer read _GetOP_WRITE; // I A: $19 end; [JavaSignature('java/nio/channels/SelectionKey')] JSelectionKey = interface(JObject) ['{0B90B36E-30F8-4F4D-9956-E955AD4B5CBB}'] function channel : JSelectableChannel; cdecl; // ()Ljava/nio/channels/SelectableChannel; A: $401 function interestOps : Integer; cdecl; overload; // ()I A: $401 function interestOps(Integerparam0 : Integer) : JSelectionKey; cdecl; overload;// (I)Ljava/nio/channels/SelectionKey; A: $401 function isValid : boolean; cdecl; // ()Z A: $401 function readyOps : Integer; cdecl; // ()I A: $401 function selector : JSelector; cdecl; // ()Ljava/nio/channels/Selector; A: $401 procedure cancel ; cdecl; // ()V A: $401 end; TJSelectionKey = class(TJavaGenericImport<JSelectionKeyClass, JSelectionKey>) end; const TJSelectionKeyOP_ACCEPT = 16; TJSelectionKeyOP_CONNECT = 8; TJSelectionKeyOP_READ = 1; TJSelectionKeyOP_WRITE = 4; implementation end.
unit Model.ReaderReport; interface uses System.JSON; type TReaderReport = class private FEmail: String; FFirstName: String; FLastName: String; FCompany: String; FBookISBN: String; FBookTitle: String; FRating: Integer; FOppinion: String; FReportedDate: TDateTime; public procedure Validate; procedure LoadFromJSON(AJSONReport: TJSONObject); // -------- property email: String read FEmail write FEmail; property firstName: String read FFirstName write FFirstName; property lastName: String read FLastName write FLastName; property company: String read FCompany write FCompany; property bookISBN: String read FBookISBN write FBookISBN; property bookTitle: String read FBookTitle write FBookTitle; property rating: Integer read FRating write FRating; property oppinion: String read FOppinion write FOppinion; property ReportedDate: TDateTime read FReportedDate write FReportedDate; end; implementation uses System.SysUtils, Helper.TJSONObject, Utils.General; procedure TReaderReport.LoadFromJSON(AJSONReport: TJSONObject); begin if AJSONReport.IsValidIsoDateUtc('created') then ReportedDate := AJSONReport.GetPairValueAsUtcDate('created') else raise Exception.Create('Invalid date. Expected ISO format'); if not AJSONReport.IsValidateEmail('email') then raise Exception.Create('Invalid e-mail addres'); Email := AJSONReport.Values['email'].Value; FirstName := AJSONReport.GetPairValueAsString('firstname'); LastName := AJSONReport.GetPairValueAsString('lastname'); Company := AJSONReport.GetPairValueAsString('company'); BookISBN := AJSONReport.GetPairValueAsString('book-isbn'); BookTitle := AJSONReport.GetPairValueAsString('book-title'); Rating := AJSONReport.GetPairValueAsInteger('rating'); Oppinion := AJSONReport.GetPairValueAsString('oppinion'); Validate; end; procedure TReaderReport.Validate; begin //Regu�y walidacji TReaderReport if not TValidateLibrary.CheckEmail(Email) then raise Exception.Create('Invalid email addres!'); end; end.
unit uFrmConsultaCargo; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uFrmConsultaBase, DB, DBClient, Grids, DBGrids, StdCtrls, ExtCtrls, uCargoDAOClient, Cargo; type TFrmConsultaCargo = class(TFrmConsultaBase) cdsConsultaID: TIntegerField; cdsConsultaDESCRICAO: TStringField; private { Private declarations } DAOClient: TCargoDAOClient; protected procedure OnCreate; override; procedure OnDestroy; override; procedure OnListar; override; procedure OnConsultar; override; procedure OnSelecionar; override; public { Public declarations } Cargo: TCargo; end; var FrmConsultaCargo: TFrmConsultaCargo; implementation uses DataUtils; {$R *.dfm} { TFrmConsultaCargo } procedure TFrmConsultaCargo.OnConsultar; begin inherited; cdsConsulta.Filtered := False; cdsConsulta.Filter := 'UPPER(DESCRICAO) LIKE ' + QuotedStr('%'+UpperCase(edtConsultar.Text)+'%'); cdsConsulta.Filtered := True; end; procedure TFrmConsultaCargo.OnCreate; begin inherited; DAOClient := TCargoDAOClient.Create(DBXConnection); end; procedure TFrmConsultaCargo.OnDestroy; begin inherited; DAOClient.Free; end; procedure TFrmConsultaCargo.OnListar; begin inherited; CopyReaderToClientDataSet(DAOClient.List, cdsConsulta); end; procedure TFrmConsultaCargo.OnSelecionar; begin inherited; Cargo := TCargo.Create(cdsConsultaID.AsInteger, cdsConsultaDESCRICAO.AsString); Self.Close; end; end.
unit ibSHRegisterEditors; interface uses SysUtils, Classes, Controls, Dialogs, DesignIntf, TypInfo, StrUtils, SHDesignIntf, ibSHDesignIntf; type // -> Property Editors TibSHDatabaseAliasOptionsPropEditor = class(TSHPropertyEditor) public function GetValue: string; override; end; TibBTHostPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; end; TibSHServerVersionPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTClientLibraryPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure Edit; override; end; TibBTProtocolPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTPasswordPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; function GetValue: string; override; procedure Edit; override; end; TibSHServerPropEditor = class(TSHPropertyEditor) private FValueList: TStrings; FOwnerList: TStrings; procedure Prepare; public constructor Create(APropertyEditor: TObject); override; destructor Destroy; override; function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; property ValueList: TStrings read FValueList; property OwnerList: TStrings read FOwnerList; end; TibSHDatabasePropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure Edit; override; end; TibBTIsolationLevelPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTCharsetPropEditor = class(TSHPropertyEditor) private FValueList: TStrings; procedure Prepare; public constructor Create(APropertyEditor: TObject); override; destructor Destroy; override; function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; property ValueList: TStrings read FValueList; end; TibBTPageSizePropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTSQLDialectPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTStartFromPropEditor = class(TSHPropertyEditor) private function GetCallStrings: string; public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTConfirmEndTransaction = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTDefaultTransactionAction = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure GetValues(AValues: TStrings); override; procedure SetValue(const Value: string); override; end; TibBTSQLLogPropEditor = class(TSHPropertyEditor) public function GetAttributes: TPropertyAttributes; override; procedure Edit; override; end; TibBTAdditionalConnectParamsPropEditor = class(TSHPropertyEditor) public function GetValue: string; override; end; implementation uses ibSHConsts, ibSHValues; { TibSHDatabaseAliasOptionsPropEditor } function TibSHDatabaseAliasOptionsPropEditor.GetValue: string; begin Result := '::'; end; { TibBTHostPropEditor } function TibBTHostPropEditor.GetAttributes: TPropertyAttributes; begin Result := inherited GetAttributes; // if AnsiSameText(Value, SLocalhost) = 0 then Result := Result + [paReadOnly]; end; { TibSHServerVersionPropEditor } function TibSHServerVersionPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibSHServerVersionPropEditor.GetValues(AValues: TStrings); begin if Supports(Component, IibSHServerOptions) then begin // для опций if Supports(Component, IibSHBranch) then AValues.Text := GetServerVersionIB; if Supports(Component, IfbSHBranch) then AValues.Text := GetServerVersionFB; end else begin if IsEqualGUID(Component.BranchIID, IibSHBranch) then AValues.Text := GetServerVersionIB; if IsEqualGUID(Component.BranchIID, IfbSHBranch) then AValues.Text := GetServerVersionFB; end; end; procedure TibSHServerVersionPropEditor.SetValue(const Value: string); begin if Supports(Component, IibSHServerOptions) then begin // для опций if Supports(Component, IibSHBranch) and Designer.CheckPropValue(Value, GetServerVersionIB) then begin inherited SetStrValue(Value); Designer.UpdateObjectInspector; end; if Supports(Component, IfbSHBranch) and Designer.CheckPropValue(Value, GetServerVersionFB) then begin inherited SetStrValue(Value); Designer.UpdateObjectInspector; end; end else begin if IsEqualGUID(Component.BranchIID, IibSHBranch) and Designer.CheckPropValue(Value, GetServerVersionIB) then begin inherited SetStrValue(Value); Designer.UpdateObjectInspector; end; if IsEqualGUID(Component.BranchIID, IfbSHBranch) and Designer.CheckPropValue(Value, GetServerVersionFB) then begin inherited SetStrValue(Value); Designer.UpdateObjectInspector; end; end; end; { TibBTClientLibraryPropEditor } function TibBTClientLibraryPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paDialog]; end; procedure TibBTClientLibraryPropEditor.Edit; var OpenDialog: TOpenDialog; begin OpenDialog := TOpenDialog.Create(nil); try OpenDialog.Filter := Format('%s', [SOpenDialogClientLibraryFilter]); if OpenDialog.Execute then SetStrValue(OpenDialog.FileName); finally FreeAndNil(OpenDialog); end; end; { TibBTProtocolPropEditor } function TibBTProtocolPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibBTProtocolPropEditor.GetValues(AValues: TStrings); begin AValues.Text := GetProtocol; end; procedure TibBTProtocolPropEditor.SetValue(const Value: string); begin if Assigned(Designer) and Designer.CheckPropValue(Value, GetProtocol) then inherited SetStrValue(Value); end; { TibBTPasswordPropEditor } function TibBTPasswordPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paDialog]; end; function TibBTPasswordPropEditor.GetValue: string; begin Result := Format('%s', [SPasswordMask]); end; procedure TibBTPasswordPropEditor.Edit; var S: string; begin S := GetPropValue(Component, 'Password'); inherited SetStrValue(Designer.InputBox(Format('%s', [SInputPassword]), Format('%s', [SPassword]), S, True, '*')); Designer.UpdateObjectInspector; end; { TibSHServerPropEditor } constructor TibSHServerPropEditor.Create(APropertyEditor: TObject); begin inherited Create(APropertyEditor); FValueList := TStringList.Create; FOwnerList := TStringList.Create; Prepare; end; destructor TibSHServerPropEditor.Destroy; begin FValueList.Free; FOwnerList.Free; inherited Destroy; end; function TibSHServerPropEditor.GetAttributes: TPropertyAttributes; begin if Component.Tag = 4 then Result := [paReadOnly] else Result := [paValueList, paSortList]; end; procedure TibSHServerPropEditor.Prepare; var I: Integer; begin ValueList.Clear; OwnerList.Clear; for I := 0 to Pred(Designer.Components.Count) do if Supports(Designer.Components[I], ISHServer) and IsEqualGUID(TSHComponent(Designer.Components[I]).BranchIID, Designer.CurrentBranch.ClassIID) then begin ValueList.Add(Format('%s (%s) ', [TSHComponent(Designer.Components[I]).Caption, TSHComponent(Designer.Components[I]).CaptionExt])); OwnerList.Add(GUIDToString(TSHComponent(Designer.Components[I]).InstanceIID)); end; end; procedure TibSHServerPropEditor.GetValues(AValues: TStrings); begin AValues.Assign(ValueList); end; procedure TibSHServerPropEditor.SetValue(const Value: string); begin if Assigned(Designer) and Assigned(Component) and Designer.CheckPropValue(Value, ValueList.Text) then begin if ValueList.IndexOf(Value) <> -1 then begin inherited SetStrValue(Value); Component.OwnerIID := StringToGUID(OwnerList.Strings[ValueList.IndexOf(Value)]); Designer.UpdateObjectInspector; end; end; end; { TibSHDatabasePropEditor } function TibSHDatabasePropEditor.GetAttributes: TPropertyAttributes; begin Result := [paDialog]; end; procedure TibSHDatabasePropEditor.Edit; var OpenDialog: TOpenDialog; begin OpenDialog := TOpenDialog.Create(nil); try OpenDialog.Filter := Format('%s', [SOpenDialogDatabaseFilter]); if OpenDialog.Execute then SetStrValue(OpenDialog.FileName); finally FreeAndNil(OpenDialog); end; end; { TibBTIsolationLevelPropEditor } function TibBTIsolationLevelPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibBTIsolationLevelPropEditor.GetValues(AValues: TStrings); begin AValues.Text := GetIsolationLevel; end; procedure TibBTIsolationLevelPropEditor.SetValue(const Value: string); begin inherited SetStrValue(Value); end; { TibBTCharsetPropEditor } constructor TibBTCharsetPropEditor.Create(APropertyEditor: TObject); begin inherited Create(APropertyEditor); FValueList := TStringList.Create; Prepare; end; destructor TibBTCharsetPropEditor.Destroy; begin FValueList.Free; inherited Destroy; end; procedure TibBTCharsetPropEditor.Prepare; var ibBTServerIntf: IibSHServer; ibBTDatabaseIntf: IibSHDatabase; ibBTDBObjectIntf: IibSHDBObject; vServerVersion:string; begin if Assigned(Component) then begin if Supports(Component, IibSHDatabase, ibBTDatabaseIntf) then ibBTServerIntf := ibBTDatabaseIntf.BTCLServer; if Supports(Component, IibSHDBObject, ibBTDBObjectIntf) then ibBTServerIntf := ibBTDBObjectIntf.BTCLDatabase.BTCLServer; end; if Assigned(ibBTServerIntf) then begin vServerVersion:=ibBTServerIntf.Version; if AnsiSameText(vServerVersion, SFirebird15) then ValueList.Text := GetCharsetFB15 else if AnsiSameText(vServerVersion, SFirebird20) then ValueList.Text := GetCharsetFB20 else if AnsiSameText(vServerVersion, SInterBase71) then ValueList.Text := GetCharsetIB71 else if AnsiSameText(vServerVersion, SInterBase75) then ValueList.Text := GetCharsetIB75 else if AnsiSameText(vServerVersion, SFirebird21) then ValueList.Text := GetCharsetFB21 end; if ValueList.Count = 0 then ValueList.Text := GetCharsetFB10; if Supports(Component, IibSHServerOptions) then begin // для опций if Supports(Component, IibSHBranch) then ValueList.Text := GetCharsetIB71; if Supports(Component, IfbSHBranch) then ValueList.Text := GetCharsetFB20; end; end; function TibBTCharsetPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paValueList, paSortList]; if Supports(Component, IibSHDBObject) then Result := [paReadOnly]; end; procedure TibBTCharsetPropEditor.GetValues(AValues: TStrings); begin AValues.Assign(ValueList); end; procedure TibBTCharsetPropEditor.SetValue(const Value: string); begin if Assigned(Designer) and Designer.CheckPropValue(Value, ValueList.Text) then begin inherited SetStrValue(Value); Designer.UpdateObjectInspector; end; end; { TibBTPageSizePropEditor } function TibBTPageSizePropEditor.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibBTPageSizePropEditor.GetValues(AValues: TStrings); begin AValues.Text := GetPageSize; end; procedure TibBTPageSizePropEditor.SetValue(const Value: string); begin if Assigned(Designer) and Designer.CheckPropValue(Value, GetPageSize) then inherited SetStrValue(Value); end; { TibBTSQLDialectPropEditor } function TibBTSQLDialectPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibBTSQLDialectPropEditor.GetValues(AValues: TStrings); begin AValues.Text := GetDialect; end; procedure TibBTSQLDialectPropEditor.SetValue(const Value: string); begin if Assigned(Designer) and Designer.CheckPropValue(Value, GetDialect) then inherited SetOrdValue(StrToInt(Value)); end; { TibBTStartFromPropEditor } function TibBTStartFromPropEditor.GetCallStrings: string; var I: Integer; vClassIID: TGUID; vCallString: string; begin if AnsiSameText(PropName, 'StartDomainForm') then vClassIID := IibSHDomain else if AnsiSameText(PropName, 'StartTableForm') then vClassIID := IibSHTable else if AnsiSameText(PropName, 'StartIndexForm') then vClassIID := IibSHIndex else if AnsiSameText(PropName, 'StartViewForm') then vClassIID := IibSHView else if AnsiSameText(PropName, 'StartProcedureForm') then vClassIID := IibSHProcedure else if AnsiSameText(PropName, 'StartTriggerForm') then vClassIID := IibSHTrigger else if AnsiSameText(PropName, 'StartGeneratorForm') then vClassIID := IibSHGenerator else if AnsiSameText(PropName, 'StartExceptionForm') then vClassIID := IibSHException else if AnsiSameText(PropName, 'StartFunctionForm') then vClassIID := IibSHFunction else if AnsiSameText(PropName, 'StartFilterForm') then vClassIID := IibSHFilter else if AnsiSameText(PropName, 'StartRoleForm') then vClassIID := IibSHRole; if not IsEqualGUID(vClassIID, IUnknown) then begin for I := Pred(Designer.GetCallStrings(vClassIID).Count) downto 0 do begin vCallString := Designer.GetCallStrings(vClassIID)[I]; Result := Result + SLineBreak + vCallString; end; end; Result := Trim(Result); end; function TibBTStartFromPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibBTStartFromPropEditor.GetValues(AValues: TStrings); begin AValues.Text := GetCallStrings; end; procedure TibBTStartFromPropEditor.SetValue(const Value: string); begin if Assigned(Designer) and Designer.CheckPropValue(Value, GetCallStrings) then inherited SetStrValue(Value); end; { TibBTConfirmEndTransaction } function TibBTConfirmEndTransaction.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibBTConfirmEndTransaction.GetValues(AValues: TStrings); begin AValues.Text := GetConfirmEndTransaction; end; procedure TibBTConfirmEndTransaction.SetValue(const Value: string); begin if Assigned(Designer) and Designer.CheckPropValue(Value, GetConfirmEndTransaction) then inherited SetStrValue(Value); end; { TibBTDefaultTransactionAction } function TibBTDefaultTransactionAction.GetAttributes: TPropertyAttributes; begin Result := [paValueList]; end; procedure TibBTDefaultTransactionAction.GetValues(AValues: TStrings); begin AValues.Text := GetDefaultTransactionAction; end; procedure TibBTDefaultTransactionAction.SetValue(const Value: string); begin if Assigned(Designer) and Designer.CheckPropValue(Value, GetDefaultTransactionAction) then inherited SetStrValue(Value); end; { TibBTSQLLogPropEditor } function TibBTSQLLogPropEditor.GetAttributes: TPropertyAttributes; begin Result := [paDialog]; end; procedure TibBTSQLLogPropEditor.Edit; var OpenDialog: TOpenDialog; begin OpenDialog := TOpenDialog.Create(nil); try OpenDialog.Filter := Format('%s', [SOpenDialogSQLLogFilter]); if OpenDialog.Execute then SetStrValue(OpenDialog.FileName); finally FreeAndNil(OpenDialog); end; end; { TibBTAdditionalConnectParamsPropEditor } function TibBTAdditionalConnectParamsPropEditor.GetValue: string; begin Result := Trim((Component as IibSHDatabase).AdditionalConnectParams.Text); if Length(Result) > 0 then Result := AnsiReplaceStr(Trim((Component as IibSHDatabase).AdditionalConnectParams.CommaText), ',', ', '); end; end.
unit uExplorerFolderImages; interface uses System.SysUtils, Vcl.Graphics, Dmitry.Utils.Files, uMemory, uRWLock, uBitmapUtils; type TFolderImages = record Images: array [1 .. 4] of TBitmap; FileNames: array [1 .. 4] of string; FileDates: array [1 .. 4] of TDateTime; Directory: string; Width: Integer; Height: Integer; end; TExplorerFolders = class(TObject) private FImages: array of TFolderImages; FSaveFoldersToDB: Boolean; FSync: IReadWriteSync; procedure SetSaveFoldersToDB(const Value: Boolean); public constructor Create; destructor Destroy; override; procedure SaveFolderImages(FolderImages: TFolderImages; Width: Integer; Height: Integer); function GetFolderImages(Directory: string; Width: Integer; Height: Integer): TFolderImages; property SaveFoldersToDB: Boolean read FSaveFoldersToDB write SetSaveFoldersToDB; procedure CheckFolder(Folder: string); procedure Clear; end; function ExplorerFolders: TExplorerFolders; implementation var FExplorerFolders: TExplorerFolders = nil; function ExplorerFolders: TExplorerFolders; begin if FExplorerFolders = nil then FExplorerFolders := TExplorerFolders.Create; Result := FExplorerFolders; end; { TExplorerFolders } procedure TExplorerFolders.CheckFolder(Folder: string); var I, K, L: Integer; begin FSync.BeginWrite; try for I := Length(FImages) - 1 downto 0 do begin if AnsiLowerCase(FImages[I].Directory) = AnsiLowerCase(Folder) then for k := 1 to 4 do if FImages[I].FileNames[K] = '' then begin for L := 1 to 4 do F(FImages[I].Images[L]); for L := I to Length(FImages) - 2 do FImages[L] := FImages[L + 1]; if Length(FImages) > 0 then SetLength(FImages, Length(FImages) - 1); Exit; end; end; finally FSync.EndWrite; end; end; procedure TExplorerFolders.Clear; var I, J: Integer; begin FSync.BeginWrite; try for I := 0 to Length(FImages) - 1 do for J := 1 to 4 do F(FImages[I].Images[J]); SetLength(FImages, 0); finally FSync.EndWrite; end; end; constructor TExplorerFolders.Create; begin FSync := CreateRWLock; SaveFoldersToDB := False; SetLength(FImages, 0); end; destructor TExplorerFolders.Destroy; begin Clear; FSync := nil; inherited; end; function TExplorerFolders.GetFolderImages( Directory: String; Width: Integer; Height: Integer): TFolderImages; var I, J, K, W, H: Integer; B: Boolean; begin FSync.BeginRead; try Directory := IncludeTrailingBackslash(Directory); Result.Directory := ''; for I := 1 to 4 do Result.Images[I] := nil; for I := 0 to Length(FImages)-1 do begin if (AnsiLowerCase(FImages[I].Directory) = AnsiLowerCase(Directory)) and (Width <= FImages[i].Width) then begin B := True; for K := 1 to 4 do if FImages[I].FileNames[K]<>'' then if not FileExistsSafe(FImages[I].FileNames[K]) then begin B := False; Break; end; if B then for k:=1 to 4 do if FImages[I].FileNames[K] <> '' then if FImages[I].FileDates[K] <> GetFileDateTime(FImages[I].FileNames[K]) then begin B := False; Break; end; if B then begin Result.Directory := Directory; for J := 1 to 4 do begin Result.Images[J] := TBitmap.create; if FImages[I].Images[J] <> nil then begin W := FImages[I].Images[J].Width; H := FImages[I].Images[J].height; ProportionalSize(Width, Height, W, H); Result.Images[J].PixelFormat := FImages[I].Images[J].PixelFormat; DoResize(W, H, FImages[I].Images[J], Result.Images[J]); end; end; end; end; end; finally FSync.EndRead; end; end; procedure TExplorerFolders.SaveFolderImages(FolderImages: TFolderImages; Width: Integer; Height: Integer); var I, J: Integer; B: Boolean; L: Integer; begin FSync.BeginWrite; try B := False; FolderImages.Directory := IncludeTrailingBackslash(FolderImages.Directory); for I := 0 to Length(FImages) - 1 do begin if AnsiLowerCase(FImages[I].Directory) = AnsiLowerCase(FolderImages.Directory) then if FImages[I].Width < Width then begin FImages[I].Width := Width; FImages[I].Height := Height; FImages[I].Directory := FolderImages.Directory; for J := 1 to 4 do FImages[I].FileNames[J] := FolderImages.FileNames[J]; for J := 1 to 4 do FImages[I].FileDates[J] := FolderImages.FileDates[J]; for J := 1 to 4 do F(FImages[I].Images[J]); for J := 1 to 4 do begin if FolderImages.Images[J] = nil then Break; FImages[I].Images[J] := TBitmap.Create; AssignBitmap(FImages[I].Images[J], FolderImages.Images[J]); end; B := True; Break; end; end; if not B and (FolderImages.Images[1] <> nil) then begin SetLength(FImages, Length(FImages) + 1); L := Length(FImages) - 1; FImages[L].Width := Width; FImages[L].Height := Height; FImages[L].Directory := FolderImages.Directory; for I := 1 to 4 do FImages[L].FileNames[I] := FolderImages.FileNames[I]; for I := 1 to 4 do FImages[L].FileDates[I] := FolderImages.FileDates[I]; for I := 1 to 4 do FImages[L].Images[I] := nil; for I := 1 to 4 do begin if FolderImages.Images[I] = nil then Break; FImages[L].Images[I] := TBitmap.Create; AssignBitmap(FImages[L].Images[I], FolderImages.Images[I]); end; end; finally FSync.EndWrite; end; end; procedure TExplorerFolders.SetSaveFoldersToDB(const Value: Boolean); begin FSaveFoldersToDB := Value; end; initialization finalization F(FExplorerFolders); end.
unit Forms.FrmEditor; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, AdvUtil, Vcl.Grids, AdvObj, BaseGrid, AdvGrid, Flix.Utils.Maps, Vcl.ExtCtrls, AdvStyleIF, AdvAppStyler, Modules.Resources, AdvToolBar, AdvGlowButton, System.ImageList, Vcl.ImgList, Vcl.VirtualImageList; type TFrmEditor = class(TForm) grServices: TAdvStringGrid; dlgOpen: TFileOpenDialog; dlgSave: TFileSaveDialog; FormStyler: TAdvFormStyler; imgToolbar: TVirtualImageList; AdvDockPanel1: TAdvDockPanel; AdvToolBar1: TAdvToolBar; btnToolOpen: TAdvGlowButton; btnToolSave: TAdvGlowButton; AdvToolBarSeparator1: TAdvToolBarSeparator; btnToolExit: TAdvGlowButton; btnToolAdd: TAdvGlowButton; btnToolDelete: TAdvGlowButton; AdvToolBarSeparator2: TAdvToolBarSeparator; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure btnOpenFileClick(Sender: TObject); procedure grServicesGetEditorType(Sender: TObject; ACol, ARow: Integer; var AEditor: TEditorType); procedure grServicesGetEditorProp(Sender: TObject; ACol, ARow: Integer; AEditLink: TEditLink); procedure grServicesCanEditCell(Sender: TObject; ARow, ACol: Integer; var CanEdit: Boolean); procedure btnAddClick(Sender: TObject); procedure grServicesEditCellDone(Sender: TObject; ACol, ARow: Integer); procedure btnSaveFileClick(Sender: TObject); procedure btnRemoveClick(Sender: TObject); procedure grServicesEllipsClick(Sender: TObject; ACol, ARow: Integer; var S: string); procedure FormResize(Sender: TObject); procedure btnToolExitClick(Sender: TObject); private { Private declarations } // keeps track of services in grid FServices: TStringlist; procedure SyncGrid( AKeys: TServiceAPIKeys); procedure AlignGrid; public { Public declarations } end; var FrmEditor: TFrmEditor; implementation uses VCL.ClipBrd, AdvTypes, System.Generics.Collections; {$R *.dfm} procedure TFrmEditor.AlignGrid; begin grServices.AutoSizeColumns(true,15); end; procedure TFrmEditor.btnAddClick(Sender: TObject); begin if FServices.IndexOf('') = -1 then begin grServices.RowCount := grServices.RowCount + 1; FServices.Add(''); end; end; procedure TFrmEditor.btnOpenFileClick(Sender: TObject); var LKeys: TServiceAPIKeys; begin if dlgOpen.Execute then begin LKeys := TServiceAPIKeys.Create; try LKeys.LoadFromFile(dlgOpen.FileName); SyncGrid(LKeys); finally LKeys.Free; end; end; end; procedure TFrmEditor.btnRemoveClick(Sender: TObject); var LRow: Integer; begin if grServices.RowCount > 1 then begin if MessageDlg( 'Remove key?', mtConfirmation, [mbYes,mbNo], 0 ) = mrYes then begin LRow := grServices.SelectedRow[0]; grServices.RemoveRows(LRow, 1); FServices.Delete(LRow-1); end; end; end; procedure TFrmEditor.btnSaveFileClick(Sender: TObject); var LKeys: TServiceAPIKeys; LRow : Integer; begin if dlgSave.Execute then begin LKeys := TServiceAPIKeys.Create; try for LRow := 1 to FServices.Count do begin LKeys.AddKey( LKeys.GetServiceForName( FServices[LRow-1] ), grServices.Cells[ 1, LRow ] ); end; LKeys.SaveToFile(dlgSave.FileName); finally LKeys.Free; end; end; end; procedure TFrmEditor.btnToolExitClick(Sender: TObject); begin Close; end; procedure TFrmEditor.FormCreate(Sender: TObject); begin FServices := TStringlist.Create; FServices.Add(''); grServices.RowCount := 2; grServices.Cells[0,0] := 'Service'; grServices.Cells[1,0] := 'API Key'; end; procedure TFrmEditor.FormDestroy(Sender: TObject); begin FServices.Free; end; procedure TFrmEditor.FormResize(Sender: TObject); begin AlignGrid; end; procedure TFrmEditor.grServicesCanEditCell(Sender: TObject; ARow, ACol: Integer; var CanEdit: Boolean); begin if ACol = 0 then begin // only allow editing if no API key has been entered for the service CanEdit := TAdvStringGrid( Sender ).Cells[1, ARow].IsEmpty; end; end; procedure TFrmEditor.grServicesEditCellDone(Sender: TObject; ACol, ARow: Integer); begin if ACol = 0 then begin FServices[ARow-1] := TAdvStringGrid( Sender ).Cells[ACol, ARow]; end; end; procedure TFrmEditor.grServicesEllipsClick(Sender: TObject; ACol, ARow: Integer; var S: string); var LGrid: TAdvStringGrid; LDoCopy: Boolean; begin LGrid := Sender as TAdvStringGrid; // copy if there is a key and paste if there is none LDoCopy := Length( S ) > 0; if LDoCopy then begin ClipBoard.AsText := S; MessageDlg( 'Copied key to clipboard.', mtInformation, [mbOK], 0); end else begin S := ClipBoard.AsText; end; end; procedure TFrmEditor.grServicesGetEditorProp(Sender: TObject; ACol, ARow: Integer; AEditLink: TEditLink); var LName: String; LNames: TArray<string>; LKeys: TServiceAPIKeys; LGrid: TAdvStringGrid; LBit: TAdvSVGBitmap; LGlyph: TBitmap; begin LGrid := Sender as TAdvStringGrid; // populate combo list with services that // are not in the list yet if ACol = 0 then begin LKeys := TServiceAPIKeys.Create; try LNames := LKeys.GetAllNames; finally LKeys.Free; end; LGrid.Combobox.Items.Clear; for LName in LNames do begin if (FServices.IndexOf(LName) = -1) OR (LGrid.Cells[ACol, ARow] = LName) then begin LGrid.Combobox.Items.Add( LName ); end; end; end; // assign a vector image to the button of the edit control if ACol = 1 then begin LBit := TAdvSVGBitmap.Create; LGlyph := TBitmap.Create; try LBit.LoadFromFile('d:\demo\svg\resources\copypaste.svg'); LGlyph.TransparentMode := tmAuto; LGlyph.PixelFormat := pf32bit; LGlyph.Width := LGrid.RowHeights[ARow] - 6; LGlyph.Height := LGrid.RowHeights[ARow] - 6; LGlyph.Canvas.Brush.Color := LGrid.BtnEdit.Color; LGlyph.Canvas.FillRect(Rect(0,0,LGlyph.Width, LGlyph.Height)); LBit.Draw(LGlyph.Canvas, Rect( 0,0,LGlyph.Width, LGlyph.Height) ); LGrid.BtnEdit.Glyph.Assign(LGlyph); LGrid.BtnEdit.ButtonWidth := 50; LGrid.BtnEdit.ButtonCaption := ''; finally LBit.Free; LGlyph.Free; end; end; end; procedure TFrmEditor.grServicesGetEditorType(Sender: TObject; ACol, ARow: Integer; var AEditor: TEditorType); begin case ACol of 0: AEditor := edComboList; 1: AEditor := edEditBtn; end; end; procedure TFrmEditor.SyncGrid( AKeys: TServiceAPIKeys); var LServices: TList<TMapService>; LService: TMapService; LRow : Integer; begin FServices.Clear; LServices := TList<TMapService>.Create; grServices.BeginUpdate; try AKeys.GetServices(LServices); grServices.RowCount := LServices.Count + 1; LRow := 1; for LService in LServices do begin grServices.Cells[0,LRow] := AKeys.GetNameForService(LService); grServices.Cells[1,LRow] := AKeys.GetKey(LService); FServices.Add( AKeys.GetNameForService(LService) ); Inc( LRow ); end; AlignGrid; finally LServices.Free; grServices.EndUpdate; end; end; end.
unit uFilter; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, Mask, ToolEdit, ExtCtrls; type TFilterTypes = (ftDate); TFilterForm = class(TForm) pnlBtn: TPanel; pnlDate: TPanel; LblBeginDate: TLabel; deBeginDate: TDateEdit; LblEndDate: TLabel; deEndDate: TDateEdit; pBtn: TPanel; bbOk: TBitBtn; bbCancel: TBitBtn; procedure bbOkClick(Sender: TObject); procedure bbCancelClick(Sender: TObject); private { Private declarations } public FilterType: set of ftDate..ftDate; class function GetDates(var ABeginDate, AEndDate: TDateTime): boolean; end; var FilterForm: TFilterForm; implementation {$R *.dfm} class function TFilterForm.GetDates(var ABeginDate, AEndDate: TDateTime): boolean; begin Result := false; FilterForm := TFilterForm.Create(Application); try FilterForm.FilterType := [ftDate]; FilterForm.deBeginDate.Date := ABeginDate; FilterForm.deEndDate.Date := AEndDate; if FilterForm.ShowModal = mrOk then begin ABeginDate := FilterForm.deBeginDate.Date; AEndDate := FilterForm.deEndDate.Date; Result := true; end; finally FilterForm.Free; end; end; procedure TFilterForm.bbOkClick(Sender: TObject); begin self.ModalResult := mrOk; end; procedure TFilterForm.bbCancelClick(Sender: TObject); begin self.ModalResult := mrCancel; end; end.
unit Layout2; interface uses SysUtils, Node, Box; type TBlockContext = class(TBoxContext) private Boxes: TBoxList; public constructor Create(inBox: TBox; inNode: TNode); procedure AddNodes(inNodes: TNodeList); end; // TInlineContext = class(TBoxContext) private Context: TBlockContext; Line: TBox; public constructor Create(inContext: TBlockContext); procedure AddNode(inNode: TNode); end; // TFlow = class private InlineContext: TInlineContext; protected procedure AddBlock(inBox: TBox; inNode: TNode); procedure AddNode(inContext: TBlockContext; inNode: TNode); procedure AddInline(inContext: TBlockContext; inNode: TNode); public constructor Create(inBox: TBox; inNode: TNode); destructor Destroy; override; end; implementation var Flow: TFlow; { TFlow } constructor TFlow.Create(inBox: TBox; inNode: TNode); begin Flow := Self; AddBlock(inBox, inNode); Free; end; destructor TFlow.Destroy; begin FreeAndNil(InlineContext); inherited; end; procedure TFlow.AddNode(inContext: TBlockContext; inNode: TNode); begin if inNode.ContextClass = TBlockContext then AddBlock(inContext.Boxes.NewBox, inNode) else AddInline(inContext, inNode); end; procedure TFlow.AddBlock(inBox: TBox; inNode: TNode); begin FreeAndNil(InlineContext); TBlockContext.Create(inBox, inNode); end; procedure TFlow.AddInline(inContext: TBlockContext; inNode: TNode); begin if InlineContext = nil then InlineContext := TInlineContext.Create(inContext); InlineContext.AddNode(inNode); end; { TBlockContext } constructor TBlockContext.Create(inBox: TBox; inNode: TNode); begin inBox.Node := inNode; if (inNode.Nodes <> nil) and (inNode.Nodes.Count > 0) then begin Boxes := inBox.CreateBoxList; AddNodes(inNode.Nodes); end; Free; end; procedure TBlockContext.AddNodes(inNodes: TNodeList); var i: Integer; begin for i := 0 to inNodes.Max do Flow.AddNode(Self, inNodes[i]); end; { TInlineContext } constructor TInlineContext.Create(inContext: TBlockContext); begin Context := inContext; Line := Context.Boxes.NewBox; Line.CreateBoxList; end; procedure TInlineContext.AddNode(inNode: TNode); begin Line.Boxes.NewBox.Node := inNode; Context.AddNodes(inNode.Nodes); end; end.
unit ufrmDailySalesReport; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ufrmMaster, StdCtrls, ExtCtrls, ufraFooter5Button, Mask, JvToolEdit, SUIButton, uConn, ActnList; type TfrmDailySalesReport = class(TfrmMaster) fraFooter5Button1: TfraFooter5Button; pnlMain: TPanel; lbl1: TLabel; dtTglTo: TJvDateEdit; btnPrint: TsuiButton; actlstDSR: TActionList; actPrintDSR: TAction; actSaveDSRToFile: TAction; procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormDestroy(Sender: TObject); procedure actPrintDSRExecute(Sender: TObject); procedure actSaveDSRToFileExecute(Sender: TObject); procedure FormShow(Sender: TObject); procedure btnPrintEnter(Sender: TObject); procedure btnPrintExit(Sender: TObject); private FParamList: TStringList; function GetDataDSR(ADate: TDateTime): TResultDataSet; procedure SetParamList(const Value: TStringList); public property ParamList: TStringList read FParamList write SetParamList; end; var frmDailySalesReport: TfrmDailySalesReport; implementation uses uGTSUICommonDlg,suithemes, uReportCashierSupv, uConstanta, udmReport, ufrmDialogPrintPreview; {$R *.dfm} { TfrmDailySalesReport } function TfrmDailySalesReport.GetDataDSR(ADate: TDateTime): TResultDataSet; var arrParam: TArr; begin if not Assigned(ReportCashierSupv) then ReportCashierSupv := TReportCashierSupv.Create; SetLength(arrParam, 2); arrParam[0].tipe := ptDateTime; arrParam[0].data := ADate; arrParam[1].tipe := ptInteger; arrParam[1].data := MasterNewUnit.ID; Result := ReportCashierSupv.GetDSR(arrParam); end; procedure TfrmDailySalesReport.SetParamList(const Value: TStringList); begin FParamList := Value; end; procedure TfrmDailySalesReport.FormCreate(Sender: TObject); begin inherited; ParamList := TStringList.Create; end; procedure TfrmDailySalesReport.FormClose(Sender: TObject; var Action: TCloseAction); begin inherited; Action := caFree; end; procedure TfrmDailySalesReport.FormDestroy(Sender: TObject); begin inherited; frmDailySalesReport := nil; frmDailySalesReport.Free; end; procedure TfrmDailySalesReport.actPrintDSRExecute(Sender: TObject); begin inherited; ParamList.Clear; ParamList.Add(FLoginFullname); ParamList.Add(FormatDateTime('dd/mm/yyyy', dtTglTo.Date)); ParamList.Add(MasterNewUnit.Nama); if not Assigned(frmDialogPrintPreview) then frmDialogPrintPreview:= TfrmDialogPrintPreview.Create(Application); try with frmDialogPrintPreview do begin RecordSet := GetDataDSR(dtTglTo.Date); ListParams:= ParamList; FilePath := FFilePathReport + 'frCetakDailySalesReport.fr3'; SetFormPropertyAndShowDialog(frmDialogPrintPreview); end; finally frmDialogPrintPreview.Free; end; end; procedure TfrmDailySalesReport.actSaveDSRToFileExecute(Sender: TObject); begin inherited; ParamList.Clear; ParamList.Add(FLoginFullname); ParamList.Add(FormatDateTime('dd/mm/yyyy', dtTglTo.Date)); ParamList.Add(MasterNewUnit.Nama); with dmReport do begin Params := ParamList; frxDBDataset.DataSet := GetDataDSR(dtTglTo.Date); pMainReport.LoadFromFile(ExtractFilePath(Application.ExeName) + '/template/frCetakDailySalesReport.fr3'); pMainReport.PrepareReport; pMainReport.ShowReport; // frxDotMatrix.ExportObject(pMainReport); pMainReport.Export(frxDotMatrix); end; end; procedure TfrmDailySalesReport.FormShow(Sender: TObject); begin inherited; dtTglTo.Date := now; end; procedure TfrmDailySalesReport.btnPrintEnter(Sender: TObject); begin inherited; (Sender as TsuiButton).UIStyle := DeepBlue; end; procedure TfrmDailySalesReport.btnPrintExit(Sender: TObject); begin inherited; (Sender as TsuiButton).UIStyle := BlueGlass; end; end.
unit unDM; interface uses System.SysUtils, System.Classes, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.FB, FireDAC.Phys.FBDef, FireDAC.VCLUI.Wait, Data.DB, FireDAC.Comp.Client, FireDAC.Phys.ADSDef, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, FireDAC.Comp.DataSet, FireDAC.Phys.ADS, FireDAC.Comp.UI; type TDM = class(TDataModule) Con: TFDConnection; WaitCursor: TFDGUIxWaitCursor; DriverLink: TFDPhysADSDriverLink; qryUsuarios: TFDQuery; qryUsuariosID_USUARIO: TIntegerField; qryUsuariosNOME: TStringField; qryUsuariosUSUARIO: TStringField; qryUsuariosSENHA: TStringField; qryUsuariosATIVO: TStringField; updUsuarios: TFDUpdateSQL; dsUsuarios: TDataSource; qryTanques: TFDQuery; updTanques: TFDUpdateSQL; dsTanques: TDataSource; qryBombas: TFDQuery; updBombas: TFDUpdateSQL; dsBombas: TDataSource; qryAbastecimentos: TFDQuery; updAbastecimentos: TFDUpdateSQL; dsAbastecimentos: TDataSource; qryBombasID_BOMBA: TIntegerField; qryBombasNUMERO: TIntegerField; qryBombasID_TANQUE: TIntegerField; qryTanquesID_TANQUE: TIntegerField; qryTanquesNUMERO: TIntegerField; qryTanquesID_COMBUSTIVEL: TIntegerField; qryTanquesCAPACIDADE: TBCDField; qryCombustiveis: TFDQuery; dsCombustiveis: TDataSource; updCombustiveis: TFDUpdateSQL; qryCombustiveisID_COMBUSTIVEL: TIntegerField; qryCombustiveisTIPO: TStringField; qryCombustiveisVALOR_COMPRA: TBCDField; qryCombustiveisVALOR_VENDA: TBCDField; qryCombustiveisPERC_IMPOSTO: TBCDField; qryTanquesCOMBUSTIVEL: TStringField; qryBombasTANQUE: TIntegerField; qryAbastecimentosUSUARIO: TStringField; qryAbastecimentosBOMBA: TIntegerField; qryAcesso: TFDQuery; qryAcessoID_USUARIO: TFDAutoIncField; qryAcessoNOME: TStringField; qryAcessoUSUARIO: TStringField; qryAcessoSENHA: TStringField; qryAcessoATIVO: TStringField; qryDadosAbastecimento: TFDQuery; qryDadosAbastecimentoID_COMBUSTIVEL: TIntegerField; qryDadosAbastecimentoTIPO: TStringField; qryDadosAbastecimentoVALOR_COMPRA: TBCDField; qryDadosAbastecimentoVALOR_VENDA: TBCDField; qryDadosAbastecimentoPERC_IMPOSTO: TBCDField; qryDadosAbastecimentoDATA: TDateField; qryDadosAbastecimentoHORA: TTimeField; dsDadosAbastecimento: TDataSource; qryAbastecimentosID_ABASTECIMENTO: TFDAutoIncField; qryAbastecimentosID_BOMBA: TIntegerField; qryAbastecimentosID_USUARIO: TIntegerField; qryAbastecimentosVALOR_LIQUIDO: TFMTBCDField; qryAbastecimentosLITROS: TFMTBCDField; qryAbastecimentosDATA: TDateField; qryAbastecimentosHORA: TTimeField; qryAbastecimentosVALOR_IMPOSTO: TBCDField; qryAbastecimentosVALOR_TOTAL: TBCDField; qryDadosAbastecimentoVALOR_IMPOSTO: TFMTBCDField; qryDadosAbastecimentoVALOR_VENDA_IMPOSTO: TFMTBCDField; qryRelatorioGeral: TFDQuery; dsRelatorioGeral: TDataSource; qryRelatorioGeralCOMBUSTIVEL: TStringField; qryRelatorioGeralBOMBA: TIntegerField; qryRelatorioGeralTANQUE: TIntegerField; qryRelatorioGeralVALOR_IMPOSTO: TBCDField; qryRelatorioGeralVALOR_TOTAL: TBCDField; qryRelatorioGeralDATA: TDateField; qryRelatorioGeralVALOR_LIQUIDO: TFMTBCDField; procedure DataModuleCreate(Sender: TObject); procedure qryUsuariosBeforePost(DataSet: TDataSet); private { Private declarations } public { Public declarations } vgIdUsuario : Integer; procedure AbrirUsuarios; procedure AbrirTanques; procedure AbrirBombas; procedure AbrirCombustiveis; procedure AbrirAbastecimento; function Acesso(pUsuario, pSenha : String) : String; procedure BuscarDadosAbastecimento(pIdBomba : Integer); procedure verificacampospreenchidos(DataSet: TDataSet); end; var DM: TDM; implementation {%CLASSGROUP 'Vcl.Controls.TControl'} {$R *.dfm} uses Forms; procedure TDM.AbrirAbastecimento; begin with qryAbastecimentos do begin Close; Open; end; end; procedure TDM.AbrirBombas; begin with qryBombas do begin Close; Open; end; end; procedure TDM.AbrirCombustiveis; begin with qryCombustiveis do begin Close; Open; end; end; procedure TDM.AbrirTanques; begin with qryTanques do begin Close; Open; end; end; procedure TDM.AbrirUsuarios; begin with qryUsuarios do begin Close; Open; end; end; function TDM.Acesso(pUsuario, pSenha: String): String; begin Result := 'SEM ACESSO'; with qryAcesso do begin Close; ParamByName('USUARIO').AsString := pUsuario; Open; if RecordCount > 0 then if (UpperCase(qryAcessoSENHA.AsString) = UpperCase(pSenha)) then if (UpperCase(qryAcessoATIVO.AsString) = UpperCase('S')) then begin vgIdUsuario := qryAcessoID_USUARIO.AsInteger; Result := ''; end else Result := 'Usuário inativo.' else Result := 'Senha Incorreta.' else Result := 'Usuário năo existe.'; end; end; procedure TDM.DataModuleCreate(Sender: TObject); begin with DM.Con do begin if Connected then Connected := False; Connected := True; end; end; procedure TDM.qryUsuariosBeforePost(DataSet: TDataSet); begin verificacampospreenchidos(DataSet); end; procedure TDM.verificacampospreenchidos(DataSet: TDataSet); var I: Integer; begin for I := 0 to DataSet.FieldCount -1 do begin if DataSet.Fields[i].AsString = '' then begin Application.MessageBox(PChar(DataSet.Fields[i].DisplayName), PChar('Obrigatório')); Abort; end; end; end; procedure TDM.BuscarDadosAbastecimento(pIdBomba : Integer); begin with qryDadosAbastecimento do begin Close; ParamByName('id_bomba').AsInteger := pIdBomba; Open; end; end; end.
FUNCTION isPlausible(h, min : INTEGER; temp : REAL) : BOOLEAN; static lastTime : INTEGER = 0; static lastTemp : Real = 0; VAR diff_time : INTEGER; VAR diff_temp : REAL; BEGIN diff_time := (h*60 +min) - lastTime; diff_temp := temp - lastTemp; IF(temp < 936,8) OR (temp > 1345,3) OR ((11,45 / 60) * diff_time > abs(diff_temp)) THEN isPlausible := False; ELSE THEN isPlausible := True; lastTime := (h*60 + minute); lastTemp := temp; END;
{..............................................................................} { Summary A simple hello world - an introduction to DelphiScript language. } { Copyright (c) 2003 by Altium Limited } {..............................................................................} {..............................................................................} Procedure HelloWorld; Begin ShowMessage('Hello world!'); End; {..............................................................................} {..............................................................................} Procedure ShowAParametricMessage(S : String); Var DefaultMessage; Begin DefaultMessage := 'Hello World!'; If S = '' Then ShowMessage(DefaultMessage) Else ShowMessage(S); End; {..............................................................................} {..............................................................................}
{***************************************************************************} { } { Delphi Package Manager - DPM } { } { Copyright © 2019 Vincent Parrett and contributors } { } { vincent@finalbuilder.com } { https://www.finalbuilder.com } { } { } {***************************************************************************} { } { Licensed under the Apache License, Version 2.0 (the "License"); } { you may not use this file except in compliance with the License. } { You may obtain a copy of the License at } { } { http://www.apache.org/licenses/LICENSE-2.0 } { } { Unless required by applicable law or agreed to in writing, software } { distributed under the License is distributed on an "AS IS" BASIS, } { WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. } { See the License for the specific language governing permissions and } { limitations under the License. } { } {***************************************************************************} unit DPM.Console.Options; interface uses DPM.Core.Types, DPM.Console.Types; //NOTE : obsolete - will be removed - changing to indivual options per command in the core. //type // TCommandOptions = class // public // class var // Command : TDPMCommand; // end; // // TCacheOptions = class // public // class var // PackageId : string; // PackageVersion : string; // Source : string; // Platform : TDPMPlatform; // CompilerVersion : TCompilerVersion; // end; // // // // TConfigOptions = class // public // class var // UseSymLinks : boolean; //use symlinks to package cache when installing package // SetValues : string; // end; // // TDeleteOptions = class // public // // end; // type THelpOptions = class public class var HelpCommand : TDPMCommand; end; // // TListOptions = class // public // class var // SearchTerm : string; // Source : string; //source to list package for // end; // // TUpdateOptions = class // public // // end; // // // // // TPushOptions = class // public // // end; // // TSpecOptions = class // public // class var // SpecFile : string; // FromProject : string; // PackagesFile : string; // end; implementation initialization // //default to help if no other command specified; // TCommandOptions.Command := TDPMCommand.Help; // //default to help if not other command specified after help. THelpOptions.HelpCommand := TDPMCommand.None; // // //default is use symlinks, saves disk space. // TConfigOptions.UseSymLinks := true; // end.
{$G+} Unit Sprites; Interface Type SpriteTyp=Record {Aufbau eines Sprite-Datenblocks} Adr:Pointer; {Zeiger auf Grafik-Daten} dtx,dty:Word; {Breite und H”he in Pixel} px,py, {gegenw„rtige Position, optional *} sx,sy:Integer; {gegenw„rtige Geschwindigkeit, optional *} End; {*: optional bedeutet, daá die Sprite-Routinen GetSprite und PutSprite von diesen Angaben keinen Gebrauch machen, die Variablen dienen lediglich dazu, eine Steuerung seitens des Hauptprogramms zu erleichtern} Procedure GetSprite(Ofs,dtx,dty:Word;var zSprite:SpriteTyp); {lies ein Sprite aus vscreen-Offset ofs, mit Breite dtx und H”he dty, zsprite ist der Sprite-Record, in dem Sprite gespeichert werden soll} Procedure PutSprite(pg_ofs,x,y:Integer;qsprite:spritetyp); {kopiert Sprite aus Hauptspeicher (Lage und Gr”áe werden qsprite entnommen) auf Bildschirmspeicher Seite pg an Position (x/y)} Implementation Uses ModeXLib; Var i:Word; Procedure GetSprite; Var ppp:Array[0..3] of Byte; {Tabelle mit Anzahl zu kopierender Pixel} {pro Plane} Skip:word; {Anzahl zu berspringender Bytes} Plane_Count:Word; {Z„hler der bereits kopierten Planes} Begin GetMem(zsprite.adr,dtx*dty); {Hauptspeicher allokieren} zsprite.dtx:=dtx; {im Sprite-Record Breite und H”he vermerken} zsprite.dty:=dty; i:=dtx shr 2; {Anzahl glatter Viererbl”cke} ppp[0]:=i;ppp[1]:=i; {entspricht Mindestanzahl zu kop. Bytes} ppp[2]:=i;ppp[3]:=i; For i:=1 to dtx and 3 do {"berstehende" Pixel in ppp vermerken} Inc(ppp[(i-1) and 3]); {beginnend mit Startplane Pixel anfgen} Plane_Count:=4; {4 Planes kopieren} asm push ds mov di,word ptr zsprite {zun„chst Zeiger auf Daten-Block laden} les di,[di] {Zeiger auf Grafikdaten in es:di laden} lea bx,ppp {bx zeigt auf ppp-Array} lds si,vscreen {Zeiger auf Bild laden} add Ofs,si {Offset der eigentlichen Sprite-Daten dazu} @lcopy_plane: {wird einmal pro Plane durchlaufen} mov si,ofs {si mit Startadresse der Sprite-Daten laden} mov dx,dty {y-Z„hler mit Zeilenzahl laden} xor ah,ah {ah l”schen} mov al,ss:[bx] {al mit aktuelem ppp-Eintrag laden} shl ax,2 {es werden jeweils 4er-Bl”cke bewegt} sub ax,320 {Differenz zur 320 bilden} neg ax {aus ax-320 320-ax machen} mov skip,ax {Wert in Skip sichern} @lcopy_y: {wird einmal pro Zeile durchlaufen} mov cl,ss:[bx] {Breite aus ppp-Array laden} @lcopy_x: {wird einmal pro Punkt durchlaufen} movsb {Byte kopieren} add si,3 {auf n„chsten Punkt dieser Plane} dec cl {alle Punkte dieser Zeile kopieren} jne @lcopy_x add si,skip {danach auf Anfang der n„chsten Zeile} dec dx {alle Zeilen kopieren} jne @lcopy_y inc bx {auf n„chsten ppp-Eintrag positionieren} inc ofs {auf neuen Plane-Start positionieren} dec plane_count {alle Planes kopieren} jne @lcopy_plane pop ds End; End; Procedure PutSprite; var plane_count, {Z„hler der bereits kopierten Planes} planemask:Byte; {maskiert Write-Plane in TS-Register 2} Skip, {Anzahl zu berspringender Bytes} ofs, {aktueller Offset im Bildschirmspeicher} plane, {Nummer der aktuellen Plane} Breite, {Breite zu kopierender Bytes in einer Zeile,} dty:Word; {H”he} quelle:Pointer; {Zeiger auf Grafikdaten, wenn ds ver„ndert} clip_lt, clip_rt:integer; {Anzahl links und rechts berstehender PIXEL} clipakt_lt, {bei aktueller Plane aktive Anzahl} clipakt_rt, {berstehender BYTES} clip_dn,clip_up:Word; {Anzahl oben und unten berstehender ZEILEN} ppp:Array[0..3] of Byte; {Anzahl Pixel pro Plane} cpp:Array[0..3] of Byte; {berstehende BYTES pro Plane} Begin if (x > 319) or {Darstellung berflssig, } (x+qsprite.dtx < 0) or {weil gar nicht im Bild ?} (y > 199) or (y+qsprite.dty < 0) then exit; clip_rt:=0; {im Normalfall kein Clipping} clip_lt:=0; {-> alle Clipping-Variablen auf 0} clip_dn:=0; clip_up:=0; clipakt_rt:=0; clipakt_lt:=0; with qsprite do begin if y+dty > 200 then begin {erster Clipping Fall: unten} clip_dn:=(y+dty-200); {berstehende Zeilen vermerken} dty:=200-y; {und Sprite-H”he reduzieren} End; if y<0 then begin {zweiter Clipping Fall: oben} clip_up:=-y; {berstehende Zeilen vermerken} dty:=dty+y; {und Sprite-H”he reduzieren} y:=0; {Start-y ist 0, weil oberer Bildrand} End; if x+dtx > 320 then begin {dritter Clipping Fall: rechts} clip_rt:=x+dtx-320; {berstehende Pixel vermerken} dtx:=320-x; {Breite reduzieren} End; if x<0 then begin {vierter Clipping Fall: links} clip_lt:=-x; {berstehende Pixel vermerken} plane:=4-(clip_lt mod 4); {neue Startplane fr Spalte 0 berechnen} plane:=plane and 3; {diese auf 0..3 reduzieren} ofs:=pg_ofs+80*y+((x+1) div 4) - 1; {Ofs auf korrekten 4er-Block setzen} x:=0; {Darstellung in Spalte beginnen} End Else Begin {rechts kein Clipping ?} plane:=x mod 4; {dann konventionelle Berechnung von Plane} ofs:=pg_ofs+80*y+(x div 4); {und Offset} End; End; Quelle:=qsprite.adr; {Zeiger Grafik-Daten} dty:=qsprite.dty; {und H”he in lok. Variablen sichern} Breite:=0; {Breite und Skip vorinitialisieren} Skip:=0; i:=qsprite.dtx shr 2; {Anzahl glatter Viererbl”cke} ppp[0]:=i;ppp[1]:=i; {entspricht Mindestanzahl zu kop. Bytes} ppp[2]:=i;ppp[3]:=i; For i:=1 to qsprite.dtx and 3 do{"berstehende" Pixel in ppp vermerken} Inc(ppp[(plane+i - 1) and 3]);{beginnend mit Startplane Pixel anfgen} i:=(clip_lt+clip_rt) shr 2; cpp[0]:=i;cpp[1]:=i; {Clipping-Vorgabe : alle Seiten 0} cpp[2]:=i;cpp[3]:=i; For i:=1 to clip_rt and 3 do {wenn rechts Clipping entsprechende Anzahl} Inc(cpp[i-1]); {in Planes eintragen} For i:=1 to clip_lt and 3 do {wenn rechts Clipping entsprechende Anzahl} Inc(cpp[4-i]); {in Planes eintragen} asm mov dx,3ceh {GDC Register 5 (GDC Mode)} mov ax,4005h {auf Write Mode 0 setzen} out dx,ax push ds {ds sichern} mov ax,0a000h {Zielsegment (VGA) laden} mov es,ax lds si,quelle {Quelle (Zeiger auf Grafikdaten) nach ds:si} mov cx,plane {Start-Planemaske erstellen} mov ax,1 {dazu Bit 0 um Plane nach links schieben} shl ax,cl mov planemask,al {Maske sichern} shl al,4 {auch in oberes Nibble eintragen} or planemask,al mov plane_count,4 {4 Planes zu kopieren} @lplane: {wird einmal pro Plane durchlaufen} mov cl,byte ptr plane {aktuelle Plane laden} mov di,cx {in di} mov cl,byte ptr ppp[di] {cx mit zugeh”riger ppp-Anzahl laden} mov byte ptr Breite,cl {Skip jeweils neu ausrechnen} mov ax,80 {dazu Differenz 80-Breite bilden} sub al,cl mov byte ptr skip,al {und in skip schreiben} mov al,byte ptr cpp[di] {Plane-spezifische Clipping-Weite laden} cmp clip_lt,0 {wenn links kein Clipping, weiter mit rechts} je @rechts mov clipakt_lt,ax {in clip_akt_lt sichern} sub Breite,ax {Breite zu kopierender Bytes reduzieren} jmp @clip_rdy {rechts kein Clipping} @rechts: {wenn links kein Clipping} mov clipakt_rt,ax {dazu Clipping fr alle Planes, in clip_akt} @clip_rdy: mov ax,Breite {Gesamtbreite in Byte berechnen} add ax,clipakt_rt add ax,clipakt_lt mul clip_up {mit Anzahl Zeilen des oberen Clipping mul.} add si,ax {diese Bytes werden nicht dargestellt} mov cx,Breite {cx mit Breite laden} or cl,cl {Breite 0, dann Plane fertig} je @plane_fertig mov di,ofs {Zieloffset im Bildschirmspeicher nach di} mov ah,planemask {Planemaske auf bit [0..3] reduzieren} and ah,0fh mov al,02h {und ber TS - Register 2 (Write Plane Mask)} mov dx,3c4h {setzen} out dx,ax mov bx,dty {y-Z„hler initialisieren} @lcopy_y: {y-Schleife, pro Zeile einmal durchlaufen} add si,clipakt_lt {Quellzeiger um linkes Clipping weiter} add di,clipakt_lt {auch Zielzeiger} @lcopy: {x-Schleife, pro Punkt einmal durchlaufen} lodsb {Byte holen} or al,al {wenn 0, dann berspringen} je @Wert0 stosb {ansonsten: setzen} @entry: loop @lcopy {und Schleife weiter} add si,clipakt_rt {nach kompletter Zeile rechtes Clipping} dec bx {y-Z„hler weiter} je @plane_fertig {y-Z„hler = 0, dann n„chste Plane} add di,skip {sonst auf n„chsten Zeilenanfang springen} mov cx,Breite {x-Z„hler reinitialisieren,} jmp @lcopy_y {wieder in y-Schleife springen} @wert0: {Sprite-Farbe 0:} inc di {Zielbyte berspringen} jmp @entry {und wieder in Schleife zurck} @plane_fertig: {hier ist y-Schleife beendet} mov ax,Breite {Gesamtbreite in Byte berechnen} add ax,clipakt_rt add ax,clipakt_lt mul clip_dn {mit Anzahl Zeilen des unteren Clipping mul.} add si,ax {diese Bytes werden nicht dargestellt} rol planemask,1 {n„chste Plane maskieren} mov cl,planemask {plane 0 selektiert ?} and cx,1 {(Bit 1 gesetzt), dann} add ofs,cx {Zieloffset erh”hen um 1 (cx Bit 1 !)} inc plane {Plane-Nummer (Index in ppp) weiter} and plane,3 {auf 0 bis 3 reduzieren} dec plane_count {schon 4 Planes kopiert ?, dann Ende} jne @lplane pop ds {ds restaurieren, und Tschá} End;{asm} End; Begin End.
unit Validador.Core.Impl.UnificadorXML; interface implementation uses System.SysUtils, Xml.xmldom, Xml.XMLDoc, Xml.XMLIntf, Validador.DI, Validador.Data.dbChangeXML, Validador.Core.UnificadorXML; type TUnificadorXML = class(TInterfacedObject, IUnificadorXML) private FXMLAnterior: IXMLDocument; FXMLNovo: IXMLDocument; procedure Mesclar(const AXMLUnificado: IXMLHavillanType); procedure CopiarScript(_xmlNovoScript, _xmlScript: IXMLScriptType); procedure CopiarXMLNovo(const AXMLUnificado: IXMLHavillanType); procedure CopiarXMLAnterior(const AXMLUnificado: IXMLHavillanType); public procedure PegarXMLMesclado(const AXMLDocument: IXMLDocument); procedure SetXMLAnterior(const Xml: IXMLDocument); procedure SetXMLNovo(const Xml: IXMLDocument); end; procedure TUnificadorXML.SetXMLAnterior(const Xml: IXMLDocument); begin FXMLAnterior := Xml; end; procedure TUnificadorXML.SetXMLNovo(const Xml: IXMLDocument); begin FXMLNovo := Xml; end; procedure TUnificadorXML.PegarXMLMesclado(const AXMLDocument: IXMLDocument); var _havillan: IXMLHavillanType; begin _havillan := Gethavillan(AXMLDocument); Mesclar(_havillan); end; procedure TUnificadorXML.Mesclar(const AXMLUnificado: IXMLHavillanType); begin CopiarXMLAnterior(AXMLUnificado); CopiarXMLNovo(AXMLUnificado); end; procedure TUnificadorXML.CopiarXMLAnterior(const AXMLUnificado: IXMLHavillanType); var i: Integer; _xmlScript: IXMLScriptType; _xmlNovoScript: IXMLScriptType; _xmlHavillanNovo: IXMLHavillanType; begin _xmlHavillanNovo := Gethavillan(FXMLAnterior); for i := 0 to Pred(_xmlHavillanNovo.Count) do begin _xmlScript := _xmlHavillanNovo.Script[i]; _xmlNovoScript := AXMLUnificado.Add; CopiarScript(_xmlNovoScript, _xmlScript); end; end; procedure TUnificadorXML.CopiarXMLNovo(const AXMLUnificado: IXMLHavillanType); var i: Integer; _xmlScript: IXMLScriptType; _xmlNovoScript: IXMLScriptType; _xmlHavillanNovo: IXMLHavillanType; begin _xmlHavillanNovo := Gethavillan(FXMLNovo); for i := 0 to Pred(_xmlHavillanNovo.Count) do begin _xmlScript := _xmlHavillanNovo.Script[i]; _xmlNovoScript := AXMLUnificado.Add; CopiarScript(_xmlNovoScript, _xmlScript); end; end; procedure TUnificadorXML.CopiarScript(_xmlNovoScript, _xmlScript: IXMLScriptType); begin Validador.Data.dbChangeXML.AtribuirNome(_xmlNovoScript, _xmlScript.Text, _xmlScript.A_name); if not _xmlScript.Version.Trim.IsEmpty then _xmlNovoScript.Version := _xmlScript.Version; if not _xmlScript.X_has_pos.Trim.IsEmpty then _xmlNovoScript.X_has_pos := _xmlScript.X_has_pos; if not _xmlScript.Description.Trim.IsEmpty then _xmlNovoScript.Description := _xmlScript.Description; if not _xmlScript.Z_description.Trim.IsEmpty then _xmlNovoScript.Z_description := _xmlScript.Z_description; if not _xmlScript.Text.Trim.IsEmpty then _xmlNovoScript.Text := _xmlScript.Text; end; initialization ContainerDI.RegisterType<TUnificadorXML>.Implements<IUnificadorXML>('UnificadorXML'); ContainerDI.Build; end.
//------------------------------------------------------------------------------ //GMCommandsOptions UNIT //------------------------------------------------------------------------------ // What it does- // gain access to configuration variables loaded from GMCommands.ini // // Changes - // [2007/08/10] Aeomin - Created. // [2007/09/08] Aeomin - Update to support new command structure // [2007/10/29] Aeomin - Merge from CustomGMCommandNameOptions.pas // //------------------------------------------------------------------------------ unit GMCommandsOptions; {$IFDEF FPC} {$MODE Delphi} {$ENDIF} interface uses Classes, IniFiles, List32; type //---------------------------------------------------------------------- //TGMCommandsOptions CLASS //---------------------------------------------------------------------- TGMCommandsOptions = class(TMemIniFile) public function Load(const CommandList : TStringList;var Commands: TStringList):Char; procedure Save(const Commands : TStringList); end; implementation uses SysUtils, Math, Globals, GMCommands; //------------------------------------------------------------------------------ //Load PROCEDURE //------------------------------------------------------------------------------ // What it does- // Loop through list of commands, and try get each level // setting. // // Changes - // [2007/08/10] Aeomin - Created. // [2007/10/29] Aeomin - Merge from CustomGMCommandNameOptions.pas // //------------------------------------------------------------------------------ function TGMCommandsOptions.Load(const CommandList : TStringList;var Commands: TStringList):Char; var Section : TStringList; //---------------------------------------------------------------------- //LoadCommandConf SUB PROCEDURE //---------------------------------------------------------------------- function LoadCommandConf:Char; begin ReadSectionValues('Command Configs', Section); if Section.Values['Command Prefix'] = '' then begin Section.Values['Command Prefix'] := '#'; WriteString('Command Configs', 'Command Prefix', '#'); UpdateFile; Result := '#'; end else begin Result := Section.Values['Command Prefix'][1]; end; end; //---------------------------------------------------------------------- //---------------------------------------------------------------------- //LoadGMCommandsOptions SUB PROCEDURE //---------------------------------------------------------------------- procedure LoadGMCommandsOptions; var Index : Integer; Command : TCommand; begin ReadSectionValues('Command Level', Section); //Loop through all commands, and try to get each level config for Index := CommandList.Count -1 downto 0 do begin Command := CommandList.Objects[Index] as TCommand; // Set default GM level require 99, to prevent mistakes Command.Level := EnsureRange(StrToIntDef(Section.Values[CommandList[Index]], 99), 0, High(Byte)); end; end;{LoadGMCommandsOptions} //---------------------------------------------------------------------- //---------------------------------------------------------------------- //LoadCustomGMCommandNames SUB PROCEDURE //---------------------------------------------------------------------- procedure LoadCustomGMCommandNames; var Index : Integer; Splitter : TStringList; SplitIdx : Integer; Command : TCommand; begin ReadSectionValues('Command Names', Section); Commands.Clear; Splitter := TStringList.Create; Splitter.Delimiter := ','; //Loop through all commands for Index := CommandList.Count -1 downto 0 do begin // So yeh, nothing is best // If there's empty or called entry not exit, then just set as default name! if Section.Values[CommandList[Index]] = '' then begin Section.Values[CommandList[Index]] := CommandList[Index]; //And don't forget to write it! WriteString('Command Names', CommandList[Index], CommandList[Index]); end; Splitter.DelimitedText := Section.Values[CommandList[Index]]; // Get TCommand object Command := CommandList.Objects[Index] as TCommand; // TODO: use result isnt smart =( Command.Syntax := Result + Command.Name + ' ' + Command.Syntax; for SplitIdx := Splitter.Count -1 downto 0 do begin if ( Commands.IndexOf(Splitter[SplitIdx]) = -1 ) then begin Commands.AddObject(Splitter[SplitIdx], Command); end else begin // Duplicated! Console.Message('Duplicated GM Command name ''' + Splitter[SplitIdx] + '''', 'Config', MS_WARNING); end; end; end; Splitter.Clear; Splitter.Free; //Well, update it, even though "may" not needed it.. UpdateFile; end;{LoadCustomGMCommandNames} //---------------------------------------------------------------------- begin Section := TStringList.Create; Section.QuoteChar := '"'; Section.Delimiter := ','; Result := LoadCommandConf; LoadGMCommandsOptions; LoadCustomGMCommandNames; Section.Free; end;{Load} //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Load PROCEDURE //------------------------------------------------------------------------------ // What it does- // Loop through list of commands, and try get each level // setting. // // Changes - // [2007/09/28] Aeomin - Created header... // //------------------------------------------------------------------------------ procedure TGMCommandsOptions.Save(const Commands : TStringList); var Index : Integer; Command : TCommand; begin for Index := Commands.Count -1 downto 0 do begin Command := Commands.Objects[Index] as TCommand; WriteString('Command Level',Command.Name, IntToStr(Command.Level)); end; UpdateFile; end;{Save} //------------------------------------------------------------------------------ end{GMCommandsOptions}.
PROGRAM Kleines; USES Gem,OWindows,OTypes,ODialogs; {$I KLEINES.I} TYPE TMyApplication = OBJECT(TApplication) PROCEDURE InitInstance; VIRTUAL; PROCEDURE InitMainWindow; VIRTUAL; END; PInfoMenu = ^TInfoMenu; TInfoMenu = OBJECT(TKeyMenu) PROCEDURE Work; VIRTUAL; END; POpenDialog = ^TOpenDialog; TOpenDialog = OBJECT(TKeyMenu) PROCEDURE Work; VIRTUAL; END; PMyDialog = ^TMyDialog; TMyDialog = OBJECT(TDialog) FUNCTION Ok : BOOLEAN; VIRTUAL; FUNCTION Cancel : BOOLEAN; VIRTUAL; END; VAR MyApplication : TMyApplication; Buffer : RECORD Kette : STRING[21]; O1,O2 : INTEGER; END; PROCEDURE TMyApplication.InitInstance; BEGIN LoadResource('KLEINES.RSC',''); LoadMenu(main_menu); NEW(PInfoMenu,Init(@SELF,K_Ctrl,Ctrl_I,menu_info,desk_menu)); NEW(POpenDialog,Init(@SELF,K_Ctrl,Ctrl_D,menu_open_dialog,file_menu)); INHERITED InitInstance; SetQuit(menu_quit,file_menu); END; PROCEDURE TMyApplication.InitMainWindow; BEGIN END; PROCEDURE TInfoMenu.Work; BEGIN IF ADialog = NIL THEN BEGIN NEW(ADialog,Init(NIL,'šber KLEINES',info_dial)); END; IF ADialog <> NIL THEN ADialog^.MakeWindow; END; PROCEDURE TOpenDialog.Work; BEGIN IF ADialog = NIL THEN BEGIN ADialog := NEW(PMyDialog,Init(NIL,'KLEINES šbungsprogramm',main_dial)); IF ADialog <> NIL THEN BEGIN NEW(PButton,Init(ADialog,md_ok,id_ok,TRUE,'Zeigt Eingaben in einer Alertbox an und beendet das Programm.')); NEW(PButton,Init(ADialog,md_cancel,id_cancel,TRUE,'Beendet Programm, ohne Daten Anzuzeigen.')); NEW(PEdit,Init(ADialog,md_edit,21,'Hier kann Text eingegeben werden.')); NEW(PGroupBox,Init(ADialog,md_option_box,'Optionen','In dieser Box befinden sich zwei RadioButtons')); NEW(PRadioButton,Init(ADialog,md_option1,TRUE,'Die erste Option')); NEW(PRadioButton,Init(ADialog,md_option2,TRUE,'Die zweite Option')); ADialog^.TransferBuffer := @Buffer; END; END; IF ADialog <> NIL THEN ADialog^.MakeWindow; END; FUNCTION TMyDialog.Ok : BOOLEAN; VAR Valid : BOOLEAN; Ausgabe : STRING; BEGIN Valid := INHERITED Ok; IF Valid = TRUE THEN BEGIN Ausgabe := 'In die Editzeile wurde "'+Buffer.Kette+'" eingegeben. Es wurde der Radiobutton "'; IF Buffer.O1 = bf_checked THEN Ausgabe := Ausgabe+'1' ELSE Ausgabe := Ausgabe+'2'; Ausgabe := Ausgabe+'. Option" ausgew„hlt.'; Application^.Alert(NIL,1,0,Ausgabe,'&Ok'); Ok := TRUE; END ELSE Ok := FALSE; END; FUNCTION TMyDialog.Cancel : BOOLEAN; BEGIN IF Application^.Alert(NIL,2,2,'Wirklich Beenden?','&Abbruch|&Ok') = 2 THEN BEGIN Cancel := TRUE; END ELSE Cancel := FALSE; END; BEGIN MyApplication.Init('Kleines'); MyApplication.Run; MyApplication.Done; END.
unit ufrmWorksheet; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ufrmMasterBrowse, uFormProperty, ComCtrls, StdCtrls, ExtCtrls, ActnList, Math, System.Actions, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxBarBuiltInMenu, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, cxNavigator, Data.DB, cxDBData, cxContainer, dxCore, cxDateUtils, Vcl.Menus, ufraFooter4Button, cxButtons, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxCalendar, cxLabel, cxGridLevel, cxClasses, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid, cxPC; type TfrmWorksheet = class(TfrmMasterBrowse) dlgSaveFile: TSaveDialog; pnlButtonUP: TPanel; rgReportType: TRadioGroup; procedure actExportExecute(Sender: TObject); procedure actPrintExecute(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure actRefreshExecute(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); private procedure Detil; procedure InitGrid; public end; var frmWorksheet: TfrmWorksheet; const _Kol_No : integer = 0; _Kol_Date : integer = 1; _Kol_POS : integer = 2; _Kol_Shift : integer = 3; _Kol_Cashier : integer = 4; _Kol_TransNo : integer = 5; _Kol_Init : integer = 6; _Kol_Cash : integer = 7; _Kol_VAH : integer = 8; _Kol_BAH : integer = 9; _Kol_Db_Card : integer = 10; _Kol_Cr_Card : integer = 11; _kol_Disc_cc : Integer = 12; _Kol_BCA : integer = 13; _Kol_Physical : integer = 14; _Kol_DeltaCash: integer = 15; _Kol_Total : integer = 16; _ColCount : Integer = 18; _Kol_toko : Integer = 17; _RowCount : Integer = 2; implementation uses udmReport, ufrmPopupGrid, uTSCommonDlg; {$R *.dfm} procedure TfrmWorksheet.actExportExecute(Sender: TObject); begin inherited; {if GrdMain.Cells[0,0] = '' then exit; dlgSaveFile.InitialDir := ExtractFilePath(Application.ExeName); if dlgSaveFile.Execute then begin GrdMain.SaveToXLS(dlgSaveFile.FileName); end; } end; procedure TfrmWorksheet.actPrintExecute(Sender: TObject); var sSQL: string; ss:string; begin inherited; { frVariables.Variable['PERIODE'] := dtp1.Date; if FTipeApp = TSTORE then begin if rgReportType.ItemIndex = 0 then begin sSQL := 'select wr.*, fp.FINPAYMENT_GRAND_TOTAL ' + ' from PROC_TR$WORKSHEET_RPT(' + QuotD(dtp1.Date)+ ',' + IntToStr(masternewunit.id) + ') wr' + ' Left join FINAL_PAYMENT fp on wr.BAL_ID = fp.FINPAYMENT_BALANCE_ID and wr.Bal_unt_ID=fp.FINPAYMENT_BALANCE_UNT_ID where o_pos<> ' + Quot('-'); dmReportNew.EksekusiReport('frWorksheetReportByValue',sSQL,''); end else begin sSQL := 'select * from PROC_TR$WORKSHEET_RPT_TRANS(' + QuotD(dtp1.Date) + ',' + IntToStr(masternewunit.id) + ')'; dmReportNew.EksekusiReport('frWorksheetReportByTrans',sSQL,''); end; end else begin SS := 'select unt_id,unt_name from aut$unit where unt_is_active=1'; sSQL := ''; with cOpenQuery(ss) do begin while not Eof do begin if sSql <> '' then sSQL := sSQL + ' union '; if rgReportType.ItemIndex = 0 then sSQL := sSQL + 'select unt_id,unt_name, wr.*, fp.FINPAYMENT_GRAND_TOTAL ' + ' from PROC_TR$WORKSHEET_RPT(' + QuotD(dtp1.Date)+ ',' + IntToStr(Fields[0].AsInteger) + ') wr' + ' Left join FINAL_PAYMENT fp on wr.BAL_ID = fp.FINPAYMENT_BALANCE_ID and wr.Bal_unt_ID=fp.FINPAYMENT_BALANCE_UNT_ID' + ' inner join aut$unit on unt_id= ' + IntToStr(Fields[0].AsInteger) + ' where e_total<>0 and o_pos<> ' + Quot('-') else sSQL := sSQL + 'select unt_id,unt_name,a.* from PROC_TR$WORKSHEET_RPT_TRANS(' + QuotD(dtp1.Date) + ',' + IntToStr(Fields[0].AsInteger) + ') a' + ' inner join aut$unit on unt_id= ' + IntToStr(Fields[0].AsInteger) + ' where e_total<>0 and o_pos<> ' + Quot('-'); next; end; end; if rgReportType.ItemIndex = 0 then dmReportNew.EksekusiReport('frWorksheetReportByValue',sSQL,'') else dmReportNew.EksekusiReport('frWorksheetReportByTrans',sSQL,''); end; } end; procedure TfrmWorksheet.FormShow(Sender: TObject); begin inherited; dtAwalFilter.Date := Now; actRefresh.Enabled := True; actExport.Enabled := True; InitGrid; end; procedure TfrmWorksheet.FormDestroy(Sender: TObject); begin inherited; frmWorksheet := nil; end; procedure TfrmWorksheet.FormClose(Sender: TObject; var Action: TCloseAction); begin inherited; Action := caFree; end; procedure TfrmWorksheet.actRefreshExecute(Sender: TObject); var sSQL: string; i : integer; SS : string; begin inherited; { if FTipeApp = TSTORE then begin if rgReportType.ItemIndex = 0 then sSQL := 'select wr.*, fp.FINPAYMENT_GRAND_TOTAL ' + ' from PROC_TR$WORKSHEET_RPT(' + QuotD(dtp1.Date)+ ',' + IntToStr(masternewunit.id) + ') wr' + ' Left join FINAL_PAYMENT fp on wr.BAL_ID = fp.FINPAYMENT_BALANCE_ID and wr.Bal_unt_ID=fp.FINPAYMENT_BALANCE_UNT_ID' else sSQL := 'select * from PROC_TR$WORKSHEET_RPT_TRANS(' + QuotD(dtp1.Date) + ',' + IntToStr(masternewunit.id) + ')'; end else begin SS := 'select unt_id,unt_name from aut$unit where unt_is_active=1'; sSQL := ''; with cOpenQuery(ss) do begin while not Eof do begin if sSql <> '' then sSQL := sSQL + ' union '; if rgReportType.ItemIndex = 0 then sSQL := sSQL + 'select unt_id,unt_name, wr.*, fp.FINPAYMENT_GRAND_TOTAL ' + ' from PROC_TR$WORKSHEET_RPT(' + QuotD(dtp1.Date)+ ',' + IntToStr(Fields[0].AsInteger) + ') wr' + ' Left join FINAL_PAYMENT fp on wr.BAL_ID = fp.FINPAYMENT_BALANCE_ID and wr.Bal_unt_ID=fp.FINPAYMENT_BALANCE_UNT_ID' + ' inner join aut$unit on unt_id= ' + IntToStr(Fields[0].AsInteger) + ' where e_total<>0' else sSQL := sSQL + 'select unt_id,unt_name,a.* from PROC_TR$WORKSHEET_RPT_TRANS(' + QuotD(dtp1.Date) + ',' + IntToStr(Fields[0].AsInteger) + ') a' + ' inner join aut$unit on unt_id= ' + IntToStr(Fields[0].AsInteger) + ' where e_total<>0'; next; end; end; end; InitGrid; i := 1; with cOpenQuery(sSQL) do begin try with GrdMain do begin while not Eof do begin if (FieldByName('O_POS').AsString <> '-') or (FieldByName('O_SHIFT').AsString <> '-') then begin AddRow; Dates[_Kol_Date, i] := FieldByName('O_DATE').AsDateTime; if FTipeApp = TSTORE then Cells[_Kol_POS, i] := FieldByName('O_POS').AsString else Cells[_Kol_POS, i] := FieldByName('UNT_NAME').AsString; Cells[_Kol_Shift, i] := FieldByName('O_SHIFT').AsString; Cells[_Kol_Cashier, i] := FieldByName('CSR_ID').AsString + ' - ' + FieldByName('CSR_NAME').AsString; if rgReportType.ItemIndex = 0 then begin Cells[_Kol_TransNo, i] := ''; Cells[_Kol_Physical, i] := FieldByName('FINPAYMENT_GRAND_TOTAL').AsString; Floats[_Kol_DeltaCash, i]:= FieldByName('FINPAYMENT_GRAND_TOTAL').AsFloat - Round((FieldByName('E_INIT').AsFloat + FieldByName('E_CASH').AsFloat) - Floor(FieldByName('E_DISCCC').AsFloat)); end else begin Cells[_Kol_TransNo, i] := FieldByName('TR_NO').AsString; Cells[_Kol_Physical, i] := '0'; Cells[_Kol_DeltaCash, i]:= '0'; end; if FTipeApp = TSTORE THEN begin if (Cells[_Kol_Shift, i-1 ] <> FieldByName('O_SHIFT').AsString) or (Cells[_Kol_Cashier, i-1] <> FieldByName('CSR_ID').AsString + ' - ' + FieldByName('CSR_NAME').AsString) or (Cells[_Kol_POS, i-1] <> FieldByName('O_POS').AsString) then Floats[_Kol_Init, i] := FieldByName('E_INIT').AsFloat; end else begin if (Cells[_Kol_Shift, i-1 ] <> FieldByName('O_SHIFT').AsString) or (Cells[_Kol_Cashier, i-1] <> FieldByName('CSR_ID').AsString + ' - ' + FieldByName('CSR_NAME').AsString) or (Cells[_Kol_POS, i-1] <> FieldByName('UNT_NAME').AsString) then Floats[_Kol_Init, i] := FieldByName('E_INIT').AsFloat; end; // ShowMessage(FieldByName('E_DISCCC').AsString); Floats[_Kol_Cash, i] := Round(FieldByName('E_CASH').AsFloat - Floor(FieldByName('E_DISCCC').AsFloat)); Floats[_Kol_VAH, i] := FieldByName('E_VOCR').AsFloat; Floats[_Kol_BAH, i] := FieldByName('E_BTL').AsFloat; Floats[_Kol_Db_Card, i] := FieldByName('E_DEB').AsFloat; Floats[_Kol_Cr_Card, i] := FieldByName('E_CRE').AsFloat; Floats[_kol_Disc_cc, i] := FieldByName('E_DISCCC').AsFloat; Floats[_Kol_BCA, i] := FieldByName('E_BCA').AsFloat; if rgReportType.ItemIndex = 0 then Floats[_Kol_Total, i] := FieldByName('E_total').AsFloat else Floats[_Kol_Total, i] := FieldByName('E_total').AsFloat + Floats[_Kol_Init, i] ; IF FTipeApp = THO then Ints[_Kol_toko,i] := FieldByName('UNT_id').AsInteger; // Round(FieldByName('E_TOTAL').AsFloat // - Floor(FieldByName('E_DISCCC').AsFloat)); i := i + 1; end; Next; End; SplitAllCells; AutoNumberCol(_Kol_No); FloatingFooter.Visible := True; if rgReportType.ItemIndex = 0 then begin for i := _Kol_Init to _Kol_Total do begin Floats[i, RowCount-1] := ColumnSum(i, 1, RowCount-2); end; AutoSize := True; Columns[_Kol_TransNo].Width := 0; end else begin for i := _Kol_Cash to _Kol_Total do begin Floats[i, RowCount-1] := ColumnSum(i, 1, RowCount-2); end; AutoSize := True; Columns[_Kol_Physical].Width := 0; Columns[_Kol_DeltaCash].Width := 0; end; MergeCells(_Kol_No, RowCount-1, _Kol_Cash, 1); Cells[_Kol_No, RowCount-1] := 'G R A N D T O T A L'; end; finally SetWarnaBarisSG(GrdMain); Free; end; //try end; //with } end; procedure TfrmWorksheet.Detil; var sDtFormat: string; dtTrans : TDateTime; sSQL : string; sFilter : string; sfield : string; begin { sDtFormat := FormatSettings.ShortDateFormat; FormatSettings.ShortDateFormat := 'DD-MM-YYYY'; if not TryStrToDate(GrdMain.Cells[_Kol_Date, GrdMain.Row], dtTrans) then begin FormatSettings.ShortDateFormat := 'MM-DD-YYYY'; if not TryStrToDate(GrdMain.Cells[_Kol_Date, GrdMain.Row], dtTrans) then begin CommonDlg.ShowError('Tidak bisa melakukan konversi tanggal transaksi'); Exit; end; end; FormatSettings.ShortDateFormat := sDtFormat; if FTipeApp = TSTORE then sFilter :=' and a.TRANSD_UNT_ID= '+ IntToStr(MasterNewUnit.ID) else sFilter := ' and a.TRANSD_UNT_ID= '+ IntToStr(GrdMain.ints[_Kol_toko, grdmain.row]); if FTipeApp = TSTORE then sfield :='' else sfield := IntToStr(GrdMain.ints[_Kol_toko, grdmain.row]) + ' as "Toko", '; sSQL := 'select e.SUP_CODE as "Kode Suplier", e.SUP_NAME as "Nama Suplier",' + sfield + ' f.MERCHAN_CODE ||'' ''|| f.MERCHAN_NAME as "Divisi",' + ' g.MERCHANGRUP_CODE ||'' ''||g.MERCHANGRUP_NAME as "Kategori",' + ' a.TRANSD_BRG_CODE as "Plu", c.BRG_ALIAS as "Nama Barang",' + ' cast(sum(a.TRANSD_QTY) as double precision) as "Qty Sales",' + ' cast(sum(a.TRANSD_SELL_PRICE * a.TRANSD_QTY) as double precision)as "Gross",' + ' cast(sum(a.TRANSD_TOTAL - (a.TRANSD_DISC_CARD * a.TRANSD_QTY) - a.TRANSD_DISC_GMC_NOMINAL) as double precision) as "Netto",' + ' cast(sum(a.TRANSD_SELL_PRICE * a.TRANSD_QTY - a.TRANSD_TOTAL + a.TRANSD_DISC_CARD + a.TRANSD_DISC_GMC_NOMINAL) as double precision) as "Diskon"' + ' from TRANSAKSI_DETIL a' + ' inner join TRANSAKSI b on a.TRANSD_TRANS_NO = b.TRANS_NO' + ' and a.TRANSD_TRANS_UNT_ID = b.TRANS_UNT_ID' + sfilter + ' and b.TRANS_IS_PENDING = 0' + ' and (b.TRANS_DATE BETWEEN '+ QuotDT(dtTrans) + ' and '+ QuotD(dtTrans, True) + ')' + ' inner join barang c on a.TRANSD_BRG_CODE = c.BRG_CODE' + ' inner join BARANG_SUPLIER d on c.BRG_CODE = d.BRGSUP_BRG_CODE' + ' inner join SUPLIER e on d.BRGSUP_SUP_CODE = e.SUP_CODE' + ' and d.BRGSUP_IS_PRIMARY = 1' + ' inner join REF$MERCHANDISE f on c.BRG_MERCHAN_ID = f.MERCHAN_ID' + ' inner join REF$MERCHANDISE_GRUP g on c.BRG_MERCHANGRUP_ID = g.MERCHANGRUP_ID' + ' group by a.TRANSD_BRG_CODE, c.BRG_ALIAS,' + ' e.SUP_CODE, e.SUP_NAME, f.MERCHAN_CODE, f.MERCHAN_NAME,' + ' g.MERCHANGRUP_CODE, g.MERCHANGRUP_NAME'; if not Assigned(frmPopupGrid) then frmPopupGrid := TfrmPopupGrid.Create(Self); frmPopupGrid.Init(sSQL, 'TRANSAKSI TANGGAL '+ GrdMain.Cells[_Kol_Date, GrdMain.Row]); frmPopupGrid.ShowModal; } end; procedure TfrmWorksheet.InitGrid; var i : integer; begin // TODO -cMM: TfrmWorksheet.InitGrid default body inserted { with GrdMain do begin FloatingFooter.Visible := False; ClearNormalCells; ColCount := _ColCount; RowCount := _RowCount; Columns[_Kol_No].Header := 'No.'; Columns[_Kol_Date].Header := 'Date'; if FTipeApp = TSTORE then Columns[_Kol_POS].Header := 'POS' else Columns[_Kol_POS].Header := 'STORE'; Columns[_Kol_POS].Alignment := taCenter; Columns[_Kol_Shift].Header := 'Shift'; Columns[_Kol_Shift].Alignment := taCenter; Columns[_Kol_Cashier].Header := 'ID & Cashier Name'; if rgReportType.ItemIndex = 0 then begin Columns[_Kol_TransNo].Width := 0; Columns[_Kol_Physical].Width := 20; Columns[_Kol_DeltaCash].Width := 20; Columns[_Kol_Physical].Header := 'LAST FINAL PAY.'; Columns[_Kol_DeltaCash].Header := 'SELISIH CASH'; end else begin Columns[_Kol_TransNo].Header := 'Trans. No.'; Columns[_Kol_TransNo].Width := 20; Columns[_Kol_Physical].Width := 0; Columns[_Kol_DeltaCash].Width := 0; end; Columns[_Kol_toko].Width := 0; Columns[_Kol_Init].Header := 'Init Amount'; Columns[_Kol_Cash].Header := 'Cash Amount'; Columns[_Kol_VAH].Header := 'Voucher'; Columns[_Kol_BAH].Header := 'B.Assalaam'; Columns[_Kol_Db_Card].Header := 'Db. Card'; Columns[_Kol_Cr_Card].Header := 'Cr. Card'; Columns[_kol_Disc_cc].Header := 'Disc. Card'; Columns[_Kol_BCA].Header := 'Cash Back'; Columns[_Kol_Total].Header := 'T o t a l'; for i := _Kol_Init to _Kol_Total do begin Columns[i].Alignment := taRightJustify; end; end; } end; procedure TfrmWorksheet.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin inherited; if(Key = Ord('D'))and(ssctrl in Shift) then Detil; end; end.
unit Lock; interface uses Windows, Messages, SysUtils, Classes, IBQuery, IBSQL, IBDatabase, Db, IBStoredProc; type TLockTransaction = class(TObject) private dbConnection: TIBDatabase; transInput: TIBTransaction; FLockID: Integer; FKeyFieldName: string; FTableName: string; FUseLocalTransaction: Boolean; FLocked: Boolean; procedure SetUseLocalTransaction(Value: Boolean); procedure SetTransaction(trans: TIBTransaction); public property LockID: Integer read FLockID write FLockID default -1; property KeyFieldName: string read FKeyFieldName; property TableName: string read FTableName; property UseLocalTransaction: Boolean read FUseLocalTransaction write SetUseLocalTransaction default false; property Transaction: TIBTransaction read transInput write SetTransaction default nil; property Locked: Boolean read FLocked default false; function Lock(LockTable, LockKeyField: string; KeyValue: Integer): Boolean; function UnLock(Commit: Boolean = true): Boolean; constructor Create(db: TIBDatabase; LockingTransaction: TIBTransaction = nil); destructor Destroy; override; end; implementation { TLockTransaction } constructor TLockTransaction.Create(db: TIBDatabase; LockingTransaction: TIBTransaction); begin inherited Create; dbConnection := db; FKeyFieldName := ''; FTableName := ''; if Assigned(LockingTransaction) then transInput := LockingTransaction; end; destructor TLockTransaction.Destroy; begin inherited; if FUseLocalTransaction then begin if transInput.InTransaction then transInput.Commit; transInput.Free; end; end; function TLockTransaction.Lock(LockTable, LockKeyField: string; KeyValue: Integer): Boolean; var sqlLock: TIBSQL; begin Result := false; if not FLocked then begin sqlLock := TIBSQL.Create(nil); sqlLock.Database := dbConnection; sqlLock.Transaction := transInput; sqlLock.SQL.Text := 'update '+ Trim(LockTable)+ ' set '+Trim(LockKeyField)+'='+IntToStr(KeyValue)+ ' where '+Trim(LockTable)+'.'+Trim(LockKeyField)+'='+IntToStr(KeyValue); transInput.StartTransaction; try sqlLock.ExecQuery; except on Exception do Exit; end; Result := true; FLocked := true; FTableName := Trim(LockTable); FKeyFieldName := Trim(LockKeyField); FLockID := KeyValue; end; end; procedure TLockTransaction.SetTransaction(trans: TIBTransaction); begin if not FUseLocalTransaction then transInput := trans end; procedure TLockTransaction.SetUseLocalTransaction(Value: Boolean); begin if Locked then begin Raise Exception.Create('Дані заблоковано!'); Exit; end; if (Value = true) and (FUseLocalTransaction = false) then begin FUseLocalTransaction := true; transInput := TIBTransaction.Create(nil); transInput.DefaultDatabase := dbConnection; transInput.Params.Add('read_committed'); transInput.Params.Add('rec_version'); transInput.Params.Add('wait'); end; if (Value = false) and (FUseLocalTransaction = true) then begin FUseLocalTransaction := false; if transInput.InTransaction then transInput.Commit; transInput.Free; transInput := nil; end; end; function TLockTransaction.UnLock(Commit: Boolean): Boolean; begin Result := true; if FLocked then try if Commit then transInput.Commit else transInput.Rollback; except on exc: Exception do begin ShowException(exc, ExceptAddr); Result := false; Exit end; end; FLocked := false; end; end.
{ ******************************************************* } { * {* uTVDB.pas {* Delphi Implementation of the Class TVDB {* Generated by Enterprise Architect {* Created on: 09-févr.-2015 11:49:22 {* Original author: bvidovic {* {******************************************************* } unit xmltvdb.tvdb; interface uses System.Generics.Collections, CodeSiteLogging, xmltvdb.Episode,System.RegularExpressions , xmltvdb.TVDBSeries, xmltvdb.TVDBMatcher; type TTVGeneral=class strict private const UNCOMMON_CHAR_ARRAY2: Set of Ansichar = ['<', '>', ':', '"', '/', '\', '|', '?', '*', '#', '$', '%', '^', '*', '!', '~', '\', '’', '=', '[', ']', '(', ')', ';', ',', '_']; public class function cleanCommonWords(s: String): String; class function cleanParenthesis(s: String): String; class function dateToTVDBString(d: TDateTime): String; class function fuzzyTitleMatch(source: String; test: String; percentDiscrepencyAllowed: Integer): boolean; class function getLevenshteinDistance(s: String; t: String): Integer; class function normalize(s: String): String; end; TTVDB = class strict private Fe: IEpisode; Fserieses: TTVDBSeriesColl; procedure getMatches(series: ITVDBSeries; out resultat: ITVDBMatcher); procedure findMatchingSeries(out resultat: TTVDBSeriesColl); public function lookup: boolean; constructor Create(var e: IEpisode); overload; destructor Destroy; override; // ###if no series, no lookup### // // Lookups from best to worst: // --------------------------------------- // exact title & original airdate (check for multipart?) // fuzzy title & original air date (check for multipart) // contains title & original air date (check for multipart) // exact title (must be a solo match) // original airdate (must be a solo match) // fuzzy title (must be a solo match) // contains title (must be a solo match) // // checking for multiparts: // multipart means that a single airing in the guide XML maps to 2 or more seperate entries on thetvdb.com // The original air date for all tvdb entries must be the same // The titles must either match fuzzy or match contains. /// end; TTVGracenote = class strict private Fe: IEpisode; Fserieses: TTVDBSeriesColl; // procedure getMatches(series: ITVDBSeries; out resultat: ITVDBMatcher); procedure findMatchingSeries(out resultat: TTVDBSeriesColl); public function lookup: boolean; constructor Create(var e: IEpisode); overload; destructor Destroy; override; end; var FRegEx: TRegEx; implementation uses System.SysUtils, System.Math, REST.Utils, uConts, Xml.XMLIntf, Xml.XMLDoc, uTVDBBind, System.DateUtils, HTTPApp, System.Variants, IdHTTP, System.Classes, uDataModule, System.NetEncoding, xmltvdb.Match, xmltvdb.TVDBEpisode, xmltvdb.MatchAccuracy; { implementation of TVDB } destructor TTVDB.Destroy; begin Fserieses.Free; inherited Destroy; end; class function TTVGeneral.cleanCommonWords(s: String): String; const articles: array [1 .. 8] of string = ('the', 'a', 'an', 'The', 'A', 'An', 'part', 'Part'); var article: string; begin if (s = '') then begin Result := s; end else begin for article in articles do begin s := s.replace(' ' + article + ' ', ' '); s := s.replace(' ' + article, ' '); s := s.replace(article + ' ', ' '); s := s.replace(' ', ' '); // catch any double spaces end; Result := s; end; end; class function TTVGeneral.cleanParenthesis(s: String): String; var RegEx: TRegEx; m:TMatchCollection; unMath: system.RegularExpressions.TMatch; begin RegEx:= TRegEx.Create('[\\(].*[\\)]'); try m:= RegEx.Matches(s); for unMath in m do begin s:= s.Replace(unMath.Groups[0].Value,''); end; finally Result := s; end; { TODO : Code à Completer } // Pattern p = Pattern.compile("[\\(].*[\\)]");///catch any characters inside of (...) // Matcher m = p.matcher(s); // while(m.find()) // { // s = s.replace(m.group(), ""); // } end; function URLEncode(const s: string): string; begin // Result := HTTPEncode(s); Result := TNetEncoding.URL.Encode(s); end; constructor TTVDB.Create(var e: IEpisode); begin inherited Create; self.Fe := e; Fserieses := TTVDBSeriesColl.Create; if e = nil then begin raise Exception.Create('No episode found to look up.'); end; if not e.hasSeries then begin raise Exception.Create('No series name found.'); end; // get the series from tvdb based on series name and language findMatchingSeries(Fserieses); // populates seriesIds if (Fserieses.Count = 0) then begin // raise Exception.Create('No series found on TVDB.com for series name \' + e.getSeries.toString + '\'); end; end; class function TTVGeneral.dateToTVDBString(d: TDateTime): String; begin Result := FormatDateTime('yyyy-mm-dd', d); end; procedure TTVDB.findMatchingSeries(out resultat: TTVDBSeriesColl); var maxSeries: Integer; seriesName: string; tvdbURL: string; doc: IXMLDocument; Xml: IXMLTVDBDataType; I: Integer; seriesCount: Integer; series: IXMLTVDBSeriesType; seriesId: string; nextSeries: ITVDBSeries; Entry: TPair<String, String>; remoteProvider: string; remoteId: string; remoteIds: TDictionary<String, String>; begin remoteIds := TDictionary<String, String>.Create; try if (Fe.hasTVDBid()) then begin resultat.add(TTVDBSeries.Create(Fe.getTVDBId())); // we alrady know the series id CodeSite.SendMsg('TheTVDB series ID is overridden in config file, no need to look it up. Using ID of: ' + Fe.getTVDBId); exit; end; // remote id provided from schedulesdirect/zap2it or imdb if (Fe.hasRemoteId()) then begin Fe.getRemoteIds(remoteIds); for Entry in remoteIds do begin remoteProvider := Entry.Key; remoteId := Entry.Value; tvdbURL := 'http://www.thetvdb.com/api/GetSeriesByRemoteID.php?' + remoteProvider + '=' + URLEncode(remoteId) + '&language=' + Fe.getLanguage; doc := TXMLDocument.Create(nil); doc.LoadFromFile(tvdbURL); Xml := uTVDBBind.GetData(doc); if (Xml <> nil) then begin if Xml.series.Count = 0 then begin CodeSite.SendWarning('No tvdb series id found for ' + remoteProvider + ' ' + remoteId); // will do a search end else // only returns 1 series begin series := Xml.series[0]; // children.get(0); seriesId := series.seriesId; // .getChildText('seriesid'); resultat.add(TTVDBSeries.Create(seriesId)); seriesName := series.seriesName; // .getChildText('SeriesName'); CodeSite.SendMsg('Found TVDB series using ' + remoteProvider + ' ' + remoteId + ': seriesName= ' + seriesName + ' tvdbid = ' + seriesId); // return ids; exit; end; end; end; end; if (Fe.hasRemoteId()) then begin // if got here, we did not successfully lookup based on remote id. Remove it since it's not useful to us Fe.clearRemoteIds(); end; // if got here no id specified or remote id lookup failed, lookup based on series name maxSeries := 5; // FConfig.MAX_TVDB_SERIES_LOOKUP; seriesName := Fe.getSeries().GetseriesName; tvdbURL := 'http://www.thetvdb.com/api/GetSeries.php?seriesname=' + URLEncode(seriesName) + '&language=' + Fe.getLanguage; CodeSite.SendMsg('Attempting to get series ID (max of ' + maxSeries.ToString + ') based on seriesname of ' + seriesName + ', url = ' + tvdbURL); doc := TXMLDocument.Create(nil); doc.LoadFromFile(tvdbURL); Xml := uTVDBBind.GetData(doc); // Document xml = HTTP.getXMLFromURL(tvdbURL); if (Xml <> nil) then begin // children := xml.Series.SeriesID; // List<Element> children = xml.getRootElement().getChildren(); seriesCount := 0; for I := 0 to Xml.series.Count - 1 do begin series := Xml.series[I]; seriesId := series.seriesId; // seriesId := IntToStr(series.Id);// .getChildText('seriesid'); seriesName := series.seriesName; // .getChildText('SeriesName'); nextSeries := TTVDBSeries.Create(seriesId, seriesName, ''); if (resultat.contains(nextSeries)) then continue; // dont want dups resultat.add(nextSeries); inc(seriesCount); // CodeSite.SendMsg( 'Adding Series #'+seriesCount.ToString+' found from thetvdb: seriesName= ' + seriesName + '\' + tvdbid = '' + seriesId+); if (seriesCount = maxSeries) then break; // limit end; end; if (resultat.Count = 0) then begin CodeSite.SendWarning('No series could be found by querying TheTVDB.com for series named ' + Fe.getSeries.ToString); end; finally remoteIds.Free; end; // Result := ids; end; class function TTVGeneral.fuzzyTitleMatch(source: String; test: String; percentDiscrepencyAllowed: Integer): boolean; var difference: Integer; fuzzyMatchMaxDifferent: Integer; begin if ((source = '') or (test = '')) then begin Result := False; exit; end; // clean out articles and anything in parenthesis source := cleanCommonWords(cleanParenthesis(source.ToLower)); test := cleanCommonWords(cleanParenthesis(test.ToLower)); if (percentDiscrepencyAllowed > 100) then percentDiscrepencyAllowed := 100; fuzzyMatchMaxDifferent := Trunc(source.length / (100 / percentDiscrepencyAllowed)); // allow x% discrepency if (fuzzyMatchMaxDifferent <= 0) then fuzzyMatchMaxDifferent := 1; // allow at least 1 char diff difference := getLevenshteinDistance(source, test); Result := (difference <= fuzzyMatchMaxDifferent); end; class function TTVGeneral.getLevenshteinDistance(s: String; t: String): Integer; var d: array of array of Integer; I, j, cost: Integer; begin // initialize our cost array SetLength(d, length(s) + 1); for I := Low(d) to High(d) do begin SetLength(d[I], length(t) + 1); end; for I := Low(d) to High(d) do begin d[I, 0] := I; for j := Low(d[I]) to High(d[I]) do begin d[0, j] := j; end; end; // store our costs in a 2-d grid for I := Low(d) + 1 to High(d) do begin for j := Low(d[I]) + 1 to High(d[I]) do begin if s[I] = t[j] then begin cost := 0; end else begin cost := 1; end; // to use "Min", add "Math" to your uses clause! d[I, j] := Min(Min(d[I - 1, j] + 1, // deletion d[I, j - 1] + 1), // insertion d[I - 1, j - 1] + cost // substitution ); end; // for j end; // for i // now that we've stored the costs, return the final one Result := d[length(s), length(t)]; // dynamic arrays are reference counted. // no need to deallocate them end; procedure TTVDB.getMatches(series: ITVDBSeries; out resultat: ITVDBMatcher); var Xml: IXMLTVDBDataType; tvdbURL: string; firstAired: string; episodes: IXMLTVDBEpisodeTypeList; // matches: ITVDBMatcher; seriesElem: IXMLTVDBSeriesTypeList; ms: TStringStream; begin // look for matches on title & original air date tvdbURL := 'http://www.thetvdb.com/api/' + TVDB_API_KEY + '/series/' + series.GetseriesId + '/all/' + Fe.getLanguage + '.xml'; ms := TStringStream.Create; try if DataModuleMain.GetXmlDocument(tvdbURL, ms) then begin DataModuleMain.XMLDocument1.LoadFromStream(ms, TXMLEncodingType.xetUTF_8); Xml := uTVDBBind.GetData(DataModuleMain.XMLDocument1); // doc); end; if Xml = nil then begin resultat := nil end else begin seriesElem := Xml.series; series.SetseriesName(seriesElem[0].seriesName); // .getChildText('SeriesName'); CodeSite.SendMsg('Getting episodes for series: ' + series.GetseriesName); // parse the year this series was first aired firstAired := seriesElem[0].firstAired; // . getChildText('FirstAired');//2011-10-23 if (firstAired <> '') then begin series.SetseriesYear(YearOf(vartoDateTime(firstAired)).ToString); end; episodes := Xml.Episode; if (episodes = nil) then // || episodes.isEmpty()) begin CodeSite.SendWarning('No episodes found on TheTVDB for series: ' + series.ToString + '. ' + 'You may need to add the series/episodes on TheTVDB.com, or manually provide the correct TVDB id in the config file.'); resultat := nil; end else begin CodeSite.SendMsg('Will search ' + episodes.Count.ToString + ' episodes for a match.'); end; CodeSite.Send('Found ' + episodes.Count.ToString + ' episodes for series: ' + series.ToString); resultat := TTVDBMatcher.Create(Fe, episodes); // resultat := matches; end; // Recheche GraceNote TGracenoteMatcher.Create(Fe,resultat); // matches := TGracenoteMatcher.Create(Fe,matches); // resultat := matches; finally ms.Free; end; end; function TTVDB.lookup: boolean; var matches: TMatchColl; series: ITVDBSeries; tvdbMatch: ITVDBMatcher; ep: ITVDBEpisode; dateStr: string; m: IMatch; bestMatch: IMatch; // unMatch: Match; begin // matches := TInterfaceList.Create; matches := TMatchColl.Create; try for series in Fserieses do begin tvdbMatch := TTVDBMatcher.Create; try getMatches(series, tvdbMatch); if (tvdbMatch = nil) then continue; CodeSite.SendMsg(csmLevel7, 'TVDB Matches Found (title=' + Fe.getTitle + ', airdate=' + iif(Fe.hasOriginalAirDate, TTVGeneral.dateToTVDBString(Fe.getOriginalAirDate), 'unknown')); // FormatDateTime('yyyymmdd', Fe.getOriginalAirDate), 'unknown')); // CodeSite.SendMsg('originalAirDateMatches: ' + tvdbMatch.originalAirDateMatches.ToString); // CodeSite.SendMsg('exactTitleMatches: ' + tvdbMatch.exactTitleMatches.ToString); // CodeSite.SendMsg('fuzzyTitleMatches: ' + tvdbMatch.fuzzyTitleMatches.ToString); // CodeSite.SendMsg('containsTitleMatches: ' + tvdbMatch.containsTitleMatches.ToString); // check air date + title matches if not(tvdbMatch.GetoriginalAirDateMatches.Count = 0) then // original airdate had some some matches begin // exact title & date if not(tvdbMatch.GetexactTitleMatches.Count = 0) then begin if (tvdbMatch.GetoriginalAirDateMatches.containsAll(tvdbMatch.GetexactTitleMatches)) then begin matches.add(TMatch.Create(TMatchAccuracy.ORIGINAL_AIR_DATE_AND_EXACT_TITLE, series, tvdbMatch.GetexactTitleMatches)); break; // exact match, we can break now end; end; // fuzzytitle & date if (tvdbMatch.GetfuzzyTitleMatches.containsAll(tvdbMatch.GetoriginalAirDateMatches)) then begin matches.add(TMatch.Create(TMatchAccuracy.ORIGINAL_AIR_DATE_AND_FUZZY_TITLE, series, tvdbMatch.GetoriginalAirDateMatches)); break; // exact (enough) match, we can break now end; // contains title & date if (tvdbMatch.GetcontainsTitleMatches.containsAll(tvdbMatch.GetoriginalAirDateMatches)) then begin matches.add(TMatch.Create(TMatchAccuracy.ORIGINAL_AIR_DATE_AND_CONTAINS_TITLE, series, tvdbMatch.GetoriginalAirDateMatches)); continue; // check next series too since this isn't a very exact match end else // check in opposite direction. Catches if multiple episodes have same original air date, but needs to be filtered down to this episode begin if (tvdbMatch.GetcontainsTitleMatches.Count <> 0) then begin if (tvdbMatch.GetoriginalAirDateMatches.containsAll(tvdbMatch.GetcontainsTitleMatches)) then begin matches.add(TMatch.Create(TMatchAccuracy.ORIGINAL_AIR_DATE_AND_CONTAINS_TITLE, series, tvdbMatch.GetcontainsTitleMatches)); continue; // check next series too since this isn't very exact match end; end; end; end; // done with date combo matches // if we got here, there are no air date/combo matches. Check for title matches, but don't allow multi // part for those because we can't verify they aired on the same date. // exact title, solo match if (tvdbMatch.GetexactTitleMatches.Count = 1) then begin CodeSite.SendMsg(csmLevel7, 'Found Exact title match: ' + tvdbMatch.GetexactTitleMatches.ToString); matches.add(TMatch.Create(TMatchAccuracy.EXACT_TITLE, series, tvdbMatch.GetexactTitleMatches)); break; // exact enough, break here end else if (tvdbMatch.GetexactTitleMatches.Count > 1) then begin CodeSite.SendWarning('Found ' + tvdbMatch.GetexactTitleMatches.Count.ToString + ' exact title matches! Don''t know what one to use!'); end; // original airdate, solo/multi match if (tvdbMatch.GetoriginalAirDateMatches.Count <> 0) then begin // allow multi match for original air date matches.add(TMatch.Create(TMatchAccuracy.ORIGINAL_AIR_DATE, series, tvdbMatch.GetoriginalAirDateMatches)); continue; end; // fuzzy title, solo match if (tvdbMatch.GetfuzzyTitleMatches.Count = 1) then begin matches.add(TMatch.Create(TMatchAccuracy.FUZZY_TITLE, series, tvdbMatch.GetfuzzyTitleMatches)); continue; end else if (tvdbMatch.GetfuzzyTitleMatches.Count > 1) then CodeSite.SendMsg(csmLevel7, 'Found ' + tvdbMatch.GetfuzzyTitleMatches.Count.ToString + ' fuzzy title matches! Don''t know what one to use!'); // contains title, solo match if (tvdbMatch.GetcontainsTitleMatches.Count = 1) then begin matches.add(TMatch.Create(TMatchAccuracy.CONTAINS_TITLE, series, tvdbMatch.GetcontainsTitleMatches)); continue; end; // allow multi-contains if the air date is all the same if (tvdbMatch.GetcontainsTitleMatches.Count > 1) then begin CodeSite.SendMsg(csmLevel7, 'Found multiple contains-title matches, determining if all have same original air date.'); dateStr := ''; // = null; for ep in tvdbMatch.GetcontainsTitleMatches do begin if (ep.GetfirstAired = '') then begin // no valid date from tvdb... can't check this dateStr := ''; break; end; if (dateStr = '') then begin dateStr := ep.GetfirstAired; // init end else if (not dateStr.equals(ep.GetfirstAired)) then begin dateStr := ''; // signals invalid because they dont all have the same date break; end; end; if (dateStr <> '') then // same date for all episodes begin CodeSite.SendMsg(csmLevel7, 'All contains-title matches have same original air date, will add as a multi-part episode'); matches.add(TMatch.Create(TMatchAccuracy.CONTAINS_TITLE, series, tvdbMatch.GetcontainsTitleMatches)); end else begin CodeSite.SendMsg(csmLevel7, 'Contains-title matches have different air-dates, cannot determine what episode to use.'); end; end; finally if assigned(tvdbMatch) then begin // tvdbMatch:=nil; // tvdbMatch.Free; end; end; end; // end looping through all series and finding matches //REcherhe avec GraceNote // getMatches(series, tvdbMatch); if (matches.Count <> 0) then begin CodeSite.SendMsg(csmLevel7, 'Found ' + matches.Count.ToString + ' TVDB.com match' + iif(matches.Count = 1, ', will use it', 'es, will use best one')); matches.Sort; // best matches (most accurate) are on top now // print all matches for m in matches do begin CodeSite.SendMsg('Match - Series: ' + m.getSeries.ToString + ': ' + m.Getaccuracy.ToString + ' for ' + m.GetmatchingEpisodes.Count.ToString + ' episode(s):'); // CodeSite.SendWarning(m.matchingEpisodes.ToString); end; // use the first (best) match bestMatch := matches[0]; Fe.setSeries(bestMatch.getSeries); if (bestMatch.GetmatchingEpisodes.Count > 1) then // log if multiple episodes begin CodeSite.SendMsg(csmLevel7, 'Multi-Part: Setting matching episodes to: ' + bestMatch.GetmatchingEpisodes.ToString); end; Fe.setMatchingEpisodes(bestMatch.GetmatchingEpisodes); Result := true; end else begin if (Fe.hasRemoteId) then // maybe the remote id is wrong, try it based on series name begin CodeSite.SendMsg(csmLevel7,'No match was found using exernal id(s), will try lookup based on series name now.'); Fe.clearRemoteIds(); findMatchingSeries(Fserieses); Result := lookup(); // recurse using the new seriesIds end else // no match begin CodeSite.SendWarning('Found no matches!'); Result := False; end; end; finally matches.Free; tvdbMatch:=nil; end; end; class function TTVGeneral.normalize(s: String): String; var normal: string; I: Integer; c: char; begin if (s = '') then begin Result := ''; end else begin normal := ''; for I := 0 to s.length - 1 do begin c := s.Chars[I]; // s.charAt(i); if (c = '/') then begin // c := ' '; // replace slash with a space normal := normal + c; end else if not CharInSet(c, TTVGeneral.UNCOMMON_CHAR_ARRAY2) then // not(c in UNCOMMON_CHAR_ARRAY2) then // noy uncommon begin normal := normal + c; end; end; Result := normal; end; end; { TTVGracenote } constructor TTVGracenote.Create(var e: IEpisode); begin inherited Create; self.Fe := e; Fserieses := TTVDBSeriesColl.Create; if e = nil then begin raise Exception.Create('No episode found to look up.'); end; if not e.hasSeries then begin raise Exception.Create('No series name found.'); end; // get the series from tvdb based on series name and language findMatchingSeries(Fserieses); // populates seriesIds if (Fserieses.Count = 0) then begin // raise Exception.Create('No series found on TVDB.com for series name \' + e.getSeries.toString + '\'); end; end; destructor TTVGracenote.Destroy; begin inherited; end; procedure TTVGracenote.findMatchingSeries(out resultat: TTVDBSeriesColl); begin end; function TTVGracenote.lookup: boolean; begin end; end.
unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, StdCtrls, Buttons, ExtCtrls, Dialogs, ExtDlgs, ActnList, Menus, ComCtrls, ScrollingImage, TexturePanel; type TMainForm = class(TForm) SI: TSBScrollingImage; MainMenu: TMainMenu; File1: TMenuItem; View1: TMenuItem; ActionList: TActionList; FileOpen: TAction; ViewScrollBars: TAction; StatusBar: TStatusBar; OpenPictureDialog: TOpenPictureDialog; FileOpen1: TMenuItem; ViewNavigator: TAction; ViewNavigator1: TMenuItem; ViewCanScroll: TAction; N1: TMenuItem; EnableDisableScroll1: TMenuItem; ViewAutoCenter: TAction; ShowHideScrollBars1: TMenuItem; AutoCenter1: TMenuItem; ViewIncrementalDisplay: TAction; N2: TMenuItem; IncrementalDisplay1: TMenuItem; Help1: TMenuItem; HelpAbout: TAction; HelpAbout1: TMenuItem; pnlOptions: TPanel; Splitter: TSplitter; Panel2: TPanel; Label1: TLabel; SpeedButton1: TSpeedButton; CheckBox1: TCheckBox; CheckBox2: TCheckBox; CheckBox3: TCheckBox; CheckBox4: TCheckBox; CheckBox5: TCheckBox; ViewOptions: TAction; ViewOptions1: TMenuItem; btnNavInOptions: TSpeedButton; Label2: TLabel; Bevel1: TBevel; Edit1: TEdit; udScale: TUpDown; cbAutoShrink: TCheckBox; Label3: TLabel; CheckBox6: TCheckBox; ViewCanScrollWithMouse: TAction; NEWEnableDisableScrollWithMouse1: TMenuItem; TexturePanel: TTexturePanel; ViewTransparent: TAction; NE1: TMenuItem; cbAutoZoom: TCheckBox; mnuZoom: TMenuItem; ScrollBox1: TScrollBox; cbStretchMethod: TComboBox; Label4: TLabel; procedure ViewScrollBarsExecute(Sender: TObject); procedure ActionListUpdate(Action: TBasicAction; var Handled: Boolean); procedure FileOpenExecute(Sender: TObject); procedure FormCreate(Sender: TObject); procedure ViewCanScrollExecute(Sender: TObject); procedure ViewNavigatorExecute(Sender: TObject); procedure SIChangeImage(Sender: TObject); procedure ViewAutoCenterExecute(Sender: TObject); procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); procedure FormShow(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure ViewIncrementalDisplayExecute(Sender: TObject); procedure HelpAboutExecute(Sender: TObject); procedure ViewOptionsExecute(Sender: TObject); procedure btnNavInOptionsClick(Sender: TObject); procedure udScaleClick(Sender: TObject; Button: TUDBtnType); procedure SIChangePos(Sender: TObject); procedure SIMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure cbAutoShrinkClick(Sender: TObject); procedure ViewCanScrollWithMouseExecute(Sender: TObject); procedure ViewTransparentExecute(Sender: TObject); procedure cbAutoZoomClick(Sender: TObject); procedure SIZoomChanged(Sender: TObject); procedure cbStretchMethodChange(Sender: TObject); private procedure OnImageProgress(Sender: TObject; Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string); end; var MainForm: TMainForm; implementation {$R *.dfm} uses JPEG, Navig; procedure TMainForm.FormCreate(Sender: TObject); var AppPath, S: string; begin AppPath := ExtractFilePath(Application.ExeName); S := ExtractFilePath(ExcludeTrailingBackSlash(AppPath)); OpenPictureDialog.InitialDir := S; S := S + 'Default.bmp'; if FileExists(S) then SI.Picture.LoadFromFile(S); SIZoomChanged(Sender); cbStretchMethod.ItemIndex := SI.StretchMode - 1; end; procedure TMainForm.ActionListUpdate(Action: TBasicAction; var Handled: Boolean); begin if Action = ViewNavigator then ViewNavigator.Checked := NavigatorForm.Visible; if Action = ViewScrollBars then ViewScrollBars.Checked := SI.ScrollBarsVisible; if Action = ViewCanScroll then ViewCanScroll.Checked := SI.CanScroll; if Action = ViewAutoCenter then ViewAutoCenter.Checked := SI.AutoCenter; if Action = ViewCanScrollWithMouse then ViewCanScrollWithMouse.Checked := SI.CanScrollWithMouse; if Action = ViewTransparent then ViewTransparent.Checked := SI.Transparent; end; procedure TMainForm.ViewScrollBarsExecute(Sender: TObject); begin SI.ScrollBarsVisible := not SI.ScrollBarsVisible; end; procedure TMainForm.ViewCanScrollExecute(Sender: TObject); begin SI.CanScroll := not SI.CanScroll; end; procedure TMainForm.ViewNavigatorExecute(Sender: TObject); begin NavigatorForm.Visible := not NavigatorForm.Visible; end; procedure TMainForm.ViewAutoCenterExecute(Sender: TObject); begin SI.AutoCenter := not SI.AutoCenter; end; procedure TMainForm.ViewIncrementalDisplayExecute(Sender: TObject); begin with ViewIncrementalDisplay do begin Checked := not Checked; if Checked then Application.MessageBox('Some pictures may not support incremental display and program may hang.', 'Warning!!!', MB_ICONWARNING); end; end; procedure TMainForm.FileOpenExecute(Sender: TObject); var Picture: TPicture; BMP: TBitmap; begin with OpenPictureDialog do if Execute then begin if AnsiLowerCase(ExtractFileExt(FileName)) <> '.bmp' then begin // Экспериментальный код для инкрементальной загрузки изображений. // // Должен загружать графику любого типа, которая // установлена в среде Delphi. if ViewIncrementalDisplay.Checked then begin Picture := TPicture.Create; try Picture.OnProgress := OnImageProgress; Picture.LoadFromFile(FileName); // Извращение конечно: производить никому не нужную отрисовку, // но другого метода вызвать Picture.OnProgress я не нашел. BMP := TBitmap.Create; try BMP.Canvas.Draw(0, 0, Picture.Graphic); finally BMP.Free; end; finally Picture.Free; end; end else begin Picture := TPicture.Create; try Picture.LoadFromFile(FileName); SI.LoadGraphic(Picture.Graphic); finally Picture.Free; end; end; end else SI.Picture.LoadFromFile(FileName); StatusBar.SimpleText := FileName; end; end; procedure TMainForm.SIChangeImage(Sender: TObject); begin if Assigned(NavigatorForm) and not Assigned(NavigatorForm.Parent) then with NavigatorForm do if Width = 250 then // специально для инкрементального отображения изображений Height := CorrectNavigatorHeight(250) else Width := 250; end; procedure TMainForm.FormShow(Sender: TObject); begin ActiveControl := nil; end; procedure TMainForm.FormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); begin if Self.ControlAtPos(ScreenToClient(MousePos), False, True) = TexturePanel then if (ssCtrl in Shift) or (ssMiddle in SHift) then SI.ScrollImage(WheelDelta, 0) else SI.ScrollImage(0, WheelDelta); end; procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin case Key of VK_PRIOR : SI.ScrollPageUp; VK_NEXT : SI.ScrollPageDown; VK_END : SI.ScrollEnd; VK_HOME : SI.ScrollHome; VK_LEFT : SI.ScrollImage(SI.ScrollBarIncrement, 0); VK_UP : SI.ScrollImage(0, SI.ScrollBarIncrement); VK_RIGHT : SI.ScrollImage(-SI.ScrollBarIncrement, 0); VK_DOWN : SI.ScrollImage(0, -SI.ScrollBarIncrement); VK_ADD : if SI.Zoom < 5000 then SI.Zoom := SI.Zoom * 2; VK_SUBTRACT : if SI.Zoom > 25 then SI.Zoom := SI.Zoom / 2; end; end; procedure TMainForm.HelpAboutExecute(Sender: TObject); const AboutText = 'Image Controls 2.1'#13 + 'Advanced Demo'#13#13 + 'Используйте также колесо мыши, Ctrl + прокрутку колеса, прокрутку нажатого' + ' колеса мыши, клавиши управления курсором, Home, End, PageUp, PageDown,' + ' а также навигатор для скроллинга изображения.'; begin Application.MessageBox(PChar(AboutText), 'About', MB_ICONQUESTION); end; procedure TMainForm.OnImageProgress(Sender: TObject; Stage: TProgressStage; PercentDone: Byte; RedrawNow: Boolean; const R: TRect; const Msg: string); var Graphic: TGraphic; begin Graphic := TGraphic(Sender); SI.Picture.Width := Graphic.Width; SI.Picture.Height := Graphic.Height; SI.Picture.Canvas.Draw(0, 0, Graphic); StatusBar.SimpleText := IntToStr(PercentDone); // Практически ничего не дает. // TODO: Поместить в поток? Application.ProcessMessages; end; procedure TMainForm.ViewOptionsExecute(Sender: TObject); begin Splitter.Visible := not pnlOptions.Visible; pnlOptions.Visible := Splitter.Visible; end; procedure TMainForm.btnNavInOptionsClick(Sender: TObject); begin if Assigned(NavigatorForm.Parent) then begin with NavigatorForm do begin Visible := False; BorderStyle := bsSizeToolWin; Parent := nil; SetBounds((Screen.Width - 228) div 2, (Screen.Height - 181) div 2, 228, NavigatorForm.CorrectNavigatorHeight(228)); Anchors := [akLeft, akTop]; Visible := True; end; ViewNavigator.Enabled := True; end else begin with NavigatorForm do begin BorderStyle := bsNone; Parent := pnlOptions; SetBounds(3, btnNavInOptions.Top - 153, pnlOptions.Width - 6, 150); Anchors := [akLeft, akRight, akBottom]; Visible := True; end; ViewNavigator.Enabled := False; end; end; procedure TMainForm.udScaleClick(Sender: TObject; Button: TUDBtnType); begin SI.Zoom := udScale.Position; end; procedure TMainForm.SIChangePos(Sender: TObject); begin Label3.Caption := Format('%dx%d', [SI.ImageLeft, SI.ImageTop]); end; procedure TMainForm.SIMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ActiveControl := nil; end; procedure TMainForm.cbAutoShrinkClick(Sender: TObject); begin SI.AutoShrinkImage := cbAutoShrink.Checked; end; procedure TMainForm.cbAutoZoomClick(Sender: TObject); begin SI.AutoZoomImage := cbAutoZoom.Checked; end; procedure TMainForm.ViewCanScrollWithMouseExecute(Sender: TObject); begin SI.CanScrollWithMouse := not ViewCanScrollWithMouse.Checked; end; procedure TMainForm.ViewTransparentExecute(Sender: TObject); begin SI.Transparent := not ViewTransparent.Checked; end; procedure TMainForm.SIZoomChanged(Sender: TObject); begin ModifyMenu(MainMenu.Handle, 3, mf_ByPosition or mf_Popup or mf_Help, mnuZoom.Handle, PChar(FloatToStrF(SI.Zoom, ffFixed, 18, 2) + '%')); SendMessage(Handle, WM_NCPAINT, 0, 0); end; procedure TMainForm.cbStretchMethodChange(Sender: TObject); begin SI.StretchMode := cbStretchMethod.ItemIndex + 1; end; end.
// The Game of Life {$APPTYPE CONSOLE} program Life; const Width = 8; Height = 25; type TField = array [0..Height - 1, 0..Width - 1] of Boolean; var Fld: TField; procedure Redraw; var i, j: Integer; ch: Char; s: string; begin s := ''; for i := 0 to Height - 1 do begin for j := 0 to Width - 1 do begin if Fld[i, j] then ch := 'O' else ch := '.'; s := s + ch; end; if i < Height - 1 then s := s + #13 + #10; end; Write(s); end; // Redraw procedure Init; var i, j: Integer; begin Randomize; for i := 0 to Height - 1 do for j := 0 to Width - 1 do Fld[i, j] := Random > 0.5; end; // Init procedure Regenerate; var NextFld: TField; i, j, ni, nj, n: Integer; begin for i := 0 to Height - 1 do for j := 0 to Width - 1 do begin // Count cell neighbors n := 0; for ni := i - 1 to i + 1 do for nj := j - 1 to j + 1 do if Fld[(ni + Height) mod Height, (nj + Width) mod Width] and not ((ni = i) and (nj = j)) then Inc(n); // Revive or kill the current cell in the next generation if Fld[i, j] then NextFld[i, j] := (n > 1) and (n < 4) // Kill the cell or keep it alive else NextFld[i, j] := n = 3; // Revive the cell or keep it dead end; // for j... // Make new generation Fld := NextFld; end; // Regenerate var ch: Char; begin // Create initial population Init; // Run simulation repeat Redraw; Regenerate; ReadLn(ch); until (ch = 'Q') or (ch = 'q'); end.
unit uConditionEditor; interface uses Windows, Messages, Classes, ExtCtrls, Controls, Dialogs, Variants, Forms, StdCtrls, ComCtrls, SysUtils, StrUtils, Contnrs, IdGlobal; resourcestring WAR_InputDataType= 'WAR_对于%s必须输入%s或格式不正确.'; type TConditionType = (ctString, ctNumber, ctDate, ctDateTime, ctBoolean); {TItemName} TConditionItem = class(TCollectionItem) private { Private declarations } FConditionName: string; FConditionCaption: string; FConditionType: TConditionType; FConditionHint: string; FDefaultValue: string; FEmunItem: string; function GetCompareOperates: string; function GetDefaultValue: string; protected { Protected declarations } function GetDisplayName: string; override; public { Public declarations } constructor Create(Collection: TCollection); override; published { Published declarations } property ConditionName: string read FConditionName write FConditionName; property ConditionCaption: string read FConditionCaption write FConditionCaption; property CompareOperates: string read GetCompareOperates; property ConditionType: TConditionType read FConditionType write FConditionType default ctString; property ConditionHint: string read FConditionHint write FConditionHint; property DefaultValue: string read GetDefaultValue write FDefaultValue; property EmunItem: string read FEmunItem write FEmunItem; end; TConditionItems = class(TCollection); TValueEdit = class(TComboBox) private { Private declarations } FKind: TConditionType; procedure SetKind(const Value: TConditionType); public { public declarations } published { published declarations } property Kind: TConditionType read FKind write SetKind; end; TMakeConditionController = class(TComponent) private { Private declarations } FTitle: string; FConditionItems: TConditionItems; FConditionString: string; FPreDeclareString: string; FComponentList: TComponentList; FCpationComboBox: TComboBox; FCompareComboBox: TComboBox; FConditionValueControl: TValueEdit; FConditionListBox: TListBox; procedure CpationComboBoxChange(Sender: TObject); procedure ControlKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure AddCondition(Sender: TObject); procedure ClearConditionList(Sender: TObject); procedure CloseQuery(Sender: TObject; var CanClose: Boolean); procedure CreateControls(ParentControl: TWinControl); procedure SetValueEidtControlStyle(AEditControl: TWinControl); function GetExpression(IsDispLay: Boolean; CompareOperate: String; AEditControl: TComponent): String; function GetPreDeclares: String; function GetConditions: String; protected { protected declarations } function DoExecute: Boolean; public { public declarations } constructor Create(AOwner: TComponent); override; destructor Destroy; override; function Execute: Boolean; published { published declarations } property ConditionItems: TConditionItems read FConditionItems write FConditionItems; property ConditionString: string read FConditionString; property PreDeclareString: string read FPreDeclareString; property Title: string read FTitle write FTitle; end; procedure Register; implementation { TConditionItem } procedure Register; begin RegisterComponents('Dialogs', [TMakeConditionController]); end; function TConditionItem.GetDisplayName: string; begin if FConditionCaption = '' then Result := inherited GetDisplayName else Result := FConditionCaption; end; constructor TConditionItem.Create(Collection: TCollection); begin inherited; ConditionType:=ctString; end; function TConditionItem.GetCompareOperates: string; begin result:='=/<>/'; if FConditionType = ctString then result := result + '>/</>=/<=/Like'; if FConditionType in [ctNumber, ctDateTime] then result := result + '>/</>=/<='; end; function TConditionItem.GetDefaultValue: string; begin Result := FDefaultValue; if Result <> '' then exit; if ConditionType = ctDateTime then result:=DateTimeToStr(Now); if ConditionType = ctDate then result:=DateToStr(Now); if ConditionType = ctNumber then result:='0'; end; function CreateNewConditionDialog: TForm; var FormWith: Integer; begin FormWith:=395; result:=TForm.CreateNew(Application); with result do begin Canvas.Font := Font; KeyPreview := True; BorderStyle := bsDialog; Font.Name:='宋体'; Font.Size:=9; Position := poScreenCenter; BiDiMode := Application.BiDiMode; Width:=FormWith; end; end; { TValueEdit } procedure TValueEdit.SetKind(const Value: TConditionType); var EditStyle: Longint; pcbi: TComboBoxInfo; begin if FKind = Value then exit; FKind := Value; //ctString, ctNumber, ctDate, ctDateTime, ctBoolean Text:=''; ItemIndex:= -1; pcbi.cbSize:=SizeOf(TComboBoxInfo); if GetComboBoxInfo(Handle, pcbi) then begin EditStyle:=GetWindowLong(pcbi.hwndItem, GWL_STYLE); if FKind = ctNumber then SetWindowLong(pcbi.hwndItem, GWL_STYLE, EditStyle or ES_NUMBER) else SetWindowLong(pcbi.hwndItem, GWL_STYLE, EditStyle and not ES_NUMBER); end; if FKind = ctDate then Text:=DateToStr(Now); if FKind = ctDateTime then Text:=DateTimeToStr(Now); end; { TMakeConditionDialog } constructor TMakeConditionController.Create(AOwner: TComponent); begin inherited; Title:='条件编辑器'; FConditionString:=''; FPreDeclareString:=''; FComponentList:=TComponentList.Create; FConditionItems:=TConditionItems.Create(TConditionItem); end; destructor TMakeConditionController.Destroy; begin FConditionItems.Free; FComponentList.Free; inherited; end; procedure TMakeConditionController.CloseQuery(Sender: TObject; var CanClose: Boolean); var ConditionStr, PreDeclareStr: String; begin CanClose := True; if (Sender as TForm).ModalResult <> mrOK then exit; ConditionStr:=GetConditions; PreDeclareStr:=GetPreDeclares; if (FConditionListBox <> nil) and (ConditionStr = '') then begin //请输入自定义条件 CanClose := False; end; if CanClose then begin //请输入指定条件 if (FComponentList.Count <> 0) and (PreDeclareStr = '')then CanClose := False; end; end; function TMakeConditionController.DoExecute: Boolean; var ConditionDialog: TForm; begin try FConditionString:=''; FPreDeclareString:=''; if true then begin ConditionDialog:=nil; ConditionDialog:=CreateNewConditionDialog; ConditionDialog.Caption:=Title; CreateControls(ConditionDialog); if FCpationComboBox <> nil then CpationComboBoxChange(FCpationComboBox); ConditionDialog.ShowModal; result:=ConditionDialog.ModalResult = mrok; if result then begin FConditionString:=GetConditions; FPreDeclareString:=GetPreDeclares; end; end; FComponentList.Clear; FCpationComboBox:=nil; FCompareComboBox:=nil; FConditionValueControl:=nil; FConditionListBox:=nil; finally FreeAndNil(ConditionDialog); end; end; procedure TMakeConditionController.CpationComboBoxChange(Sender: TObject); var ConditionItem: TConditionItem; begin if Sender = nil then exit; with Sender as TComboBox do begin if ItemIndex = -1 then exit; ConditionItem:=ConditionItems.Items[Integer(Items.Objects[ItemIndex])] as TConditionItem; end; FCompareComboBox.Items.Text:=StringReplace(ConditionItem.CompareOperates, '/', #13, [rfReplaceAll]); FCompareComboBox.ItemIndex:=0; FConditionValueControl.Tag:=ConditionItem.Index; SetValueEidtControlStyle(FConditionValueControl); end; procedure TMakeConditionController.ControlKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var AForm: TCustomForm; begin if key <> VK_RETURN then exit; AForm:=GetParentForm(Sender as TWinControl); if AForm <> nil then begin if AForm.ActiveControl = FConditionValueControl then begin AddCondition(nil); FCpationComboBox.SetFocus; end else AForm.PerForm(WM_NEXTDLGCTL, 0, 0); end end; procedure TMakeConditionController.AddCondition(Sender: TObject); var CompareOperate, Expression: string; begin if (Sender = nil) or ((Sender as TWinControl).Name = 'Button_And') then CompareOperate:='AND'; if (Sender <> nil) and ((Sender as TWinControl).Name = 'Button_Or') then CompareOperate:='OR'; Expression:=GetExpression(True, FCompareComboBox.Text, FConditionValueControl); if FConditionListBox.Items.Count <> 0 then FConditionListBox.Items.AddObject(CompareOperate, TObject(9999)); FConditionListBox.Items.AddObject(Expression, TObject(FConditionValueControl.Tag)); end; procedure TMakeConditionController.ClearConditionList(Sender: TObject); begin if FConditionListBox <> nil then FConditionListBox.Items.Clear; end; procedure TMakeConditionController.CreateControls(ParentControl: TWinControl); var i, ctop, cLeft, FormWith, ValueControlWith, PreDecConditionCount: Integer; NewControl: TWinControl; begin ctop:=5; cLeft:=5; FormWith:=395; ValueControlWith:=140; PreDecConditionCount:=0; if ParentControl.ClassNameIs('TForm') then begin (ParentControl as TForm).OnKeyDown:=ControlKeyDown; (ParentControl as TForm).OnCloseQuery:=CloseQuery; end; //预定义条件 for i := 0 to ConditionItems.Count - 1 do with (ConditionItems.Items[i] as TConditionItem) do begin if (ConditionName = '') or (ConditionName[1] <> '@') then Continue; //Create Edit Control if (not (ConditionType in [ctBoolean])) or (EmunItem <> '') then with TStaticText.Create(ParentControl) do begin Parent:=ParentControl; Caption:=ConditionCaption + ':'; SetBounds(FormWith div 3 - cLeft - Width, ctop + 6, Width, Height); end; NewControl:=nil; if (ConditionType in [ctDateTime, ctDate, ctString, ctNumber]) or (EmunItem <> '')then NewControl:=TValueEdit.Create(ParentControl) else if ConditionType in [ctBoolean] then NewControl:=TCheckBox.Create(ParentControl); if NewControl <> nil then with NewControl do begin Parent:=ParentControl; Tag:=Index; SetBounds(FormWith div 3, ctop, ValueControlWith, Height); SetValueEidtControlStyle(NewControl); end; FComponentList.Add(NewControl); cTop:= cTop + NewControl.Height + 2; inc(PreDecConditionCount); end; //用户定义条件 //Create Edit Control cTop:= cTop + 4; if PreDecConditionCount < ConditionItems.Count then begin FCpationComboBox:=TComboBox.Create(ParentControl); with FCpationComboBox do begin Parent:=ParentControl; FCpationComboBox.Style:=csDropDownList; SetBounds(cLeft, ctop, 140, Height); FCpationComboBox.OnChange:=CpationComboBoxChange; //加入可选条件 for i := 0 to ConditionItems.Count - 1 do with ConditionItems.Items[i] as TConditionItem do begin if (ConditionName = '') or (ConditionName[1] = '@') then Continue; AddItem(ConditionCaption, TObject(Index)); end; FCpationComboBox.ItemIndex:=0; end; FCompareComboBox:= TComboBox.Create(ParentControl); with FCompareComboBox do begin Parent:=ParentControl; SetBounds(cLeft + 140 + 5, ctop, 90, Height); end; FConditionValueControl:=TValueEdit.Create(ParentControl); with FConditionValueControl do begin Parent:=ParentControl; SetBounds(cLeft + 140 + 90 + 10, ctop, 140, Height); cTop:= cTop + Height + 2; end; FConditionListBox:=TListBox.Create(ParentControl); with FConditionListBox do begin Parent:=ParentControl; TabStop:=false; SetBounds(cLeft, ctop, 235, Height); end; cLeft:=245; cTop:= cTop + 6; with TButton.Create(ParentControl) do begin Parent:=ParentControl; Name:='Button_And'; Caption:='&AND'; TabStop:=false; SetBounds(cLeft, ctop, 68, Height); OnClick:=AddCondition end; with TButton.Create(ParentControl) do begin Parent:=ParentControl; Name:='Button_Or'; TabStop:=false; Caption:='&OR'; SetBounds(cLeft + 68 + 5, ctop, 68, Height); OnClick:=AddCondition; cTop:= cTop + Height + 6; end; with TButton.Create(ParentControl) do begin Parent:=ParentControl; SetBounds(cLeft, ctop, 140, Height); TabStop:=false; Caption:='清除(&L)'; cTop:= cTop + Height + 6; OnClick:=ClearConditionList; end; end; cLeft:=245; with TButton.Create(ParentControl) do begin Parent:=ParentControl; ModalResult:=mrOK; TabStop:=false; Caption:='运行(&R)'; SetBounds(cLeft, ctop, 68, Height); end; with TButton.Create(ParentControl) do begin Parent:=ParentControl; Cancel:=true; ModalResult:=mrCancel; Caption:='取消(&C)'; TabStop:=false; SetBounds(cLeft + 68 + 5, ctop, 68, Height); cTop:= cTop + Height + 6; end; //设置窗体客户区 ParentControl.ClientHeight:= cTop + 4; end; procedure TMakeConditionController.SetValueEidtControlStyle(AEditControl: TWinControl); var i: Integer; DefaultBoolean: Boolean; begin if ConditionItems = nil then exit; with ConditionItems.Items[AEditControl.Tag] as TConditionItem do begin if AEditControl.ClassNameIs('TValueEdit') then with AEditControl as TValueEdit do begin CharCase := ecUpperCase; Kind:=FConditionType; Items.Text:=StringReplace(EmunItem, '/', #13, [rfReplaceAll]); if EmunItem = '' then Style:=csSimple else if EmunItem[Length(EmunItem)] = '/' then Style:=csDropDown else Style:=csDropDownList; if DefaultValue <> '' then begin Text:=DefaultValue; if Style = csDropDownList then for i := 0 to Items.Count - 1 do if Pos(DefaultValue, Items.Strings[i]) > 0 then begin ItemIndex:=i; Break; end; end; end; if AEditControl.ClassNameIs('TCheckBox') then with AEditControl as TCheckBox do begin Caption:=ConditionCaption; if (DefaultValue <> '') and TryStrToBool(DefaultValue, DefaultBoolean) then Checked:=DefaultBoolean; end; AEditControl.Visible:=True; end; end; function TMakeConditionController.GetExpression(IsDispLay: Boolean; CompareOperate: String; AEditControl: TComponent): String; var TempInt: Integer; TempBool: Boolean; TempDateTime: TDateTime; AConditionItem: TConditionItem; FactConditionValue, ConditionValue, TempExpression: String; begin if AEditControl.ClassNameIs('TListBox') then with AEditControl as TListBox do AConditionItem:=FConditionItems.Items[Integer(Items.Objects[ItemIndex])] as TConditionItem else AConditionItem:=FConditionItems.Items[AEditControl.Tag] as TConditionItem; if AEditControl.ClassNameIs('TValueEdit') then ConditionValue:=(AEditControl as TComboBox).Text; if AEditControl.ClassNameIs('TCheckBox') then ConditionValue:= Ifthen((AEditControl as TCheckBox).Checked, '1', '0'); if AEditControl.ClassNameIs('TListBox') then with AEditControl as TListBox do begin TempExpression:=Items.Strings[ItemIndex]; System.Delete(TempExpression, 1, Pos(' ', TempExpression)); CompareOperate:=LeftStr(TempExpression, Pos(' ', TempExpression) - 1); ConditionValue:=MidStr(TempExpression, Pos(' ', TempExpression) + 1, MAXINT); System.Delete(ConditionValue, 1, 1); SetLength(ConditionValue, Length(ConditionValue) - 1); end; FactConditionValue:=ConditionValue; if Pos('->', FactConditionValue) > 0 then FactConditionValue:=LeftStr(FactConditionValue, Pos('->', FactConditionValue) - 1); if not IsDispLay then ConditionValue:=FactConditionValue; case AConditionItem.ConditionType of ctNumber: if not TryStrToInt(FactConditionValue, TempInt) then raise Exception.CreateResFmt(@WAR_InputDataType, [AConditionItem.FConditionCaption, '整数']); ctBoolean: if not TryStrToBool(FactConditionValue, TempBool) then raise Exception.CreateResFmt(@WAR_InputDataType, [AConditionItem.FConditionCaption, '0/1']); ctDate, ctDateTime: if not TryStrToDateTime(FactConditionValue, TempDateTime) then raise Exception.CreateResFmt(@WAR_InputDataType, [AConditionItem.FConditionCaption, '日期']); end; result:=Format('%s %s ''%s''', [Ifthen(IsDispLay, AConditionItem.ConditionCaption, AConditionItem.ConditionName), CompareOperate, ConditionValue]); end; function TMakeConditionController.GetPreDeclares: String; var i: Integer; Component: TComponent; ConditionName: String; begin result:=''; for i := 0 to FComponentList.Count - 1 do begin Component:=FComponentList.Items[i]; ConditionName:=(FConditionItems.Items[Component.Tag] as TConditionItem).ConditionName; if (ConditionName = '') or (ConditionName[1] <> '@') then Continue; result := result + GetExpression(false, '=', Component) + ', '; end; if result <> '' then result[Length(result) - 1]:=' '; end; function TMakeConditionController.GetConditions: String; var i: Integer; begin result:=''; if FConditionListBox = nil then exit; for i := 0 to FConditionListBox.Count - 1 do begin FConditionListBox.ItemIndex:=i; if Integer(FConditionListBox.Items.Objects[i]) = 9999 then result := result + ' ' + FConditionListBox.Items.Strings[i] + ' ' else result := result + GetExpression(false, ' ', FConditionListBox); end; end; function TMakeConditionController.Execute: Boolean; begin result:=DoExecute end; end.
{$I+,R+,Q+,H+} {$IFDEF FPC} {$MODE DELPHI} {$ENDIF} {DEFINE DEBUG} Unit Rotary; Interface Uses {$IFDEF FPC}CThreads, CMem, BaseUnix,{$ELSE}CompileInDelphi,{$ENDIF} {$IFDEF DEBUG}DebugMe,{$ENDIF} Classes, SysUtils, RtlConsts, Input, InputEventCodes; Const MaxNumEvents = 8; //never got more than 2 event at time, this a hand moved knob Type TRotary = class(TThread) private ev : array[0..MaxNumEvents -1] of TInput_Event; EventFileName : string; EventHandle : integer; FPosition : integer; FStep : integer; FMin, FMax : integer; FCircular : Boolean; FSemaphore : Pointer; FChanged : Boolean; procedure SetCircular(const Value: Boolean); procedure SetMax(const Value: integer); procedure SetMin(const Value: integer); procedure SetStep(const Value: integer); protected procedure Execute; override; Procedure SetPosition(Const Value:Integer); public {$IFNDEF FPC} Finished:Boolean; Procedure Start; {$ENDIF} Constructor Create(CreateSuspended:boolean; Const EventName:string); Destructor Destroy; Override; published Property Position:Integer read FPosition write SetPosition; Property Min:integer read FMin write SetMin; Property Max:integer read FMax write SetMax; Property Step:integer read FStep write SetStep; Property Circular:Boolean read FCircular write SetCircular; Property Changed:Boolean read FChanged write FChanged; end; Implementation {$IFNDEF FPC} //delphi fast sintax check! Procedure TRotary.Start; begin end; {$ENDIF} constructor TRotary.Create(CreateSuspended:boolean; Const EventName:string); begin FreeOnTerminate := False; FPosition := 0; FMin := -100; FMax := 100; FStep := 1; FCircular := False; FChanged := False; FSemaphore := SemaphoreInit; SemaphorePost(FSemaphore); EventFileName := EventName; EventHandle := FpOpen(EventFileName, O_RDONLY); if EventHandle < 0 then raise EFOpenError.CreateFmt(SFOpenError, [EventFileName]); FpFcntl(EventHandle, F_SETFL, O_NONBLOCK); Inherited Create(CreateSuspended); end; //Create destructor TRotary.Destroy; begin if not Terminated then writeln('Rotary not Terminated!'); if EventHandle > 0 then FpClose(EventHandle); EventHandle := 0; if Assigned(FSemaphore) then SemaphoreDestroy(FSemaphore); {$IFDEF DEBUG} //DebugLn(TimeStamp + ' Rotary.Destroy'); {$ENDIF} Inherited; end; //Destroy procedure TRotary.Execute; Var np, p, i, r : integer; begin if EventHandle <= 0 then Exit; while (not Terminated) do begin r := FpRead(EventHandle, ev, sizeof(TInput_Event) * MaxNumEvents); if (r <= 0) then Sleep(10); if Terminated then Break; for i := 0 to (r div Sizeof(TInput_Event) - 1) do begin if (ev[i].etype = EV_REL) and (ev[i].code = REL_X) then begin try SemaphoreWait(FSemaphore); p := FStep; if ev[i].value > 0 then begin np := FPosition + p; if np > FMax then begin if FCircular then np := FMin else np := FMax; end; end else if ev[i].value < 0 then begin np := FPosition - p; if np < FMin then begin if FCircular then np := FMax else np := FMin; end; end else np := FPosition; //in teoria non ci passa mai FPosition := np; FChanged := True; finally SemaphorePost(FSemaphore); end; //try end; //if end; //for end; //while SemaphoreDestroy(FSemaphore); FSemaphore := Nil; end; //Execute procedure TRotary.SetCircular(const Value: Boolean); begin try SemaphoreWait(FSemaphore); FCircular := Value; finally SemaphorePost(FSemaphore); end; end; procedure TRotary.SetMax(const Value: integer); begin try SemaphoreWait(FSemaphore); FMax := Value; finally SemaphorePost(FSemaphore); end; end; procedure TRotary.SetMin(const Value: integer); begin try SemaphoreWait(FSemaphore); FMin := Value; finally SemaphorePost(FSemaphore); end; end; procedure TRotary.SetPosition(const Value: Integer); begin try SemaphoreWait(FSemaphore); FPosition := Value; finally SemaphorePost(FSemaphore); end; end; procedure TRotary.SetStep(const Value: integer); begin try SemaphoreWait(FSemaphore); FStep := Value; finally SemaphorePost(FSemaphore); end; end; end.
unit DPM.Core.Package.InstallerContext; interface uses Spring.Collections, VSoft.CancellationToken, DPM.Core.Types, DPM.Core.Logging, DPM.Core.Package.Interfaces, DPM.Core.Dependency.Interfaces, DPM.Core.Package.Installer.Interfaces, DPM.Core.Spec.Interfaces; type TCorePackageInstallerContext = class(TInterfacedObject, IPackageInstallerContext) protected FProjectGraphs : IDictionary<string, IDictionary<TDPMPlatform, IPackageReference>>; FProjectResolutions : IDictionary<string, IDictionary<TDPMPlatform, IList<IResolution>>>; FLogger : ILogger; procedure PackageInstalled(const platform : TDPMPlatform; const dpmPackageId : string; const packageVersion : TPackageVersion; const designFiles : TArray<string>);virtual; procedure PackageUninstalled(const platform : TDPMPlatform; const dpmPackageId : string);virtual; procedure RemoveProject(const projectFile : string);virtual; procedure RecordGraph(const projectFile: string; const platform : TDPMPlatform; const graph: IPackageReference);virtual; //called when package uninstalled procedure PackageGraphPruned(const projectFile : string; const platform : TDPMPlatform; const graph : IPackageReference);virtual; //this is a no-op here, look at the IDE installer context to see how this is implemented. function InstallDesignPackages(const cancellationToken: ICancellationToken; const projectFile : string; const packageSpecs: IDictionary<string, IPackageSpec>) : boolean;virtual; //record package resoltions for a project, so we can detect conflicts procedure RecordResolutions(const projectFile: string; const platform : TDPMPlatform; const resolutions : TArray<IResolution>); //search other projects in the project group to see if they have resolved the package. function FindPackageResolution(const projectFile: string; const platform : TDPMPlatform; const packageId : string ) : IResolution; procedure Clear;virtual; public constructor Create(const logger : ILogger);virtual; end; implementation uses System.SysUtils, DPM.Core.Dependency.Resolution; { TPackageInstallerContext } procedure TCorePackageInstallerContext.Clear; begin //IDE will override this FProjectGraphs.Clear; FProjectResolutions.Clear; end; constructor TCorePackageInstallerContext.Create(const logger : ILogger); begin FLogger := Logger; FProjectGraphs := TCollections.CreateDictionary<string, IDictionary<TDPMPlatform, IPackageReference>>; FProjectResolutions := TCollections.CreateDictionary<string, IDictionary<TDPMPlatform, IList<IResolution>>>; end; function TCorePackageInstallerContext.FindPackageResolution(const projectFile : string; const platform: TDPMPlatform; const packageId: string): IResolution; var pair : TPair<string, IDictionary<TDPMPlatform, IList<IResolution>>>; resolutions : IList<IResolution>; begin result := nil; for pair in FProjectResolutions do begin //only check other projects which might have already resolved the package. if not SameText(projectFile, pair.Key) then begin if pair.Value.TryGetValue(platform, resolutions) then begin result := resolutions.FirstOrDefault( function (const resolution : IResolution) : boolean begin result := SameText(packageId, resolution.Package.Id); end); if result <> nil then exit; end; end; end; end; function TCorePackageInstallerContext.InstallDesignPackages(const cancellationToken: ICancellationToken; const projectFile : string; const packageSpecs: IDictionary<string, IPackageSpec>): boolean; begin result := true; //this is only needed for the IDE context end; procedure TCorePackageInstallerContext.PackageGraphPruned(const projectFile: string; const platform: TDPMPlatform; const graph: IPackageReference); var projectPlatformEntry : IDictionary<TDPMPlatform, IPackageReference>; // resolutionPlatformEntry : IDictionary<TDPMPlatform, IList<IResolution>>; resolutions : IDictionary<string, integer>; begin if not FProjectGraphs.TryGetValue(LowerCase(projectFile), projectPlatformEntry) then begin projectPlatformEntry := TCollections.CreateDictionary<TDPMPlatform, IPackageReference>; FProjectGraphs[LowerCase(projectFile)] := projectPlatformEntry; end; projectPlatformEntry[platform] := graph; resolutions := TCollections.CreateDictionary<string,integer>; graph.VisitDFS( procedure(const packageReference: IPackageReference) begin resolutions[packageReference.Id] := 1; end); end; procedure TCorePackageInstallerContext.PackageInstalled(const platform: TDPMPlatform; const dpmPackageId: string; const packageVersion : TPackageVersion; const designFiles: TArray<string>); begin //do nothing, used in the IDE plugin end; procedure TCorePackageInstallerContext.PackageUninstalled(const platform: TDPMPlatform; const dpmPackageId: string); begin //do nothing, used in the IDE plugin end; procedure TCorePackageInstallerContext.RecordGraph(const projectFile: string; const platform : TDPMPlatform; const graph: IPackageReference); var projectPlatformEntry : IDictionary<TDPMPlatform, IPackageReference>; begin if not FProjectGraphs.TryGetValue(LowerCase(projectFile), projectPlatformEntry) then begin projectPlatformEntry := TCollections.CreateDictionary<TDPMPlatform, IPackageReference>; FProjectGraphs[LowerCase(projectFile)] := projectPlatformEntry; end; projectPlatformEntry[platform] := graph; end; procedure TCorePackageInstallerContext.RecordResolutions(const projectFile: string; const platform: TDPMPlatform; const resolutions: TArray<IResolution>); var resolutionPlatformEntry : IDictionary<TDPMPlatform, IList<IResolution>>; begin if not FProjectResolutions.TryGetValue(LowerCase(projectFile),resolutionPlatformEntry) then begin resolutionPlatformEntry := TCollections.CreateDictionary<TDPMPlatform, IList<IResolution>>; FProjectResolutions[LowerCase(projectFile)] := resolutionPlatformEntry; end; resolutionPlatformEntry[platform] := TCollections.CreateList<IResolution>(resolutions); end; procedure TCorePackageInstallerContext.RemoveProject(const projectFile: string); begin if FProjectGraphs.ContainsKey(LowerCase(projectFile)) then FProjectGraphs.Remove(LowerCase(projectFile)); if FProjectResolutions.ContainsKey(LowerCase(projectFile)) then FProjectResolutions.Remove(LowerCase(projectFile)); end; end.
unit uExercicio02; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; type TfrmExercicio02 = class(TForm) mmTextoOriginal: TMemo; lbTextoOriginal: TLabel; mmTextoConvertido: TMemo; rgOpcoes: TRadioGroup; lbQuantidadeLetras: TLabel; lbTextoConvertido: TLabel; edQuantidadeLetras: TEdit; btConverter: TButton; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure btConverterClick(Sender: TObject); private procedure Converter; procedure ConverterInvertido; procedure ConverterPrimeiraMaiuscula; procedure ConverterOrdemAlfabetica; public { Public declarations } end; var frmExercicio02: TfrmExercicio02; implementation uses uConversao; {$R *.dfm} procedure TfrmExercicio02.btConverterClick(Sender: TObject); begin if rgOpcoes.ItemIndex < 0 then begin ShowMessage('Selecione uma opção de conversão.'); Exit; end; Converter; end; procedure TfrmExercicio02.Converter; begin if rgOpcoes.ItemIndex = nINVERTIDO then ConverterInvertido else if rgOpcoes.ItemIndex = nPRIMEIRA_MAIUSCULA then ConverterPrimeiraMaiuscula else if rgOpcoes.ItemIndex = nORDEM_ALFABETICA then ConverterOrdemAlfabetica; end; procedure TfrmExercicio02.ConverterInvertido; var oConverteInvertido: TConverteInvertido; sResultado: string; nQuantidade: integer; begin oConverteInvertido := TConverteInvertido.Create; try oConverteInvertido.Texto := mmTextoOriginal.Text; if edQuantidadeLetras.Text = EmptyStr then nQuantidade := nNUMERO_INDEFINIDO else nQuantidade := StrToIntDef(edQuantidadeLetras.Text, 0); oConverteInvertido.QuantidadeLetras := nQuantidade; sResultado := oConverteInvertido.Converter; mmTextoConvertido.Text := sResultado; finally FreeAndNil(oConverteInvertido); end; end; procedure TfrmExercicio02.ConverterOrdemAlfabetica; var oConverteOrdenado: TConverteOrdenado; sResultado: string; nQuantidade: integer; begin oConverteOrdenado := TConverteOrdenado.Create; try oConverteOrdenado.Texto := mmTextoOriginal.Text; if edQuantidadeLetras.Text = EmptyStr then nQuantidade := nNUMERO_INDEFINIDO else nQuantidade := StrToIntDef(edQuantidadeLetras.Text, 0); oConverteOrdenado.QuantidadeLetras := nQuantidade; sResultado := oConverteOrdenado.Converter; mmTextoConvertido.Text := sResultado; finally FreeAndNil(oConverteOrdenado); end; end; procedure TfrmExercicio02.ConverterPrimeiraMaiuscula; var oConvertePrimeiraMaiuscula: TConvertePrimeiraMaiuscula; sResultado: string; nQuantidade: integer; begin oConvertePrimeiraMaiuscula := TConvertePrimeiraMaiuscula.Create; try oConvertePrimeiraMaiuscula.Texto := mmTextoOriginal.Text; if edQuantidadeLetras.Text = EmptyStr then nQuantidade := nNUMERO_INDEFINIDO else nQuantidade := StrToIntDef(edQuantidadeLetras.Text, 0); oConvertePrimeiraMaiuscula.QuantidadeLetras := nQuantidade; sResultado := oConvertePrimeiraMaiuscula.Converter; mmTextoConvertido.Text := sResultado; finally FreeAndNil(oConvertePrimeiraMaiuscula); end; end; procedure TfrmExercicio02.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; end.
unit hdf5_lite; interface uses windows, util1, hdf5dll; (* Flag definitions for H5LTopen_file_image() *) Const H5LT_FILE_IMAGE_OPEN_RW = 1; (* Open image for read-write *) H5LT_FILE_IMAGE_DONT_COPY = 2; (* The HDF5 lib won't copy *) (* user supplied image buffer. The same image is open with the core driver. *) H5LT_FILE_IMAGE_DONT_RELEASE = 4; (* The HDF5 lib won't *) (* deallocate user supplied image buffer. The user application is reponsible *) (* for doing so. *) H5LT_FILE_IMAGE_ALL = 7; type H5LT_lang_t = ( H5LT_LANG_ERR = -1, (*this is the first*) H5LT_DDL = 0, (*for DDL*) H5LT_C = 1, (*for C*) H5LT_FORTRAN = 2, (*for Fortran*) H5LT_NO_LANG = 3 (*this is the last*) ); (*------------------------------------------------------------------------- * * Make dataset functions * *------------------------------------------------------------------------- *) var H5LTmake_dataset: function( loc_id: hid_t; dset_name: PansiChar; rank: integer; dims: pointer; type_id: hid_t; buffer: pointer ) : herr_t; cdecl; H5LTmake_dataset_char, H5LTmake_dataset_short, H5LTmake_dataset_int, H5LTmake_dataset_long, H5LTmake_dataset_float, H5LTmake_dataset_double, H5LTmake_dataset_string: function( loc_id: hid_t ; dset_name: PansiChar; rank: integer; dims: pointer; buffer: pointer ): herr_t; cdecl; (*------------------------------------------------------------------------- * * Read dataset functions * *------------------------------------------------------------------------- *) H5LTread_dataset: function( loc_id: hid_t; dset_name: PansiChar; type_id: hid_t; buffer:pointer ):herr_t; cdecl; H5LTread_dataset_char, H5LTread_dataset_short, H5LTread_dataset_int, H5LTread_dataset_long, H5LTread_dataset_float, H5LTread_dataset_double, H5LTread_dataset_string: function( loc_id: hid_t; dset_name: PansiChar; buffer:pointer ):herr_t; cdecl; (*------------------------------------------------------------------------- * * Query dataset functions * *------------------------------------------------------------------------- *) H5LTget_dataset_ndims: function(loc_id: hid_t ; dset_name: PansiChar; var rank: integer ):herr_t; cdecl; H5LTget_dataset_info: function( loc_id: hid_t ; dset_name: PansiChar; dims: pointer; var type_class:H5T_class_t; var type_size: size_t ):herr_t; cdecl; H5LTfind_dataset: function( loc_id: hid_t; name: PansiChar ):herr_t; cdecl; (*------------------------------------------------------------------------- * * Set attribute functions * *------------------------------------------------------------------------- *) H5LTset_attribute_string: function( loc_id: hid_t; obj_name: Pansichar; attr_name: Pansichar; attr_data: PansiChar ): herr_t; H5LTset_attribute_char, H5LTset_attribute_uchar, H5LTset_attribute_short, H5LTset_attribute_ushort, H5LTset_attribute_int, H5LTset_attribute_uint, H5LTset_attribute_long, H5LTset_attribute_long_long, H5LTset_attribute_ulong, H5LTset_attribute_float, H5LTset_attribute_double: function( loc_id: hid_t; obj_name: Pansichar; attr_name: Pansichar; attr_data: Pointer; size: size_t): herr_t;cdecl; (*------------------------------------------------------------------------- * * Get attribute functions * *------------------------------------------------------------------------- *) H5LTget_attribute: function( loc_id: hid_t; obj_name: PansiChar; attr_name: Pansichar; mem_type_id: hid_t; data:pointer ): herr_t;cdecl; H5LTget_attribute_string, H5LTget_attribute_char, H5LTget_attribute_uchar, H5LTget_attribute_short, H5LTget_attribute_ushort, H5LTget_attribute_int, H5LTget_attribute_uint, H5LTget_attribute_long, H5LTget_attribute_long_long, H5LTget_attribute_ulong, H5LTget_attribute_float, H5LTget_attribute_double: function ( loc_id: hid_t; obj_name: Pansichar; attr_name: Pansichar; data: pointer ): herr_t;cdecl; (*------------------------------------------------------------------------- * * Query attribute functions * *------------------------------------------------------------------------- *) H5LTget_attribute_ndims: function( loc_id: hid_t; obj_name: PansiChar; attr_name: Pansichar; var rank: integer ): herr_t;cdecl; H5LTget_attribute_info: function( loc_id: herr_t; obj_name: Pansichar; attr_name: Pansichar; dims: pointer; var type_class: H5T_class_t; var type_size: size_t ): herr_t;cdecl; (*------------------------------------------------------------------------- * * General functions * *------------------------------------------------------------------------- *) H5LTtext_to_dtype: function( text: Pansichar; lang_type: H5LT_lang_t): hid_t ;cdecl; H5LTdtype_to_text: function( dtype: hid_t; str: Pansichar; lang_type:H5LT_lang_t; var len: size_t):herr_t ;cdecl; (*------------------------------------------------------------------------- * * Utility functions * *------------------------------------------------------------------------- *) H5LTfind_attribute: function( loc_id:hid_t; name: Pansichar ):herr_t;cdecl; H5LTpath_valid: function(loc_id: hid_t ; path: Pansichar; check_object_valid: hbool_t):htri_t ;cdecl; (*------------------------------------------------------------------------- * * File image operations functions * *------------------------------------------------------------------------- *) H5LTopen_file_image: function ( buf_ptr: pointer; buf_size: size_t ; flags: integer): hid_t ;cdecl; function InitHdf5_lite: boolean; implementation Const DLLname = 'hdf5_hl'; var hh: Thandle; function InitHdf5_lite: boolean; begin result:=true; if hh<>0 then exit; hh:=GloadLibrary(Appdir+'\hdf5\'+DLLname); result:=(hh<>0); if not result then exit; H5LTmake_dataset:= getProc(hh,'H5LTmake_dataset'); H5LTmake_dataset_char:= getProc(hh,'H5LTmake_dataset_char'); H5LTmake_dataset_short:= getProc(hh,'H5LTmake_dataset_short'); H5LTmake_dataset_int:= getProc(hh,'H5LTmake_dataset_int'); H5LTmake_dataset_long:= getProc(hh,'H5LTmake_dataset_long'); H5LTmake_dataset_float:= getProc(hh,'H5LTmake_dataset_float'); H5LTmake_dataset_double:= getProc(hh,'H5LTmake_dataset_double'); H5LTmake_dataset_string:= getProc(hh,'H5LTmake_dataset_string'); H5LTread_dataset:= getProc(hh,'H5LTread_dataset'); H5LTread_dataset_char:= getProc(hh,'H5LTread_dataset_char'); H5LTread_dataset_short:= getProc(hh,'H5LTread_dataset_short'); H5LTread_dataset_int:= getProc(hh,'H5LTread_dataset_int'); H5LTread_dataset_long:= getProc(hh,'H5LTread_dataset_long'); H5LTread_dataset_float:= getProc(hh,'H5LTread_dataset_float'); H5LTread_dataset_double:= getProc(hh,'H5LTread_dataset_double'); H5LTread_dataset_string:= getProc(hh,'H5LTread_dataset_string'); H5LTget_dataset_ndims:= getProc(hh,'H5LTget_dataset_ndims'); H5LTget_dataset_info:= getProc(hh,'H5LTget_dataset_info'); H5LTfind_dataset:= getProc(hh,'H5LTfind_dataset'); H5LTset_attribute_string:= getProc(hh,'H5LTset_attribute_string'); H5LTset_attribute_char:= getProc(hh,'H5LTset_attribute_char'); H5LTset_attribute_uchar:= getProc(hh,'H5LTset_attribute_uchar'); H5LTset_attribute_short:= getProc(hh,'H5LTset_attribute_short'); H5LTset_attribute_ushort:= getProc(hh,'H5LTset_attribute_ushort'); H5LTset_attribute_int:= getProc(hh,'H5LTset_attribute_int'); H5LTset_attribute_uint:= getProc(hh,'H5LTset_attribute_uint'); H5LTset_attribute_long:= getProc(hh,'H5LTset_attribute_long'); H5LTset_attribute_long_long:= getProc(hh,'H5LTset_attribute_long_long'); H5LTset_attribute_ulong:= getProc(hh,'H5LTset_attribute_ulong'); H5LTset_attribute_float:= getProc(hh,'H5LTset_attribute_float'); H5LTset_attribute_double:= getProc(hh,'H5LTset_attribute_double'); H5LTget_attribute:= getProc(hh,'H5LTget_attribute'); H5LTget_attribute_string:= getProc(hh,'H5LTget_attribute_string'); H5LTget_attribute_char:= getProc(hh,'H5LTget_attribute_char'); H5LTget_attribute_uchar:= getProc(hh,'H5LTget_attribute_uchar'); H5LTget_attribute_short:= getProc(hh,'H5LTget_attribute_short'); H5LTget_attribute_ushort:= getProc(hh,'H5LTget_attribute_ushort'); H5LTget_attribute_int:= getProc(hh,'H5LTget_attribute_int'); H5LTget_attribute_uint:= getProc(hh,'H5LTget_attribute_uint'); H5LTget_attribute_long:= getProc(hh,'H5LTget_attribute_long'); H5LTget_attribute_long_long:= getProc(hh,'H5LTget_attribute_long_long'); H5LTget_attribute_ulong:= getProc(hh,'H5LTget_attribute_ulong'); H5LTget_attribute_float:= getProc(hh,'H5LTget_attribute_float'); H5LTget_attribute_double:= getProc(hh,'H5LTget_attribute_double'); H5LTget_attribute_ndims:= getProc(hh,'H5LTget_attribute_ndims'); H5LTget_attribute_info:= getProc(hh,'H5LTget_attribute_info'); H5LTtext_to_dtype:= getProc(hh,'H5LTtext_to_dtype'); H5LTdtype_to_text:= getProc(hh,'H5LTdtype_to_text'); H5LTfind_attribute:= getProc(hh,'H5LTfind_attribute'); H5LTpath_valid:= getProc(hh,'H5LTpath_valid'); H5LTopen_file_image:= getProc(hh,'H5LTopen_file_image'); end; end.
unit FoLogin; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TFrmLogin = class(TForm) Label1: TLabel; btnCancel: TButton; edtLogin: TEdit; Label2: TLabel; edtPassword: TEdit; btnConfirm: TButton; procedure btnConfirmClick(Sender: TObject); private function CheckRequiredFields : Boolean; public { Public declarations } end; var FrmLogin: TFrmLogin; implementation uses Alerts, LoginBusiness; {$R *.dfm} function TFrmLogin.CheckRequiredFields: Boolean; begin Result := False; if self.edtLogin.Text = '' then begin ShowErrorDialog('Empty field', 'Username field must not be empty'); Exit; end; if self.edtPassword.Text = '' then begin ShowErrorDialog('Empty field', 'Password field must not be empty'); Exit; end; Result := True; end; procedure TFrmLogin.btnConfirmClick(Sender: TObject); begin if not self.CheckRequiredFields then Exit; if not LoginUser(self.edtLogin.Text, self.edtPassword.Text) then begin ShowErrorDialog('Invalid username/password'); end else begin self.ModalResult := mrOk; end; end; end.
(* ========================================== *) (* -- Sack TEST 27.05.17 -- *) (* ========================================== *) PROGRAM SackTest; USES SOSU; VAR s, s1, s2, s3: SackPtr; BEGIN WriteLn('=== SackTest ==='); New(s, Init); New(s1, Init); New(s2, Init); s^.Add('Hallo'); s^.Add('ich'); s1^.Add('Hallo'); s1^.Add('ich'); s1^.Add('bin'); s1^.Add('eine'); s1^.Add('Unit'); s2^.Add('Hallo'); s2^.Add('me'); s2^.Add('bin'); s2^.Add('Unit'); (* Cardinality Test *) WriteLn; WriteLn('Cardinality s1: ', s1^.Cardinality); WriteLn('Cardinality s2: ', s2^.Cardinality); WriteLn; (* Successful union *) WriteLn('-- Union --'); s3 := s1^.Union(s2); s3^.Print(); s3^.Remove('Hallo'); WriteLn('-- Removed Hallo --'); s3^.Print(); (* unsuccessful union,s3 gets overwritten with new object -> no output *) WriteLn; s2^.Add('T'); s2^.Add('T2'); s2^.Add('T3'); s2^.Add('T4'); s2^.Add('T5'); s2^.Add('T6'); s3 := s1^.Union(s2); s3^.Print(); (* Difference Test *) WriteLn('-- Difference --'); s3 := s1^.Difference(s2); s3^.Print(); WriteLn; (* Intersection Test *) WriteLn('-- Intersection --'); s3 := s1^.Intersection(s2); s3^.Print(); WriteLn; (* Subset Test, first true, second false *) WriteLn('-- Subset --'); IF s^.Subset(s1) THEN WriteLn('s is a subset from s1') ELSE WriteLn('s is not a subset from s1'); s^.Add('TTTTTT'); WriteLn('Added Element TTTTTT to s (Not in s1)'); IF s^.Subset(s1) THEN WriteLn('s is a subset from s1') ELSE WriteLn('s is not a subset from s1'); WriteLn; Dispose(s, Done); Dispose(s1, Done); Dispose(s2, Done); Dispose(s3, Done); END.
unit MT5.History; interface uses System.SysUtils, System.JSON, REST.JSON, System.Generics.Collections, MT5.Connect, MT5.RetCode, MT5.Order; type TMTHistoryProtocol = class; TMTHistoryTotalAnswer = class; TMTHistoryPageAnswer = class; TMTHistoryAnswer = class; TMTHistoryProtocol = class private { private declarations } FMTConnect: TMTConnect; function ParseHistory(ACommand: string; AAnswer: string; out AHistoryAnswer: TMTHistoryAnswer): TMTRetCodeType; function ParseHistoryPage(AAnswer: string; out AHistoryPageAnswer: TMTHistoryPageAnswer): TMTRetCodeType; function ParseHistoryTotal(AAnswer: string; out AHistoryTotalAnswer: TMTHistoryTotalAnswer): TMTRetCodeType; protected { protected declarations } public { public declarations } constructor Create(AConnect: TMTConnect); function HistoryGet(ATicket: string; out AHistory: TMTOrder): TMTRetCodeType; function HistoryGetPage(ALogin, AFrom, ATo, AOffset, ATotal: Integer; out AHistorysCollection: TArray<TMTOrder>): TMTRetCodeType; function HistoryGetTotal(ALogin, AFrom, ATo: Integer; out ATotal: Integer): TMTRetCodeType; end; TMTHistoryTotalAnswer = class private FRetCode: string; FTotal: Integer; procedure SetRetCode(const Value: string); procedure SetTotal(const Value: Integer); { private declarations } protected { protected declarations } public { public declarations } constructor Create; virtual; property RetCode: string read FRetCode write SetRetCode; property Total: Integer read FTotal write SetTotal; end; TMTHistoryPageAnswer = class private FConfigJson: string; FRetCode: string; procedure SetConfigJson(const Value: string); procedure SetRetCode(const Value: string); { private declarations } protected { protected declarations } public { public declarations } constructor Create; virtual; property RetCode: string read FRetCode write SetRetCode; property ConfigJson: string read FConfigJson write SetConfigJson; function GetArrayFromJson: TArray<TMTOrder>; end; TMTHistoryAnswer = class private FConfigJson: string; FRetCode: string; procedure SetConfigJson(const Value: string); procedure SetRetCode(const Value: string); { private declarations } protected { protected declarations } public { public declarations } constructor Create; virtual; property RetCode: string read FRetCode write SetRetCode; property ConfigJson: string read FConfigJson write SetConfigJson; function GetFromJson: TMTOrder; end; implementation uses MT5.Types, MT5.Protocol, MT5.Utils, MT5.BaseAnswer, MT5.ParseProtocol, System.Classes; { TMTHistoryTotalAnswer } constructor TMTHistoryTotalAnswer.Create; begin FRetCode := '-1'; FTotal := 0; end; procedure TMTHistoryTotalAnswer.SetRetCode(const Value: string); begin FRetCode := Value; end; procedure TMTHistoryTotalAnswer.SetTotal(const Value: Integer); begin FTotal := Value; end; { TMTHistoryPageAnswer } constructor TMTHistoryPageAnswer.Create; begin FConfigJson := ''; FRetCode := '-1'; end; function TMTHistoryPageAnswer.GetArrayFromJson: TArray<TMTOrder>; var LHistorysJsonArray: TJsonArray; I: Integer; begin LHistorysJsonArray := TJsonObject.ParseJSONValue(ConfigJson) as TJsonArray; try for I := 0 to LHistorysJsonArray.Count - 1 do Result := Result + [TMTOrderJson.GetFromJson(TJsonObject(LHistorysJsonArray.Items[I]))]; finally LHistorysJsonArray.Free; end; end; procedure TMTHistoryPageAnswer.SetConfigJson(const Value: string); begin FConfigJson := Value; end; procedure TMTHistoryPageAnswer.SetRetCode(const Value: string); begin FRetCode := Value; end; { TMTHistoryAnswer } constructor TMTHistoryAnswer.Create; begin FConfigJson := ''; FRetCode := '-1'; end; function TMTHistoryAnswer.GetFromJson: TMTOrder; begin Result := TMTOrderJson.GetFromJson(TJsonObject.ParseJSONValue(ConfigJson) as TJsonObject); end; procedure TMTHistoryAnswer.SetConfigJson(const Value: string); begin FConfigJson := Value; end; procedure TMTHistoryAnswer.SetRetCode(const Value: string); begin FRetCode := Value; end; { TMTHistoryProtocol } constructor TMTHistoryProtocol.Create(AConnect: TMTConnect); begin FMTConnect := AConnect; end; function TMTHistoryProtocol.HistoryGet(ATicket: string; out AHistory: TMTOrder): TMTRetCodeType; var LData: TArray<TMTQuery>; LAnswer: TArray<Byte>; LAnswerString: string; LRetCodeType: TMTRetCodeType; LHistoryAnswer: TMTHistoryAnswer; begin LData := [ TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_TICKET, ATicket) ]; if not FMTConnect.Send(TMTProtocolConsts.WEB_CMD_HISTORY_GET, LData) then Exit(TMTRetCodeType.MT_RET_ERR_NETWORK); LAnswer := FMTConnect.Read(True); if Length(LAnswer) = 0 then Exit(TMTRetCodeType.MT_RET_ERR_NETWORK); LAnswerString := TMTUtils.GetString(LAnswer); LRetCodeType := ParseHistory(TMTProtocolConsts.WEB_CMD_HISTORY_GET, LAnswerString, LHistoryAnswer); try if LRetCodeType <> TMTRetCodeType.MT_RET_OK then Exit(LRetCodeType); AHistory := LHistoryAnswer.GetFromJson; Exit(TMTRetCodeType.MT_RET_OK); finally LHistoryAnswer.Free; end; end; function TMTHistoryProtocol.HistoryGetPage(ALogin, AFrom, ATo, AOffset, ATotal: Integer; out AHistorysCollection: TArray<TMTOrder>): TMTRetCodeType; var LData: TArray<TMTQuery>; LAnswer: TArray<Byte>; LAnswerString: string; LRetCodeType: TMTRetCodeType; LHistoryPageAnswer: TMTHistoryPageAnswer; begin LData := [ TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_LOGIN, ALogin.ToString), TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_FROM, AFrom.ToString), TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_TO, ATo.ToString), TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_OFFSET, AOffset.ToString), TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_TOTAL, ATotal.ToString) ]; if not FMTConnect.Send(TMTProtocolConsts.WEB_CMD_HISTORY_GET_PAGE, LData) then Exit(TMTRetCodeType.MT_RET_ERR_NETWORK); LAnswer := FMTConnect.Read(True); if Length(LAnswer) = 0 then Exit(TMTRetCodeType.MT_RET_ERR_NETWORK); LAnswerString := TMTUtils.GetString(LAnswer); LRetCodeType := ParseHistoryPage(LAnswerString, LHistoryPageAnswer); try if LRetCodeType <> TMTRetCodeType.MT_RET_OK then Exit(LRetCodeType); AHistorysCollection := LHistoryPageAnswer.GetArrayFromJson; Exit(TMTRetCodeType.MT_RET_OK); finally LHistoryPageAnswer.Free; end; end; function TMTHistoryProtocol.HistoryGetTotal(ALogin, AFrom, ATo: Integer; out ATotal: Integer): TMTRetCodeType; var LData: TArray<TMTQuery>; LAnswer: TArray<Byte>; LAnswerString: string; LRetCodeType: TMTRetCodeType; LHistoryTotalAnswer: TMTHistoryTotalAnswer; begin ATotal := 0; LData := [ TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_LOGIN, ALogin.ToString), TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_FROM, AFrom.ToString), TMTQuery.Create(TMTProtocolConsts.WEB_PARAM_TO, ATo.ToString) ]; if not FMTConnect.Send(TMTProtocolConsts.WEB_CMD_HISTORY_GET_TOTAL, LData) then Exit(TMTRetCodeType.MT_RET_ERR_NETWORK); LAnswer := FMTConnect.Read(True); if Length(LAnswer) = 0 then Exit(TMTRetCodeType.MT_RET_ERR_NETWORK); LAnswerString := TMTUtils.GetString(LAnswer); LRetCodeType := ParseHistoryTotal(LAnswerString, LHistoryTotalAnswer); try if LRetCodeType <> TMTRetCodeType.MT_RET_OK then Exit(LRetCodeType); ATotal := LHistoryTotalAnswer.Total; Exit(TMTRetCodeType.MT_RET_OK); finally LHistoryTotalAnswer.Free; end; end; function TMTHistoryProtocol.ParseHistory(ACommand: string; AAnswer: string; out AHistoryAnswer: TMTHistoryAnswer): TMTRetCodeType; var LPos: Integer; LPosEnd: Integer; LCommandReal: string; LParam: TMTAnswerParam; LRetCodeType: TMTRetCodeType; LJsonDataString: string; begin LPos := 0; AHistoryAnswer := nil; LCommandReal := TMTParseProtocol.GetCommand(AAnswer, LPos); if (LCommandReal <> ACommand) then Exit(TMTRetCodeType.MT_RET_ERR_DATA); AHistoryAnswer := TMTHistoryAnswer.Create; LPosEnd := -1; LParam := TMTParseProtocol.GetNextParam(AAnswer, LPos, LPosEnd); try while LParam <> nil do begin if LParam.Name = TMTProtocolConsts.WEB_PARAM_RETCODE then begin AHistoryAnswer.RetCode := LParam.Value; Break; end; FreeAndNil(LParam); LParam := TMTParseProtocol.GetNextParam(AAnswer, LPos, LPosEnd); end; finally LParam.Free; end; LRetCodeType := TMTParseProtocol.GetRetCode(AHistoryAnswer.RetCode); if LRetCodeType <> TMTRetCodeType.MT_RET_OK then Exit(LRetCodeType); LJsonDataString := TMTParseProtocol.GetJson(AAnswer, LPosEnd); if LJsonDataString = EmptyStr then Exit(TMTRetCodeType.MT_RET_REPORT_NODATA); AHistoryAnswer.ConfigJson := LJsonDataString; Exit(TMTRetCodeType.MT_RET_OK); end; function TMTHistoryProtocol.ParseHistoryPage(AAnswer: string; out AHistoryPageAnswer: TMTHistoryPageAnswer): TMTRetCodeType; var LPos: Integer; LPosEnd: Integer; LCommandReal: string; LParam: TMTAnswerParam; LRetCodeType: TMTRetCodeType; LJsonDataString: string; begin LPos := 0; AHistoryPageAnswer := nil; LCommandReal := TMTParseProtocol.GetCommand(AAnswer, LPos); if (LCommandReal <> TMTProtocolConsts.WEB_CMD_HISTORY_GET_PAGE) then Exit(TMTRetCodeType.MT_RET_ERR_DATA); AHistoryPageAnswer := TMTHistoryPageAnswer.Create; LPosEnd := -1; LParam := TMTParseProtocol.GetNextParam(AAnswer, LPos, LPosEnd); try while LParam <> nil do begin if LParam.Name = TMTProtocolConsts.WEB_PARAM_RETCODE then begin AHistoryPageAnswer.RetCode := LParam.Value; Break; end; FreeAndNil(LParam); LParam := TMTParseProtocol.GetNextParam(AAnswer, LPos, LPosEnd); end; finally LParam.Free; end; LRetCodeType := TMTParseProtocol.GetRetCode(AHistoryPageAnswer.RetCode); if LRetCodeType <> TMTRetCodeType.MT_RET_OK then Exit(LRetCodeType); LJsonDataString := TMTParseProtocol.GetJson(AAnswer, LPosEnd); if LJsonDataString = EmptyStr then Exit(TMTRetCodeType.MT_RET_REPORT_NODATA); AHistoryPageAnswer.ConfigJson := LJsonDataString; Exit(TMTRetCodeType.MT_RET_OK); end; function TMTHistoryProtocol.ParseHistoryTotal(AAnswer: string; out AHistoryTotalAnswer: TMTHistoryTotalAnswer): TMTRetCodeType; var LPos: Integer; LPosEnd: Integer; LCommandReal: string; LParam: TMTAnswerParam; LRetCodeType: TMTRetCodeType; begin LPos := 0; AHistoryTotalAnswer := nil; LCommandReal := TMTParseProtocol.GetCommand(AAnswer, LPos); if (LCommandReal <> TMTProtocolConsts.WEB_CMD_HISTORY_GET_TOTAL) then Exit(TMTRetCodeType.MT_RET_ERR_DATA); AHistoryTotalAnswer := TMTHistoryTotalAnswer.Create; LPosEnd := -1; LParam := TMTParseProtocol.GetNextParam(AAnswer, LPos, LPosEnd); try while LParam <> nil do begin if LParam.Name = TMTProtocolConsts.WEB_PARAM_RETCODE then AHistoryTotalAnswer.RetCode := LParam.Value; if LParam.Name = TMTProtocolConsts.WEB_PARAM_TOTAL then AHistoryTotalAnswer.Total := LParam.Value.ToInteger; FreeAndNil(LParam); LParam := TMTParseProtocol.GetNextParam(AAnswer, LPos, LPosEnd); end; finally LParam.Free; end; LRetCodeType := TMTParseProtocol.GetRetCode(AHistoryTotalAnswer.RetCode); if LRetCodeType <> TMTRetCodeType.MT_RET_OK then Exit(LRetCodeType); Exit(TMTRetCodeType.MT_RET_OK); end; end.
unit ThreadUtils; interface uses SysUtils, Classes, Windows; type tThreadQueue = class(tThreadList) protected procedure CallNext(l: TList); public // constructor Create; function Enter: THandle; // you can use handle to make Timers that can be dismissed from queue procedure Leave; function Count: Integer; destructor Destroy; override; procedure Dismiss(Index: Integer = -1); end; implementation procedure tThreadQueue.Leave; var l: TList; h: THandle; begin l := LockList; try if l.Count > 0 then begin h := THandle(l[0]); CloseHandle(h); // Dismiss l.Delete(0); CallNext(l); end; finally UnlockList; end; end; procedure tThreadQueue.CallNext(l: TList); var h: THandle; begin if l.Count > 0 then begin h := THandle(l[0]); SetEvent(h); // NEXT end; end; function tThreadQueue.Enter: THandle; var h: THandle; l: TList; B: Boolean; begin h := CreateEvent(nil, True, False, nil); l := LockList; try B := l.Add(Pointer(h)) = 0; finally UnlockList; end; // if thread not first in list then wait if not B then B := WaitForSingleObject(h, INFINITE) = WAIT_OBJECT_0; //WAIT_OBJECT_0 means thread got his turn from previous, alse something bad happened (handle closed) if not B then begin Result := 0; l := LockList; try CallNext(l); finally UnlockList; end; end else begin ResetEvent(h); Result := h; end; end; function tThreadQueue.Count: Integer; // better to avoid an use of it var l: TList; begin l := LockList; try Result := l.Count; finally UnlockList; end; end; destructor tThreadQueue.Destroy; begin Dismiss; inherited; end; procedure tThreadQueue.Dismiss(Index: Integer = -1); //Dismiss all handles or chosen one var i: Integer; h: THandle; l: TList; begin if index = -1 then begin l := LockList; try for i := 0 to l.Count - 1 do begin h := THandle(l[i]); CloseHandle(h); end; l.Clear; // Counter := 0; finally UnlockList; end; end else begin l := LockList; try h := THandle(l[index]); CloseHandle(h); // it should singal to thread that it dismissed, and thread should leave control to next one l.Delete(index); // threads should not opperate with their position in list after Unlock finally UnlockList; end; end; end; end.
unit ufmMainForm; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, Winapi.Messages, FMX.Platform.Win, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Controls.Presentation, FMX.ListBox, Winapi.Windows, FMX.Layouts, uMultiDisplay; type TfrmDeviceSettings = class(TForm) btnOK: TButton; btnCancel: TButton; cbbMonitor: TComboBox; cbbResolution: TComboBox; cbbOrientation: TComboBox; chkMonitor: TCheckBox; chkResolution: TCheckBox; chkOrientation: TCheckBox; pnlContent: TPanel; pnlMain: TPanel; lytMain: TLayout; lblCaption: TLabel; procedure btnOKClick(Sender: TObject); procedure btnCancelClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure cbbMonitorChange(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure cbbResolutionChange(Sender: TObject); procedure FormCreate(Sender: TObject); procedure cbbOrientationChange(Sender: TObject); procedure chkMonitorChange(Sender: TObject); private FMultiDisplay: TMultiDisplay; private procedure UpdateControls; procedure UpdateModeListContol; procedure UpdateControlsEnabled; procedure ApplySettings; procedure OnUpdateMonitorList(ASender: TObject); public { Public declarations } end; var frmDeviceSettings: TfrmDeviceSettings; implementation resourcestring RsNeedRestartWarning = 'Для применения настроек, необходимо перезапустить приложение' + sLineBreak + 'Продолжить?'; RsWarning = 'Предупреждение'; {$R *.fmx} procedure TfrmDeviceSettings.ApplySettings; var LMonitor: TMonitorDevice; LResolution: string; LOrientation: TMonitorOrientation; begin if (not chkMonitor.IsChecked) and (cbbMonitor.ItemIndex < 0) then Exit; LMonitor := TMonitorDevice(cbbMonitor.Items.Objects[cbbMonitor.ItemIndex]); LResolution := ''; LOrientation := moUnknown; if chkOrientation.IsChecked and (cbbOrientation.ItemIndex >= 0) then LOrientation := TMonitorOrientation(cbbOrientation.ItemIndex); if chkResolution.IsChecked and (cbbResolution.ItemIndex >= 0) then LResolution := cbbResolution.Items[cbbResolution.ItemIndex]; LMonitor.SetMode(LResolution, LOrientation); end; procedure TfrmDeviceSettings.btnCancelClick(Sender: TObject); begin Close; end; procedure TfrmDeviceSettings.btnOKClick(Sender: TObject); begin ApplySettings; end; procedure TfrmDeviceSettings.cbbMonitorChange(Sender: TObject); begin chkMonitor.IsChecked := cbbMonitor.ItemIndex >= 0; if cbbMonitor.ItemIndex < 0 then Exit; UpdateModeListContol; UpdateControlsEnabled; end; procedure TfrmDeviceSettings.cbbResolutionChange(Sender: TObject); begin chkResolution.IsChecked := cbbResolution.ItemIndex >= 0; end; procedure TfrmDeviceSettings.cbbOrientationChange(Sender: TObject); begin chkOrientation.IsChecked := cbbOrientation.ItemIndex >= 0; end; procedure TfrmDeviceSettings.chkMonitorChange(Sender: TObject); begin UpdateControlsEnabled; end; procedure TfrmDeviceSettings.FormCreate(Sender: TObject); var I: TMonitorOrientation; begin FMultiDisplay := TMultiDisplay.Create; FMultiDisplay.OnUpdateMonitorList := OnUpdateMonitorList; cbbOrientation.Clear; for I := Low(TMonitorOrientation) to High(TMonitorOrientation) do cbbOrientation.Items.Add(MONITOR_ORIENTATIONS[I]); end; procedure TfrmDeviceSettings.FormDestroy(Sender: TObject); begin cbbResolution.Clear; cbbMonitor.Clear; FMultiDisplay.Free; end; procedure TfrmDeviceSettings.FormShow(Sender: TObject); begin UpdateControls; UpdateControlsEnabled; end; procedure TfrmDeviceSettings.OnUpdateMonitorList(ASender: TObject); begin UpdateControls; end; procedure TfrmDeviceSettings.UpdateControls; var I: Integer; begin chkMonitor.IsChecked := False; chkResolution.IsChecked := False; chkOrientation.IsChecked := False; cbbResolution.Clear; cbbMonitor.Clear; cbbOrientation.ItemIndex := -1; for I := 0 to FMultiDisplay.MonitorList.Count - 1 do cbbMonitor.Items.AddObject(FMultiDisplay.MonitorList[I].FriendlyName, FMultiDisplay.MonitorList[I]); end; procedure TfrmDeviceSettings.UpdateControlsEnabled; var LMonitorSelected: Boolean; begin LMonitorSelected := chkMonitor.IsChecked and (cbbMonitor.ItemIndex >= 0); chkResolution.Enabled := LMonitorSelected; cbbResolution.Enabled := LMonitorSelected; chkOrientation.Enabled := LMonitorSelected; cbbOrientation.Enabled := LMonitorSelected; end; procedure TfrmDeviceSettings.UpdateModeListContol; var I: Integer; LModes: TMonitorModeList; LMonitor: TMonitorDevice; begin chkResolution.IsChecked := False; if (cbbMonitor.ItemIndex < 0) or (not Assigned(cbbMonitor.Items.Objects[cbbMonitor.ItemIndex])) then Exit; LMonitor := TMonitorDevice(cbbMonitor.Items.Objects[cbbMonitor.ItemIndex]); LModes := LMonitor.Modes; cbbResolution.Clear; for I := Pred(LModes.Count) downto 0 do cbbResolution.Items.Add(LModes[I].Resolution); end; end.
unit OTFEPGPDiskStructures_U; // By Sarah Dean // Email: sdean12@sdean12.org // WWW: http://www.SDean12.org/ // // ----------------------------------------------------------------------------- // interface uses Classes, SysUtils, Windows; type // base types PGPUInt8 = Byte; PGPUInt16 = Word; PGPUInt32 = Cardinal; PGPUInt64 = array [1..2] of cardinal; // KLUDGE - xxx PGPBoolean = Byte; {= can be TRUE(1) or FALSE(0) } CRC32 = PGPUInt32; EPGPDiskError = Exception; EPGPDiskNotConnected = EPGPDiskError; EPGPDiskExeNotFound = EPGPDiskError; EPGPDiskVxdNotFound = EPGPDiskError; TDeviceIOControlRegisters = packed record EBX : DWORD; EDX : DWORD; ECX : DWORD; EAX : DWORD; EDI : DWORD; ESI : DWORD; Flags : DWORD; end; TParamBlock = packed record Operation : Integer; NumLocks : Integer; end; const VWIN32_DIOC_DOS_IOCTL = 1; E_NOT_CONNECTED = 'PGPDisk not connected - set Active to TRUE first'; E_PGPDISK_EXE_NOT_FOUND = 'The PGPDisk executable could not be found'; E_DRIVE_IN_USE = 'Close all windows and applications used by this drive first'; // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- PGPDISK_APP_NAME = 'PGPdisk'; PGPDISK_DRIVER_NAME = '\\.\PGPdisk'; // We are emulating v6.0.2, so use this version number PGPDISK_APP_VERSION = $60000001; PGPDISK_MAX_DRIVES = 26; // (PGPUInt32) PGPDISK_INVALID_DRIVE = 255; // invalid drive # (PGPUInt8) PGPDISK_MAX_STRING_SIZE = 300; // > MAX_PATH (PGPUInt32) PGPDISK_BOOL_FALSE = 0; PGPDISK_BOOL_TRUE = 1; ///////////////////////////////////////////////////////////// // Application to driver (DeviceIoControl) packet definitions ///////////////////////////////////////////////////////////// const METHOD_BUFFERED = 0; const FILE_ANY_ACCESS = 0; const FILE_DEVICE_DISK = 7; // The PGPdisk app is allowed to pass two values to the driver - a control // code and a pointer. // The above line is the expanded out version using: //#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ // ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ //) // ... and ... //const PGPUInt32 IOCTL_PGPDISK_SENDPACKET = CTL_CODE(FILE_DEVICE_DISK, 0x800, // METHOD_BUFFERED, FILE_ANY_ACCESS) | 0x40000000; const IOCTL_PGPDISK_SENDPACKET : PGPUInt32 = ((FILE_DEVICE_DISK * $10000) OR ((FILE_ANY_ACCESS) * $4000) OR (($800) * $4) OR (METHOD_BUFFERED)) OR $40000000; const PGPDISK_ADPacketMagic : PGPUInt32 = $820F7353; PGPDISK_HeaderMagic = 'PGPd'; PGPDISK_PrimaryHeaderType = 'MAIN'; // Functions codes for packets. const PGPDISK_AD_Mount = $0001; const PGPDISK_AD_Unmount = $0002; const PGPDISK_AD_QueryVersion = $0003; const PGPDISK_AD_QueryMounted = $0004; const PGPDISK_AD_QueryOpenFiles = $0005; const PGPDISK_AD_ChangePrefs = $0006; const PGPDISK_AD_LockUnlockMem = $0007; const PGPDISK_AD_GeTOTFEPGPDiskInfo = $0008; const PGPDISK_AD_LockUnlockVol = $0009; const PGPDISK_AD_ReadWriteVol = $000A; const PGPDISK_AD_QueryVolInfo = $000B; const PGPDISK_AD_NotifyUserLogoff = $000C; type PGPDISK_Rec_ADPacketHeader = packed record magic: PGPUInt32; // must be PGPDISK_ADPacketMagic code: PGPUInt16; // packet code // DualErr *pDerr; // error (DualErr *) pDerr: Pointer; end; PGPDISK_Rec_AD_QueryMounted = packed record header: PGPDISK_Rec_ADPacketHeader; // standard header trueIfUsePath: PGPboolean; // TRUE to use path, FALSE to use drive path: PChar; // file to enquire about sizePath: PGPUInt32; // size of path drive: PGPUInt8; // drive to enquire about pIsPGPdisk: ^PGPboolean; // is a mounted PGPdisk? (PGPBoolean *) end; PGPDISK_Rec_AD_QueryVersion = packed record header : PGPDISK_Rec_ADPacketHeader; // standard header appVersion: PGPUInt32; // application version pDriverVersion: ^PGPUInt32; // driver version (PGPUInt32 *) end; { PGPDISK_Rec_AD_Mount = packed record header: ADPacketHeader; // standard header path: PChar; // path to the PGPdisk sizePath: PGPUInt32; // size of path drive: PGPUInt8; // preferred drive letter readOnly: PGPBoolean; // mount as read-only? CipherContext is a C++ object that (AFAIK) handles all the encryption/decryption pContext: ^CipherContext; // the cipher context pDrive: ^PGPUInt8; // drive mounted on (PGPUInt8 *) end; } PGPDISK_Rec_AD_Unmount = packed record header: PGPDISK_Rec_ADPacketHeader; // standard header drive: PGPUInt8; // drive to unmount isThisEmergency: PGPBoolean; // emergency unmount? end; PGPDISK_Rec_PGPdiskInfo = packed record path: array [1..PGPDISK_MAX_STRING_SIZE] of Ansichar; // path to the PGPdisk drive: PGPUInt8; // drive # of a mounted PGPdisk sessionId: PGPUInt64; // unique session Id end; PGPDISK_Rec_AD_GetPGPDiskInfo = packed record header: PGPDISK_Rec_ADPacketHeader; // standard header arrayElems: PGPUInt32; // elems in below array pPDIArray: ^PGPDISK_Rec_PGPdiskInfo; // array of kMaxDrives # of structures. end; PGPDISK_Rec_AD_QueryVolInfo = packed record header: PGPDISK_Rec_ADPacketHeader; // standard header drive: PGPUInt8; // drive number pBlockSize: ^PGPUInt16; // return blocksize here (PGPUInt16 *) pTotalBlocks: ^PGPUInt64; // return total blocks here (PGPUInt64 *) end; PGPDISK_Rec_AD_QueryOpenFiles = packed record header: PGPDISK_Rec_ADPacketHeader; // standard header drive: PGPUInt8; // drive to enumerate open files on pHasOpenFiles: ^PGPBoolean; // pointer to answer (PGPBoolean *) end; PGPDISK_Rec_PGPDiskFileHeaderInfo = packed record headerMagic: array [1..4] of Ansichar; // Magic field. Always PGPDISK_HeaderMagic headerType: array [1..4] of Ansichar; // PGPDISK_PrimaryHeaderType + ??? headerSize: PGPUInt32; // Total size of this header, in bytes headerCRC: CRC32; // CRC of this header nextHeaderOffset: PGPUInt64; // Offset to next header from file start // 0 = no additional headers reserved: array [1..2] of PGPUInt32; end; implementation END.
unit Uptime; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, main, ExtCtrls; type TUptimeForm = class(TForm) Label1: TLabel; TimeLabel: TLabel; OkBtn: TButton; UptimeUpdateTimer: TTimer; procedure OkBtnClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormActivate(Sender: TObject); procedure UptimeUpdateTimerTimer(Sender: TObject); private { Private declarations } public { Public declarations } end; var UptimeForm: TUptimeForm; implementation {$R *.dfm} // Viser hvor lang tid computeren har været tændt. function GetUptime: PWideChar; const ticksperday: integer = 1000 * 60 * 60 * 24; ticksperhour: integer = 1000 * 60 * 60; ticksperminute: integer = 1000 * 60; var t: longword; d, h, m: integer; begin t := GetTickCount64; d := t div ticksperday; dec(t, d * ticksperday); h := t div ticksperhour; dec(t, h * ticksperhour); m := t div ticksperminute; dec(t, m * ticksperminute); Result := PWideChar(IntToStr(d)+' Dage '+IntToStr(h)+' Timer '+IntToStr(m)+' Minutter'); end; procedure TUptimeForm.OkBtnClick(Sender: TObject); begin Close; end; procedure TUptimeForm.FormShow(Sender: TObject); begin TimeLabel.Caption:=GetUptime; end; procedure TUptimeForm.FormActivate(Sender: TObject); begin TimeLabel.Caption:=GetUptime; end; procedure TUptimeForm.UptimeUpdateTimerTimer(Sender: TObject); begin TimeLabel.Caption:=GetUptime; end; end.
// ---------------------------------------------------------------- // Programa em que o usuário informa o valor de um ângulo em graus // e o programa informa o seno e o cosseno deste ângulo. // // OBS: As funções Sin() e Cos() esperam um angulo em radianos. :~ // // Autor : Rodrigo Garé Pissarro - Beta Tester // Contato : rodrigogare@uol.com.br // ---------------------------------------------------------------- Program ExemploPzim ; Var graus: real; grausRadiano: real; Begin // Solicita o valor do angulo write('Informe o valor do ângulo em graus: '); readln(graus); // Mostra o seno e o cosseno grausRadiano:= graus*(3.1415/180) ; writeln('O Seno do ângulo é: ', sin(grausRadiano):2:2); writeln('O Cosseno do ângulo é: ', cos(grausRadiano):2:2); End.
{*******************************************************} { } { CodeGear Delphi Runtime Library } { Copyright(c) 2013-2018 Embarcadero Technologies, Inc. } { All rights reserved } { } {*******************************************************} unit System.Permissions; {$SCOPEDENUMS ON} interface uses System.Classes, System.Generics.Collections, System.SysUtils, System.Types; type EPermissionException = class(Exception); TPermissionStatus = (Granted, Denied, PermanentlyDenied); /// <summary>Callback type for when the system has processed our permission requests</summary> /// <remarks>For each requested permission in APermissions, there is /// a Boolean in AGrantResults indicating if the permission was granted. /// <para>This type is compatible with an event handler method.</para></remarks> TRequestPermissionsResultEvent = procedure(Sender: TObject; const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>) of object; /// <summary>Callback type for when the system has processed our permission requests</summary> /// <remarks>For each requested permission in APermissions, there is /// a Boolean in AGrantResults indicating if the permission was granted. /// <para>This type is compatible with an anonymous procedure.</para></remarks> TRequestPermissionsResultProc = reference to procedure(const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>); /// <summary>Callback type for providing an explanation to the user for the need for a permission</summary> /// <remarks>For previously denied permissions that we pre-loaded a rationale string for, /// this callback provides the opportunity to display it, but it *must* be done asynchronously. /// When the rationale display is over, be sure to call the APostRationalProc routine, /// which will then request the permissions that need requesting. /// <para>This type is compatible with an event handler method.</para></remarks> TDisplayRationaleEvent = procedure(Sender: TObject; const APermissions: TArray<string>; const APostRationaleProc: TProc) of object; /// <summary>Callback type for providing an explanation to the user for the need for a permission</summary> /// <remarks>For previously denied permissions that we pre-loaded a rationale string for, /// this callback provides the opportunity to display it, but it *must* be done asynchronously. /// When the rationale display is over, be sure to call the APostRationalProc routine, /// which will then request the permissions that need requesting. /// <para>This type is compatible with an anonymous procedure.</para></remarks> TDisplayRationaleProc = reference to procedure(const APermissions: TArray<string>; const APostRationaleProc: TProc); /// <summary>Base permissions service abstract class</summary> TPermissionsService = class abstract private class function GetDefaultService: TPermissionsService; static; protected class var FDefaultService: TPermissionsService; constructor Create; virtual; public class destructor UnInitialize; /// <summary>Find out if a permission is currently granted to the app</summary> /// <remarks>If there is no platform permissions service implemented to actually do any checking, /// then we default to responding that all permissions are granted</remarks> function IsPermissionGranted(const APermission: string): Boolean; virtual; /// <summary>Find out if a permissions are all currently granted to the app</summary> function IsEveryPermissionGranted(const APermissions: TArray<string>): Boolean; virtual; /// <summary>Request one or more permissions</summary> /// <remarks>Any permissions that are not currently granted will be requested. /// Beforehand, a rationale may be displayed to the user if: /// <para> i) a rationale string has been set for the permission in question</para> /// <para> ii) the OS deems it appropriate (we're requesting a permission again that was previously denied)</para> /// <para>iii) a rationale display routine is passed in</para> /// The rationale handler must display the passed in rationale string asynchronously and not block the thread. /// <para>This overload takes an event handler method.</para></remarks> procedure RequestPermissions(const APermissions: TArray<string>; const AOnRequestPermissionsResult: TRequestPermissionsResultEvent; AOnDisplayRationale: TDisplayRationaleEvent = nil); overload; virtual; /// <summary>Request one or more permissions</summary> /// <remarks>Any permissions that are not currently granted will be requested. /// Beforehand, a rationale may be displayed to the user if: /// <para> i) a rationale string has been set for the permission in question</para> /// <para> ii) the OS deems it appropriate (we're requesting a permission again that was previously denied)</para> /// <para>iii) a rationale display routine is passed in</para> /// The rationale handler must display the passed in rationale string asynchronously and not block the thread. /// <para>This overload takes an event handler method.</para></remarks> procedure RequestPermissions(const APermissions: TArray<string>; const AOnRequestPermissionsResult: TRequestPermissionsResultProc; AOnDisplayRationale: TDisplayRationaleProc = nil); overload; virtual; /// <summary>Factory property to retrieve an appropriate permissions implementation, if available on the current platform</summary> class property DefaultService: TPermissionsService read GetDefaultService; end; TPermissionsServiceClass = class of TPermissionsService; var PermissionsServiceClass: TPermissionsServiceClass = TPermissionsService; /// <summary>Helper to call TPermissionsService.DefaultService</summary> function PermissionsService: TPermissionsService; inline; implementation {$IFDEF ANDROID} uses System.Android.Permissions; {$ENDIF} { TPermissionsService } constructor TPermissionsService.Create; begin inherited Create; end; class function TPermissionsService.GetDefaultService: TPermissionsService; begin if (FDefaultService = nil) and (PermissionsServiceClass <> nil) then FDefaultService := PermissionsServiceClass.Create; Result := FDefaultService; end; function TPermissionsService.IsPermissionGranted(const APermission: string): Boolean; begin Result := True end; function TPermissionsService.IsEveryPermissionGranted(const APermissions: TArray<string>): Boolean; begin Result := True end; procedure TPermissionsService.RequestPermissions(const APermissions: TArray<string>; const AOnRequestPermissionsResult: TRequestPermissionsResultEvent; AOnDisplayRationale: TDisplayRationaleEvent); var GrantResults: TArray<TPermissionStatus>; I: Integer; begin SetLength(GrantResults, Length(APermissions)); for I := Low(GrantResults) to High(GrantResults) do GrantResults[I] := TPermissionStatus.Granted; AOnRequestPermissionsResult(Self, APermissions, GrantResults) end; procedure TPermissionsService.RequestPermissions(const APermissions: TArray<string>; const AOnRequestPermissionsResult: TRequestPermissionsResultProc; AOnDisplayRationale: TDisplayRationaleProc); var GrantResults: TArray<TPermissionStatus>; I: Integer; begin SetLength(GrantResults, Length(APermissions)); for I := Low(GrantResults) to High(GrantResults) do GrantResults[I] := TPermissionStatus.Granted; AOnRequestPermissionsResult(APermissions, GrantResults) end; class destructor TPermissionsService.UnInitialize; begin FreeAndNil(FDefaultService); end; function PermissionsService: TPermissionsService; begin Exit(TPermissionsService.DefaultService) end; end.
unit ImageRGBLongData; interface uses Windows, Graphics, BasicDataTypes, Abstract2DImageData, RGBLongDataSet, dglOpenGL; type T2DImageRGBLongData = class (TAbstract2DImageData) private FDefaultColor: TPixelRGBLongData; // Gets function GetData(_x, _y, _c: integer):longword; function GetDefaultColor:TPixelRGBLongData; // Sets procedure SetData(_x, _y, _c: integer; _value: longword); procedure SetDefaultColor(_value: TPixelRGBLongData); protected // Constructors and Destructors procedure Initialize; override; // Gets function GetBitmapPixelColor(_Position: longword):longword; override; function GetRPixelColor(_Position: longword):byte; override; function GetGPixelColor(_Position: longword):byte; override; function GetBPixelColor(_Position: longword):byte; override; function GetAPixelColor(_Position: longword):byte; override; function GetRedPixelColor(_x,_y: integer):single; override; function GetGreenPixelColor(_x,_y: integer):single; override; function GetBluePixelColor(_x,_y: integer):single; override; function GetAlphaPixelColor(_x,_y: integer):single; override; // Sets procedure SetBitmapPixelColor(_Position, _Color: longword); override; procedure SetRGBAPixelColor(_Position: integer; _r, _g, _b, _a: byte); override; procedure SetRedPixelColor(_x,_y: integer; _value:single); override; procedure SetGreenPixelColor(_x,_y: integer; _value:single); override; procedure SetBluePixelColor(_x,_y: integer; _value:single); override; procedure SetAlphaPixelColor(_x,_y: integer; _value:single); override; public // Gets function GetOpenGLFormat:TGLInt; override; // copies procedure Assign(const _Source: TAbstract2DImageData); override; // Misc procedure ScaleBy(_Value: single); override; procedure Invert; override; // properties property Data[_x,_y,_c:integer]:longword read GetData write SetData; default; property DefaultColor:TPixelRGBLongData read GetDefaultColor write SetDefaultColor; end; implementation // Constructors and Destructors procedure T2DImageRGBLongData.Initialize; begin FDefaultColor.r := 0; FDefaultColor.g := 0; FDefaultColor.b := 0; FData := TRGBLongDataSet.Create; end; // Gets function T2DImageRGBLongData.GetData(_x, _y, _c: integer):longword; begin if (_x >= 0) and (_x < FXSize) and (_y >= 0) and (_y < FYSize) and (_c >= 0) and (_c <= 2) then begin case (_c) of 0: Result := (FData as TRGBLongDataSet).Red[(_y * FXSize) + _x]; 1: Result := (FData as TRGBLongDataSet).Green[(_y * FXSize) + _x]; else begin Result := (FData as TRGBLongDataSet).Blue[(_y * FXSize) + _x]; end; end; end else begin case (_c) of 0: Result := FDefaultColor.r; 1: Result := FDefaultColor.g; else begin Result := FDefaultColor.b; end; end; end; end; function T2DImageRGBLongData.GetDefaultColor:TPixelRGBLongData; begin Result := FDefaultColor; end; function T2DImageRGBLongData.GetBitmapPixelColor(_Position: longword):longword; begin Result := RGB((FData as TRGBLongDataSet).Blue[_Position],(FData as TRGBLongDataSet).Green[_Position],(FData as TRGBLongDataSet).Red[_Position]); end; function T2DImageRGBLongData.GetRPixelColor(_Position: longword):byte; begin Result := (FData as TRGBLongDataSet).Red[_Position] and $FF; end; function T2DImageRGBLongData.GetGPixelColor(_Position: longword):byte; begin Result := (FData as TRGBLongDataSet).Green[_Position] and $FF; end; function T2DImageRGBLongData.GetBPixelColor(_Position: longword):byte; begin Result := (FData as TRGBLongDataSet).Blue[_Position] and $FF; end; function T2DImageRGBLongData.GetAPixelColor(_Position: longword):byte; begin Result := 0; end; function T2DImageRGBLongData.GetRedPixelColor(_x,_y: integer):single; begin Result := (FData as TRGBLongDataSet).Red[(_y * FXSize) + _x]; end; function T2DImageRGBLongData.GetGreenPixelColor(_x,_y: integer):single; begin Result := (FData as TRGBLongDataSet).Green[(_y * FXSize) + _x]; end; function T2DImageRGBLongData.GetBluePixelColor(_x,_y: integer):single; begin Result := (FData as TRGBLongDataSet).Blue[(_y * FXSize) + _x]; end; function T2DImageRGBLongData.GetAlphaPixelColor(_x,_y: integer):single; begin Result := 0; end; function T2DImageRGBLongData.GetOpenGLFormat:TGLInt; begin Result := GL_RGB; end; // Sets procedure T2DImageRGBLongData.SetBitmapPixelColor(_Position, _Color: longword); begin (FData as TRGBLongDataSet).Red[_Position] := GetRValue(_Color); (FData as TRGBLongDataSet).Green[_Position] := GetGValue(_Color); (FData as TRGBLongDataSet).Blue[_Position] := GetBValue(_Color); end; procedure T2DImageRGBLongData.SetRGBAPixelColor(_Position: integer; _r, _g, _b, _a: byte); begin (FData as TRGBLongDataSet).Red[_Position] := _r; (FData as TRGBLongDataSet).Green[_Position] := _g; (FData as TRGBLongDataSet).Blue[_Position] := _b; end; procedure T2DImageRGBLongData.SetRedPixelColor(_x,_y: integer; _value:single); begin (FData as TRGBLongDataSet).Red[(_y * FXSize) + _x] := Round(_value); end; procedure T2DImageRGBLongData.SetGreenPixelColor(_x,_y: integer; _value:single); begin (FData as TRGBLongDataSet).Green[(_y * FXSize) + _x] := Round(_value); end; procedure T2DImageRGBLongData.SetBluePixelColor(_x,_y: integer; _value:single); begin (FData as TRGBLongDataSet).Blue[(_y * FXSize) + _x] := Round(_value); end; procedure T2DImageRGBLongData.SetAlphaPixelColor(_x,_y: integer; _value:single); begin // do nothing end; procedure T2DImageRGBLongData.SetData(_x, _y, _c: integer; _value: longword); begin if (_x >= 0) and (_x < FXSize) and (_y >= 0) and (_y < FYSize) and (_c >= 0) and (_c <= 2) then begin case (_c) of 0: (FData as TRGBLongDataSet).Red[(_y * FXSize) + _x] := _value; 1: (FData as TRGBLongDataSet).Green[(_y * FXSize) + _x] := _value; 2: (FData as TRGBLongDataSet).Blue[(_y * FXSize) + _x] := _value; end; end; end; procedure T2DImageRGBLongData.SetDefaultColor(_value: TPixelRGBLongData); begin FDefaultColor.r := _value.r; FDefaultColor.g := _value.g; FDefaultColor.b := _value.b; end; // Copies procedure T2DImageRGBLongData.Assign(const _Source: TAbstract2DImageData); begin inherited Assign(_Source); FDefaultColor.r := (_Source as T2DImageRGBLongData).FDefaultColor.r; FDefaultColor.g := (_Source as T2DImageRGBLongData).FDefaultColor.g; FDefaultColor.b := (_Source as T2DImageRGBLongData).FDefaultColor.b; end; // Misc procedure T2DImageRGBLongData.ScaleBy(_Value: single); var x,maxx: integer; begin maxx := (FXSize * FYSize) - 1; for x := 0 to maxx do begin (FData as TRGBLongDataSet).Red[x] := Round((FData as TRGBLongDataSet).Red[x] * _Value); (FData as TRGBLongDataSet).Green[x] := Round((FData as TRGBLongDataSet).Green[x] * _Value); (FData as TRGBLongDataSet).Blue[x] := Round((FData as TRGBLongDataSet).Blue[x] * _Value); end; end; procedure T2DImageRGBLongData.Invert; var x,maxx: integer; begin maxx := (FXSize * FYSize) - 1; for x := 0 to maxx do begin (FData as TRGBLongDataSet).Red[x] := 255 - (FData as TRGBLongDataSet).Red[x]; (FData as TRGBLongDataSet).Green[x] := 255 - (FData as TRGBLongDataSet).Green[x]; (FData as TRGBLongDataSet).Blue[x] := 255 - (FData as TRGBLongDataSet).Blue[x]; end; end; end.
{$I-,Q-,R-,S-} {104¦ Catch That Cow. Croacia 2007 ---------------------------------------------------------------------- Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 <= N <= 100,000) on a number line and the cow is at a point K (0 <= K <= 100,000) on the same number line. Farmer John has two modes of transportation: walking and teleporting. * Walking: FJ can move from any point X to the points X-1 or X+1 in a single minute * Teleporting: FJ can move from any point X to the point 2*X in a single minute. If the cow, unaware of its pursuit, does not move at all, how long does it take for Farmer John to retrieve it? PROBLEM NAME: catchcow INPUT FORMAT: * Line 1: Two space-separated integers: N and K SAMPLE INPUT (file catchcow.in): 5 17 INPUT DETAILS: Farmer John starts at point 5 and the fugitive cow is at point 17. OUTPUT FORMAT: * Line 1: The least amount of time, in minutes, it takes for Farmer John to catch the fugitive cow. SAMPLE OUTPUT (file catchcow.out): 4 OUTPUT DETAILS: The fastest way for Farmer John to reach the fugitive cow is to move along the following path: 5-10-9-18-17, which takes 4 minutes. } const max = 100001; var fe,fs : text; n,m,ch,cp : longint; sav : array[boolean,1..max] of longint; tab : array[0..max] of longint; procedure open; begin assign(fe,'catchcow.in'); reset(fe); assign(fs,'catchcow.out'); rewrite(fs); readln(fe,n,m); close(fe); end; procedure closer(x : longint); begin writeln(fs,x); close(fs); halt; end; function updatex(x,cant : longint) : boolean; begin if tab[x] > cant then begin tab[x]:=cant; updatex:=true; end else updatex:=false; end; procedure work; var i,j,k,h1 : longint; s : boolean; begin s:=true; cp:=1; ch:=0; fillchar(tab,sizeof(tab),127); sav[s,1]:=n; tab[n]:=0; while cp > 0 do begin for i:=1 to cp do begin h1:=sav[s,i]; if (h1-1 >= 0) and (updatex(h1-1,tab[h1]+1)) then begin inc(ch); sav[not s,ch]:=h1-1; if h1-1 = m then closer(tab[h1]+1); end; if (h1+1 <= max) and (updatex(h1+1,tab[h1]+1)) then begin inc(ch); sav[not s,ch]:=h1+1; if h1+1 = m then closer(tab[h1]+1); end; if (h1*2 <= max) and (updatex(h1*2,tab[h1]+1)) then begin inc(ch); sav[not s,ch]:=h1*2; if h1*2 = m then closer(tab[h1]+1); end; end; cp:=ch; ch:=0; s:=not s; end; end; begin open; if n=m then closer(0); work; end.
namespace RemotingSample.Implementation; interface uses System, RemotingSample.Interfaces; type { RemoteService } RemoteService = public class(MarshalByRefObject, IRemoteService) private protected method Sum(A, B : Integer) : Integer; public end; implementation method RemoteService.Sum(A, B : integer) : integer; begin Console.WriteLine('Serving a remote request: Sum '+A.ToString+'+'+B.ToString+'...'); result := A+B; end; end.
unit ThTypes; interface uses FMX.Types, System.Types, System.UITypes, System.Generics.Collections; type TSpotCorner = ( scUnknown = 0, scTop = 1, scLeft = 2, scRight = 4, scBottom = 8, scTopLeft = 3 {rsdTop + rsdLeft}, scTopRight = 5 {rsdTop + rsdRight}, scBottomLeft = 10 {rsdBottom + rsdLeft}, scBottomRight = 12 {rsdBottom + rsdRight}{, spCustom}); TTrackingEvent = procedure(Sender: TObject; X, Y: Single) of object; type IThObserver = interface; ///////////////////////////////////////////////////////// /// Commands IThCommand = interface ['{DC09EDE9-D127-4EF5-B463-D34918B93F34}'] procedure Execute; procedure Rollback; end; // IThItemCommand = interface(IThCommand) // end; // // IThSystemCommand = interface(IThCommand) // end; ///////////////////////////////////////////////////////// /// Observer Pattern IThSubject = interface ['{6E501865-1F0D-4804-B6F0-E9C24A883555}'] procedure Subject(ASource: IThObserver; ACommand: IThCommand); procedure RegistObserver(AObserver: IThObserver); procedure UnregistObserver(AObserver: IThObserver); end; IThObserver = interface ['{26D4EC95-764F-467B-9AA1-6E52B8AD3F5E}'] procedure Notifycation(ACommand: IThCommand); procedure SetSubject(ASubject: IThSubject); end; // Basic item IThItem = interface ['{E0963BA6-CA3E-47C6-8BA0-F44A6E7FB85F}'] function GetItemRect: TRectF; procedure ItemResizeBySpot(Sender: TObject; BeforeRect: TRectF); end; // Basic canvas IThCanvas = interface ['{41BC19D7-6DFC-4507-8B60-F3FD2AB57086}'] // procedure DoGrouping(AIItem: IThItem); function IsDrawingItem: Boolean; function IsMultiSelected: Boolean; end; // Optional item data(e.g. Image item`s filepath) IThItemData = interface ['{F1D5D66C-7534-4390-8D7C-BB4D24183014}'] end; // Contain item control IThItems = TList<IThItem>; IThCanvasController = interface ['{DAA1217E-23A2-4622-9704-2026F5D5D678}'] end; ////////////////////////////////////////////////////////////// /// Zoom object /// Target is Canvas and Item IThZoomObject = interface ['{A383554D-8195-4BA8-9098-2C4342FC4A26}'] function GetZoomScale: Single; property ZoomScale: Single read GetZoomScale; end; ////////////////////////////////////////////////////////////// /// Item Highlight /// IItemHighlightObject is IItemHighlighter's parent IItemHighlightObject = interface(IThItem) ['{A62D8499-2F18-47B2-8363-BE8B74CA51BB}'] procedure PaintItem(ARect: TRectF; AFillColor: TAlphaColor); end; IItemHighlighter = interface ['{1187AA98-5C17-441E-90F7-521735E07002}'] function GetHighlightRect: TRectF; procedure DrawHighlight; property HighlightRect: TRectF read GetHighlightRect; end; ////////////////////////////////////////////////////////////// /// Item Selection and ResizeSpot /// IItemSelectionObject is IItemSelection's parent /// IItemSelection is IItemResizeSpots parent IItemSelectionObject = interface(IThItem) ['{4887F0E3-ECC3-4B67-B45E-7E79ECBBC3F8}'] function GetMinimumSize: TSizeF; property MinimumSize: TSizeF read GetMinimumSize; end; IItemResizeSpot = interface ['{9B408774-991E-438D-95B2-1D0BB1A6EBD3}'] end; IItemSelection = interface ['{871374CC-B174-4ED0-A0AD-BAFFA97E21D5}'] function GetSelectionRect: TRectF; property SelectionRect: TRectF read GetSelectionRect; function GetCount: Integer; property Count: Integer read GetCount; function GetSpots(Index: Integer): IItemResizeSpot; property Spots[Index: Integer] : IItemResizeSpot read GetSpots; function GetIsMouseOver: Boolean; property IsMouseOver: Boolean read GetIsMouseOver; procedure DrawSelection; procedure ShowSpots; procedure ShowDisableSpots; procedure HideSpots; procedure RealignSpot; end; TPointFHelper = record helper for TPointF public function Scale(const AFactor: Single): TPointF; end; implementation { TPointFHelper } function TPointFHelper.Scale(const AFactor: Single): TPointF; begin Result.X := X * AFactor; Result.Y := Y * AFactor; end; end.
{***************************************************************************} { } { Delphi Package Manager - DPM } { } { Copyright © 2019 Vincent Parrett and contributors } { } { vincent@finalbuilder.com } { https://www.finalbuilder.com } { } { } {***************************************************************************} { } { Licensed under the Apache License, Version 2.0 (the "License"); } { you may not use this file except in compliance with the License. } { You may obtain a copy of the License at } { } { http://www.apache.org/licenses/LICENSE-2.0 } { } { Unless required by applicable law or agreed to in writing, software } { distributed under the License is distributed on an "AS IS" BASIS, } { WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. } { See the License for the specific language governing permissions and } { limitations under the License. } { } {***************************************************************************} unit DPM.Core.Repository.BaseGithub; interface uses Generics.Defaults, VSoft.Awaitable, Spring.Collections, DPM.Core.Types, DPM.Core.Dependency.Version, DPM.Core.Logging, DPM.Core.Options.Search, DPM.Core.Package.Interfaces, DPM.Core.Configuration.Interfaces, DPM.Core.Repository.Interfaces, DPM.Core.Repository.Base, VSoft.CancellationToken, VSoft.HttpClient; type TGithubBasePackageRepository = class(TBaseRepository) private FHttpClient : IHttpClient; protected // function DownloadPackage(const cancellationToken: ICancellationToken; const packageIdentity: IPackageIdentity; const localFolder: string; var fileName: string): Boolean; // function GetIsLocal: Boolean; // function GetIsRemote: Boolean; // function GetName: string; // function GetPackageInfo(const cancellationToken: ICancellationToken; const packageIdentity: IPackageIdentity): IPackageInfo; // function GetPackageVersions(const cancellationToken: ICancellationToken; const id: string; const compilerVersion: TCompilerVersion; const platform: TDPMPlatform; const versionRange: TVersionRange; const preRelease: Boolean): Spring.Collections.IList<VSoft.SemanticVersion.TSemanticVersion>; // function GetPackageVersionsWithDependencies(const cancellationToken: ICancellationToken; const id: string; const compilerVersion: TCompilerVersion; const platform: TDPMPlatform; const versionRange: TVersionRange; const preRelease: Boolean): Spring.Collections.IList<DPM.Core.Package.Interfaces.IPackageInfo>; // function GetSource: string; procedure Configure(const source : ISourceConfig); override; // function Search(const cancellationToken: ICancellationToken; const id: string; const range: TVersionRange): Spring.Collections.IList<DPM.Core.Package.Interfaces.IPackageIdentity>; property HttpClient : IHttpClient read FHttpClient; public constructor Create(const logger : ILogger); override; end; const //needed for now because repo search on topics is in preview cTopicSearchAccept = 'application/vnd.github.mercy-preview+json'; cGithubv3Accept = 'application/vnd.github.v3+json'; cGithubRawAccept = 'application/vnd.github.v3.raw'; cGithubApiUrl = 'https://api.github.com'; cGithubReleases = 'repos/%s/releases'; //repo cGithubReleaseDownloadUrl = 'repos/%s/zipball/%s'; //repo release implementation { TGithubBasePackageRepository } procedure TGithubBasePackageRepository.Configure(const source : ISourceConfig); begin inherited Configure(source); FHttpClient := THttpClientFactory.CreateClient(Self.SourceUri); FHttpClient.UserName := Self.UserName; FHttpClient.Password := Self.Password; if Self.Password <> '' then FHttpClient.AuthType := THttpAuthType.GitHubToken else FHttpClient.AuthType := THttpAuthType.None; end; constructor TGithubBasePackageRepository.Create(const logger : ILogger); begin inherited Create(logger) end; end.
unit Demo.GeoChart.Marker; interface uses System.Classes, Demo.BaseFrame, cfs.GCharts; type TDemo_GeoChart_Marker = class(TDemoBaseFrame) public procedure GenerateChart; override; end; implementation procedure TDemo_GeoChart_Marker.GenerateChart; var Chart: IcfsGChartProducer; //Defined as TInterfacedObject. No need try..finally begin Chart := TcfsGChartProducer.Create; Chart.ClassChartType := TcfsGChartProducer.CLASS_GEO_CHART; // Data Chart.Data.DefineColumns([ TcfsGChartDataCol.Create(TcfsGChartDataType.gcdtString, 'Country'), TcfsGChartDataCol.Create(TcfsGChartDataType.gcdtNumber, 'Popularity'), TcfsGChartDataCol.Create(TcfsGChartDataType.gcdtNumber, 'Area') ]); Chart.Data.AddRow(['Rome', 2761477, 1285.31]); Chart.Data.AddRow(['Milan', 1324110, 181.76]); Chart.Data.AddRow(['Naples', 959574, 117.27]); Chart.Data.AddRow(['Turin', 907563, 130.17]); Chart.Data.AddRow(['Palermo', 655875, 158.9]); Chart.Data.AddRow(['Genoa', 607906, 243.60]); Chart.Data.AddRow(['Bologna', 380181, 140.7]); Chart.Data.AddRow(['Florence', 371282, 102.41]); Chart.Data.AddRow(['Fiumicino', 67370, 213.44]); Chart.Data.AddRow(['Anzio', 52192, 43.43]); Chart.Data.AddRow(['Ciampino', 38262, 11]); // Options Chart.Options.Region('IT'); Chart.Options.DisplayMode('markers'); Chart.Options.ColorAxis('colors', '[''green'', ''blue'']'); Chart.LibraryMapsApiKey := '?'; // <------------------------------ Your Google MapsApiKey (https://developers.google.com/maps/documentation/javascript/get-api-key) // Generate GChartsFrame.DocumentInit; GChartsFrame.DocumentSetBody( '<div style="width:100%;font-family: Arial; font-size:14px; text-align: center;"><br>NOTE: Because this Geo Chart requires geocoding, you''ll need a mapsApiKey to see Data. (Look at source code for details)<br></div>' + '<div id="Chart1" style="width:100%;height:90%"></div>' ); GChartsFrame.DocumentGenerate('Chart1', Chart); GChartsFrame.DocumentPost; end; initialization RegisterClass(TDemo_GeoChart_Marker); end.
unit DXPUtils; interface uses Forms, Windows, Controls, StdCtrls, Graphics, DXPCommonTypes, DXPConsts, Types, Classes, PngImage; type TOption = ( opRequired, opPrimaryKey, opCompleteZeros ); procedure ShowMsgInformation(const aMsg: string); function TryFocus(aWinControl: TWinControl): boolean; function MethodsEqual(const aMethod1, aMethod2: TMethod): boolean; procedure DrawLine(const aCanvas: TCanvas; const x1, y1, x2, y2: integer); procedure ConvertToGray2(aGraphic: TGraphic); procedure ColorizeBitmap(aBitmap: TBitmap; const aColor: TColor); // // { begin animal } procedure AdjustBoundRect(const BorderWidth: Byte; const ShowBoundLines: Boolean; const BoundLines: TDXPBoundLines; var Rect: TRect); // procedure DrawBoundLines(const aCanvas: TCanvas; const aBoundLines: TDXPBoundLines; const aColor: TColor; const Rect: TRect); // procedure RenderText(const aParent: TControl; const aCanvas: TCanvas; aText: string; const aFont: TFont; const aEnabled, aShowAccelChar: boolean; var Rect: TRect; Flags: integer); // procedure Frame3d(const aCanvas: TCanvas; const Rect: TRect; const TopColor, BottomColor: TColor; const Swapped: boolean = false); // procedure SetDrawFlags(const aAlignment: TAlignment; const aWordWrap: boolean; var Flags: Integer); // procedure PlaceText(const aParent: TControl; const aCanvas: TCanvas; const aText: string; const aFont: TFont; const aEnabled, aShowAccelChar: boolean; const aAlignment: TAlignment; const aWordWrap: boolean; var Rect: TRect); //{ end animal } // implementation procedure ShowMsgInformation(const aMsg: string); begin Application.MessageBox( PWideChar( aMsg ), PWideChar( Application.Title ), MB_OK + MB_ICONINFORMATION ); end; function TryFocus(aWinControl: TWinControl): boolean; begin Result := false; // try if ( aWinControl is TCustomEdit ) and ( TCustomEdit( aWinControl ) ).ReadOnly then Exit; // aWinControl.SetFocus; Result := true; except { Aqui um mudinho, mas está sobe controle!! :-) ( Araújo ) } end; end; function MethodsEqual(const aMethod1, aMethod2: TMethod): boolean; begin Result := ( aMethod1.Code = aMethod2.Code ) and ( aMethod1.Data = aMethod2.Data ); end; procedure DrawLine(const aCanvas: TCanvas; const x1, y1, x2, y2: integer); begin aCanvas.MoveTo( x1, y1 ); aCanvas.LineTo( x2, y2 ); end; procedure AdjustBoundRect(const BorderWidth: Byte; const ShowBoundLines: Boolean; const BoundLines: TDXPBoundLines; var Rect: TRect); begin InflateRect( Rect, -BorderWidth, -BorderWidth ); // if not( ShowBoundLines ) then Exit; // if blLeft in BoundLines then Inc( Rect.Left ); // if blRight in BoundLines then Dec( Rect.Right ); // if blTop in BoundLines then Inc( Rect.Top ); // if blBottom in BoundLines then Dec( Rect.Bottom ); end; procedure DrawBoundLines(const aCanvas: TCanvas; const aBoundLines: TDXPBoundLines; const aColor: TColor; const Rect: TRect); begin aCanvas.Pen.Color := AColor; aCanvas.Pen.Style := psSolid; // if blLeft in aBoundLines then DrawLine( aCanvas, Rect.Left, Rect.Top, Rect.Left, Rect.Bottom - 1 ); // if blTop in aBoundLines then DrawLine( aCanvas, Rect.Left, Rect.Top, Rect.Right, Rect.Top ); // if blRight in aBoundLines then DrawLine( aCanvas, Rect.Right - 1, Rect.Top, Rect.Right - 1, Rect.Bottom - 1 ); // if blBottom in aBoundLines then DrawLine( aCanvas, Rect.Top, Rect.Bottom - 1, Rect.Right, Rect.Bottom - 1 ); end; procedure ConvertToGray2(aGraphic: TGraphic); var x, y, c: integer; PxlColor: TColor; Can: TCanvas; begin if ( aGraphic is TBitmap ) then Can := TBitmap( aGraphic ).Canvas else if ( aGraphic is TPngImage ) then Can := TPngImage( aGraphic ).Canvas else Exit; // for x := 0 to aGraphic.Width - 1 do for y := 0 to aGraphic.Height - 1 do begin PxlColor := ColorToRGB( Can.Pixels[x, y] ); c := ( PxlColor shr 16 + ( ( PxlColor shr 8 ) and $00FF ) + PxlColor and $0000FF ) div 3 + 100; // if c > 255 then c := 255; // Can.Pixels[x, y] := RGB( c, c, c ); end; end; procedure RenderText(const aParent: TControl; const aCanvas: TCanvas; aText: string; const aFont: TFont; const aEnabled, aShowAccelChar: boolean; var Rect: TRect; Flags: integer); // procedure DoDrawText; begin DrawText( aCanvas.Handle, PChar( aText ), -1, Rect, Flags ); end; // begin if ( Flags and DT_CALCRECT <> 0 ) and ( ( aText = '' ) or aShowAccelChar and ( aText[1] = '&' ) and ( aText[2] = #0 ) ) then aText := aText + ' '; // if not( aShowAccelChar ) then Flags := Flags or DT_NOPREFIX; // Flags := aParent.DrawTextBiDiModeFlags( Flags ); // aCanvas.Font.Assign( aFont ); // if not( aEnabled ) then aCanvas.Font.Color := DXPColor_Msc_Dis_Caption_WXP; // if not( AEnabled ) then begin OffsetRect( Rect, 1, 1 ); aCanvas.Font.Color := clBtnHighlight; DoDrawText; OffsetRect( Rect, -1, -1 ); aCanvas.Font.Color := clBtnShadow; DoDrawText; end else DoDrawText; end; procedure Frame3d(const aCanvas: TCanvas; const Rect: TRect; const TopColor, BottomColor: TColor; const Swapped: boolean = false); var aTopColor, aBottomColor: TColor; begin aTopColor := TopColor; aBottomColor := BottomColor; // if Swapped then begin aTopColor := BottomColor; aBottomColor := TopColor; end; // aCanvas.Pen.Color := ATopColor; aCanvas.Polyline( [ Point( Rect.Left, Rect.Bottom - 1 ), Point( Rect.Left, Rect.Top ), Point( Rect.Right - 1, Rect.Top )] ); aCanvas.Pen.Color := ABottomColor; aCanvas.Polyline( [ Point( Rect.Right - 1, Rect.Top + 1 ), Point( Rect.Right - 1 , Rect.Bottom - 1 ), Point( Rect.Left, Rect.Bottom - 1 )] ); end; procedure ColorizeBitmap(aBitmap: TBitmap; const aColor: TColor); var ColorMap: TBitmap; Rect: TRect; begin Rect := Bounds( 0, 0, aBitmap.Width, aBitmap.Height ); ColorMap := TBitmap.Create; // try ColorMap.Assign( aBitmap ); aBitmap.Dormant; aBitmap.FreeImage; // ColorMap.Canvas.Brush.Color := AColor; ColorMap.Canvas.BrushCopy( Rect, aBitmap, Rect, clBlack ); aBitmap.Assign( ColorMap ); ColorMap.ReleaseHandle; finally ColorMap.Free; end; end; procedure SetDrawFlags(const aAlignment: TAlignment; const aWordWrap: boolean; var Flags: Integer); begin Flags := DT_END_ELLIPSIS; // case aAlignment of taLeftJustify: Flags := Flags or DT_LEFT; taCenter: Flags := Flags or DT_CENTER; taRightJustify: Flags := Flags or DT_RIGHT; end; // if not( aWordWrap ) then Flags := Flags or DT_SINGLELINE else Flags := Flags or DT_WORDBREAK; end; procedure PlaceText(const aParent: TControl; const aCanvas: TCanvas; const aText: string; const aFont: TFont; const aEnabled, aShowAccelChar: boolean; const aAlignment: TAlignment; const aWordWrap: boolean; var Rect: TRect); var Flags, dx, OH, OW: Integer; begin OH := Rect.Bottom - Rect.Top; OW := Rect.Right - Rect.Left; SetDrawFlags( aAlignment, aWordWrap, Flags ); // RenderText( aParent, aCanvas, aText, aFont, aEnabled, aShowAccelChar, Rect, Flags or DT_CALCRECT ); // if aAlignment = taRightJustify then dx := OW - ( Rect.Right + Rect.Left ) else if AAlignment = taCenter then dx := ( OW - Rect.Right ) div 2 else dx := 0; // OffsetRect( Rect, dx, ( OH - Rect.Bottom ) div 2 ); RenderText( aParent, aCanvas, aText, aFont, aEnabled, aShowAccelChar, Rect, Flags ); end; end.
unit pd32hdrG; // -------------------------------------------------------- // converted from D:\Work\Delphi\headerconvertor\pd32hdr.h // 4/13/00 1:29:44 PM // -------------------------------------------------------- //=========================================================================== // // NAME: pd32hdr.h // // DESCRIPTION: // // PowerDAQ Win32 DLL header file // // Definitions for PowerDAQ DLL driver interface functions. // // AUTHOR: Alex Ivchenko // // DATE: 22-DEC-99 // // REV: 0.11 // // R DATE: 12-MAR-2000 // // HISTORY: // // Rev 0.1, 26-DEC-99, A.I., Initial version. // Rev 0.11, 12-MAR-2000,A.I., DSP reghister r/w added // // //--------------------------------------------------------------------------- // // Copyright (C) 1999,2000 United Electronic Industries, Inc. // All rights reserved. // United Electronic Industries Confidential Information. // //=========================================================================== interface {$IFDEF FPC} {$mode delphi} {$DEFINE AcqElphy2} {$A1} {$Z1} {$ENDIF} {$IFNDEF _INC_PWRDAQ32HDR} {$DEFINE _INC_PWRDAQ32HDR} {$ENDIF} uses windows,pwrdaqG; // move this constant below uses clause const DLLName = 'pwrdaq32.dll'; // Adapter information structure --------------------------------------- type DWORD = Cardinal; EVENT_PROC = procedure(pAllEvents : PPD_ALL_EVENTS); stdcall; PD_EVENT_PROC = ^EVENT_PROC; PPD_ADAPTER_INFO = ^PD_ADAPTER_INFO; PD_ADAPTER_INFO = record dwAdapterId : DWORD; hAdapter : THANDLE; bTerminate : BOOL; hTerminateEvent : THANDLE; hEventThread : THANDLE; dwProcessId : DWORD; pfn_EventProc : PD_EVENT_PROC; csAdapter : THANDLE; end; var _PD_ADAPTER_INFO : PD_ADAPTER_INFO; // // Private functions // _PdFreeBufferList:procedure; stdcall; _PdDevCmd: function(hDevice : THANDLE;pError : PDWORD;dwIoControlCode : DWORD; lpInBuffer : POINTER;nInBufferSize : DWORD;lpOutBuffer : POINTER; nOutBufferSize : DWORD;bOverlapped : BOOL) : BOOL; stdcall; _PdDevCmdEx: function(hDevice : THANDLE;pError : PDWORD;dwIoControlCode : DWORD; lpInBuffer : POINTER;nInBufferSize : DWORD; lpOutBuffer : POINTER;nOutBufferSize : DWORD; pdwRetBytes : PDWORD;bOverlapped : BOOL) : DWORD; stdcall; //?CHECK THIS: _PdAInEnableClCount: function(hAdapter : THANDLE;pError : PDWORD;bEnable : BOOL) : BOOL; stdcall; _PdAInEnableTimer: function(hAdapter : THANDLE;pError : PDWORD;bEnable : BOOL;dwMilliSeconds : DWORD) : BOOL; stdcall; PdEventThreadProc: function(lpParameter : POINTER) : DWORD; stdcall; _PdDIO256CmdWrite: function(hAdapter : THANDLE;pError : PDWORD;dwCmd : DWORD;dwValue : DWORD) : BOOL; stdcall; _PdDIO256CmdRead: function(hAdapter : THANDLE;pError : PDWORD;dwCmd : DWORD;pdwValue : PDWORD) : BOOL; stdcall; _PdDspRegWrite: function(hAdapter : THANDLE;pError : PDWORD;dwReg : DWORD;dwValue : DWORD) : BOOL; stdcall; _PdDspRegRead: function(hAdapter : THANDLE;pError : PDWORD;dwReg : DWORD;pdwValue : PDWORD) : BOOL; stdcall; //---------------------------------- PdRegisterForEvents: function(dwAdapter : DWORD;pError : PDWORD;pEventProc : PD_EVENT_PROC) : BOOL; stdcall; PdUnregisterForEvents: function(dwAdapter : DWORD;pError : PDWORD) : BOOL; stdcall; _PdAdapterTestInterrupt: function(hAdapter : THANDLE;pError : PDWORD) : BOOL; stdcall; _PdAdapterBoardReset: function(hAdapter : THANDLE;pError : PDWORD) : BOOL; stdcall; _PdAdapterEepromWriteOnDate: function(hAdapter : THANDLE;pError : PDWORD;wValue : WORD) : BOOL; stdcall; //AIN _PdAInFlushFifo: function(hAdapter : THANDLE;pError : PDWORD;pdwSamples : PDWORD) : BOOL; stdcall; _PdAInSetXferSize: function(hAdapter : THANDLE;pError : PDWORD;dwSize : DWORD) : BOOL; stdcall; // Events _PdAdapterGetBoardStatus: function(hAdapter : THANDLE;pError : PDWORD;pdwStatusBuf : PDWORD) : BOOL; stdcall; _PdAdapterSetBoardEvents1: function(hAdapter : THANDLE;pError : PDWORD;dwEvents : DWORD) : BOOL; stdcall; _PdAdapterSetBoardEvents2: function(hAdapter : THANDLE;pError : PDWORD;dwEvents : DWORD) : BOOL; stdcall; _PdAInSetEvents: function(hAdapter : THANDLE;pError : PDWORD;dwEvents : DWORD) : BOOL; stdcall; // SSH _PdAInSetSSHGain: function(hAdapter : THANDLE;pError : PDWORD;dwCfg : DWORD) : BOOL; stdcall; _PdAOutSetEvents: function(hAdapter : THANDLE;pError : PDWORD;dwEvents : DWORD) : BOOL; stdcall; // Diag _PdDiagPCIEcho: function(hAdapter : THANDLE;pError : PDWORD;dwValue : DWORD;pdwReply : PDWORD) : BOOL; stdcall; _PdDiagPCIInt: function(hAdapter : THANDLE;pError : PDWORD) : BOOL; stdcall; implementation begin end.
unit UDParamFields; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, UCrpe32; type TCrpeParamFieldsDlg = class(TForm) pnlParamFields: TPanel; lblName: TLabel; lbNames: TListBox; btnOk: TButton; btnClear: TButton; btnRanges: TButton; lblPrompt: TLabel; lblPromptValue: TLabel; lblCurrentValue: TLabel; editPrompt: TEdit; cbShowDialog: TCheckBox; editPromptValue: TEdit; editCurrentValue: TEdit; lblValueMin: TLabel; lblValueMax: TLabel; cbValueLimit: TCheckBox; editValueMin: TEdit; editValueMax: TEdit; lblEditMask: TLabel; editEditMask: TEdit; gbInfo: TGroupBox; lblValueType: TLabel; lblGroupNum: TLabel; cbAllowNull: TCheckBox; cbAllowEditing: TCheckBox; cbAllowMultipleValues: TCheckBox; cbPartOfGroup: TCheckBox; cbMutuallyExclusiveGroup: TCheckBox; cbValueType: TComboBox; editGroupNum: TEdit; btnPromptValues: TButton; btnPromptValue: TButton; btnCurrentValue: TButton; btnCurrentValues: TButton; cbAllowDialog: TCheckBox; gbFormat: TGroupBox; lblFieldName: TLabel; lblFieldType: TLabel; lblFieldLength: TLabel; lblTop: TLabel; lblLeft: TLabel; lblSection: TLabel; lblWidth: TLabel; lblHeight: TLabel; editFieldName: TEdit; editFieldType: TEdit; editFieldLength: TEdit; btnBorder: TButton; btnFont: TButton; btnFormat: TButton; editTop: TEdit; editLeft: TEdit; editWidth: TEdit; editHeight: TEdit; cbSection: TComboBox; FontDialog1: TFontDialog; cbNeedsCurrentValue: TCheckBox; editReportName: TEdit; lblReportName: TLabel; editParamSource: TEdit; lblParamSource: TLabel; editParamType: TEdit; lblParamType: TLabel; lblCount: TLabel; editCount: TEdit; rgUnits: TRadioGroup; btnHiliteConditions: TButton; editBrowseField: TEdit; lblBrowseField: TLabel; cbObjectPropertiesActive: TCheckBox; cbIsLinked: TCheckBox; procedure UpdateParamFields; procedure lbNamesClick(Sender: TObject); procedure editPromptChange(Sender: TObject); procedure editEditMaskChange(Sender: TObject); procedure cbShowDialogClick(Sender: TObject); procedure cbValueLimitClick(Sender: TObject); procedure editValueMinExit(Sender: TObject); procedure editValueMaxExit(Sender: TObject); procedure btnRangesClick(Sender: TObject); procedure btnClearClick(Sender: TObject); procedure editGroupNumExit(Sender: TObject); procedure cbAllowNullClick(Sender: TObject); procedure cbAllowEditingClick(Sender: TObject); procedure cbAllowMultipleValuesClick(Sender: TObject); procedure cbPartOfGroupClick(Sender: TObject); procedure cbMutuallyExclusiveGroupClick(Sender: TObject); procedure cbValueTypeChange(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure btnOkClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure btnPromptValueClick(Sender: TObject); procedure btnCurrentValueClick(Sender: TObject); procedure btnCurrentValuesClick(Sender: TObject); procedure btnPromptValuesClick(Sender: TObject); procedure cbAllowDialogClick(Sender: TObject); procedure editSizeEnter(Sender: TObject); procedure editSizeExit(Sender: TObject); procedure btnBorderClick(Sender: TObject); procedure btnFontClick(Sender: TObject); procedure cbSectionChange(Sender: TObject); procedure EnableControl(Control: TComponent; Enable: boolean); procedure rgUnitsClick(Sender: TObject); procedure btnFormatClick(Sender: TObject); procedure btnHiliteConditionsClick(Sender: TObject); procedure InitializeControls(OnOff: boolean); procedure InitializeFormatControls(OnOff: boolean); procedure editPromptValueExit(Sender: TObject); procedure editCurrentValueExit(Sender: TObject); procedure editBrowseFieldExit(Sender: TObject); procedure cbObjectPropertiesActiveClick(Sender: TObject); private { Private declarations } public { Public declarations } Cr : TCrpe; PIndex : smallint; PrevSize : string; end; var CrpeParamFieldsDlg: TCrpeParamFieldsDlg; bParamFields : boolean; implementation {$R *.DFM} uses TypInfo, UCrpeUtl, UDPFRanges, UDPFAsDate, UDFormulaEdit, UDPFPValues, UDPFCValues, UDBorder, UDFormat, UDHiliteConditions, UDFont, UCrpeClasses; {------------------------------------------------------------------------------} { FormCreate procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.FormCreate(Sender: TObject); begin bParamFields := True; LoadFormPos(Self); btnOk.Tag := 1; PIndex := -1; cbObjectPropertiesActive.Tag := 1; end; {------------------------------------------------------------------------------} { FormShow procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.FormShow(Sender: TObject); begin UpdateParamFields; end; {------------------------------------------------------------------------------} { UpdateParamFields procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.UpdateParamFields; var OnOff : boolean; begin PIndex := -1; {Enable/Disable controls} if IsStrEmpty(Cr.ReportName) then OnOff := False else begin OnOff := (Cr.ParamFields.Count > 0); {Get ParamFields Index} if OnOff then begin if Cr.ParamFields.ItemIndex > -1 then PIndex := Cr.ParamFields.ItemIndex else PIndex := 0; end; end; cbObjectPropertiesActive.Checked := Cr.ParamFields.ObjectPropertiesActive; InitializeControls(OnOff); {Disable items if less than SCR 7+} if Cr.Version.Crpe.Major < 7 then begin btnRanges.Enabled := False; cbValueLimit.Enabled := False; editValueMin.Color := ColorState(False); editValueMax.Color := ColorState(False); editValueMin.Enabled := False; editValueMax.Enabled := False; editEditMask.Enabled := False; editBrowseField.Enabled := False; editBrowseField.Color := ColorState(False); {Info} cbAllowNull.Enabled := False; cbAllowEditing.Enabled := False; cbAllowMultipleValues.Enabled := False; cbValueType.Enabled := False; cbPartOfGroup.Enabled := False; cbMutuallyExclusiveGroup.Enabled := False; editGroupNum.Enabled := False; end; {Update list box} if OnOff then begin {Fill Section ComboBox} cbSection.Clear; cbSection.Items.AddStrings(Cr.SectionFormat.Names); {Fill Names ListBox} lbNames.Clear; lbNames.Items.AddStrings(Cr.ParamFields.Names); editCount.Text := IntToStr(Cr.ParamFields.Count); lbNames.ItemIndex := PIndex; lbNamesClick(Self); end; end; {------------------------------------------------------------------------------} { InitializeControls } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.InitializeControls(OnOff: boolean); var i : integer; begin {Enable/Disable the Form Controls} for i := 0 to ComponentCount - 1 do begin if TComponent(Components[i]).Tag = 0 then begin if Components[i] is TButton then TButton(Components[i]).Enabled := OnOff; if Components[i] is TCheckBox then TCheckBox(Components[i]).Enabled := OnOff; if Components[i] is TRadioGroup then TRadioGroup(Components[i]).Enabled := OnOff; if Components[i] is TListBox then begin TListBox(Components[i]).Clear; TListBox(Components[i]).Color := ColorState(OnOff); TListBox(Components[i]).Enabled := OnOff; end; if Components[i] is TComboBox then begin TComboBox(Components[i]).Color := ColorState(OnOff); TComboBox(Components[i]).Enabled := OnOff; end; if Components[i] is TEdit then begin if not OnOff then TEdit(Components[i]).Text := ''; if TEdit(Components[i]).ReadOnly = False then TEdit(Components[i]).Color := ColorState(OnOff); TEdit(Components[i]).Enabled := OnOff; end; end; end; end; {------------------------------------------------------------------------------} { InitializeFormatControls } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.InitializeFormatControls(OnOff: boolean); var i : integer; begin {Enable/Disable the Form Controls} for i := 0 to ComponentCount - 1 do begin {Check Tag} if TComponent(Components[i]).Tag <> 0 then Continue; {Make sure these components are owned by the Format groupbox} if Components[i] is TButton then begin if TButton(Components[i]).Parent <> gbFormat then Continue; TButton(Components[i]).Enabled := OnOff; end; if Components[i] is TRadioGroup then begin if TRadioGroup(Components[i]).Parent <> gbFormat then Continue; TRadioGroup(Components[i]).Enabled := OnOff; end; if Components[i] is TComboBox then begin if TComboBox(Components[i]).Parent <> gbFormat then Continue; TComboBox(Components[i]).Color := ColorState(OnOff); TComboBox(Components[i]).Enabled := OnOff; end; if Components[i] is TEdit then begin if TEdit(Components[i]).Parent <> gbFormat then Continue; TEdit(Components[i]).Text := ''; if TEdit(Components[i]).ReadOnly = False then TEdit(Components[i]).Color := ColorState(OnOff); TEdit(Components[i]).Enabled := OnOff; end; end; end; {------------------------------------------------------------------------------} { lbNamesClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.lbNamesClick(Sender: TObject); var OnOff : Boolean; begin PIndex := lbNames.ItemIndex; cbAllowDialog.Checked := (Cr.ParamFields.AllowDialog = True); {Set Events to nil} cbShowDialog.OnClick := nil; editPrompt.OnChange := nil; editPromptValue.OnChange := nil; editCurrentValue.OnChange := nil; editEditMask.OnChange := nil; cbValueLimit.OnClick := nil; {Update Controls from VCL values} Cr.ParamFields[PIndex]; editPrompt.Text := Cr.ParamFields.Item.Prompt; cbShowDialog.Checked := Cr.ParamFields.Item.ShowDialog; {Values} editPromptValue.Text := Cr.ParamFields.Item.PromptValue; editCurrentValue.Text := Cr.ParamFields.Item.CurrentValue; EnableControl(editCurrentValue, (Cr.ParamFields.Item.Info.ValueType = vtDiscrete)); btnPromptValue.Enabled := (Cr.ParamFields.Item.ParamType <> pfString); btnCurrentValue.Enabled := (Cr.ParamFields.Item.ParamType <> pfString); btnPromptValues.Enabled := (Cr.ParamFields.Item.ParamType <> pfBoolean); btnCurrentValues.Enabled := (Cr.ParamFields.Item.Info.ValueType <> vtRange) and (Cr.ParamFields.Item.ParamType <> pfBoolean); btnRanges.Enabled := (Cr.ParamFields.Item.Info.ValueType = vtRange) and (Cr.ParamFields.Item.ParamType <> pfBoolean); {Value Limits} editEditMask.Text := Cr.ParamFields.Item.EditMask; {Disable ValueLimits if boolean type} OnOff := (Cr.ParamFields.Item.ParamType <> pfBoolean); EnableControl(cbValueLimit, OnOff); EnableControl(editValueMin, OnOff); EnableControl(editValueMax, OnOff); editValueMin.Text := Cr.ParamFields.Item.ValueMin; editValueMax.Text := Cr.ParamFields.Item.ValueMax; cbValueLimit.Checked := Cr.ParamFields.Item.ValueLimit; {Disable ValueMin/Max if ValueLimit off} OnOff := Cr.ParamFields.Item.ValueLimit; EnableControl(editValueMin, OnOff); EnableControl(editValueMax, OnOff); {BrowseField} editBrowseField.Text := Cr.ParamFields.Item.BrowseField; {Parameter information - ReadOnly fields} editParamType.Text := GetEnumName(TypeInfo(TCrParamFieldType), Ord(Cr.ParamFields.Item.ParamType)); editParamSource.Text := GetEnumName(TypeInfo(TCrParamFieldSource), Ord(Cr.ParamFields.Item.ParamSource)); editReportName.Text := Cr.ParamFields.Item.ReportName; cbNeedsCurrentValue.Checked := Cr.ParamFields.Item.NeedsCurrentValue; cbIsLinked.Checked := Cr.ParamFields.Item.IsLinked; {Re-Activate Events} cbShowDialog.OnClick := cbShowDialogClick; editPrompt.OnChange := editPromptChange; editEditMask.OnChange := editEditMaskChange; editValueMin.OnExit := editValueMinExit; editValueMax.OnExit := editValueMaxExit; cbValueLimit.OnClick := cbValueLimitClick; {ParamFields.Item.Info} {Set Events to nil} cbAllowNull.OnClick := nil; cbAllowEditing.OnClick := nil; cbAllowMultipleValues.OnClick := nil; cbValueType.OnChange := nil; cbPartOfGroup.OnClick := nil; cbMutuallyExclusiveGroup.OnClick := nil; editGroupNum.OnExit := nil; case Ord(Cr.ParamFields.Item.Info.AllowNull) of 0 : cbAllowNull.State := cbUnchecked; 1 : cbAllowNull.State := cbChecked; 2 : cbAllowNull.State := cbGrayed; end; cbAllowNull.Enabled := (Cr.ParamFields.Item.ParamType <> pfBoolean); case Ord(Cr.ParamFields.Item.Info.AllowEditing) of 0 : cbAllowEditing.State := cbUnchecked; 1 : cbAllowEditing.State := cbChecked; 2 : cbAllowEditing.State := cbGrayed; end; cbAllowEditing.Enabled := (Cr.ParamFields.Item.ParamType <> pfBoolean); case Ord(Cr.ParamFields.Item.Info.AllowMultipleValues) of 0 : cbAllowMultipleValues.State := cbUnchecked; 1 : cbAllowMultipleValues.State := cbChecked; 2 : cbAllowMultipleValues.State := cbGrayed; end; cbAllowMultipleValues.Enabled := (Cr.ParamFields.Item.ParamType <> pfBoolean); case Cr.ParamFields.Item.Info.ValueType of vtRange : cbValueType.ItemIndex := 0; vtDiscrete : cbValueType.ItemIndex := 1; vtDiscreteAndRange : cbValueType.ItemIndex := 2; end; {Parameter Group properties} case Ord(Cr.ParamFields.Item.Info.PartOfGroup) of 0 : cbPartOfGroup.State := cbUnchecked; 1 : cbPartOfGroup.State := cbChecked; 2 : cbPartOfGroup.State := cbGrayed; end; case Ord(Cr.ParamFields.Item.Info.MutuallyExclusiveGroup) of 0 : cbMutuallyExclusiveGroup.State := cbUnchecked; 1 : cbMutuallyExclusiveGroup.State := cbChecked; 2 : cbMutuallyExclusiveGroup.State := cbGrayed; end; editGroupNum.Text := IntToStr(Cr.ParamFields.Item.Info.GroupNum); {Enable/Disable Group items} cbMutuallyExclusiveGroup.Enabled := (cbPartOfGroup.State = cbChecked); editGroupNum.Color := ColorState(cbPartOfGroup.State = cbChecked); editGroupNum.Enabled := (cbPartOfGroup.State = cbChecked); {Re-Activate Info Events} cbAllowNull.OnClick := cbAllowNullClick; cbAllowEditing.OnClick := cbAllowEditingClick; cbAllowMultipleValues.OnClick := cbAllowMultipleValuesClick; cbValueType.OnChange := cbValueTypeChange; cbPartOfGroup.OnClick := cbPartOfGroupClick; cbMutuallyExclusiveGroup.OnClick := cbMutuallyExclusiveGroupClick; editGroupNum.OnExit := editGroupNumExit; {Activate Format options} OnOff := Cr.ParamFields.Item.Handle > 0; InitializeFormatControls(OnOff); if OnOff then begin {Field Info} editFieldName.Text := Cr.ParamFields.Item.FieldName; editFieldType.Text := GetEnumName(TypeInfo(TCrFieldValueType), Ord(Cr.ParamFields.Item.FieldType)); editFieldLength.Text := IntToStr(Cr.ParamFields.Item.FieldLength); {Size and Position} cbSection.ItemIndex := Cr.SectionFormat.IndexOf(Cr.ParamFields.Item.Section); rgUnitsClick(Self); end; {Set HiliteConditions button} btnHiliteConditions.Enabled := (Cr.ParamFields.Item.FieldType in [fvInt8s..fvCurrency]) and OnOff; end; {------------------------------------------------------------------------------} { EnableControl } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.EnableControl(Control: TComponent; Enable: boolean); begin if Control is TButton then TButton(Control).Enabled := Enable; if Control is TRadioButton then TRadioButton(Control).Enabled := Enable; if Control is TCheckBox then TCheckBox(Control).Enabled := Enable; if Control is TRadioGroup then TRadioGroup(Control).Enabled := Enable; if Control is TComboBox then begin TComboBox(Control).Color := ColorState(Enable); TComboBox(Control).Enabled := Enable; end; if Control is TMemo then begin TMemo(Control).Color := ColorState(Enable); TMemo(Control).Enabled := Enable; end; if Control is TListBox then begin TListBox(Control).Color := ColorState(Enable); TListBox(Control).Enabled := Enable; end; if Control is TEdit then begin if TEdit(Control).ReadOnly = False then TEdit(Control).Color := ColorState(Enable); TEdit(Control).Enabled := Enable; end; end; {------------------------------------------------------------------------------} { cbPShowDialogClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbShowDialogClick(Sender: TObject); begin Cr.ParamFields.Item.ShowDialog := cbShowDialog.Checked; UpdateParamFields; end; {------------------------------------------------------------------------------} { editPromptValueExit procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editPromptValueExit(Sender: TObject); begin Cr.ParamFields.Item.PromptValue := editPromptValue.Text; UpdateParamFields; end; {------------------------------------------------------------------------------} { editCurrentValueExit procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editCurrentValueExit(Sender: TObject); begin Cr.ParamFields.Item.CurrentValue := editCurrentValue.Text; UpdateParamFields; end; {------------------------------------------------------------------------------} { editPromptChange procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editPromptChange(Sender: TObject); begin Cr.ParamFields.Item.Prompt := editPrompt.Text; end; {------------------------------------------------------------------------------} { btnPromptValueClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnPromptValueClick(Sender: TObject); begin if Cr.ParamFields.Item.ParamType <> pfString then begin CrpePFAsDateDlg := TCrpePFAsDateDlg.Create(Application); CrpePFAsDateDlg.ValueType := Cr.ParamFields.Item.ParamType; CrpePFAsDateDlg.Value := Cr.ParamFields.Item.PromptValue; if CrpePFAsDateDlg.ShowModal = mrOk then begin Cr.ParamFields.Item.PromptValue := CrpePFAsDateDlg.Value; lbNamesClick(lbNames); end; end; end; {------------------------------------------------------------------------------} { btnCurrentValueClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnCurrentValueClick(Sender: TObject); begin if Cr.ParamFields.Item.ParamType <> pfString then begin CrpePFAsDateDlg := TCrpePFAsDateDlg.Create(Application); CrpePFAsDateDlg.ValueType := Cr.ParamFields.Item.ParamType; CrpePFAsDateDlg.Value := Cr.ParamFields.Item.CurrentValue; if CrpePFAsDateDlg.ShowModal = mrOk then begin Cr.ParamFields.Item.CurrentValue := CrpePFAsDateDlg.Value; lbNamesClick(lbNames); end; end; end; {------------------------------------------------------------------------------} { btnCurrentValuesClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnCurrentValuesClick(Sender: TObject); begin CrpePFCurrentValuesDlg := TCrpePFCurrentValuesDlg.Create(Application); CrpePFCurrentValuesDlg.Crv := Cr.ParamFields.Item.CurrentValues; CrpePFCurrentValuesDlg.ShowModal; UpdateParamFields; end; {------------------------------------------------------------------------------} { btnPromptValuesClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnPromptValuesClick(Sender: TObject); begin CrpePFPromptValuesDlg := TCrpePFPromptValuesDlg.Create(Application); CrpePFPromptValuesDlg.Crv := Cr.ParamFields.Item.PromptValues;; CrpePFPromptValuesDlg.ShowModal; UpdateParamFields; end; {------------------------------------------------------------------------------} { btnRangesClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnRangesClick(Sender: TObject); begin CrpeParamFieldRangesDlg := TCrpeParamFieldRangesDlg.Create(Application); CrpeParamFieldRangesDlg.Crr := Cr.ParamFields.Item.Ranges; CrpeParamFieldRangesDlg.ShowModal; UpdateParamFields; end; {------------------------------------------------------------------------------} { editEditMaskChange procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editEditMaskChange(Sender: TObject); begin Cr.ParamFields.Item.EditMask := editEditMask.Text; end; {------------------------------------------------------------------------------} { cbValueLimitClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbValueLimitClick(Sender: TObject); begin {ValueMin} EnableControl(editValueMin, cbValueLimit.Checked); {ValueMax} EnableControl(editValueMax, cbValueLimit.Checked); if IsStrEmpty(editValueMax.Text) then begin case Cr.ParamFields.Item.ParamType of pfNumber, pfCurrency : editValueMax.Text := '0'; pfDate : editValueMax.Text := CrDateToStr(Now); pfDateTime : editValueMax.Text := CrDateTimeToStr(Now, False); pfTime : editValueMax.Text := CrTimeToStr(Now); end; end; if IsStrEmpty(editValueMin.Text) then begin case Cr.ParamFields.Item.ParamType of pfNumber, pfCurrency : editValueMin.Text := '0'; pfDate : editValueMin.Text := CrDateToStr(Now); pfDateTime : editValueMin.Text := CrDateTimeToStr(Now, False); pfTime : editValueMin.Text := CrTimeToStr(Now); end; end; Cr.ParamFields.Item.ValueLimit := cbValueLimit.Checked; if cbValueLimit.Checked then editValueMin.SetFocus; end; {------------------------------------------------------------------------------} { editValueMinExit procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editValueMinExit(Sender: TObject); var dtTmp : TDateTime; begin case Cr.ParamFields.Item.ParamType of pfNumber, pfCurrency : begin try StrToFloat(editValueMin.Text); Cr.ParamFields.Item.ValueMin := editValueMin.Text; except MessageDlg('ValueMin value must be numeric!', mtError, [mbOk], 0); editValueMin.SetFocus; editValueMin.SelLength := Length(editValueMin.Text); end; end; pfBoolean : ; {Value Limits don't apply to boolean parameters} pfDate : begin if not CrStrToDate(editValueMin.Text, dtTmp) then begin MessageDlg('ValueMin value must be formatted as Date: YYYY,MM,DD', mtError, [mbOk], 0); editValueMin.SetFocus; editValueMin.SelLength := Length(editValueMin.Text); end else Cr.ParamFields.Item.ValueMin := editValueMin.Text; end; pfString : Cr.ParamFields.Item.ValueMin := editValueMin.Text; pfDateTime : begin if not CrStrToDateTime(editValueMin.Text, dtTmp) then begin MessageDlg('ValueMin value must be formatted as DateTime: YYYY,MM,DD HH:MM:SS', mtError, [mbOk], 0); editValueMin.SetFocus; editValueMin.SelLength := Length(editValueMin.Text); end else Cr.ParamFields.Item.ValueMin := editValueMin.Text; end; pfTime : begin if not CrStrToTime(editValueMin.Text, dtTmp) then begin MessageDlg('ValueMin value must be formatted as Time: HH:MM:SS', mtError, [mbOk], 0); editValueMin.SetFocus; editValueMin.SelLength := Length(editValueMin.Text); end else Cr.ParamFields.Item.ValueMin := editValueMin.Text; end; end; end; {------------------------------------------------------------------------------} { editValueMaxExit procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editValueMaxExit(Sender: TObject); var dtTmp : TDateTime; begin case Cr.ParamFields.Item.ParamType of pfNumber, pfCurrency : begin if IsFloating(editValueMax.Text) then Cr.ParamFields.Item.ValueMax := editValueMax.Text else begin MessageDlg('ValueMax value must be numeric!', mtError, [mbOk], 0); editValueMax.SetFocus; editValueMax.SelLength := Length(editValueMax.Text); end; end; pfBoolean : ; {Ranges don't apply to boolean parameters} pfDate : begin if not CrStrToDate(editValueMax.Text, dtTmp) then begin MessageDlg('ValueMax value must be formatted as Date: YYYY,MM,DD', mtError, [mbOk], 0); editValueMax.SetFocus; editValueMax.SelLength := Length(editValueMax.Text); end else Cr.ParamFields.Item.ValueMax := editValueMax.Text; end; pfString : Cr.ParamFields.Item.ValueMax := editValueMax.Text; pfDateTime : begin if not CrStrToDateTime(editValueMax.Text, dtTmp) then begin MessageDlg('ValueMax value must be formatted as DateTime: YYYY,MM,DD HH:MM:SS', mtError, [mbOk], 0); editValueMax.SetFocus; editValueMax.SelLength := Length(editValueMax.Text); end else Cr.ParamFields.Item.ValueMax := editValueMax.Text; end; pfTime : begin if not CrStrToTime(editValueMax.Text, dtTmp) then begin MessageDlg('ValueMax value must be formatted as Time: HH:MM:SS', mtError, [mbOk], 0); editValueMax.SetFocus; editValueMax.SelLength := Length(editValueMax.Text); end else Cr.ParamFields.Item.ValueMax := editValueMax.Text; end; end; end; {------------------------------------------------------------------------------} { editBrowseFieldExit procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editBrowseFieldExit(Sender: TObject); begin Cr.ParamFields.Item.BrowseField := editBrowseField.Text; end; {------------------------------------------------------------------------------} { editGroupNumExit procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editGroupNumExit(Sender: TObject); begin try StrToInt(editGroupNum.Text); Cr.ParamFields.Item.Info.GroupNum := StrToInt(editGroupNum.Text); except MessageDlg('GroupNum value must be numeric!', mtError, [mbOk], 0); editGroupNum.SetFocus; editGroupNum.SelLength := Length(editGroupNum.Text); end; end; {------------------------------------------------------------------------------} { cbAllowNullClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbAllowNullClick(Sender: TObject); begin Cr.ParamFields.Item.Info.AllowNull := Boolean(Ord(cbAllowNull.State)); end; {------------------------------------------------------------------------------} { cbAllowEditingClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbAllowEditingClick(Sender: TObject); begin Cr.ParamFields.Item.Info.AllowEditing := Boolean(Ord(cbAllowEditing.State)); end; {------------------------------------------------------------------------------} { cbAllowMultipleValuesClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbAllowMultipleValuesClick(Sender: TObject); begin Cr.ParamFields.Item.Info.AllowMultipleValues := Boolean(Ord(cbAllowMultipleValues.State)); UpdateParamFields; end; {------------------------------------------------------------------------------} { cbPartOfGroupClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbPartOfGroupClick(Sender: TObject); begin Cr.ParamFields.Item.Info.PartOfGroup := Boolean(Ord(cbPartOfGroup.State)); {Enable/Disable Group items} cbMutuallyExclusiveGroup.Enabled := (cbPartOfGroup.State = cbChecked); editGroupNum.Color := ColorState(cbPartOfGroup.State = cbChecked); editGroupNum.Enabled := (cbPartOfGroup.State = cbChecked); end; {------------------------------------------------------------------------------} { cbMutuallyExclusiveGroupClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbMutuallyExclusiveGroupClick( Sender: TObject); begin Cr.ParamFields.Item.Info.MutuallyExclusiveGroup := Boolean(Ord(cbMutuallyExclusiveGroup.State)); end; {------------------------------------------------------------------------------} { cbValueTypeChange procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbValueTypeChange(Sender: TObject); begin Cr.ParamFields.Item.Info.ValueType := TCrParamInfoValueType(cbValueType.ItemIndex); UpdateParamFields; end; {------------------------------------------------------------------------------} { cbObjectPropertiesActiveClick } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbObjectPropertiesActiveClick(Sender: TObject); begin Cr.ParamFields.ObjectPropertiesActive := cbObjectPropertiesActive.Checked; UpdateParamFields; end; {------------------------------------------------------------------------------} { rgUnitsClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.rgUnitsClick(Sender: TObject); begin if rgUnits.ItemIndex = 0 then {inches} begin editTop.Text := TwipsToInchesStr(Cr.ParamFields.Item.Top); editLeft.Text := TwipsToInchesStr(Cr.ParamFields.Item.Left); editWidth.Text := TwipsToInchesStr(Cr.ParamFields.Item.Width); editHeight.Text := TwipsToInchesStr(Cr.ParamFields.Item.Height); end else {twips} begin editTop.Text := IntToStr(Cr.ParamFields.Item.Top); editLeft.Text := IntToStr(Cr.ParamFields.Item.Left); editWidth.Text := IntToStr(Cr.ParamFields.Item.Width); editHeight.Text := IntToStr(Cr.ParamFields.Item.Height); end; end; {------------------------------------------------------------------------------} { editSizeEnter procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editSizeEnter(Sender: TObject); begin if Sender is TEdit then PrevSize := TEdit(Sender).Text; end; {------------------------------------------------------------------------------} { editSizeExit procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.editSizeExit(Sender: TObject); begin if rgUnits.ItemIndex = 0 then {inches} begin if not IsFloating(TEdit(Sender).Text) then TEdit(Sender).Text := PrevSize else begin if TEdit(Sender).Name = 'editTop' then Cr.ParamFields.Item.Top := InchesStrToTwips(TEdit(Sender).Text); if TEdit(Sender).Name = 'editLeft' then Cr.ParamFields.Item.Left := InchesStrToTwips(TEdit(Sender).Text); if TEdit(Sender).Name = 'editWidth' then Cr.ParamFields.Item.Width := InchesStrToTwips(TEdit(Sender).Text); if TEdit(Sender).Name = 'editHeight' then Cr.ParamFields.Item.Height := InchesStrToTwips(TEdit(Sender).Text); UpdateParamFields; {this will truncate any decimals beyond 3 places} end; end else {twips} begin if not IsNumeric(TEdit(Sender).Text) then TEdit(Sender).Text := PrevSize else begin if TEdit(Sender).Name = 'editTop' then Cr.ParamFields.Item.Top := StrToInt(TEdit(Sender).Text); if TEdit(Sender).Name = 'editLeft' then Cr.ParamFields.Item.Left := StrToInt(TEdit(Sender).Text); if TEdit(Sender).Name = 'editWidth' then Cr.ParamFields.Item.Width := StrToInt(TEdit(Sender).Text); if TEdit(Sender).Name = 'editHeight' then Cr.ParamFields.Item.Height := StrToInt(TEdit(Sender).Text); end; end; end; {------------------------------------------------------------------------------} { btnBorderClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnBorderClick(Sender: TObject); begin CrpeBorderDlg := TCrpeBorderDlg.Create(Application); CrpeBorderDlg.Border := Cr.ParamFields.Item.Border; CrpeBorderDlg.ShowModal; end; {------------------------------------------------------------------------------} { btnFontClick } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnFontClick(Sender: TObject); begin if Cr.Version.Crpe.Major > 7 then begin CrpeFontDlg := TCrpeFontDlg.Create(Application); CrpeFontDlg.Crf := Cr.ParamFields.Item.Font; CrpeFontDlg.ShowModal; end else begin FontDialog1.Font.Assign(Cr.ParamFields.Item.Font); if FontDialog1.Execute then Cr.ParamFields.Item.Font.Assign(FontDialog1.Font); end; end; {------------------------------------------------------------------------------} { btnFormatClick } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnFormatClick(Sender: TObject); begin CrpeFormatDlg := TCrpeFormatDlg.Create(Application); CrpeFormatDlg.Format := Cr.ParamFields.Item.Format; CrpeFormatDlg.ShowModal; end; {------------------------------------------------------------------------------} { btnHiliteConditionsClick } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnHiliteConditionsClick(Sender: TObject); begin CrpeHiliteConditionsDlg := TCrpeHiliteConditionsDlg.Create(Application); CrpeHiliteConditionsDlg.Crh := Cr.ParamFields.Item.HiliteConditions; CrpeHiliteConditionsDlg.ShowModal; end; {------------------------------------------------------------------------------} { cbSectionChange procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbSectionChange(Sender: TObject); begin Cr.ParamFields.Item.Section := cbSection.Items[cbSection.ItemIndex]; end; {------------------------------------------------------------------------------} { cbAllowDialogClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.cbAllowDialogClick(Sender: TObject); begin Cr.ParamFields.AllowDialog := cbAllowDialog.Checked; end; {------------------------------------------------------------------------------} { btnClearClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnClearClick(Sender: TObject); begin Cr.ParamFields.Item.Clear; UpdateParamFields; end; {------------------------------------------------------------------------------} { btnOkClick procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.btnOkClick(Sender: TObject); begin rgUnits.ItemIndex := 1; {change to twips to avoid the UpdateParamFields call} if (not IsStrEmpty(Cr.ReportName)) and (PIndex > -1) then begin editSizeExit(editTop); editSizeExit(editLeft); editSizeExit(editWidth); editSizeExit(editHeight); {Explanation: we don't want to accidentally add a Prompt or Current Value when there are none in the PromptValues/CurrentValues lists, so we check first before running the exit routines} if cbShowDialog.Checked then begin if (Cr.Version.Crpe.Major < 7) or (Cr.ParamFields.Item.PromptValues.Count > 0) then editPromptValueExit(Self); end else begin if (Cr.Version.Crpe.Major < 7) or (Cr.ParamFields.Item.CurrentValues.Count > 0) then editCurrentValueExit(Self); end; end; SaveFormPos(Self); Close; end; {------------------------------------------------------------------------------} { FormClose procedure } {------------------------------------------------------------------------------} procedure TCrpeParamFieldsDlg.FormClose(Sender: TObject; var Action: TCloseAction); begin bParamFields := False; Release; end; end.
{ Несчастным, решившим разобраться с моим модулем посвящается... } { Cherny } {****************************************************************************} procedure IGetKey;interrupt; function KeyPush:boolean;{Аналог KeyPressed} procedure WaitKey;{Аналог Readkey, но не возварщает номер клавиши} procedure InitSVGA(ing:integer);{Процедура инициализации графического режима} procedure putpixel(xpo,ypo:word;colorp:byte);{Путает пиксель на экран} function getpixel(xpo,ypo:word):byte;{Гетает пиксель с экрана} procedure bar(x1,y1,x2,y2:longint;colorp:byte);{Рисует Барчик} procedure rectangle(x1,y1,x2,y2:word;colorp:byte);{Рисует прямоугольник} function Sign(Number:integer):integer;{Возвращает знак числа} Procedure Line_(x1,y1,x2,y2:integer;color:byte);{Рисует линию} procedure Line(x1,y1,x2,y2:integer;col:byte);{Рисует линию} procedure circle(xco,yco,rad:word;colorp:byte);{Рисует круг} procedure SetPalette(colnom,rbr,gbr,bbr:byte);{Устанавливает палитру} procedure GetPalette(colnom:byte;var rbr,gbr,bbr:byte);{Взять палитру} procedure SavePalette(name:string);{Сохраняет палитру в файл} procedure LoadPalette(name:string);{Читает палитру из файла} procedure GetImage(x1,y1,x2,y2:word;var pt:pointer);{Гетает имедж} procedure PutImagePP(xp,yp:word;pt:pointer;nviv,nvcol,curs:byte);{Путает имедж} procedure PutImage(xp,yp:word;pt:pointer);{Путает имедж} function ImageSize(x1,y1,x2,y2:word):word;{Возвращает размер имеджа области} procedure ImageXYSize(pt:pointer;var xsize,ysize:word);{Возвращает размер области имеджа} procedure SaveImage(name:string;x1,y1,x2,y2:word);{Сохраняет имедж в файл} procedure LoadImage(name:string;var pt:pointer);{Читает имедж из файла} procedure Octangle(x1,y1,x2,y2:word;colorp:byte);{Рисует восьмиугольник} procedure ClearScreen(colorp:byte);{Очищает экран} procedure BitsToByte(bbb:bits;var resul:byte);{Преобразует биты в байт} procedure ByteToBits(resul:byte;var bbb:bits);{Преобразует байт в виты} procedure LoadFont(name:string);{Загружает шрифт} procedure OutChar(xco,yco,cnom:integer;col,fon,zat:byte);{Путает символ} procedure OutStr(xc,yc:integer;st:string;ccol,cfon,czat:byte);{Путает строку} procedure DOutStr(xc,yc:integer;st:string;ccol,cfon,czat:byte;del:word);{Путает строку с задержкой} procedure TOutStr(x,y:integer;st:string;col,fon,meg:byte);{Путает строку в текстовом режиме} procedure loadpcx(pname:string);{Загружает PCX} procedure MouseTest(var onm,bc:byte);{Тест наличия мышки} procedure ShowMouse;{Показать курсор} procedure HideMouse;{Спрятать курсор} function MouseX:integer;{Получить X координату} function MouseY:integer;{Получить Y координату} function MouseButtonStatus:byte;{Получить статус кнопок} procedure MouseStatus(var xmouse,ymouse:integer;var mbs:byte);{Получить статус мышки} procedure SetMouseCoords(nmx,nmy:integer);{Установить мышку в точку X;Y} procedure SetMouseMoveBar(xm1,ym1,xm2,ym2:integer);{Установить область перемещения мышки} procedure GetMouseStep(xco,yco:integer);{Возвращает шаг мышки} procedure SetMouseStep(xco,yco:integer);{Устанавливает шаг мышки} procedure MouseButtonPush(nb:integer;var tbs:byte;var pb,xm,ym:integer);{Нажали кнопку мыши} procedure MouseButtonLet(nb:integer;var tbs:byte;var pb,xm,ym:integer);{Отпустили кнопку мыши} procedure CurTrans(cur,mask:curarr;var ncur:curmask);{Конвертирует формат курсора} procedure SetGraphCursor(xcp,ycp:integer;ncur:curmask);{Устанавливает графический курсор} procedure loadcur(name:string;var curr:cursor);{Загружает курсор из файла} procedure loadcurbase(cn1,cn2,cn3,cn4,cn5,cn6,cn7,cn8,cn9,cn10,cn11, cz1,cz2,cz3,cz4,cz5,cz6,cs1,cs2,cs3,cs4,cs5,cs6,cl1,cl2,cl3,cl4,cl5,cl6:string); {Загружает базу курсоров из файлов} procedure PutCur(x,y:integer;curr:cursor);{Выводит курсор на экран} procedure PPutCur(x,y:integer;curr:cursor);{Выводит курсор на экран} procedure GetCur(x,y:integer;var curr1:cursor;curr2:cursor);{Читает курсор с экрана} procedure MMove;{Отображает движение курсора} procedure Ready;{Подготавливает модуль к работе} procedure Finish;{Завершает работу модуля} {****************************************************************************}
unit uShowMessage; {*|<PRE>***************************************************************************** 软件名称 FNM CLIENT MODEL 版权所有 (C) 2004-2005 ESQUEL GROUP GET/IT 单元名称 uShowMessage.pas 创建日期 2004-7-30 9:36:55 创建人员 wuwj 修改人员 lvzd 修改日期 2004-09-09 修改原因 原类不具备通用性,类和应用程序的主窗体绑定起来了. 功能描述 1.TStatusBarMessage:在主窗体的状态栏上显示自定义消息, 2.MessageDlg的扩展函数MessageDlgEx 3.Input dialogEx带格式输入德对话框 ******************************************************************************} interface uses Controls, Forms, ComCtrls, Windows, Dialogs, StdCtrls, Classes, SysUtils, Consts, Graphics, Math, ExtCtrls, ShellApi, Mapi, Jpeg, StrUtils, UOutLookMail, uLogin, Mask, StdActns; resourcestring SMsgDlgWarning = '警告'; SMsgDlgError= '出错'; SMsgDlgInformation= '提示'; SMsgDlgConfirm = '确认'; SMsgDlgYes = '是'; SMsgDlgNo = '否'; SMsgDlgOK = '确定'; SMsgDlgCancel = '取消'; SMsgDlgAbort = '中止'; SMsgDlgRetry = '重试'; SMsgDlgIgnore = '忽略'; SMsgDlgAll = '全部'; SMsgDlgNoToAll = '全部否'; SMsgDlgYesToAll = '全部是'; SMsgDlgHelp = '帮助'; SMsgSendMail = '发送Mail'; SMsgIncludeScreenMap = 'Mail中含屏幕图片'; type TStatusBarMessage = class {* 在应用程序主窗体状态栏显示提示类} class procedure ShowMessageOnMainStatsusBar(AMessage: string; ACursor: TCursor = crDefault); {* 该函数是为了兼容就的函数存在的,请使用新函数:SetMianFormStatusMessage 和 ReSetMianFormStatusMessage} end; { TMessageFormEx } TMsgDlgExBtn = (mebYes, mebNo, mebOK, mebCancel, mebAbort, mebRetry, mebIgnore, mebAll, mebNoToAll, mebYesToAll, mebHelp, mebSendMail, mecIncScreenMap); TMsgDlgExButtons = set of TMsgDlgExBtn; const mebYesNoCancel = [mebYes, mebNo, mebCancel]; mebYesAllNoAllCancel = [mebYes, mebYesToAll, mebNo, mebNoToAll, mebCancel]; mebOKCancel = [mebOK, mebCancel]; mebAbortRetryIgnore = [mebAbort, mebRetry, mebIgnore]; mebAbortIgnore = [mebAbort, mebIgnore]; { TMsgDialog } type TMsgDialog = class class function ShowMsgDialog(msg: string; msgType: TMsgDlgType): Integer; overload; {* 显示指定的风格的MessageDialog} class function ShowMsgDialog(Msg: string; msgType: TMsgDlgType; Buttons: TMsgDlgExButtons; DefaultButton: TMsgDlgExBtn = mebOK): Integer; overload; {* 显示指定的风格的,指定按钮和默认按钮的MessageDialog} class function ShowMsgDialog(Msg: string; AVisibleTime:Integer): Integer; overload; {* 旧接口不要使用} end; { ShowStatusMessage } procedure ShowStatusMessage(AMessage: string; ACursor: TCursor); implementation { TMessageFormEx } const WarningWaitSecond = 20; InformationWaitSecond= 1; type TMessageFormEx=class(TForm) {* 扩展的MessageDlg类} private TimerControler: TTimer; MessageText: TLabel; TheCheckBox: TCheckBox; CountDownText: TLabel; procedure HelpButtonClick(Sender: TObject); procedure SendMailButtonClick(Sender: TObject); procedure TimerControlerOnTimer(Sender: TObject); protected procedure CustomKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure WriteToClipBoard(Text: String); function GetFormText: String; public constructor CreateNew(AOwner: TComponent); reintroduce; end; function GetScreenBitmap: TBitMap; var ScreenBmp: TBitMap; begin //取屏幕图像,函数调用者负责释放BitMap try ScreenBmp:=TBitMap.Create; ScreenBmp.Width:=Screen.Width; ScreenBmp.Height:=Screen.Height; BitBlt(ScreenBmp.Canvas.Handle, 0, 0, Screen.Width, Screen.Height, GetDc(0), 0, 0, SRCCOPY); result:=ScreenBmp; except result:=nil; FreeAndNil(ScreenBmp); end; end; constructor TMessageFormEx.CreateNew(AOwner: TComponent); var NonClientMetrics: TNonClientMetrics; begin inherited CreateNew(AOwner); NonClientMetrics.cbSize := sizeof(NonClientMetrics); if SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0) then Font.Handle := CreateFontIndirect(NonClientMetrics.lfMessageFont); end; procedure TMessageFormEx.HelpButtonClick(Sender: TObject); begin Application.HelpContext(HelpContext); end; procedure TMessageFormEx.SendMailButtonClick(Sender: TObject); var ScreenBmp: TBitMap; BmpSavePath: String; JpgImage: TJpegImage; MailDetail: TMailRecord; begin //取屏幕图像并保存到临时目录,文件格式超大,需要转换为JPG格式 if (TheCheckBox <> nil) and TheCheckBox.Checked then begin try ScreenBmp:=nil; Self.Visible:=false; Application.ProcessMessages; BmpSavePath:=''; ScreenBmp:=GetScreenBitmap; if ScreenBmp <> nil then begin JpgImage:=TJpegImage.Create; BmpSavePath:=GetEnvironmentVariable('TEMP')+'\Screen.Jpg'; JpgImage.Assign(ScreenBmp); JpgImage.SaveToFile(BmpSavePath); end; finally Self.Visible:=true; FreeAndNil(ScreenBmp); FreeAndNil(JpgImage); end; end; MailDetail.FileToAttach:=BmpSavePath; MailDetail.MailTo:=Login.MailBox; MailDetail.CC:=''; MailDetail.Subject:=Application.title +'--程序错误反馈'; MailDetail.Body:='#######特别注意#########'#13#10 + '反馈前先填写下面的内容:'#13#10 + '错误是否可以重现: (偶尔有/几率比较大/100%可以重现)'#13#10 + '以前是否有发生: (Y/N)'#13#10 + '重现错误的操作步骤: (请填写发生错误的具体操作步骤或其它说明)'#13#10 + '注:'#13#10 + ' 如果以上内容没有填写我们将滞后处理或者不处理、不回复。'#13#10 + '----------------------------------------------' + #13#10 + '操作系统:' + Login.OS + #13#10 + '机器名称:' + Login.WorkStation + #13#10 + '用户名称:' + Login.LoginName + #13#10 + '应用服务器:' + Login.ComPlusServer + #13#10 + GetFormText; OutLookMailProc(MailDetail); end; procedure TMessageFormEx.TimerControlerOnTimer(Sender: TObject); begin TimerControler.Tag:=TimerControler.Tag - 1; CountDownText.Caption:=IntToStr(TimerControler.Tag)+'s'; if TimerControler.Tag <= 0 then Close; end; procedure TMessageFormEx.CustomKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (Shift = [ssCtrl]) and (Key = Word('C')) then begin Beep; WriteToClipBoard(GetFormText); end; end; procedure TMessageFormEx.WriteToClipBoard(Text: String); var Data: THandle; DataPtr: Pointer; begin if OpenClipBoard(0) then begin try Data := GlobalAlloc(GMEM_MOVEABLE+GMEM_DDESHARE, Length(Text) + 1); try DataPtr := GlobalLock(Data); try Move(PChar(Text)^, DataPtr^, Length(Text) + 1); EmptyClipBoard; SetClipboardData(CF_TEXT, Data); finally GlobalUnlock(Data); end; except GlobalFree(Data); raise; end; finally CloseClipBoard; end; end else raise Exception.CreateRes(@SCannotOpenClipboard); end; function TMessageFormEx.GetFormText: String; var DividerLine, ButtonCaptions: string; I: integer; begin DividerLine := '----------------------------------------------' + sLineBreak; for I := 0 to ComponentCount - 1 do if Components[I] is TButton then ButtonCaptions := ButtonCaptions + TButton(Components[I]).Caption + StringOfChar(' ', 3); ButtonCaptions := StringReplace(ButtonCaptions,'&','', [rfReplaceAll]); Result := Format('%s%s%s%s%s%s%s%s%s%s', [DividerLine, Caption, sLineBreak, DividerLine, MessageText.Caption, sLineBreak, DividerLine, ButtonCaptions, sLineBreak, DividerLine]); end; function GetAveCharSize(Canvas: TCanvas): TPoint; var I: Integer; Buffer: array[0..51] of Char; begin for I := 0 to 25 do Buffer[I] := Chr(I + Ord('A')); for I := 0 to 25 do Buffer[I + 26] := Chr(I + Ord('a')); GetTextExtentPoint(Canvas.Handle, Buffer, 52, TSize(Result)); Result.X := Result.X div 52; end; var ButtonWidths : array[TMsgDlgExBtn] of integer; // initialized to zero ButtonCaptions: array[TMsgDlgExBtn] of Pointer = ( @SMsgDlgYes, @SMsgDlgNo, @SMsgDlgOK, @SMsgDlgCancel, @SMsgDlgAbort, @SMsgDlgRetry, @SMsgDlgIgnore, @SMsgDlgAll, @SMsgDlgNoToAll, @SMsgDlgYesToAll, @SMsgDlgHelp, @SMsgSendMail, @SMsgIncludeScreenMap); IconIDs: array[TMsgDlgType] of PChar = (IDI_EXCLAMATION, IDI_HAND, IDI_ASTERISK, IDI_QUESTION, nil); Captions: array[TMsgDlgType] of Pointer = (@SMsgDlgWarning, @SMsgDlgError, @SMsgDlgInformation, @SMsgDlgConfirm, nil); ButtonNames: array[TMsgDlgExBtn] of string = ( 'Yes', 'No', 'OK', 'Cancel', 'Abort', 'Retry', 'Ignore', 'All', 'NoToAll', 'YesToAll', 'Help', 'SendMail', 'IncludeScreenMap'); ModalResults: array[TMsgDlgExBtn] of Integer = ( mrYes, mrNo, mrOk, mrCancel, mrAbort, mrRetry, mrIgnore, mrAll, mrNoToAll, mrYesToAll, 0, 0, 0); function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgExButtons; TheDefaultButton: TMsgDlgExBtn): TForm; const mcHorzMargin = 8; mcVertMargin = 8; mcHorzSpacing = 10; mcVertSpacing = 10; mcButtonWidth = 50; mcButtonHeight = 14; mcButtonSpacing = 4; var IconID: PChar; TextRect: TRect; AButton: TButton; DialogUnits: TPoint; B, DefaultButton, CancelButton: TMsgDlgExBtn; HorzMargin, VertMargin, HorzSpacing, VertSpacing, ButtonWidth, ButtonHeight, ButtonSpacing, ButtonCount, ButtonGroupWidth, IconTextWidth, IconTextHeight, X, ALeft: Integer; begin Result := TMessageFormEx.CreateNew(Application); with Result do begin BiDiMode := Application.BiDiMode; BorderStyle := bsDialog; Canvas.Font := Font; KeyPreview := True; OnKeyDown := TMessageFormEx(Result).CustomKeyDown; DialogUnits := GetAveCharSize(Canvas); HorzMargin := MulDiv(mcHorzMargin, DialogUnits.X, 4); VertMargin := MulDiv(mcVertMargin, DialogUnits.Y, 8); HorzSpacing := MulDiv(mcHorzSpacing, DialogUnits.X, 4); VertSpacing := MulDiv(mcVertSpacing, DialogUnits.Y, 8); ButtonWidth := MulDiv(mcButtonWidth, DialogUnits.X, 4); for B := Low(TMsgDlgExBtn) to High(TMsgDlgExBtn) do begin if B in Buttons then begin if ButtonWidths[B] = 0 then begin TextRect := Rect(0,0,0,0); Windows.DrawText(canvas.handle, PChar(LoadResString(ButtonCaptions[B])), -1, TextRect, DT_CALCRECT or DT_LEFT or DT_SINGLELINE or DrawTextBiDiModeFlagsReadingOnly); with TextRect do ButtonWidths[B] := Right - Left + 8; end; if ButtonWidths[B] > ButtonWidth then ButtonWidth := ButtonWidths[B]; end; end; ButtonHeight := MulDiv(mcButtonHeight, DialogUnits.Y, 8); ButtonSpacing := MulDiv(mcButtonSpacing, DialogUnits.X, 4); SetRect(TextRect, 0, 0, Screen.Width div 2, 0); DrawText(Canvas.Handle, PChar(Msg), Length(Msg)+1, TextRect, DT_EXPANDTABS or DT_CALCRECT or DT_WORDBREAK or DrawTextBiDiModeFlagsReadingOnly); //画出图标 IconID := IconIDs[DlgType]; IconTextWidth := TextRect.Right; IconTextHeight := TextRect.Bottom; if IconID <> nil then begin Inc(IconTextWidth, 32 + HorzSpacing); if IconTextHeight < 32 then IconTextHeight := 32; end; ButtonCount := 0; for B := Low(TMsgDlgExBtn) to High(TMsgDlgExBtn) do if B in Buttons then Inc(ButtonCount); ButtonGroupWidth := 0; if ButtonCount <> 0 then ButtonGroupWidth := ButtonWidth * ButtonCount + ButtonSpacing * (ButtonCount - 1); ClientWidth := Max(IconTextWidth, ButtonGroupWidth) + HorzMargin * 2; ClientHeight := IconTextHeight + ButtonHeight + VertSpacing + VertMargin * 2; Left := (Screen.Width div 2) - (Width div 2); Top := (Screen.Height div 2) - (Height div 2); if DlgType <> mtCustom then Caption := LoadResString(Captions[DlgType]) else Caption := Application.Title; if IconID <> nil then with TImage.Create(Result) do begin Name := 'Image'; Parent := Result; Picture.Icon.Handle := LoadIcon(0, IconID); SetBounds(HorzMargin, VertMargin, 32, 32); end; //构造和显示MessageText TMessageFormEx(Result).MessageText := TLabel.Create(Result); with TMessageFormEx(Result).MessageText do begin Name := 'Message'; Parent := Result; WordWrap := True; Caption := Msg; BoundsRect := TextRect; BiDiMode := Result.BiDiMode; ALeft := IconTextWidth - TextRect.Right + HorzMargin; if UseRightToLeftAlignment then ALeft := Result.ClientWidth - ALeft - Width; SetBounds(ALeft, VertMargin, TextRect.Right, TextRect.Bottom); end; //设置Dlg的默认确认按钮 if not(TheDefaultButton in Buttons) then begin if mebOk in Buttons then DefaultButton := mebOk else if mebYes in Buttons then DefaultButton := mebYes else DefaultButton := mebRetry; end; //设置Dlg的默认取消按钮 if mebCancel in Buttons then CancelButton := mebCancel else if mebNo in Buttons then CancelButton := mebNo else CancelButton := mebOk; //建立按钮 X := (ClientWidth - ButtonGroupWidth) div 2; for B := Low(TMsgDlgExBtn) to High(TMsgDlgExBtn) do begin if not(B in Buttons) then Continue; if TheDefaultButton = B then DefaultButton:= B; if B = mecIncScreenMap then begin //显示是否包含屏幕图片的选框 TMessageFormEx(Result).TheCheckBox:=TCheckBox.Create(Result); with TMessageFormEx(Result).TheCheckBox do begin Parent := Result; Name := ButtonNames[B]; Checked:=true; Caption := LoadResString(ButtonCaptions[B]); SetBounds(X, IconTextHeight + VertMargin + VertSpacing, 126{CheckBoxWith}, ButtonHeight); end; Inc(X, 126{CheckBoxWith} + ButtonSpacing); end else begin //Create Buttons AButton:=TButton.Create(Result); with AButton do begin Parent := Result; Name := ButtonNames[B]; ModalResult := ModalResults[B]; Caption := LoadResString(ButtonCaptions[B]); SetBounds(X, IconTextHeight + VertMargin + VertSpacing, ButtonWidth, ButtonHeight); Inc(X, ButtonWidth + ButtonSpacing); if B = DefaultButton then begin Default := True; TMessageFormEx(Result).ActiveControl:=AButton; end; if B = CancelButton then Cancel := True; if B = mebHelp then OnClick := TMessageFormEx(Result).HelpButtonClick; if B = mebSendMail then OnClick := TMessageFormEx(Result).SendMailButtonClick; end end; end; //构造和启动定时器 if (DlgType = mtInformation) or (DlgType = mtWarning) then begin TMessageFormEx(Result).TimerControler:=TTimer.Create(Result); with TMessageFormEx(Result).TimerControler do begin //跳动时长 Interval:= 1000; //跳动次数 if DlgType <> mtInformation then Tag:=WarningWaitSecond else Tag:=InformationWaitSecond; OnTimer:=TMessageFormEx(Result).TimerControlerOnTimer; TMessageFormEx(Result).CountDownText:=TLabel.Create(Result); with TMessageFormEx(Result).CountDownText do begin Parent:=Result; SetBounds(HorzMargin + 10, VertMargin + 36, 32, 17); Caption:=IntToStr(TMessageFormEx(Result).TimerControler.Tag) + 's'; end; end; end; end; end; function MessageDlgPosHelp(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgExButtons; DefaultButton: TMsgDlgExBtn; X, Y: Integer; const HelpFileName: string): Integer; begin with CreateMessageDialog(Msg, DlgType, Buttons, DefaultButton) do try HelpFile := HelpFileName; if X >= 0 then Left := X; if Y >= 0 then Top := Y; if (Y < 0) and (X < 0) then Position := poScreenCenter; Result := ShowModal; finally Free; end; end; function MessageDlgEx(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgExButtons; DefaultButton: TMsgDlgExBtn): Integer; begin if DlgType = mtError then Buttons:= Buttons + [mebSendMail]; if mebSendMail in Buttons then Buttons:= Buttons + [mecIncScreenMap]; Result := MessageDlgPosHelp(Msg, DlgType, Buttons, DefaultButton, -1, -1, ''); end; { TStatusBarMessage } var lHintAction: THintAction; lMainFormStatusBar:TStatusBar; function HintAction: THintAction; begin if lHintAction = nil then lHintAction:=THintAction.Create(nil); result:=lHintAction; end; function GetMainFormStatusBar: TStatusBar; var i: Integer; begin //取主窗体的状态栏 if (lMainFormStatusBar = nil) and (Application.MainForm <> nil)then for i := 0 to Application.MainForm.ControlCount - 1 do begin if Application.MainForm.Controls[i].ClassNameIs('TStatusBar') then begin lMainFormStatusBar:=Application.MainForm.Controls[i] as TStatusBar; Break; end end; result:=lMainFormStatusBar; end; procedure ShowStatusMessage(AMessage: string; ACursor: TCursor); begin Screen.Cursor:=ACursor; with HintAction do begin HintAction.Hint := AMessage; Execute; if GetMainFormStatusBar <> nil then GetMainFormStatusBar.Refresh; end; end; class procedure TStatusBarMessage.ShowMessageOnMainStatsusBar(AMessage: string; ACursor: TCursor = crDefault); begin ShowStatusMessage(AMessage, ACursor) end; { TMsgDialog } class function TMsgDialog.ShowMsgDialog(msg: string; msgType: TMsgDlgType): Integer; var Buttons: TMsgDlgExButtons; begin Buttons:= [mebOK]; if LeftStr(msg,3) = 'WAR' then msgType := mtWarning else if LeftStr(msg,3) = 'INF' then msgType := mtInformation else if LeftStr(msg,3) = 'ERR' then msgType := mtError else if LeftStr(msg,3) = 'CON' then msgType := mtConfirmation; if msgType = mtConfirmation then Buttons:= Buttons + [mebCancel]; if Pos('_',msg) = 4 then system.Delete(msg,1,4); result:=MessageDlgEx(msg, msgType, Buttons, mebOK); end; class function TMsgDialog.ShowMsgDialog(Msg: string; msgType: TMsgDlgType; Buttons: TMsgDlgExButtons; DefaultButton: TMsgDlgExBtn = mebOK): Integer; begin result:=MessageDlgEx(msg, msgType, Buttons, DefaultButton); end; class function TMsgDialog.ShowMsgDialog(Msg:string; AVisibleTime:Integer): Integer; begin result:=MessageDlgEx(msg, mtWarning, [mebOK], mebOK); end; initialization lHintAction:=nil; lMainFormStatusBar:=nil; finalization if lHintAction <> nil then lHintAction.Destroy; end.
{ Laz-Model Copyright (C) 2002 Eldean AB, Peter Söderman, Ville Krumlinde Portions (C) 2016 Peter Dyson. Initial Lazarus port This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } unit uZoomFrame; {$mode objfpc}{$H+} interface uses Classes, Controls, Forms, ExtCtrls, uViewIntegrator; type TZoomFrame = class(TFrame) ZoomImage: TImage; procedure ZoomImageMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FrameMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FrameMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure FrameResize(Sender: TObject); private Diagram : TDiagramIntegrator; procedure OnUpdateZoom(Sender : TObject); procedure SyncScroll(X,Y : integer); procedure RedrawZoom; public constructor Create(AOwner: TComponent; ADiagram : TDiagramIntegrator); reintroduce; end; implementation {$R *.lfm} { TZoomFrame } constructor TZoomFrame.Create(AOwner: TComponent; ADiagram: TDiagramIntegrator); begin inherited Create(AOwner); Self.Diagram := ADiagram; Parent := AOwner as TWinControl; Diagram.OnUpdateZoom := @OnUpdateZoom; end; procedure TZoomFrame.OnUpdateZoom(Sender: TObject); begin RedrawZoom;; end; procedure TZoomFrame.SyncScroll(X, Y: integer); begin Diagram.SetZoomedScroll(X,Y,ZoomImage.Width,ZoomImage.Height); RedrawZoom;; end; procedure TZoomFrame.ZoomImageMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin SyncScroll(X,Y); MouseCapture := True; end; procedure TZoomFrame.FrameMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin MouseCapture := False; end; procedure TZoomFrame.FrameMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if MouseCapture then SyncScroll(X,Y); end; procedure TZoomFrame.FrameResize(Sender: TObject); begin //Force image.canvas to recreate itself with new size ZoomImage.Picture.Graphic := nil; RedrawZoom; end; procedure TZoomFrame.RedrawZoom; begin Diagram.DrawZoom(ZoomImage.Canvas,ZoomImage.Width,ZoomImage.Height); end; end.
unit PE.Common; interface uses Windows, Generics.Collections; {$MINENUMSIZE 4} { Base types } type Int8 = ShortInt; Int16 = SmallInt; Int32 = Integer; IntPtr = NativeInt; UInt8 = Byte; UInt16 = Word; UInt32 = Cardinal; Dword = UInt32; PDword = ^Dword; TVA = UInt64; TRVA = UInt64; PInt8 = ^Int8; PInt16 = ^Int16; PInt32 = ^Int32; PInt64 = ^Int64; PUInt8 = ^UInt8; PUInt16 = ^UInt16; PUInt32 = ^UInt32; PUInt64 = ^UInt64; TFileOffset = type UInt64; TParserFlag = ( PF_EXPORT, PF_IMPORT, PF_IMPORT_DELAYED, PF_RELOCS, PF_TLS, PF_RESOURCES ); TParserFlags = set of TParserFlag; TPEImageKind = ( PEIMAGE_KIND_DISK, PEIMAGE_KIND_MEMORY ); TPEImageObject = TObject; // Meant to cast TObject -> TPEImage TParserOption = ( // If section vsize is 0 try to use rsize instead. PO_SECTION_VSIZE_FALLBACK, // Rename non-alphanumeric section names. PO_SECTION_AUTORENAME_NON_ALPHANUMERIC, // If data directory is invalid directory RVA and Size nulled. PO_NULL_INVALID_DIRECTORY ); TParserOptions = set of TParserOption; const MAX_PATH_WIN = 260; SUSPICIOUS_MIN_LIMIT_EXPORTS = $10000; DEFAULT_SECTOR_SIZE = 512; DEFAULT_PAGE_SIZE = 4096; ALL_PARSER_FLAGS = [PF_EXPORT, PF_IMPORT, PF_IMPORT_DELAYED, PF_RELOCS, PF_TLS, PF_RESOURCES]; DEFAULT_PARSER_FLAGS = ALL_PARSER_FLAGS; DEFAULT_OPTIONS = [ PO_SECTION_VSIZE_FALLBACK, // This is disabled by default because now it can reject good names, like // .text, .data. In future this option must be either removed or reworked. // PO_SECTION_AUTORENAME_NON_ALPHANUMERIC, PO_NULL_INVALID_DIRECTORY ]; // Data directories. DDIR_EXPORT = 0; DDIR_IMPORT = 1; DDIR_RESOURCE = 2; DDIR_EXCEPTION = 3; DDIR_CERTIFICATE = 4; DDIR_RELOCATION = 5; DDIR_DEBUG = 6; DDIR_ARCHITECTURE = 7; DDIR_GLOBALPTR = 8; DDIR_TLS = 9; DDIR_LOADCONFIG = 10; DDIR_BOUNDIMPORT = 11; DDIR_IAT = 12; DDIR_DELAYIMPORT = 13; DDIR_CLRRUNTIMEHEADER = 14; DDIR_LAST = 14; type TParserResult = (PR_OK, PR_ERROR, PR_SUSPICIOUS); { Overlay } type TOverlay = packed record Offset: TFileOffset; Size: UInt64; end; POverlay = ^TOverlay; {$SCOPEDENUMS ON} TEndianness = (Little, Big); {$SCOPEDENUMS OFF} const SCategoryLoadFromFile = 'LoadFromFile'; SCategoryDOSHeader = 'DOS Header'; SCategorySections = 'Sections'; SCategoryDataDirecory = 'Data Directories'; SCategoryResources = 'Resources'; SCategoryImports = 'Imports'; SCategoryTLS = 'TLS'; SCategoryRelocs = 'Relocs'; // ----- // by oranke type TStringSplitOptions = (None, ExcludeEmpty); { TMyStringHelper } TMyStringHelper = record helper for string private type TSplitKind = (StringSeparatorNoQuoted, StringSeparatorQuoted, CharSeparatorNoQuoted, CharSeparatorQuoted); private function IndexOfAny(const Values: array of string; var Index: Integer; StartIndex: Integer): Integer; overload; function IndexOfAnyUnquoted(const Values: array of string; StartQuote, EndQuote: Char; var Index: Integer; StartIndex: Integer): Integer; overload; function IndexOfQuoted(const Value: string; StartQuote, EndQuote: Char; StartIndex: Integer): Integer; overload; function InternalSplit(SplitType: TSplitKind; const SeparatorC: array of Char; const SeparatorS: array of string; QuoteStart, QuoteEnd: Char; Count: Integer; Options: TStringSplitOptions): TArray<string>; function GetChars(Index: Integer): Char; function GetLength: Integer; public const Empty = ''; function IsEmpty: Boolean; function IndexOf(const Value: string; StartIndex: Integer): Integer; overload; function IndexOfAny(const AnyOf: array of Char): Integer; overload; function IndexOfAny(const AnyOf: array of Char; StartIndex: Integer): Integer; overload; function IndexOfAny(const AnyOf: array of Char; StartIndex: Integer; Count: Integer): Integer; overload; function IndexOfAnyUnquoted(const AnyOf: array of Char; StartQuote, EndQuote: Char): Integer; overload; function IndexOfAnyUnquoted(const AnyOf: array of Char; StartQuote, EndQuote: Char; StartIndex: Integer): Integer; overload; function IndexOfAnyUnquoted(const AnyOf: array of Char; StartQuote, EndQuote: Char; StartIndex: Integer; Count: Integer): Integer; overload; function Substring(StartIndex: Integer): string; overload; function Substring(StartIndex: Integer; Length: Integer): string; overload; function Split(const Separator: array of Char): TArray<string>; overload; function Split(const Separator: array of Char; Count: Integer; Options: TStringSplitOptions): TArray<string>; overload; class function EndsText(const ASubText, AText: string): Boolean; static; function StartsWith(const Value: string): Boolean; overload; inline; function StartsWith(const Value: string; IgnoreCase: Boolean): Boolean; overload; function EndsWith(const Value: string): Boolean; overload; inline; function EndsWith(const Value: string; IgnoreCase: Boolean): Boolean; overload; property Chars[Index: Integer]: Char read GetChars; property Length: Integer read GetLength; end; implementation { TMyStringHelper } function TMyStringHelper.IndexOfAny(const Values: array of string; var Index: Integer; StartIndex: Integer): Integer; var C, P, IoA: Integer; begin IoA := -1; for C := 0 to High(Values) do begin P := IndexOf(Values[C], StartIndex); if (P >= 0) and((P < IoA) or (IoA = -1)) then begin IoA := P; Index := C; end; end; Result := IoA; end; function TMyStringHelper.IndexOfAnyUnquoted(const Values: array of string; StartQuote, EndQuote: Char; var Index: Integer; StartIndex: Integer): Integer; var C, P, IoA: Integer; begin IoA := -1; for C := 0 to High(Values) do begin P := IndexOfQuoted(Values[C], StartQuote, EndQuote, StartIndex); if (P >= 0) and((P < IoA) or (IoA = -1)) then begin IoA := P; Index := C; end; end; Result := IoA; end; function TMyStringHelper.IndexOfQuoted(const Value: string; StartQuote, EndQuote: Char; StartIndex: Integer): Integer; var I, LIterCnt, L, J: Integer; PSubStr, PS: PWideChar; LInQuote: Integer; LInQuoteBool: Boolean; begin L := Value.Length; LIterCnt := Self.Length - StartIndex - L + 1; if (StartIndex >= 0) and (LIterCnt >= 0) and (L > 0) then begin PSubStr := PWideChar(Value); PS := PWideChar(Self); Inc(PS, StartIndex); if StartQuote <> EndQuote then begin LInQuote := 0; for I := 0 to LIterCnt do begin J := 0; while (J >= 0) and (J < L) do begin if PS[I + J] = StartQuote then Inc(LInQuote) else if PS[I + J] = EndQuote then Dec(LInQuote); if LInQuote > 0 then J := -1 else begin if PS[I + J] = PSubStr[J] then Inc(J) else J := -1; end; end; if J >= L then Exit(I + StartIndex); end; end else begin LInQuoteBool := False; for I := 0 to LIterCnt do begin J := 0; while (J >= 0) and (J < L) do begin if PS[I + J] = StartQuote then LInQuoteBool := not LInQuoteBool; if LInQuoteBool then J := -1 else begin if PS[I + J] = PSubStr[J] then Inc(J) else J := -1; end; end; if J >= L then Exit(I + StartIndex); end; end; end; Result := -1; end; function TMyStringHelper.InternalSplit(SplitType: TSplitKind; const SeparatorC: array of Char; const SeparatorS: array of string; QuoteStart, QuoteEnd: Char; Count: Integer; Options: TStringSplitOptions): TArray<string>; const DeltaGrow = 32; var NextSeparator, LastIndex: Integer; Total: Integer; CurrentLength: Integer; SeparatorIndex: Integer; S: string; begin Total := 0; LastIndex := 0; NextSeparator := -1; CurrentLength := 0; SeparatorIndex := 0; case SplitType of TSplitKind.StringSeparatorNoQuoted: NextSeparator := IndexOfAny(SeparatorS, SeparatorIndex, LastIndex); TSplitKind.StringSeparatorQuoted: NextSeparator := IndexOfAnyUnquoted(SeparatorS, QuoteStart, QuoteEnd, SeparatorIndex, LastIndex); TSplitKind.CharSeparatorNoQuoted: NextSeparator := IndexOfAny(SeparatorC, LastIndex); TSplitKind.CharSeparatorQuoted: NextSeparator := IndexOfAnyUnquoted(SeparatorC, QuoteStart, QuoteEnd, LastIndex); end; while (NextSeparator >= 0) and (Total < Count) do begin S := Substring(LastIndex, NextSeparator - LastIndex); if (S <> '') or ((S = '') and (Options <> ExcludeEmpty)) then begin Inc(Total); if CurrentLength < Total then begin CurrentLength := Total + DeltaGrow; SetLength(Result, CurrentLength); end; Result[Total - 1] := S; end; case SplitType of TSplitKind.StringSeparatorNoQuoted: begin LastIndex := NextSeparator + SeparatorS[SeparatorIndex].Length; NextSeparator := IndexOfAny(SeparatorS, SeparatorIndex, LastIndex); end; TSplitKind.StringSeparatorQuoted: begin LastIndex := NextSeparator + SeparatorS[SeparatorIndex].Length; NextSeparator := IndexOfAnyUnquoted(SeparatorS, QuoteStart, QuoteEnd, SeparatorIndex, LastIndex); end; TSplitKind.CharSeparatorNoQuoted: begin LastIndex := NextSeparator + 1; NextSeparator := IndexOfAny(SeparatorC, LastIndex); end; TSplitKind.CharSeparatorQuoted: begin LastIndex := NextSeparator + 1; NextSeparator := IndexOfAnyUnquoted(SeparatorC, QuoteStart, QuoteEnd, LastIndex); end; end; end; if (LastIndex < Self.Length) and (Total < Count) then begin Inc(Total); SetLength(Result, Total); Result[Total - 1] := Substring(LastIndex, Self.Length - LastIndex); end else SetLength(Result, Total); end; function TMyStringHelper.GetChars(Index: Integer): Char; begin Result := Self[Index]; end; function TMyStringHelper.GetLength: Integer; begin Result := System.Length(Self); end; function Pos2(const SubStr, Str: String; Offset: Integer): Integer; overload; var I, LIterCnt, L, J: Integer; PSubStr, PS: PChar; begin L := Length(SubStr); { Calculate the number of possible iterations. Not valid if Offset < 1. } LIterCnt := Length(Str) - Offset - L + 1; { Only continue if the number of iterations is positive or zero (there is space to check) } if (Offset > 0) and (LIterCnt >= 0) and (L > 0) then begin PSubStr := PChar(SubStr); PS := PChar(Str); Inc(PS, Offset - 1); for I := 0 to LIterCnt do begin J := 0; while (J >= 0) and (J < L) do begin if PS[I + J] = PSubStr[J] then Inc(J) else J := -1; end; if J >= L then Exit(I + Offset); end; end; Result := 0; end; function TMyStringHelper.IsEmpty: Boolean; begin Result := Self = Empty; end; function TMyStringHelper.IndexOf(const Value: string; StartIndex: Integer): Integer; begin //Result := System.Pos(Value, Self, StartIndex + 1) - 1; Result := Pos2(Value, Self, StartIndex + 1) - 1; end; function TMyStringHelper.IndexOfAny(const AnyOf: array of Char): Integer; begin Result := IndexOfAny(AnyOf, 0, Self.Length); end; function TMyStringHelper.IndexOfAny(const AnyOf: array of Char; StartIndex: Integer): Integer; begin Result := IndexOfAny(AnyOf, StartIndex, Self.Length); end; function TMyStringHelper.IndexOfAny(const AnyOf: array of Char; StartIndex: Integer; Count: Integer): Integer; var I: Integer; C: Char; Max: Integer; begin if (StartIndex + Count) >= Self.Length then Max := Self.Length else Max := StartIndex + Count; I := StartIndex; while I < Max do begin for C in AnyOf do if Self[I] = C then Exit(I); Inc(I); end; Result := -1; end; function TMyStringHelper.IndexOfAnyUnquoted(const AnyOf: array of Char; StartQuote, EndQuote: Char): Integer; begin Result := IndexOfAnyUnquoted(AnyOf, StartQuote, EndQuote, 0, Self.Length); end; function TMyStringHelper.IndexOfAnyUnquoted(const AnyOf: array of Char; StartQuote, EndQuote: Char; StartIndex: Integer): Integer; begin Result := IndexOfAnyUnquoted(AnyOf, StartQuote, EndQuote, StartIndex, Self.Length); end; function TMyStringHelper.IndexOfAnyUnquoted(const AnyOf: array of Char; StartQuote, EndQuote: Char; StartIndex: Integer; Count: Integer): Integer; var I: Integer; C: Char; Max: Integer; LInQuote: Integer; LInQuoteBool: Boolean; begin if (StartIndex + Count) >= Length then Max := Length else Max := StartIndex + Count; I := StartIndex; if StartQuote <> EndQuote then begin LInQuote := 0; while I < Max do begin if Self[I] = StartQuote then Inc(LInQuote) else if (Self[I] = EndQuote) and (LInQuote > 0) then Dec(LInQuote); if LInQuote = 0 then for C in AnyOf do if Self[I] = C then Exit(I); Inc(I); end; end else begin LInQuoteBool := False; while I < Max do begin if Self[I] = StartQuote then LInQuoteBool := not LInQuoteBool; if not LInQuoteBool then for C in AnyOf do if Self[I] = C then Exit(I); Inc(I); end; end; Result := -1; end; function TMyStringHelper.Substring(StartIndex: Integer): string; begin Result := System.Copy(Self, StartIndex + 1, Self.Length); end; function TMyStringHelper.Substring(StartIndex: Integer; Length: Integer ): string; begin Result := System.Copy(Self, StartIndex + 1, Length); end; function TMyStringHelper.Split(const Separator: array of Char): TArray<string>; begin Result := Split(Separator, MaxInt, None); end; function TMyStringHelper.Split(const Separator: array of Char; Count: Integer; Options: TStringSplitOptions): TArray<string>; begin Result := InternalSplit(TSplitKind.CharSeparatorNoQuoted, Separator, [], Char(0), Char(0), Count, Options); end; class function TMyStringHelper.EndsText(const ASubText, AText: string): Boolean; var SubTextLocation: Integer; begin SubTextLocation := AText.Length - ASubText.Length; if (SubTextLocation >= 0) and (ASubText <> '') then //and //(ByteType(AText, SubTextLocation) <> mbTrailByte) then Result := //AnsiStrIComp(PChar(ASubText), PChar(@AText[SubTextLocation])) = 0 ( CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, PChar(ASubText), -1, PChar(@AText[SubTextLocation]), -1) - 2 ) = 0 else Result := False; end; function TMyStringHelper.StartsWith(const Value: string): Boolean; begin Result := StartsWith(Value, False); end; function StrLComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer; var I: Cardinal; P1, P2: PChar; begin P1 := Str1; P2 := Str2; I := 0; while I < MaxLen do begin if (P1^ <> P2^) or (P1^ = #0) then Exit(Ord(P1^) - Ord(P2^)); Inc(P1); Inc(P2); Inc(I); end; Result := 0; end; function StrLIComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer; var P1, P2: PChar; I: Cardinal; C1, C2: Char; begin P1 := Str1; P2 := Str2; I := 0; while I < MaxLen do begin if P1^ in ['a'..'z'] then C1 := Char(Byte(P1^) xor $20) else C1 := P1^; if P2^ in ['a'..'z'] then C2 := Char(Byte(P2^) xor $20) else C2 := P2^; if (C1 <> C2) or (C1 = #0) then Exit(Ord(C1) - Ord(C2)); Inc(P1); Inc(P2); Inc(I); end; Result := 0; end; function TMyStringHelper.StartsWith(const Value: string; IgnoreCase: Boolean ): Boolean; begin if Value = '' then Result := False else if not IgnoreCase then Result := StrLComp(PChar(Self), PChar(Value), Value.Length) = 0 else Result := StrLIComp(PChar(Self), PChar(Value), Value.Length) = 0; end; function TMyStringHelper.EndsWith(const Value: string): Boolean; begin Result := EndsWith(Value, False); end; //type //TMbcsByteType = (mbSingleByte, mbLeadByte, mbTrailByte); function TMyStringHelper.EndsWith(const Value: string; IgnoreCase: Boolean): Boolean; //var //SubTextLocation: Integer; begin //if IgnoreCase then Result := EndsText(Value, Self) //else //begin { SubTextLocation := Self.Length - Value.Length; if (SubTextLocation >= 0) and (Value <> Empty) then //and (//ByteType2(Self, SubTextLocation) <> mbTrailByte) then Result := string.Compare(Value, 0, Self, SubTextLocation, Value.Length, []) = 0 else Result := False; end; } end; end.
unit SDFilesystem_FAT; interface uses Classes, Controls, Dialogs, SDFilesystem, SDPartitionImage, SDUClasses, SDUDialogs, SDUGeneral, SyncObjs, SysUtils, Windows; const FAT_INVALID_FILENAME_CHARS = '\/:*?"<>|'; VFAT_ATTRIB_FLAG_READONLY = $01; VFAT_ATTRIB_FLAG_HIDDEN = $02; VFAT_ATTRIB_FLAG_SYSTEM = $04; VFAT_ATTRIB_FLAG_VOLLABEL = $08; VFAT_ATTRIB_FLAG_SUBDIR = $10; VFAT_ATTRIB_FLAG_ARCHIVE = $20; VFAT_ATTRIB_FLAG_DEVICE = $40; VFAT_ATTRIB_FLAG_UNUSED = $80; VFAT_ATTRIB_VFAT_ENTRY = VFAT_ATTRIB_FLAG_VOLLABEL or VFAT_ATTRIB_FLAG_SYSTEM or VFAT_ATTRIB_FLAG_HIDDEN or VFAT_ATTRIB_FLAG_READONLY; resourcestring FAT_TITLE_FAT12 = 'FAT12'; FAT_TITLE_FAT16 = 'FAT16'; FAT_TITLE_FAT32 = 'FAT32'; type TSDDirItem_FAT = class (TSDDirItem) private FAttributes: Byte; protected function CheckAttr(attr: Byte): Boolean; procedure SetAttr(attr: Byte; Value: Boolean); function GetIsFile(): Boolean; override; procedure SetIsFile(Value: Boolean); override; function GetIsDirectory(): Boolean; override; procedure SetIsDirectory(Value: Boolean); override; function GetIsReadonly(): Boolean; override; procedure SetIsReadonly(Value: Boolean); override; function GetIsHidden(): Boolean; override; procedure SetIsHidden(Value: Boolean); override; function GetIsArchive(): Boolean; procedure SetIsArchive(Value: Boolean); function GetIsSystem(): Boolean; procedure SetIsSystem(Value: Boolean); function GetAttributes(): Byte; procedure SetAttributes(Value: Byte); function GetIsVolumeLabel(): Boolean; procedure SetIsVolumeLabel(Value: Boolean); public FilenameDOS: Ansistring; TimestampCreation: TTimeStamp; DatestampLastAccess: TDate; FirstCluster: DWORD; procedure Assign(srcItem: TSDDirItem_FAT); overload; published property IsVolumeLabel: Boolean Read GetIsVolumeLabel Write SetIsVolumeLabel; property IsArchive: Boolean Read GetIsArchive Write SetIsArchive; property IsSystem: Boolean Read GetIsSystem Write SetIsSystem; property Attributes: Byte Read GetAttributes Write SetAttributes; end; TFATType = (ftFAT12, ftFAT16, ftFAT32); const FATTypeTitlePtr: array [TFATType] of Pointer = (@FAT_TITLE_FAT12, @FAT_TITLE_FAT16, @FAT_TITLE_FAT32 ); type TSDFATClusterChain = array of DWORD; // Boot sector information TSDBootSector_FAT = record FATType: TFATType; JMP: array [1..3] of Byte; OEMName: Ansistring; BytesPerSector: Word; SectorsPerCluster: Byte; ReservedSectorCount: Word; FATCount: Byte; MaxRootEntries: Word; TotalSectors: DWORD; MediaDescriptor: Byte; SectorsPerFAT: DWORD; SectorsPerTrack: Word; NumberOfHeads: Word; HiddenSectors: DWORD; PhysicalDriveNo: Byte; ExtendedBootSig: Byte; FATFilesystemType: Ansistring; SerialNumber: DWORD; VolumeLabel: Ansistring; BootSectorSig: Word; // FAT32 only FATFlags: Word; Version: Word; SectorNoFSInfoSector: Word; SectorNoBootSectorCopy: Word; RootDirFirstCluster: DWORD; end; TSDFilesystem_FAT = class (TSDCustomFilesystemPartitionBased) private FPreserveTimeDateStamps: Boolean; function GetFATEntry_FAT12(clusterID: DWORD): DWORD; function GetFATEntry_FAT1632(clusterID: DWORD): DWORD; function SetFATEntry_FAT12(clusterID: DWORD; Value: DWORD): Boolean; function SetFATEntry_FAT1632(clusterID: DWORD; Value: DWORD): Boolean; // The next two shouldn't be called directly; internal use... function _ReadWriteClusterData(readNotWrite: Boolean; clusterID: DWORD; data: TStream; maxSize: Integer): Boolean; function _ReadWriteClusterChainData(readNotWrite: Boolean; chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; protected FBootSectorSummary: TSDBootSector_FAT; FFAT: TSDUMemoryStream; // IMPORTANT: Access to this must be protected by FSerializeCS FFATEntrySize: DWORD; // Size of each FAT entry FFATEntryMask: DWORD; FFATEntryFree: DWORD; // Free (unused) FAT entry FFATEntryUsedStart: DWORD; // Very first valid cluster number FFATEntryUsedEnd: DWORD; // Very lsat valid cluster number FFATEntryBadSector: DWORD; // Cluster contains bad sector FFATEntryEOCStart: DWORD; // End of cluster chain FFATEntryEOCEnd: DWORD; // End of cluster chain procedure SetupFFATEntryValues(SetupAsFATType: TFATType); function ExtractFAT1216RootDir(data: TStream): Boolean; function StoreFAT1216RootDir(data: TStream): Boolean; function ReadWriteFAT1216RootDir(readNotWrite: Boolean; data: TStream): Boolean; // This function will delete DOSFilename from dirData function DeleteEntryFromDir(DOSFilename: String; dirData: TSDUMemoryStream): Boolean; // This function will add a directory entry for newItem to dirData function AddEntryToDir(itemToAdd: TSDDirItem_FAT; var dirChain: TSDFATClusterChain; dirData: TSDUMemoryStream; var clusterReserved: DWORD; flagDirDataIsRootDirData: Boolean): Boolean; function MaxClusterID(): DWORD; function ClusterSize(): Int64; function SectorsInDataArea(): DWORD; procedure AssertSufficientData(data: TStream; maxSize: Int64 = -1); function GetCaseSensitive(): Boolean; override; function DoMount(): Boolean; override; procedure DoDismount(); override; procedure FreeCachedFAT(); // Boot sector information function ReadBootSector(): Boolean; function WriteBootSector(newBootSector: TSDBootSector_FAT): Boolean; function DetermineFATType(stmBootSector: TSDUMemoryStream): TFATType; function GetRootDirItem(item: TSDDirItem_FAT): Boolean; function GetFATEntry(clusterID: DWORD): DWORD; // !! NOTICE !! // THIS ONLY OPERATES ON IN-MEMORY FAT COPY - USE WriteFAT(...) TO WRITE // ANY CHANGES OUT TO THE UNDERLYING PARTITION function SetFATEntry(clusterID: DWORD; Value: DWORD): Boolean; // Get the next empty FAT entry (cluster ID). // Note: This *doesn't* write to the FAT, it only determines the next free // (unused) cluster // afterClusterID - If nonzero, get the next free cluster ID after the // specified cluster ID // Returns ERROR_DWORD on failure function GetNextEmptyFATEntry(afterClusterID: DWORD = 0): DWORD; // Mark the next empty FAT entry as reservced, returning it's cluster ID // Returns ERROR_DWORD on failure function ReserveFATEntry(afterClusterID: DWORD = 0): DWORD; // Undo a call to ReserveFATEntry(...) procedure UnreserveFATEntry(clusterID: DWORD); // Count the number of empty FAT entries (i.e. free clusters) function CountEmptyFATEntries(): DWORD; function WriteDirEntry(item: TSDDirItem_FAT; stream: TSDUMemoryStream): Integer; procedure WriteDirEntry_83(item: TSDDirItem_FAT; stream: TSDUMemoryStream); function SeekBlockUnusedDirEntries(cntNeeded: Integer; dirData: TSDUMemoryStream): Boolean; function Seek83FileDirNameInDirData(filename: Ansistring; dirData: TSDUMemoryStream): Boolean; // Returns TRUE/FALSE, depending on whether clusterID appers in chain or not function IsClusterInChain(clusterID: DWORD; chain: TSDFATClusterChain): Boolean; // Add the specified cluster to the given chain procedure AddClusterToChain(clusterID: DWORD; var chain: TSDFATClusterChain); // Extend the specified stream by a cluster filled with zeros procedure ExtendByEmptyCluster(stream: TSDUMemoryStream); function _TraverseClusterChain(clusterID: DWORD; var chain: TSDFATClusterChain): DWORD; // Note: TTimeStamp includes a datestamp function WORDToTTimeStamp(dateBitmask: Word; timeBitmask: Word; msec: Byte): TTimeStamp; function WORDToTDate(dateBitmask: Word): TDate; procedure TTimeStampToWORD(timeStamp: TTimeStamp; var dateBitmask: Word; var timeBitmask: Word; var msec: Byte); function TDateToWORD(date: TDate): Word; function DOSFilenameTo11Chars(DOSFilename: Ansistring): Ansistring; function DOSFilenameCheckSum(DOSFilename: Ansistring): Byte; function _LoadContentsFromDisk(dirStartCluster: DWORD; items: TSDDirItemList): Boolean; // -- READ/WRITE CLUSTER RELATED -- // Set maxSize to -1 to write all remaining data function ReadWriteClusterData(readNotWrite: Boolean; clusterID: DWORD; data: TStream; maxSize: Integer): Boolean; // Set maxSize to -1 to write all remaining data function ReadWriteClusterChainData(readNotWrite: Boolean; chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; // -- EXTRACT CLUSTER RELATED -- // Extract the cluster chain, starting from the specified cluster ID // clusterID - The cluster ID of the starting cluster. If set to 0, this // will use the cluster ID of the root directory instead function ExtractClusterChain(clusterID: DWORD): TSDFATClusterChain; // Extract the data associated with the ***SINGLE*** cluster specified // maxSize - Extract up to this number of bytes; specify -1 to extract all // data for the cluster function ExtractClusterData(clusterID: DWORD; data: TStream; maxSize: Integer = -1): Boolean; // Extract the data associated with the cluster chain starting from the // specified cluster ID // maxSize - Extract up to this number of bytes; specify -1 to extract all // data for the cluster chain function ExtractClusterChainData(clusterID: DWORD; data: TStream; maxSize: Int64 = -1): Boolean; overload; function ExtractClusterChainData(clusterID: DWORD; filename: String; maxSize: Int64 = -1): Boolean; overload; function ExtractClusterChainData(chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; overload; // -- FREE CLUSTER RELATED -- // // !! NOTICE !! // THESE ONLY UPDATE THE IN-MEMORY FAT COPY - USE WriteFAT(...) TO WRITE // THE CHANGES OUT TO THE UNDERLYING PARTITION // // Free up the specified cluster // !! WARNING !! // If this functions return FALSE, the FAT may be in an inconsistent state! function FreeCluster(clusterID: DWORD): Boolean; // Free up a cluster chain, starting from the specified cluster ID // !! WARNING !! // If this function returns FALSE, the FAT may be in an inconsistent state! function FreeClusterChain(clusterID: DWORD): Boolean; overload; // Free up all clusters in the specifid cluster chain // !! WARNING !! // If this function returns FALSE, the FAT may be in an inconsistent state! function FreeClusterChain(clusterChain: TSDFATClusterChain): Boolean; overload; // -- STORE CLUSTER RELATED -- // Store a cluster chain function StoreClusterChain(chain: TSDFATClusterChain): Boolean; // Store the data specified to the specified cluster // maxSize - Store up to this number of bytes; specify -1 to store all // data for the cluster function StoreClusterData(clusterID: DWORD; data: TStream; maxSize: Integer = -1): Boolean; // Store the data specified in the given cluster chain // maxSize - Write up to this number of bytes; specify -1 to store all // the remaining data in "data", or as much as "chain" can hold // Note: This *ONLY* updates the *data* stored in the chain, it DOESN'T WRITE THE CHAIN TO THE FAT function StoreClusterChainData(chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; // Determine the number of clusters needed to store the specified data function DetermineClustersNeeded(data: TStream; maxSize: Int64 = -1): DWORD; // Note: This doesn't update the FAT, it just gets a chain function AllocateChainForData(var chain: TSDFATClusterChain; var unusedChain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; // function StoreClusterChainData(clusterID: DWORD; filename: string; maxSize: int64 = -1): boolean; overload; // Copy all data from one cluster to another function CopyClusterChainData(srcChain: TSDFATClusterChain; destChain: TSDFATClusterChain): Boolean; function ParseDirectory(data: TSDUMemoryStream; var dirContent: TSDDirItemList): Boolean; // Get item's content (e.g. unparsed directory content, file content to // rounded up cluster) function GetItemContent(path: WideString; content: TStream): Boolean; // As GetItemContent, but only extracts to the file's size function GetFileContent(path: WideString; fileContent: TStream): Boolean; function GetStartingClusterForItem(path: WideString): DWORD; function SectorIDForCluster(clusterID: DWORD): DWORD; // FAT numbers must be >= 1 function ReadFAT(fatNo: DWORD): Boolean; overload; function ReadFAT(fatNo: DWORD; stmFAT: TSDUMemoryStream): Boolean; overload; function WriteFAT(fatNo: DWORD): Boolean; overload; function WriteFAT(fatNo: DWORD; stmFAT: TSDUMemoryStream): Boolean; overload; function WriteFATToAllCopies(): Boolean; function GetFreeSpace(): ULONGLONG; override; function GetSize(): ULONGLONG; override; function PathParent(path: WideString): WideString; function DeleteItem(fullPathToItem: WideString): Boolean; // Returns a new, unique, 8.3 DOS filename (without the path) that can be // used as for the DOS filename for the LFN supplied // Note: lfnFilename must include the path *and* filename; the path will // be checked during the generation process to ensure the 8.3 // filename generated doesn't already exist function GenerateNew83Filename(lfnFilename: WideString): String; // Filesystem checking... function CheckFilesystem_ConsistentFATs(): Boolean; function CheckFilesystem_Crosslinks(): Boolean; public // If set, preserve time/datestamps when storing/extracting files property PreserveTimeDateStamps: Boolean Read FPreserveTimeDateStamps Write FPreserveTimeDateStamps; // Boot sector information property OEMName: Ansistring Read FBootSectorSummary.OEMName; property BytesPerSector: Word Read FBootSectorSummary.BytesPerSector; property SectorsPerCluster: Byte Read FBootSectorSummary.SectorsPerCluster; property ReservedSectorCount: Word Read FBootSectorSummary.ReservedSectorCount; property FATCount: Byte Read FBootSectorSummary.FATCount; property MaxRootEntries: Word Read FBootSectorSummary.MaxRootEntries; property TotalSectors: DWORD Read FBootSectorSummary.TotalSectors; property MediaDescriptor: Byte Read FBootSectorSummary.MediaDescriptor; property SectorsPerFAT: DWORD Read FBootSectorSummary.SectorsPerFAT; property SectorsPerTrack: Word Read FBootSectorSummary.SectorsPerTrack; property NumberOfHeads: Word Read FBootSectorSummary.NumberOfHeads; property HiddenSectors: DWORD Read FBootSectorSummary.HiddenSectors; property FATType: TFATType Read FBootSectorSummary.FATType; property RootDirFirstCluster: DWORD Read FBootSectorSummary.RootDirFirstCluster; constructor Create(); override; destructor Destroy(); override; function FilesystemTitle(): String; override; function Format(): Boolean; override; function _Format(fmtType: TFATType): Boolean; function CheckFilesystem(): Boolean; override; function LoadContentsFromDisk(path: String; items: TSDDirItemList): Boolean; overload; override; function ExtractFile(srcPath: WideString; extractToFilename: String): Boolean; override; // If parentDir is not nil, it will have the dirToStoreIn's details // *assigned* to it function StoreFileOrDir(dirToStoreIn: WideString; // The dir in which item/data is to be stored item: TSDDirItem_FAT; data: TStream; parentDir: TSDDirItem_FAT = nil): Boolean; function MoveFileOrDir(srcItemPath: WideString; // The path and filename of the file/dir to be moved destItemPath: WideString // The new path and filename ): Boolean; function CopyFile(srcItemPath: WideString; // The path and filename of the file to be copied destItemPath: WideString // The path and filename of the copy ): Boolean; function CreateDir(dirToStoreIn: WideString; // The dir in which item/data is to be stored newDirname: WideString; templateDirAttrs: TSDDirItem_FAT = nil): Boolean; function DeleteFile(fullPathToItem: WideString): Boolean; function DeleteDir(fullPathToItem: WideString): Boolean; function DeleteFileOrDir(fullPathToItem: WideString): Boolean; function GetItem(path: WideString; item: TSDDirItem): Boolean; override; function GetItem_FAT(path: WideString; item: TSDDirItem_FAT): Boolean; function IsValidFilename(filename: String): Boolean; end; function FATTypeTitle(fatType: TFATType): String; implementation uses DateUtils, Math, SDUi18n, SDUSysUtils; {$IFDEF _NEVER_DEFINED} // This is just a dummy const to fool dxGetText when extracting message // information // This const is never used; it's #ifdef'd out - SDUCRLF in the code refers to // picks up SDUGeneral.SDUCRLF const SDUCRLF = ''#13#10; {$ENDIF} const ERROR_DWORD = $FFFFFFFF; DEFAULT_FAT = 1; CLUSTER_ZERO = 0; CLUSTER_FIRST_DATA_CLUSTER = 2; // First usable cluster FAT_BOOTSECTORSIG = $AA55; // Note: In little-endian format ($55AA in big-endian) BOOTSECTOR_OFFSET_JMP = $00; BOOTSECTOR_LENGTH_JMP = 3; BOOTSECTOR_OFFSET_OEMNAME = $03; BOOTSECTOR_LENGTH_OEMNAME = 8; BOOTSECTOR_OFFSET_BYTESPERSECTOR = $0b; BOOTSECTOR_OFFSET_SECTORSPERCLUSTER = $0d; BOOTSECTOR_OFFSET_RESERVEDSECTORCOUNT = $0e; BOOTSECTOR_OFFSET_FATCOUNT = $10; BOOTSECTOR_OFFSET_MAXROOTENTRIES = $11; BOOTSECTOR_OFFSET_TOTALSECTORS_SMALL = $13; BOOTSECTOR_OFFSET_TOTALSECTORS_LARGE = $20; BOOTSECTOR_OFFSET_MEDIADESCRIPTOR = $15; BOOTSECTOR_OFFSET_SECTORSPERFAT = $16; BOOTSECTOR_OFFSET_SECTORSPERTRACK = $18; BOOTSECTOR_OFFSET_NUMBEROFHEADS = $1a; BOOTSECTOR_OFFSET_HIDDENSECTORS = $1c; BOOTSECTOR_OFFSET_BOOTSECTORSIG = $1fe; // Extended BIOS parameter block: FAT12/FAT16 BOOTSECTOR_OFFSET_FAT1216_PHYSICALDRIVENO = $24; BOOTSECTOR_OFFSET_FAT1216_RESERVED = $25; BOOTSECTOR_OFFSET_FAT1216_EXTENDEDBOOTSIG = $26; BOOTSECTOR_OFFSET_FAT1216_SERIALNUMBER = $27; BOOTSECTOR_OFFSET_FAT1216_VOLUMELABEL = $2b; BOOTSECTOR_LENGTH_FAT1216_VOLUMELABEL = 11; BOOTSECTOR_OFFSET_FAT1216_FATFSTYPE = $36; BOOTSECTOR_LENGTH_FAT1216_FATFSTYPE = 8; // Extended BIOS parameter block: FAT32 BOOTSECTOR_OFFSET_FAT32_SECTORSPERFAT = $24; BOOTSECTOR_OFFSET_FAT32_FATFLAGS = $28; BOOTSECTOR_OFFSET_FAT32_VERSION = $2a; BOOTSECTOR_OFFSET_FAT32_CLUSTERNOROOTDIRSTART = $2c; BOOTSECTOR_OFFSET_FAT32_SECTORNOFSINFOSECTOR = $30; BOOTSECTOR_OFFSET_FAT32_SECTORNOBOOTSECTORCOPY = $32; BOOTSECTOR_OFFSET_FAT32_RESERVED_1 = $34; BOOTSECTOR_OFFSET_FAT32_PHYSICALDRIVENO = $40; BOOTSECTOR_OFFSET_FAT32_RESERVED_2 = $41; BOOTSECTOR_OFFSET_FAT32_EXTENDEDBOOTSIG = $42; BOOTSECTOR_OFFSET_FAT32_SERIALNUMBER = $43; BOOTSECTOR_OFFSET_FAT32_VOLUMELABEL = $47; BOOTSECTOR_LENGTH_FAT32_VOLUMELABEL = 11; BOOTSECTOR_OFFSET_FAT32_FATFSTYPE = $52; BOOTSECTOR_LENGTH_FAT32_FATFSTYPE = 8; BOOTSECTOR_OFFSET_FAT32_OSBOOTCODE = $5a; SIGNATURE_FAT12 = 'FAT12 '; SIGNATURE_FAT16 = 'FAT16 '; SIGNATURE_FAT32 = 'FAT32 '; // Root dir first cluster always cluster 2 for FAT12/FAT16 // Zero here in order to be consistent with FAT entries relating to root dir FAT1216_ROOT_DIR_FIRST_CLUSTER = 0; // FAT12 FAT entries... FAT12_ENTRY_SIZE = 1.5; // Bytes per FAT entry FAT12_ENTRY_MASK = $FFF; FAT12_ENTRY_FREE = $000; FAT12_ENTRY_USED_START = $002; FAT12_ENTRY_USED_END = $FEF; FAT12_ENTRY_BAD_SECTOR = $FF7; FAT12_ENTRY_EOC_START = $FF8; FAT12_ENTRY_EOC_END = $FFF; // FAT16 FAT entries... FAT16_ENTRY_SIZE = 2; // Bytes per FAT entry FAT16_ENTRY_MASK = $FFFF; FAT16_ENTRY_FREE = $0000; FAT16_ENTRY_USED_START = $0002; FAT16_ENTRY_USED_END = $FFEF; FAT16_ENTRY_BAD_SECTOR = $FFF7; FAT16_ENTRY_EOC_START = $FFF8; FAT16_ENTRY_EOC_END = $FFFF; // Note: Only use the 7 byte LSB for FAT32; the highest *nibble* is RESERVED. FAT32_ENTRY_SIZE = 4; // Bytes per FAT entry FAT32_ENTRY_MASK = $0FFFFFFF; FAT32_ENTRY_FREE = $0000000; FAT32_ENTRY_USED_START = $0000002; FAT32_ENTRY_USED_END = $FFFFFEF; FAT32_ENTRY_BAD_SECTOR = $FFFFFF7; FAT32_ENTRY_EOC_START = $FFFFFF8; FAT32_ENTRY_EOC_END = $FFFFFFF; // Normal DOS 8.3 directory entry: // // 00000000000000001111111111111111 // 0123456789ABCDEF0123456789ABCDEF // ^^^^^^^^ Filename (8 chars; 8 bytes - padded with spaces) // Special first characters: // 0x00 Entry unused; all subsequent entries are also unused // 0x05 Initial character is actually 0xE5 // 0xE5 Entry deleted // ^^^ Extension (3 chars; 3 bytes - padded with spaces) // ^ Attributes (as VFAT_ATTRIB_FLAG_... consts) // ^ Case information // ^ Create time (fine; 0-199; 10ms units) // ^^ Create time (bit encoded to 2 second accuracy) // ^^ Create date (bit encoded) // ^^ Last access (bit encoded) // ^^ EA-Index; highest 2 bytes of first cluster number in FAT32 // ^^ Last modified time (bit encoded to 2 second accuracy) // ^^ Last modified date (bit encoded) // ^^ First cluster; lowest 2 bytes of first cluster number in FAT32. Set to 0 for root directory, empty files and volume labels // ^^^^ File size. Set to 0 for volume labels and directories // DIR_ENTRY_SIZE: Int64 = $20; DIR_ENTRY_OFFSET_DOSFILENAME = $00; DIR_ENTRY_LENGTH_DOSFILENAME = 8; DIR_ENTRY_OFFSET_DOSEXTENSION = $08; DIR_ENTRY_OFFSET_FILEATTRS = $0b; DIR_ENTRY_OFFSET_RESERVED = $0c; // Actually used to store case information DIR_ENTRY_OFFSET_CREATETIMEFINE = $0d; DIR_ENTRY_OFFSET_CREATETIME = $0e; DIR_ENTRY_OFFSET_CREATEDATE = $10; DIR_ENTRY_OFFSET_LASTACCESSDATE = $12; DIR_ENTRY_OFFSET_EAINDEX = $14; DIR_ENTRY_OFFSET_LASTMODTIME = $16; DIR_ENTRY_OFFSET_LASTMODDATE = $18; DIR_ENTRY_OFFSET_FIRSTCLUSTERLO = $1a; DIR_ENTRY_OFFSET_FILESIZE = $1c; DIR_ENTRY_UNUSED = $00; DIR_ENTRY_DELETED = $E5; DIR_ENTRY_83CASE_BASENAME = $08; DIR_ENTRY_83CASE_EXTN = $10; // VFAT entries.. // LFN directory entry entry: // // 00000000000000001111111111111111 // 0123456789ABCDEF0123456789ABCDEF // ^ Sequence number // ^^^^^^^^^^ Name (5 chars; 10 bytes) // ^ 0x0F (Attributes) // ^ 0x00 (Reserved) // ^ Checksum // ^^^^^^^^^^^^ Name (6 chars; 12 bytes) // ^^ 0x0000 (First cluster) // ^^^^ Name (2 chars; 4 bytes) DIR_ENTRY_OFFSET_VFAT_SEQ_NO = $00; DIR_ENTRY_OFFSET_VFAT_NAME_PART_1 = $01; DIR_ENTRY_OFFSET_VFAT_ATTRIBUTES = $0b; DIR_ENTRY_OFFSET_VFAT_RESERVED = $0c; DIR_ENTRY_OFFSET_VFAT_CHECKSUM = $0d; DIR_ENTRY_OFFSET_VFAT_NAME_PART_2 = $0e; DIR_ENTRY_OFFSET_VFAT_FIRSTCLUSTER = $1a; DIR_ENTRY_OFFSET_VFAT_NAME_PART_3 = $1c; DIR_ENTRY_VFAT_LAST_LONG_ENTRY = $40; type TClusterSizeBreakdown = record MaxPartitionSize: ULONGLONG; ClusterSize_FAT12FAT16: DWORD; ClusterSize_FAT32: DWORD; end; const // From: // http://support.microsoft.com/kb/140365/EN-US/ // The following table describes the default FAT cluster sizes for Windows // Server 2003 file system volumes: // // Volume size | Cluster size // | FAT16 | FAT32 // ----------------+---------------+--------------- // 7 MB–16 MB | 2 KB | Not supported // 17 MB–32 MB | 512 bytes | Not supported // 33 MB–64 MB | 1 KB | 512 bytes // 65 MB–128 MB | 2 KB | 1 KB // 129 MB–256 MB | 4 KB | 2 KB // 257 MB–512 MB | 8 KB | 4 KB // 513 MB–1,024 MB | 16 KB | 4 KB // 1,025 MB–2 GB | 32 KB | 4 KB // 2 GB–4 GB | 64 KB | 4 KB // 4 GB–8 GB | Not supported | 4 KB // 8 GB–16 GB | Not supported | 8 KB // 16 GB–32 GB | Not supported | 16 KB // 32 GB–2 TB | Not supported | Not supported [*] // // [*] - For this one, we use 16 KB clusters // // A later version of this is at: // http://support.microsoft.com/kb/314878 // which gives details for FAT16, but not FAT32 - so we use the earlier Windows // Server 2003 system CLUSTERSIZE_BREAKDOWN: array [1..13] of TClusterSizeBreakdown = ( ( MaxPartitionSize: (16 * BYTES_IN_MEGABYTE); ClusterSize_FAT12FAT16: (2 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: 0 // Not supported ), ( MaxPartitionSize: (32 * BYTES_IN_MEGABYTE); ClusterSize_FAT12FAT16: 512; ClusterSize_FAT32: 0 // Not supported ), ( MaxPartitionSize: (64 * BYTES_IN_MEGABYTE); ClusterSize_FAT12FAT16: (1 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: 512 ), ( MaxPartitionSize: (128 * BYTES_IN_MEGABYTE); ClusterSize_FAT12FAT16: (2 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: (1 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (256 * BYTES_IN_MEGABYTE); ClusterSize_FAT12FAT16: (4 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: (2 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (512 * BYTES_IN_MEGABYTE); ClusterSize_FAT12FAT16: (8 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: (4 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (1 * BYTES_IN_GIGABYTE); ClusterSize_FAT12FAT16: (16 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: (4 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (2 * ULONGLONG(BYTES_IN_GIGABYTE)); ClusterSize_FAT12FAT16: (32 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: (4 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (4 * ULONGLONG(BYTES_IN_GIGABYTE)); ClusterSize_FAT12FAT16: (64 * BYTES_IN_KILOBYTE); ClusterSize_FAT32: (4 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (8 * ULONGLONG(BYTES_IN_GIGABYTE)); ClusterSize_FAT12FAT16: 0; // Not supported ClusterSize_FAT32: (4 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (16 * ULONGLONG(BYTES_IN_GIGABYTE)); ClusterSize_FAT12FAT16: 0; // Not supported ClusterSize_FAT32: (8 * BYTES_IN_KILOBYTE) ), ( MaxPartitionSize: (32 * ULONGLONG(BYTES_IN_GIGABYTE)); ClusterSize_FAT12FAT16: 0; // Not supported ClusterSize_FAT32: (16 * BYTES_IN_KILOBYTE) ), ( // Not MS "standard", but needed to support filesystems over 32GB // If you need more than this, you probably shouldn't be using FAT! MaxPartitionSize: (99999 * ULONGLONG(BYTES_IN_GIGABYTE)); ClusterSize_FAT12FAT16: 0; // Not supported ClusterSize_FAT32: (16 * BYTES_IN_KILOBYTE) ) ); function FATTypeTitle(fatType: TFATType): String; begin Result := LoadResString(FATTypeTitlePtr[fatType]); end; procedure TSDDirItem_FAT.Assign(srcItem: TSDDirItem_FAT); begin inherited Assign(srcItem); self.FilenameDOS := srcItem.FilenameDOS; self.Attributes := srcItem.Attributes; self.TimestampCreation := srcItem.TimestampCreation; self.DatestampLastAccess := srcItem.DatestampLastAccess; self.FirstCluster := srcItem.FirstCluster; end; function TSDDirItem_FAT.CheckAttr(attr: Byte): Boolean; begin Result := ((FAttributes and attr) = attr); end; procedure TSDDirItem_FAT.SetAttr(attr: Byte; Value: Boolean); begin if Value then begin FAttributes := (FAttributes or attr); end else begin FAttributes := (FAttributes and not (attr)); end; end; function TSDDirItem_FAT.GetIsFile(): Boolean; begin Result := not (((Attributes and VFAT_ATTRIB_FLAG_SUBDIR) = VFAT_ATTRIB_FLAG_SUBDIR) or ((Attributes and VFAT_ATTRIB_FLAG_VOLLABEL) = VFAT_ATTRIB_FLAG_VOLLABEL) or ((Attributes and VFAT_ATTRIB_FLAG_DEVICE) = VFAT_ATTRIB_FLAG_DEVICE)); end; procedure TSDDirItem_FAT.SetIsFile(Value: Boolean); begin if Value then begin Attributes := (Attributes and not (VFAT_ATTRIB_FLAG_SUBDIR or VFAT_ATTRIB_FLAG_VOLLABEL or VFAT_ATTRIB_FLAG_DEVICE)); end else begin IsDirectory := True; end; end; function TSDDirItem_FAT.GetIsDirectory(): Boolean; begin Result := CheckAttr(VFAT_ATTRIB_FLAG_SUBDIR); end; procedure TSDDirItem_FAT.SetIsDirectory(Value: Boolean); begin SetAttr(VFAT_ATTRIB_FLAG_SUBDIR, Value); end; function TSDDirItem_FAT.GetIsReadonly(): Boolean; begin Result := CheckAttr(VFAT_ATTRIB_FLAG_READONLY); end; procedure TSDDirItem_FAT.SetIsReadonly(Value: Boolean); begin SetAttr(VFAT_ATTRIB_FLAG_READONLY, Value); end; function TSDDirItem_FAT.GetIsArchive(): Boolean; begin Result := CheckAttr(VFAT_ATTRIB_FLAG_ARCHIVE); end; procedure TSDDirItem_FAT.SetIsArchive(Value: Boolean); begin SetAttr(VFAT_ATTRIB_FLAG_ARCHIVE, Value); end; function TSDDirItem_FAT.GetIsHidden(): Boolean; begin Result := CheckAttr(VFAT_ATTRIB_FLAG_HIDDEN); end; procedure TSDDirItem_FAT.SetIsHidden(Value: Boolean); begin SetAttr(VFAT_ATTRIB_FLAG_HIDDEN, Value); end; function TSDDirItem_FAT.GetIsSystem(): Boolean; begin Result := CheckAttr(VFAT_ATTRIB_FLAG_SYSTEM); end; procedure TSDDirItem_FAT.SetIsSystem(Value: Boolean); begin SetAttr(VFAT_ATTRIB_FLAG_SYSTEM, Value); end; function TSDDirItem_FAT.GetIsVolumeLabel(): Boolean; begin Result := CheckAttr(VFAT_ATTRIB_FLAG_VOLLABEL); end; function TSDDirItem_FAT.GetAttributes(): Byte; begin Result := FAttributes; end; procedure TSDDirItem_FAT.SetAttributes(Value: Byte); begin FAttributes := Value; end; procedure TSDDirItem_FAT.SetIsVolumeLabel(Value: Boolean); begin SetAttr(VFAT_ATTRIB_FLAG_VOLLABEL, Value); end; // ---------------------------------------------------------------------------- constructor TSDFilesystem_FAT.Create(); begin inherited; FPreserveTimeDateStamps := True; end; destructor TSDFilesystem_FAT.Destroy(); begin inherited; end; function TSDFilesystem_FAT.GetCaseSensitive(): Boolean; begin Result := False; end; function TSDFilesystem_FAT.DoMount(): Boolean; begin Result := False; // Assume mounting is successful... FMounted := True; try if not (ReadBootSector()) then begin raise EFileSystemNotRecognised.Create('Not a FAT12/FAT16/FAT32 filesystem'); end; SetupFFATEntryValues(FATType); Result := ReadFAT(DEFAULT_FAT); finally FMounted := False; end; end; procedure TSDFilesystem_FAT.DoDismount(); begin FreeCachedFAT(); inherited; end; procedure TSDFilesystem_FAT.FreeCachedFAT(); begin if (FFAT <> nil) then begin FFAT.Free(); end; end; function TSDFilesystem_FAT.ReadBootSector(): Boolean; var stmBootSector: TSDUMemoryStream; i: Integer; begin AssertMounted(); Result := True; FSerializeCS.Acquire(); try stmBootSector := TSDUMemoryStream.Create(); try try PartitionImage.ReadSector(0, stmBootSector); except // Problem... on E: Exception do begin Result := False; end; end; if Result then begin // Sanity check - can we find the Boot sector signature (0x55 0xAA)? if (stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_BOOTSECTORSIG) <> FAT_BOOTSECTORSIG) then begin Result := False; end; end; if Result then begin // Attempt to identify filesystem type; FAT12/FAT16/FAT32... // Default to FAT16 FBootSectorSummary.FATType := DetermineFATType(stmBootSector); // ------------ // Parse the FAT12/FAT16/FAT32 common boot sector... stmBootSector.Position := BOOTSECTOR_OFFSET_JMP; for i := low(FBootSectorSummary.JMP) to high(FBootSectorSummary.JMP) do begin FBootSectorSummary.JMP[i] := stmBootSector.ReadByte(); end; FBootSectorSummary.OEMName := stmBootSector.ReadString(BOOTSECTOR_LENGTH_OEMNAME, BOOTSECTOR_OFFSET_OEMNAME); FBootSectorSummary.BytesPerSector := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_BYTESPERSECTOR); FBootSectorSummary.SectorsPerCluster := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_SECTORSPERCLUSTER); FBootSectorSummary.ReservedSectorCount := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_RESERVEDSECTORCOUNT); FBootSectorSummary.FATCount := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_FATCOUNT); FBootSectorSummary.MaxRootEntries := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_MAXROOTENTRIES); FBootSectorSummary.TotalSectors := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_TOTALSECTORS_SMALL); if (TotalSectors = 0) then begin FBootSectorSummary.TotalSectors := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_TOTALSECTORS_LARGE); end; FBootSectorSummary.MediaDescriptor := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_MEDIADESCRIPTOR); // Note: This will be overwritten with value in the FAT32 extended BIOS parameter block if FAT32... FBootSectorSummary.SectorsPerFAT := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_SECTORSPERFAT); FBootSectorSummary.SectorsPerTrack := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_SECTORSPERTRACK); FBootSectorSummary.NumberOfHeads := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_NUMBEROFHEADS); FBootSectorSummary.HiddenSectors := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_HIDDENSECTORS); // ------------ // Parse the FAT12/FAT16 extended BIOS parameter block, if FAT12/FAT16... if ((FATType = ftFAT12) or (FATType = ftFAT16)) then begin FBootSectorSummary.PhysicalDriveNo := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_FAT1216_PHYSICALDRIVENO); FBootSectorSummary.ExtendedBootSig := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_FAT1216_EXTENDEDBOOTSIG); FBootSectorSummary.SerialNumber := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_FAT1216_SERIALNUMBER); FBootSectorSummary.VolumeLabel := stmBootSector.ReadString(BOOTSECTOR_LENGTH_FAT1216_VOLUMELABEL, BOOTSECTOR_OFFSET_FAT1216_VOLUMELABEL); // .FilesystemType read above FBootSectorSummary.BootSectorSig := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_BOOTSECTORSIG); FBootSectorSummary.RootDirFirstCluster := FAT1216_ROOT_DIR_FIRST_CLUSTER; end; // ------------ // Parse the FAT32 extended BIOS parameter block, if FAT32... if (FATType = ftFAT32) then begin FBootSectorSummary.SectorsPerFAT := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_FAT32_SECTORSPERFAT); FBootSectorSummary.FATFlags := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_FAT32_FATFLAGS); FBootSectorSummary.Version := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_FAT32_VERSION); FBootSectorSummary.RootDirFirstCluster := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_FAT32_CLUSTERNOROOTDIRSTART); FBootSectorSummary.SectorNoFSInfoSector := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_FAT32_SECTORNOFSINFOSECTOR); FBootSectorSummary.SectorNoBootSectorCopy := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_FAT32_SECTORNOBOOTSECTORCOPY); FBootSectorSummary.PhysicalDriveNo := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_FAT32_PHYSICALDRIVENO); FBootSectorSummary.ExtendedBootSig := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_FAT32_EXTENDEDBOOTSIG); FBootSectorSummary.SerialNumber := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_FAT32_SERIALNUMBER); FBootSectorSummary.VolumeLabel := stmBootSector.ReadString(BOOTSECTOR_LENGTH_FAT32_VOLUMELABEL, BOOTSECTOR_OFFSET_FAT32_VOLUMELABEL); // .FilesystemType read above FBootSectorSummary.BootSectorSig := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_BOOTSECTORSIG); end; end; finally stmBootSector.Free(); end; finally FSerializeCS.Release(); end; if Result then begin // Sanity checks... if ((FBootSectorSummary.FATCount < 1) or // Make sure there's at least *one* FAT (trim(FBootSectorSummary.OEMName) = 'NTFS') // System ID must not be NTFS ) then begin Result := False; end; end; end; function TSDFilesystem_FAT.WriteBootSector(newBootSector: TSDBootSector_FAT): Boolean; var stmBootSector: TSDUMemoryStream; i: Integer; begin // Note: Filesystem *shouldn't* be mounted to do this (e.g. When formatting // for the first time) // AssertMounted(); Result := True; FSerializeCS.Acquire(); try stmBootSector := TSDUMemoryStream.Create(); try // Initialize with all zero bytes... stmBootSector.WriteByte(0, 0, newBootSector.BytesPerSector); { try // We read in original boot sector, modify it, then write it back out stmBootSector.Position := 0; PartitionImage.ReadSector(0, stmBootSector); except // Problem... on E:Exception do begin Result := FALSE; end; end; } if Result then begin // ------------ // Write the FAT12/FAT16/FAT32 common boot sector... { // We leave the JMP instruction alone; our format rountine doesn't // populate this information, so leave any existing as-is //stmBootSector.Position := BOOTSECTOR_OFFSET_JMP; //for i:=low(newBootSector.JMP) to high(newBootSector.JMP) do // begin // stmBootSector.WriteByte(newBootSector.JMP[i]); // end; } stmBootSector.Position := BOOTSECTOR_OFFSET_JMP; for i := low(newBootSector.JMP) to high(newBootSector.JMP) do begin stmBootSector.WriteByte(newBootSector.JMP[i]); end; // 8 char OEM name stmBootSector.WriteString( newBootSector.OEMName, BOOTSECTOR_LENGTH_OEMNAME, BOOTSECTOR_OFFSET_OEMNAME ); stmBootSector.WriteWORD_LE(newBootSector.BytesPerSector, BOOTSECTOR_OFFSET_BYTESPERSECTOR); stmBootSector.WriteByte(newBootSector.SectorsPerCluster, BOOTSECTOR_OFFSET_SECTORSPERCLUSTER); stmBootSector.WriteWORD_LE(newBootSector.ReservedSectorCount, BOOTSECTOR_OFFSET_RESERVEDSECTORCOUNT); stmBootSector.WriteByte(newBootSector.FATCount, BOOTSECTOR_OFFSET_FATCOUNT); stmBootSector.WriteWORD_LE(newBootSector.MaxRootEntries, BOOTSECTOR_OFFSET_MAXROOTENTRIES); if (newBootSector.TotalSectors <= SDUMaxWORD) then begin stmBootSector.WriteWORD_LE(newBootSector.TotalSectors, BOOTSECTOR_OFFSET_TOTALSECTORS_SMALL); stmBootSector.WriteDWORD_LE(0, BOOTSECTOR_OFFSET_TOTALSECTORS_LARGE); end else begin stmBootSector.WriteWORD_LE(0, BOOTSECTOR_OFFSET_TOTALSECTORS_SMALL); stmBootSector.WriteDWORD_LE(newBootSector.TotalSectors, BOOTSECTOR_OFFSET_TOTALSECTORS_LARGE); end; stmBootSector.WriteByte(newBootSector.MediaDescriptor, BOOTSECTOR_OFFSET_MEDIADESCRIPTOR); stmBootSector.WriteWORD_LE(newBootSector.SectorsPerTrack, BOOTSECTOR_OFFSET_SECTORSPERTRACK); stmBootSector.WriteWORD_LE(newBootSector.NumberOfHeads, BOOTSECTOR_OFFSET_NUMBEROFHEADS); stmBootSector.WriteDWORD_LE(newBootSector.HiddenSectors, BOOTSECTOR_OFFSET_HIDDENSECTORS); // ------------ // Parse the FAT12/FAT16 extended BIOS parameter block, if FAT12/FAT16... if ((newBootSector.FATType = ftFAT12) or (newBootSector.FATType = ftFAT16)) then begin // Note: This will be overwritten with value in the FAT32 extended BIOS parameter block if FAT32... stmBootSector.WriteWORD_LE(newBootSector.SectorsPerFAT, BOOTSECTOR_OFFSET_SECTORSPERFAT); stmBootSector.WriteByte(newBootSector.PhysicalDriveNo, BOOTSECTOR_OFFSET_FAT1216_PHYSICALDRIVENO); stmBootSector.WriteByte(newBootSector.ExtendedBootSig, BOOTSECTOR_OFFSET_FAT1216_EXTENDEDBOOTSIG); stmBootSector.WriteDWORD_LE(newBootSector.SerialNumber, BOOTSECTOR_OFFSET_FAT1216_SERIALNUMBER); stmBootSector.WriteString(newBootSector.VolumeLabel, BOOTSECTOR_LENGTH_FAT1216_VOLUMELABEL, BOOTSECTOR_OFFSET_FAT1216_VOLUMELABEL); stmBootSector.WriteString(newBootSector.FATFilesystemType, BOOTSECTOR_LENGTH_FAT1216_FATFSTYPE, BOOTSECTOR_OFFSET_FAT1216_FATFSTYPE); end; // ------------ // Parse the FAT32 extended BIOS parameter block, if FAT32... if (newBootSector.FATType = ftFAT32) then begin // SectorsPerFAT stored in different location for FAT32 stmBootSector.WriteWORD_LE(0, BOOTSECTOR_OFFSET_SECTORSPERFAT); stmBootSector.WriteDWORD_LE(newBootSector.SectorsPerFAT, BOOTSECTOR_OFFSET_FAT32_SECTORSPERFAT); stmBootSector.WriteWORD_LE(newBootSector.FATFlags, BOOTSECTOR_OFFSET_FAT32_FATFLAGS); stmBootSector.WriteWORD_LE(newBootSector.Version, BOOTSECTOR_OFFSET_FAT32_VERSION); stmBootSector.WriteDWORD_LE(newBootSector.RootDirFirstCluster, BOOTSECTOR_OFFSET_FAT32_CLUSTERNOROOTDIRSTART); stmBootSector.WriteWORD_LE(newBootSector.SectorNoFSInfoSector, BOOTSECTOR_OFFSET_FAT32_SECTORNOFSINFOSECTOR); stmBootSector.WriteWORD_LE(newBootSector.SectorNoBootSectorCopy, BOOTSECTOR_OFFSET_FAT32_SECTORNOBOOTSECTORCOPY); stmBootSector.WriteByte(newBootSector.PhysicalDriveNo, BOOTSECTOR_OFFSET_FAT32_PHYSICALDRIVENO); stmBootSector.WriteByte(newBootSector.ExtendedBootSig, BOOTSECTOR_OFFSET_FAT32_EXTENDEDBOOTSIG); stmBootSector.WriteDWORD_LE(newBootSector.SerialNumber, BOOTSECTOR_OFFSET_FAT32_SERIALNUMBER); stmBootSector.WriteString(newBootSector.VolumeLabel, BOOTSECTOR_LENGTH_FAT32_VOLUMELABEL, BOOTSECTOR_OFFSET_FAT32_VOLUMELABEL); stmBootSector.WriteString(newBootSector.FATFilesystemType, BOOTSECTOR_LENGTH_FAT32_FATFSTYPE, BOOTSECTOR_OFFSET_FAT32_FATFSTYPE); end; stmBootSector.WriteWORD_LE(newBootSector.BootSectorSig, BOOTSECTOR_OFFSET_BOOTSECTORSIG); end; if Result then begin try stmBootSector.Position := 0; PartitionImage.WriteSector(0, stmBootSector); except // Problem... on E: Exception do begin Result := False; end; end; end; finally stmBootSector.Free(); end; finally FSerializeCS.Release(); end; end; function TSDFilesystem_FAT.ReadFAT(fatNo: DWORD): Boolean; begin FreeCachedFAT(); FFAT := TSDUMemoryStream.Create(); Result := ReadFAT(fatNo, FFAT); if not (Result) then begin FreeCachedFAT(); end; end; function TSDFilesystem_FAT.WriteFAT(fatNo: DWORD): Boolean; begin if ReadOnly then begin Result := False; end else begin FFAT.Position := 0; Result := WriteFAT(fatNo, FFAT); end; end; function TSDFilesystem_FAT.WriteFATToAllCopies(): Boolean; var i: Integer; begin Result := True; for i := 1 to FATCount do begin if not (WriteFAT(i)) then begin Result := False; end; end; end; function TSDFilesystem_FAT.ReadFAT(fatNo: DWORD; stmFAT: TSDUMemoryStream): Boolean; var FATStartSectorID: DWORD; i: DWORD; begin // Sanity checking Assert( (stmFAT <> nil), 'No stream passed into ReadFAT' ); Assert( ((fatNo >= 1) and (fatNo <= FATCount)), 'FAT number must be 1 <= x <= ' + IntToStr(FATCount) + ' when reading FAT' ); Result := True; FATStartSectorID := ReservedSectorCount + ((fatNo - 1) * SectorsPerFAT); for i := 0 to (SectorsPerFAT - 1) do begin Result := PartitionImage.ReadSector((FATStartSectorID + i), stmFAT); if not (Result) then begin break; end; end; end; function TSDFilesystem_FAT.WriteFAT(fatNo: DWORD; stmFAT: TSDUMemoryStream): Boolean; var FATStartSectorID: DWORD; begin // Sanity checking Assert( (stmFAT <> nil), 'No stream passed into WriteFAT' ); Assert( ((fatNo >= 1) and (fatNo <= FATCount)), 'FAT number must be 1 <= x <= ' + IntToStr(FATCount) + ' when writing FAT' ); FATStartSectorID := ReservedSectorCount + ((fatNo - 1) * SectorsPerFAT); Result := PartitionImage.WriteConsecutiveSectors(FATStartSectorID, stmFAT, (SectorsPerFAT * BytesPerSector)); end; function TSDFilesystem_FAT.ExtractClusterChain(clusterID: DWORD): TSDFATClusterChain; var chainLength: DWORD; begin // Determine chain length SetLength(Result, 0); chainLength := _TraverseClusterChain(clusterID, Result); // Get chain if (chainLength > 0) then begin SetLength(Result, chainLength); _TraverseClusterChain(clusterID, Result); end; end; function TSDFilesystem_FAT.StoreClusterChain(chain: TSDFATClusterChain): Boolean; var i: Integer; nextCluster: DWORD; begin Result := True; // Special case - cluster zero on a FAT12/FAT16 is the root dir. // In this case, just return a single "cluster" with that cluster ID if (((FATType = ftFAT12) or (FATType = ftFAT16)) and IsClusterInChain(CLUSTER_ZERO, chain)) then begin // Do nothing - root dir doesn't have a cluster chain, it's outside the // data area end else begin // Replace any references of clusterID 0 to cluster ID root dir cluster ID for i := low(chain) to high(chain) do begin if (chain[i] = CLUSTER_ZERO) then begin chain[i] := RootDirFirstCluster; end; end; // Update the FAT to store the chain for i := low(chain) to high(chain) do begin if (i < high(chain)) then begin nextCluster := chain[i + 1]; end else begin nextCluster := FFATEntryEOCEnd; end; Result := SetFATEntry(chain[i], nextCluster); if not (Result) then begin break; end; end; end; end; // Copy all data from one cluster chain to another function TSDFilesystem_FAT.CopyClusterChainData(srcChain: TSDFATClusterChain; destChain: TSDFATClusterChain): Boolean; var i: Integer; tmpData: TSDUMemoryStream; begin Result := True; // Sanity check both cluster chains are the same length if Result then begin Result := (length(srcChain) = length(destChain)); end; if Result then begin tmpData := TSDUMemoryStream.Create(); try // For each cluster in the chain... for i := low(srcChain) to high(srcChain) do begin // Read in the src cluster... tmpData.Position := 0; Result := ExtractClusterData(srcChain[i], tmpData); if Result then begin // ...and write it out to the dest cluster tmpData.Position := 0; Result := StoreClusterData(destChain[i], tmpData); end; if not (Result) then begin break; end; end; finally tmpData.Free(); end; end; end; function TSDFilesystem_FAT.GetFATEntry(clusterID: DWORD): DWORD; begin FSerializeCS.Acquire(); try if (FATType = ftFAT12) then begin Result := GetFATEntry_FAT12(clusterID); end else begin Result := GetFATEntry_FAT1632(clusterID); end; finally FSerializeCS.Release(); end; end; function TSDFilesystem_FAT.GetFATEntry_FAT12(clusterID: DWORD): DWORD; var tmpDouble: Double; begin tmpDouble := clusterID * FAT12_ENTRY_SIZE; FFAT.Position := trunc(tmpDouble); Result := FFAT.ReadWORD_LE(); if SDUIsOddNumber(clusterID) then begin Result := Result shr 4; end else begin Result := (Result and FFATEntryMask); end; end; function TSDFilesystem_FAT.GetFATEntry_FAT1632(clusterID: DWORD): DWORD; var multiplier: DWORD; i: DWORD; tmpByte: Byte; begin Result := 0; // FAT entries are stored LSB first // Note: Length of FAT entries VARIES with FAT12/FAT16/FAT32! multiplier := 1; FFAT.Position := (clusterID * FFATEntrySize); for i := 1 to FFATEntrySize do begin tmpByte := FFAT.ReadByte; Result := Result + (tmpByte * multiplier); multiplier := multiplier * $100; end; end; function TSDFilesystem_FAT.MaxClusterID(): DWORD; var FATSizeInBytes: DWORD; maxClustersInFAT: DWORD; begin // Implemented as failsafe - not sure if FAT size or physical partition // size should drive this?! // Calculated max number of entries in the FAT FATSizeInBytes := SectorsPerFAT * BytesPerSector; maxClustersInFAT := 0; case FATType of ftFAT12: begin maxClustersInFAT := trunc(FATSizeInBytes / FAT12_ENTRY_SIZE); end; ftFAT16: begin maxClustersInFAT := (FATSizeInBytes div FAT16_ENTRY_SIZE); end; ftFAT32: begin maxClustersInFAT := (FATSizeInBytes div FAT32_ENTRY_SIZE); end; end; // First two FAT entries are reserved maxClustersInFAT := (maxClustersInFAT - CLUSTER_FIRST_DATA_CLUSTER); Result := min( // Calculated max number of clusters in the data area (SectorsInDataArea() div SectorsPerCluster), maxClustersInFAT); end; function TSDFilesystem_FAT.SectorsInDataArea(): DWORD; var sectorsBeforeDataArea: DWORD; begin if ((FATType = ftFAT12) or (FATType = ftFAT16)) then begin sectorsBeforeDataArea := ReservedSectorCount + // Reserved sectors (FATCount * SectorsPerFAT) + // FATs ((MaxRootEntries * DIR_ENTRY_SIZE) div BytesPerSector); // Root directory end else begin sectorsBeforeDataArea := ReservedSectorCount + // Reserved sectors (FATCount * SectorsPerFAT); // FATs end; Result := (TotalSectors - sectorsBeforeDataArea); // The number of sectors in the data area end; function TSDFilesystem_FAT.ClusterSize(): Int64; var tmpInt64_A: Int64; tmpInt64_B: Int64; begin tmpInt64_A := SectorsPerCluster; tmpInt64_B := BytesPerSector; Result := (tmpInt64_A * tmpInt64_B); end; // Get the next empty FAT entry (cluster ID). // afterClusterID - If nonzero, get the next free cluster ID after the // specified cluster ID // Returns ERROR_DWORD on failure/if there are no free FAT entries function TSDFilesystem_FAT.GetNextEmptyFATEntry(afterClusterID: DWORD = 0): DWORD; var maskedFATEntry: DWORD; i: DWORD; begin Result := ERROR_DWORD; if (afterClusterID < FFATEntryUsedStart) then begin afterClusterID := FFATEntryUsedStart; end; for i := (afterClusterID + 1) to MaxClusterID() do begin maskedFATEntry := GetFATEntry(i) and FFATEntryMask; if (maskedFATEntry = FFATEntryFree) then begin Result := i; break; end; end; end; // Mark the next empty FAT entry as reservced/mark it as empty // Returns function TSDFilesystem_FAT.ReserveFATEntry(afterClusterID: DWORD = 0): DWORD; begin Result := GetNextEmptyFATEntry(afterClusterID); if (Result <> ERROR_DWORD) then begin SetFATEntry(Result, FFATEntryEOCEnd); end; end; procedure TSDFilesystem_FAT.UnreserveFATEntry(clusterID: DWORD); begin if (clusterID <> ERROR_DWORD) then begin SetFATEntry(clusterID, FFATEntryFree); end; end; function TSDFilesystem_FAT.CountEmptyFATEntries(): DWORD; var maskedFATEntry: DWORD; i: DWORD; begin Result := 0; for i := FFATEntryUsedStart to MaxClusterID() do begin maskedFATEntry := GetFATEntry(i) and FFATEntryMask; if (maskedFATEntry = FFATEntryFree) then begin Inc(Result); end; end; end; function TSDFilesystem_FAT.SetFATEntry(clusterID: DWORD; Value: DWORD): Boolean; begin FSerializeCS.Acquire(); try if (FATType = ftFAT12) then begin Result := SetFATEntry_FAT12(clusterID, Value); end else begin Result := SetFATEntry_FAT1632(clusterID, Value); end; finally FSerializeCS.Release(); end; end; function TSDFilesystem_FAT.SetFATEntry_FAT12(clusterID: DWORD; Value: DWORD): Boolean; var tmpDouble: Double; prevWord: Word; newWord: Word; begin Result := True; tmpDouble := clusterID * FAT12_ENTRY_SIZE; FFAT.Position := trunc(tmpDouble); prevWord := FFAT.ReadWORD_LE(); if SDUIsOddNumber(clusterID) then begin newWord := ((Value and FFATEntryMask) shl 4) + (prevWord and $0F); end else begin newWord := (Value and FFATEntryMask) + (prevWord and $F000); end; FFAT.Position := trunc(tmpDouble); FFAT.WriteWORD_LE(newWord); end; function TSDFilesystem_FAT.SetFATEntry_FAT1632(clusterID: DWORD; Value: DWORD): Boolean; var i: DWORD; begin Result := True; // FAT entries are stored LSB first // Note: Length of FAT entries VARIES with FAT12/FAT16/FAT32! FFAT.Position := (clusterID * FFATEntrySize); for i := 0 to (FFATEntrySize - 1) do begin FFAT.WriteByte(Value and $FF); Value := Value shr 8; end; end; // Traverse cluster chain, populating *pre-sized* chain // If the length of "chain" is zero, it won't be populated // Returns: The number of clusters in the chain function TSDFilesystem_FAT._TraverseClusterChain(clusterID: DWORD; var chain: TSDFATClusterChain): DWORD; var maskedFATEntry: DWORD; currClusterID: DWORD; finished: Boolean; writeChain: Boolean; begin Result := 0; writeChain := (length(chain) > 0); // Special case - cluster zero on a FAT12/FAT16 is the root dir. // In this case, just return a single "cluster" with that cluster ID if (((FATType = ftFAT12) or (FATType = ftFAT16)) and (clusterID = CLUSTER_ZERO)) then begin if writeChain then begin chain[0] := CLUSTER_ZERO; end; Result := 1; // Single "cluster" end else begin // NOTE: If FAT32, we don't translate cluster 0 to the root cluster here; // that's catered for in the read/write cluster functions finished := False; currClusterID := clusterID; while not (finished) do begin maskedFATEntry := GetFATEntry(currClusterID) and FFATEntryMask; if ((maskedFATEntry >= FFATEntryUsedStart) and (maskedFATEntry <= FFATEntryUsedEnd)) then begin // Include this one if writeChain then begin chain[Result] := currClusterID; end; Inc(Result); currClusterID := maskedFATEntry; end else if ((maskedFATEntry >= FFATEntryEOCStart) and (maskedFATEntry <= FFATEntryEOCEnd)) then begin // Include this one if writeChain then begin chain[Result] := currClusterID; end; Inc(Result); // Finished. finished := True; end else if (maskedFATEntry = FFATEntryFree) then begin // This shouldn't happen - shouldn't normally be calling this routine // with free FAT cluster IDs finished := True; end else if (maskedFATEntry = FFATEntryBadSector) then begin // Uh oh! // Effectivly just truncate at this point... finished := True; end; end; end; end; // Extract the data for a single, specified, cluster function TSDFilesystem_FAT.ExtractClusterData(clusterID: DWORD; data: TStream; maxSize: Integer = -1): Boolean; begin Result := ReadWriteClusterData(True, clusterID, data, maxSize); end; // NOTE: This writes starting from current position in "data" function TSDFilesystem_FAT.StoreClusterData(clusterID: DWORD; data: TStream; maxSize: Integer = -1): Boolean; var maxDataSize: Int64; begin // Sanity check... AssertSufficientData(data, maxSize); if (maxSize < 0) then begin maxDataSize := (data.Size - data.Position); if (((FATType = ftFAT12) or (FATType = ftFAT16)) and (clusterID = CLUSTER_ZERO)) then begin // Don't worry about max size - checked at point it writes the root dir end else begin maxSize := min(ClusterSize(), maxDataSize); end; end; Result := ReadWriteClusterData(False, clusterID, data, maxSize); end; function TSDFilesystem_FAT.ReadWriteClusterData(readNotWrite: Boolean; clusterID: DWORD; data: TStream; maxSize: Integer): Boolean; begin // Special case - FAT12/FAT16 root directory if (((FATType = ftFAT12) or (FATType = ftFAT16)) and (clusterID = CLUSTER_ZERO)) then begin Result := ReadWriteFAT1216RootDir(readNotWrite, data); end else begin Result := _ReadWriteClusterData(readNotWrite, clusterID, data, maxSize); end; end; function TSDFilesystem_FAT._ReadWriteClusterData(readNotWrite: Boolean; clusterID: DWORD; data: TStream; maxSize: Integer): Boolean; var startSectorID: DWORD; bytesRemaining: Integer; sectorMax: Integer; tmpInt64: Int64; begin // Sanity check... if not (readNotWrite) then begin AssertSufficientData(data, maxSize); end; bytesRemaining := maxSize; if (bytesRemaining < 0) then begin if readNotWrite then begin // Set the number of bytes remaining to the total number of bytes in the // cluster (we process the entire cluster) bytesRemaining := SectorsPerCluster * BytesPerSector; end else begin tmpInt64 := (data.Size - data.Position); bytesRemaining := min((SectorsPerCluster * BytesPerSector), tmpInt64); end; end; startSectorID := SectorIDForCluster(clusterID); sectorMax := min(bytesRemaining, (BytesPerSector * SectorsPerCluster)); if readNotWrite then begin Result := PartitionImage.ReadConsecutiveSectors(startSectorID, data, sectorMax); end else begin Result := PartitionImage.WriteConsecutiveSectors(startSectorID, data, sectorMax); end; bytesRemaining := bytesRemaining - sectorMax; if Result then begin Result := (bytesRemaining = 0); end; end; function TSDFilesystem_FAT.ExtractClusterChainData(clusterID: DWORD; data: TStream; maxSize: Int64 = -1): Boolean; var chain: TSDFATClusterChain; begin chain := ExtractClusterChain(clusterID); Result := ExtractClusterChainData(chain, data, maxSize); end; function TSDFilesystem_FAT.ExtractClusterChainData(chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; var bytesToProcess: Int64; begin bytesToProcess := maxSize; // Special case - FAT12/FAT16 root directory if (((FATType = ftFAT12) or (FATType = ftFAT16)) and IsClusterInChain(CLUSTER_ZERO, chain)) then begin // bytesToProcess already set to maxSize end else begin if (bytesToProcess < 0) then begin bytesToProcess := ClusterSize() * Int64(length(chain)); end; end; Result := ReadWriteClusterChainData(True, chain, data, bytesToProcess); end; function TSDFilesystem_FAT.StoreClusterChainData(chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; var bytesToProcess: Int64; maxDataSize: Int64; maxChainSize: Int64; begin // Sanity check... AssertSufficientData(data, maxSize); bytesToProcess := maxSize; maxDataSize := (data.Size - data.Position); // Special case - FAT12/FAT16 root directory if (((FATType = ftFAT12) or (FATType = ftFAT16)) and IsClusterInChain(CLUSTER_ZERO, chain)) then begin // Don't worry about max maxChainSize - checked at point it writes the root dir end else begin maxChainSize := ClusterSize() * Int64(length(chain)); if (bytesToProcess < 0) then begin bytesToProcess := min(maxDataSize, maxChainSize); end; Assert( (bytesToProcess <= maxChainSize), 'StoreClusterChainData(...) call attempts to store more data than the cluster chain supplied can hold' ); end; // Sanity check... Assert( (bytesToProcess <= maxDataSize), 'StoreClusterChainData(...) call attempts to store more data than supplied' ); Result := ReadWriteClusterChainData(False, chain, data, bytesToProcess); end; // Calculate based on size of "maxSize". If that's set to a -ve value, fallback // to calculating based on the size of "data" function TSDFilesystem_FAT.DetermineClustersNeeded(data: TStream; maxSize: Int64 = -1): DWORD; var maxDataSize: Int64; tmpInt64: Int64; // Used to prevent Delphi casting incorrectly useSize: Int64; begin maxDataSize := 0; if (data <> nil) then begin maxDataSize := (data.Size - data.Position); end; useSize := maxDataSize; if (maxSize >= 0) then begin useSize := maxSize; end; tmpInt64 := (useSize div ClusterSize()); Result := tmpInt64; tmpInt64 := (useSize mod ClusterSize()); if (tmpInt64 <> 0) then begin Inc(Result); end; end; // Truncate/extend chain as appropriate such that it can store the data // specified // unusedChain - If "chain" passed in is truncated, this will be set to the // unused clusters in the chain function TSDFilesystem_FAT.AllocateChainForData(var chain: TSDFATClusterChain; var unusedChain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; var clustersNeeded: DWORD; origChainLength: DWORD; newChain: TSDFATClusterChain; lastAllocCluster: DWORD; nextFreeCluster: DWORD; i: DWORD; begin Result := True; origChainLength := length(chain); clustersNeeded := DetermineClustersNeeded(data, maxSize); // Setup new chain and unused portion of chain... SetLength(newChain, clustersNeeded); SetLength(unusedChain, 0); // Copy from original chain as must as we can, and need... for i := 1 to min(clustersNeeded, origChainLength) do begin newChain[i - 1] := chain[i - 1]; end; // Store any unused portion of the original chain... if (origChainLength > clustersNeeded) then begin SetLength(unusedChain, (origChainLength - clustersNeeded)); for i := 1 to (origChainLength - clustersNeeded) do begin unusedChain[i - 1] := chain[clustersNeeded + i - 1]; end; end // Extend chain passed in... else if (clustersNeeded > origChainLength) then begin // Extend chain, if needed lastAllocCluster := 0; for i := 1 to (clustersNeeded - origChainLength) do begin nextFreeCluster := GetNextEmptyFATEntry(lastAllocCluster); if (nextFreeCluster = ERROR_DWORD) then begin // Unable to extend... Result := False; break; end; newChain[origChainLength + i - 1] := nextFreeCluster; lastAllocCluster := nextFreeCluster; end; end; if Result then begin chain := newChain; end; end; function TSDFilesystem_FAT.ReadWriteClusterChainData(readNotWrite: Boolean; chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; begin // Special case - FAT12/FAT16 root directory if (((FATType = ftFAT12) or (FATType = ftFAT16)) and IsClusterInChain(CLUSTER_ZERO, chain)) then begin Result := ReadWriteFAT1216RootDir(readNotWrite, data); end else begin Result := _ReadWriteClusterChainData(readNotWrite, chain, data, maxSize); end; end; function TSDFilesystem_FAT._ReadWriteClusterChainData(readNotWrite: Boolean; chain: TSDFATClusterChain; data: TStream; maxSize: Int64 = -1): Boolean; var i: Integer; useClusterSize: Int64; bytesRemaining: Int64; begin // Sanity check... if not (readNotWrite) then begin AssertSufficientData(data, maxSize); end; Result := True; bytesRemaining := maxSize; if (bytesRemaining < 0) then begin if readNotWrite then begin bytesRemaining := SectorsPerCluster; bytesRemaining := bytesRemaining * BytesPerSector; bytesRemaining := bytesRemaining * length(Chain); end else begin bytesRemaining := (data.Size - data.Position); end; end; for i := low(chain) to high(chain) do begin useClusterSize := min(bytesRemaining, ClusterSize()); if readNotWrite then begin Result := ExtractClusterData(chain[i], data, useClusterSize); end else begin Result := StoreClusterData(chain[i], data, useClusterSize); end; if not (Result) then begin break; end; bytesRemaining := bytesRemaining - useClusterSize; // If we can exit early... if (bytesRemaining <= 0) then begin break; end; end; if Result then begin Result := (bytesRemaining = 0); end; end; function TSDFilesystem_FAT.ExtractClusterChainData(clusterID: DWORD; filename: String; maxSize: Int64 = -1): Boolean; var fileStream: TFileStream; begin fileStream := TFileStream.Create(filename, fmCreate); try Result := ExtractClusterChainData(clusterID, fileStream, maxSize); finally fileStream.Free(); end; end; // Note: TTimeStamp includes a datestamp function TSDFilesystem_FAT.WORDToTTimeStamp(dateBitmask: Word; timeBitmask: Word; msec: Byte): TTimeStamp; var dd: Integer; mm: Integer; yyyy: Integer; hh: Integer; mi: Integer; ss: Integer; begin dd := (dateBitmask and $1F); mm := ((dateBitmask and $1E0) shr 5); yyyy := 1980 + ((dateBitmask and $FE00) shr 9); ss := ((timeBitmask and $1F) * 2); mi := ((timeBitmask and $7E0) shr 5); hh := ((timeBitmask and $F800) shr 11); try Result := DateTimeToTimeStamp(EncodeDateTime(yyyy, mm, dd, hh, mi, ss, msec)); except on EConvertError do begin // Dud date/timestamp Result.Date := 0; Result.Time := 0; end; end; end; procedure TSDFilesystem_FAT.TTimeStampToWORD(timeStamp: TTimeStamp; var dateBitmask: Word; var timeBitmask: Word; var msec: Byte); var dd: Word; mm: Word; yyyy: Word; hh: Word; mi: Word; ss: Word; tmpMsec: Word; begin try DecodeDateTime( TimeStampToDateTime(timeStamp), yyyy, mm, dd, hh, mi, ss, tmpMsec ); yyyy := yyyy - 1980; dateBitmask := dd + (mm shl 5) + (yyyy shl 9); timeBitmask := (ss div 2) + (mi shl 5) + (hh shl 11); msec := tmpMsec except on EConvertError do begin // Dud date/timestamp dateBitmask := 0; timeBitmask := 0; msec := 0; end; end; end; function TSDFilesystem_FAT.WORDToTDate(dateBitmask: Word): TDate; var dd: Integer; mm: Integer; yyyy: Integer; begin dd := (dateBitmask and $1F); mm := ((dateBitmask and $1E0) shr 5); yyyy := 1980 + ((dateBitmask and $FE00) shr 9); try Result := EncodeDate(yyyy, mm, dd); except on EConvertError do // Dud date/timestamp Result := 0; end; end; function TSDFilesystem_FAT.TDateToWORD(date: TDate): Word; var dd: Word; mm: Word; yyyy: Word; begin try DecodeDate(date, yyyy, mm, dd); yyyy := yyyy - 1980; Result := dd + (mm shl 5) + (yyyy shl 9); except on EConvertError do // Dud date/timestamp Result := 0; end; end; function TSDFilesystem_FAT.ParseDirectory(data: TSDUMemoryStream; var dirContent: TSDDirItemList): Boolean; var currItem: TSDDirItem_FAT; sfnFilename: String; sfnFileExt: String; recordOffset: Int64; clusterHi: DWORD; clusterLo: DWORD; currAttributes: DWORD; lfn: WideString; lfnPart: WideString; lfnChkSum: Byte; currChkSum: Byte; seqNo: DWORD; caseByte: Byte; begin Result := True; lfn := ''; lfnChkSum := 0; recordOffset := 0; while (recordOffset < data.Size) do begin sfnFilename := data.ReadString(DIR_ENTRY_LENGTH_DOSFILENAME, (recordOffset + DIR_ENTRY_OFFSET_DOSFILENAME)); // Skip free if (Ord(sfnFilename[1]) = DIR_ENTRY_UNUSED) then begin lfnChkSum := 0; lfn := ''; recordOffset := recordOffset + DIR_ENTRY_SIZE; continue; end; // Skip unused if (Ord(sfnFilename[1]) = DIR_ENTRY_DELETED) then begin lfnChkSum := 0; lfn := ''; recordOffset := recordOffset + DIR_ENTRY_SIZE; continue; end; currAttributes := data.ReadByte(recordOffset + DIR_ENTRY_OFFSET_FILEATTRS); if ((currAttributes and VFAT_ATTRIB_VFAT_ENTRY) = VFAT_ATTRIB_VFAT_ENTRY) then begin seqNo := data.ReadByte(recordOffset + DIR_ENTRY_OFFSET_VFAT_SEQ_NO); currChkSum := data.ReadByte(recordOffset + DIR_ENTRY_OFFSET_VFAT_CHECKSUM); if ((seqNo and DIR_ENTRY_VFAT_LAST_LONG_ENTRY) = DIR_ENTRY_VFAT_LAST_LONG_ENTRY) then begin // Next line commented out to prevent compiler error // seqNo := seqNo and not(DIR_ENTRY_VFAT_LAST_LONG_ENTRY); lfnChkSum := currChkSum; lfn := ''; end; // Sanity check if (lfnChkSum <> currChkSum) then begin //lplp - handle - REJECT end; lfnPart := data.ReadWideString(10, (recordOffset + DIR_ENTRY_OFFSET_VFAT_NAME_PART_1)); lfnPart := lfnPart + data.ReadWideString(12, (recordOffset + DIR_ENTRY_OFFSET_VFAT_NAME_PART_2)); lfnPart := lfnPart + data.ReadWideString( 4, (recordOffset + DIR_ENTRY_OFFSET_VFAT_NAME_PART_3)); lfn := lfnPart + lfn; //showmessage('LFN CHECKSUM:'+SDUCRLF+inttostr(data.ReadByte((recordOffset+DIR_ENTRY_OFFSET_VFAT_CHECKSUM)))); end else begin currItem := TSDDirItem_FAT.Create(); sfnFilename := trim(sfnFilename); sfnFileExt := trim(data.ReadString(3, (recordOffset + DIR_ENTRY_OFFSET_DOSEXTENSION))); currItem.FilenameDOS := sfnFilename; if (sfnFileExt <> '') then begin currItem.FilenameDOS := currItem.FilenameDOS + '.' + sfnFileExt; end; //showmessage('CHECKSUM:'+SDUCRLF+currItem.FilenameDOS+SDUCRLF+inttostr(DOSFilenameCheckSum(currItem.FilenameDOS))); // Only use the first chars up to (WideChar) #0 lfn := Copy(lfn, 1, SDUWStrLen(PWideChar(lfn))); currItem.Filename := lfn; if ((currItem.Filename = '') or (DOSFilenameCheckSum(currItem.FilenameDOS) <> lfnChkSum) // Abandon any LFN if it's checksum fails ) then begin caseByte := data.ReadByte(recordOffset + DIR_ENTRY_OFFSET_RESERVED); if ((caseByte and DIR_ENTRY_83CASE_BASENAME) = DIR_ENTRY_83CASE_BASENAME) then begin sfnFilename := lowercase(sfnFilename); end; if ((caseByte and DIR_ENTRY_83CASE_EXTN) = DIR_ENTRY_83CASE_EXTN) then begin sfnFileExt := lowercase(sfnFileExt); end; currItem.Filename := sfnFilename; if (sfnFileExt <> '') then begin currItem.Filename := currItem.Filename + '.' + sfnFileExt; end; end; currItem.Attributes := currAttributes; currItem.TimestampCreation := WORDToTTimeStamp(data.ReadWORD_LE(recordOffset + DIR_ENTRY_OFFSET_CREATEDATE), data.ReadWORD_LE(recordOffset + DIR_ENTRY_OFFSET_CREATETIME), data.ReadByte(recordOffset + DIR_ENTRY_OFFSET_CREATETIMEFINE)); currItem.DatestampLastAccess := WORDToTDate(data.ReadWORD_LE(recordOffset + DIR_ENTRY_OFFSET_LASTACCESSDATE)); currItem.TimestampLastModified := WORDToTTimeStamp(data.ReadWORD_LE(recordOffset + DIR_ENTRY_OFFSET_LASTMODDATE), data.ReadWORD_LE(recordOffset + DIR_ENTRY_OFFSET_LASTMODTIME), 0); clusterLo := data.ReadWORD_LE(recordOffset + DIR_ENTRY_OFFSET_FIRSTCLUSTERLO); clusterHi := 0; if (FATType = ftFAT32) then begin clusterHi := data.ReadWORD_LE(recordOffset + DIR_ENTRY_OFFSET_EAINDEX); end; currItem.FirstCluster := (clusterHi shl 16) + clusterLo; currItem.Size := data.ReadDWORD_LE(recordOffset + DIR_ENTRY_OFFSET_FILESIZE); dirContent.Add(currItem); lfn := ''; lfnChkSum := 0; end; recordOffset := recordOffset + DIR_ENTRY_SIZE; end; end; function TSDFilesystem_FAT.SectorIDForCluster(clusterID: DWORD): DWORD; begin if ((FATType = ftFAT12) or (FATType = ftFAT16)) then begin if (clusterID = CLUSTER_ZERO) then begin // FAT12/FAT16 - should never want sector ID for cluster zero; this // cluster refers to the root dir, which should be accessed via // ReadWriteFAT1216RootDir(...) Assert( (1 = 2), 'SectorIDForCluster(...) called for FAT12/FAT16 volume with CLUSTER_ZERO' ); Result := 0; // Ger rid of compiler error end else begin // -2 (CLUSTER_FIRST_DATA_CLUSTER) because the 2nd cluster is the zero'th // cluster from the start of the data beyond the FATs; clusters 0 and 1 // are "skipped" Result := ReservedSectorCount + // Reserved sectors (FATCount * SectorsPerFAT) + // FATs ((MaxRootEntries * DIR_ENTRY_SIZE) div BytesPerSector) + // Root directory (SectorsPerCluster * (clusterID - CLUSTER_FIRST_DATA_CLUSTER)); // Cluster required end; end else begin // Subdirs off the root dir still use first cluster 0 (zero) for ".."; // adjust this to be the root dir first cluster if (clusterID = 0) then begin clusterID := RootDirFirstCluster; end; // -2 because the 2nd cluster is the zero'th cluster from the start of // the data beyond the FATs; clusters 0 and 1 are "skipped" Result := ReservedSectorCount + // Reserved sectors (FATCount * SectorsPerFAT) + // FATs (SectorsPerCluster * (clusterID - CLUSTER_FIRST_DATA_CLUSTER)); // Cluster required end; end; function TSDFilesystem_FAT.LoadContentsFromDisk(path: String; items: TSDDirItemList): Boolean; var startClusterID: DWORD; begin Result := False; startClusterID := GetStartingClusterForItem(path); if (startClusterID <> ERROR_DWORD) then begin Result := _LoadContentsFromDisk(startClusterID, items); if not (Result) then begin LastErrorSet(SDUParamSubstitute(_('Unable to read contents of: %1'), [path])); end; end; end; function TSDFilesystem_FAT._LoadContentsFromDisk(dirStartCluster: DWORD; items: TSDDirItemList): Boolean; var ms: TSDUMemoryStream; begin AssertMounted(); Result := False; ms := TSDUMemoryStream.Create(); try ms.Position := 0; if ExtractClusterChainData(dirStartCluster, ms) then begin ms.Position := 0; Result := ParseDirectory(ms, items); end; finally ms.Free(); end; end; // Returns ERROR_DWORD on failure function TSDFilesystem_FAT.GetStartingClusterForItem(path: WideString): DWORD; var item: TSDDirItem_FAT; begin Result := ERROR_DWORD; item := TSDDirItem_FAT.Create(); try if GetItem_FAT(path, item) then begin Result := item.FirstCluster; end; finally item.Free(); end; end; function TSDFilesystem_FAT.GetRootDirItem(item: TSDDirItem_FAT): Boolean; begin inherited; item.Filename := PATH_SEPARATOR; item.FilenameDOS := PATH_SEPARATOR; item.Attributes := VFAT_ATTRIB_FLAG_SUBDIR; item.TimestampCreation.Date := 0; item.TimestampCreation.Time := 0; item.DatestampLastAccess := 0; item.TimestampLastModified := item.TimestampCreation; item.FirstCluster := RootDirFirstCluster; // Note: This will be 0 (zero) for // FAT12/FAT16. The actual cluster // ID for FAT32 item.Size := 0; Result := True; end; function TSDFilesystem_FAT.GetItem(path: WideString; item: TSDDirItem): Boolean; var tmpItem: TSDDirItem_FAT; begin tmpItem := TSDDirItem_FAT.Create(); try Result := GetItem_FAT(path, tmpItem); if Result then begin item.Assign(tmpItem); end; finally tmpItem.Free(); end; end; // Returns ERROR_DWORD on failure function TSDFilesystem_FAT.GetItem_FAT(path: WideString; item: TSDDirItem_FAT): Boolean; var dirContent: TSDDirItemList; foundPathPart: Boolean; nextPathPart: WideString; pathRemaining: WideString; nextCluster: DWORD; i: Integer; dirData: TSDUMemoryStream; begin // Sanity check... if (path = '') then begin Result := False; exit; end; // Normalize by ensuring path is prefixed with a "\" if path[1] <> PATH_SEPARATOR then begin path := PATH_SEPARATOR + path; end; dirData := TSDUMemoryStream.Create(); try dirData.SetSize(0); dirData.Position := 0; // Take out the leading "\"; setting nextCluster to the 1st cluster of the root // dir SDUSplitWideString(path, nextPathPart, pathRemaining, PATH_SEPARATOR); GetRootDirItem(item); nextCluster := item.FirstCluster; ExtractClusterChainData(nextCluster, dirData); dirContent := TSDDirItemList.Create(); try ParseDirectory(dirData, dirContent); while ((pathRemaining <> '') and (nextCluster <> ERROR_DWORD)) do begin foundPathPart := False; SDUSplitWideString(pathRemaining, nextPathPart, pathRemaining, PATH_SEPARATOR); for i := 0 to (dirContent.Count - 1) do begin if (uppercase(dirContent[i].Filename) = uppercase(nextPathPart)) then begin // Ignore volume labels and devices; skip to next dir entry if (((TSDDirItem_FAT(dirContent[i]).Attributes and VFAT_ATTRIB_FLAG_VOLLABEL) = VFAT_ATTRIB_FLAG_VOLLABEL) or ((TSDDirItem_FAT(dirContent[i]).Attributes and VFAT_ATTRIB_FLAG_DEVICE) = VFAT_ATTRIB_FLAG_DEVICE)) then begin continue; end else begin foundPathPart := True; item.Assign(TSDDirItem_FAT(dirContent[i])); nextCluster := item.FirstCluster; // Found what we were looking for; just break out if (pathRemaining = '') then begin break; end else begin if TSDDirItem_FAT(dirContent[i]).IsDirectory then begin // Setup for the next dir... dirData.SetSize(0); dirData.Position := 0; ExtractClusterChainData(nextCluster, dirData); dirContent.Free(); dirContent := TSDDirItemList.Create(); ParseDirectory(dirData, dirContent); break; end else begin // Problem - path segment matches file (or non-dir), but there's // more on the path nextCluster := ERROR_DWORD; break; end; end; end; end; end; // Unable to locate... if not (foundPathPart) then begin nextCluster := ERROR_DWORD; break; end; end; finally dirContent.Free(); end; finally dirData.Free(); end; Result := (nextCluster <> ERROR_DWORD); end; function TSDFilesystem_FAT.GetItemContent(path: WideString; content: TStream): Boolean; var item: TSDDirItem_FAT; begin Result := False; item := TSDDirItem_FAT.Create(); try if GetItem_FAT(path, item) then begin ExtractClusterChainData(item.FirstCluster, content); Result := True; end; finally item.Free(); end; end; function TSDFilesystem_FAT.GetFileContent(path: WideString; fileContent: TStream): Boolean; var item: TSDDirItem_FAT; begin Result := False; item := TSDDirItem_FAT.Create(); try if GetItem_FAT(path, item) then begin if (item.Size <> 0) then begin ExtractClusterChainData(item.FirstCluster, fileContent, item.Size); end; Result := True; end; finally item.Free(); end; end; function TSDFilesystem_FAT.ExtractFile(srcPath: WideString; extractToFilename: String): Boolean; var item: TSDDirItem_FAT; attrs: Integer; fileHandle: THandle; ftCreationTime: TFileTime; ftLastAccessTime: TFileTime; ftLastWriteTime: TFileTime; begin Result := False; item := TSDDirItem_FAT.Create(); try if GetItem_FAT(srcPath, item) then begin Result := ExtractClusterChainData(item.FirstCluster, extractToFilename, item.Size); // If extraction successful, set file attributes and date/timestamps if not (Result) then begin LastErrorSet( SDUParamSubstitute(_( 'Unable to extract cluster chain data starting from cluster: %1'), [item.FirstCluster]) ); end else begin // Set file attributes... attrs := 0; // Disable useless warnings about faReadOnly, etc and FileSetAttr(...) being // platform-specific {$WARN SYMBOL_PLATFORM OFF} if item.IsReadonly then begin attrs := attrs or faReadOnly; end; if ((item.Attributes and VFAT_ATTRIB_FLAG_HIDDEN) = VFAT_ATTRIB_FLAG_HIDDEN) then begin attrs := attrs or faHidden; end; if ((item.Attributes and VFAT_ATTRIB_FLAG_SYSTEM) = VFAT_ATTRIB_FLAG_SYSTEM) then begin attrs := attrs or faSysFile; end; FileSetAttr(extractToFilename, attrs); {$WARN SYMBOL_PLATFORM ON} // Set file timestamps... if PreserveTimeDateStamps then begin fileHandle := FileOpen(extractToFilename, fmOpenWrite); if (fileHandle = 0) then begin LastErrorSet( SDUParamSubstitute(_( 'Unable to open extracted file to set timestamps: %1'), [extractToFilename]) ); end else begin ftCreationTime := SDUDateTimeToFileTime(TimeStampToDateTime(item.TimestampCreation)); ftLastAccessTime := SDUDateTimeToFileTime(item.DatestampLastAccess); ftLastWriteTime := SDUDateTimeToFileTime(TimeStampToDateTime( item.TimestampLastModified)); SetFileTime( fileHandle, @ftCreationTime, @ftLastAccessTime, @ftLastWriteTime ); FileClose(fileHandle); end; end; end; end; finally item.Free(); end; end; function TSDFilesystem_FAT.FreeCluster(clusterID: DWORD): Boolean; begin Result := SetFATEntry(clusterID, FFATEntryFree); end; function TSDFilesystem_FAT.FreeClusterChain(clusterID: DWORD): Boolean; var clusterChain: TSDFATClusterChain; begin clusterChain := ExtractClusterChain(clusterID); Result := FreeClusterChain(clusterChain); end; function TSDFilesystem_FAT.FreeClusterChain(clusterChain: TSDFATClusterChain): Boolean; var i: Integer; begin Result := True; for i := low(clusterchain) to high(clusterChain) do begin if not (FreeCluster(clusterChain[i])) then begin Result := False; end; end; end; // atm, this only does a rudimentary check that all of the FATs are identical function TSDFilesystem_FAT.CheckFilesystem(): Boolean; begin Result := True; if Result then begin Result := CheckFilesystem_ConsistentFATs(); end; if Result then begin Result := CheckFilesystem_Crosslinks(); end; end; function TSDFilesystem_FAT.CheckFilesystem_ConsistentFATs(): Boolean; var i: Integer; j: Int64; firstFAT: TSDUMemoryStream; checkFAT: TSDUMemoryStream; begin firstFAT := TSDUMemoryStream.Create(); try Result := ReadFAT(1, firstFAT); if Result then begin // Start from 2; we've already got the first FAT for i := 2 to FATCount do begin checkFAT := TSDUMemoryStream.Create(); try Result := ReadFAT(1, checkFAT); // Compare the FATs... if Result then begin Result := (firstFAT.Size = checkFAT.Size); end; if Result then begin firstFAT.Position := 0; checkFAT.Position := 0; j := 0; while (j < firstFAT.Size) do begin Result := (firstFAT.ReadByte = checkFAT.ReadByte); if not (Result) then begin LastErrorSet(SDUParamSubstitute( _('FAT copy #%1 doesn''t match FAT copy #%2'), [1, i])); break; end; Inc(j); end; end; finally checkFAT.Free(); end; if not (Result) then begin break; end; end; end; finally firstFAT.Free(); end; end; function TSDFilesystem_FAT.CheckFilesystem_Crosslinks(): Boolean; begin Result := True; //lplp - to implement end; function TSDFilesystem_FAT.GetFreeSpace(): ULONGLONG; var freeTotal: ULONGLONG; tmpULL: ULONGLONG; // Use temp var to prevent inappropriate casting by Delphi begin freeTotal := CountEmptyFATEntries(); tmpULL := SectorsPerCluster; freeTotal := (freeTotal * tmpULL); tmpULL := BytesPerSector; freeTotal := (freeTotal * tmpULL); Result := freeTotal; end; function TSDFilesystem_FAT.GetSize(): ULONGLONG; var freeTotal: ULONGLONG; tmpULL: ULONGLONG; // Use temp var to prevent inappropriate casting by Delphi begin freeTotal := TotalSectors; tmpULL := BytesPerSector; freeTotal := (freeTotal * tmpULL); Result := freeTotal; end; procedure TSDFilesystem_FAT.AssertSufficientData(data: TStream; maxSize: Int64 = -1); var maxDataSize: Int64; begin if (maxSize >= 0) then begin maxDataSize := (data.Size - data.Position); Assert( (maxDataSize >= maxSize), 'Insufficient data supplied for operation (need: ' + SDUIntToStr( maxSize) + '; got: ' + SDUIntToStr(maxDataSize) + ')' ); end; end; // Given a specfied path, return the directory it's stored in. // e.g.: // \fred\bert\joe will return \fred\bert // \fred\bert will return \fred // \fred will return \ // Note that: // \ will return \ function TSDFilesystem_FAT.PathParent(path: WideString): WideString; var i: Integer; begin Result := ''; if path = PATH_SEPARATOR then begin Result := PATH_SEPARATOR; end else begin for i := length(path) downto 1 do begin if (path[i] = PATH_SEPARATOR) then begin Result := Copy(path, 1, (i - 1)); if (Result = '') then begin Result := PATH_SEPARATOR; end; break; end; end; end; end; // Convert filename from 8.3 format to "NNNNNNNNEEE" format function TSDFilesystem_FAT.DOSFilenameTo11Chars(DOSFilename: Ansistring): Ansistring; var i: Integer; j: Integer; begin // Special handling for "." and ".." so the other half of this process // doens't get confused by the "." and return a string containing just // spaces if ((DOSFilename = DIR_CURRENT_DIR) or (DOSFilename = DIR_PARENT_DIR)) then begin Result := DOSFilename; end else begin for i := 1 to length(DOSFilename) do begin if (DOSFilename[i] = '.') then begin // Pad out... for j := i to 8 do begin Result := Result + ' '; end; end else begin Result := Result + DOSFilename[i]; end; end; end; Result := Result + StringOfChar(AnsiChar(' '), (11 - length(Result))); end; // This takes a notmal 8.3 filename (e.g. fred.txt) function TSDFilesystem_FAT.DOSFilenameCheckSum(DOSFilename: Ansistring): Byte; var i: Integer; useFilename: Ansistring; begin useFilename := DOSFilenameTo11Chars(DOSFilename); Result := 0; for i := 1 to 11 do begin Result := (((Result and $0000001) shl 7) + (Result shr 1) + Ord(useFilename[i])) mod 256; end; end; // Write directory entry to the specified stream, at the *current* *position* in // the stream. // If "stream" is set to nil, this will just return the number of directory // entries required, without writing anything // Returns: The number of directory entries used/required // Returns -1 on error function TSDFilesystem_FAT.WriteDirEntry(item: TSDDirItem_FAT; stream: TSDUMemoryStream): Integer; const // The number of LFN chars per dir entry LFN_CHARS_PER_ENTRY = 5 + 6 + 2; var tempLFN: WideString; lfnParts: array of WideString; maxSeqNo: Byte; useSeqNo: Byte; checksum: Byte; i: Integer; begin tempLFN := item.Filename; // Terminate LFN with NULL tempLFN := tempLFN + WChar($0000); // Pad LFN with #FFFF chars, if needed if ((length(tempLFN) mod LFN_CHARS_PER_ENTRY) > 0) then begin tempLFN := tempLFN + SDUWideStringOfWideChar(WChar($FFFF), (LFN_CHARS_PER_ENTRY - (length(tempLFN) mod LFN_CHARS_PER_ENTRY))); end; // Calculate number of directory entries required to store LFN maxSeqNo := length(tempLFN) div LFN_CHARS_PER_ENTRY; // (Additional directory entry required for 8.3 entry) Result := maxSeqNo + 1; if (stream = nil) then begin // Bail out exit; end; SetLength(lfnParts, maxSeqNo); for i := 0 to (maxSeqNo - 1) do begin lfnParts[i] := Copy(tempLFN, 1, LFN_CHARS_PER_ENTRY); Delete(tempLFN, 1, LFN_CHARS_PER_ENTRY); end; checksum := DOSFilenameCheckSum(item.FilenameDOS); // Write out the LFN entries... for i := (maxSeqNo - 1) downto 0 do begin useSeqNo := i + 1; // Mask the last segment (first one to be written) if (useSeqNo = maxSeqNo) then begin useSeqNo := useSeqNo or DIR_ENTRY_VFAT_LAST_LONG_ENTRY; end; stream.WriteByte(useSeqNo); stream.WriteWideString(Copy(lfnParts[i], 1, 5)); stream.WriteByte(VFAT_ATTRIB_VFAT_ENTRY); stream.WriteByte($00); stream.WriteByte(checksum); stream.WriteWideString(Copy(lfnParts[i], 6, 6)); stream.WriteWORD_LE($0000); stream.WriteWideString(Copy(lfnParts[i], 12, 2)); end; WriteDirEntry_83(item, stream); end; procedure TSDFilesystem_FAT.WriteDirEntry_83(item: TSDDirItem_FAT; stream: TSDUMemoryStream); var createDate: Word; createTime: Word; createTimeFine: Byte; lastAccessDate: Word; lastModDate: Word; lastModTime: Word; lastModTimeFine: Byte; useFirstCluster: DWORD; useSize: DWORD; begin TTimeStampToWORD(item.TimestampCreation, createDate, createTime, createTimeFine); lastAccessDate := TDateToWORD(item.DatestampLastAccess); TTimeStampToWORD(item.TimestampLastModified, lastModDate, lastModTime, lastModTimeFine); useFirstCluster := item.FirstCluster; if ((item.Size = 0) and not (item.IsDirectory) // Directories have their size set to 0 anyway ) then begin useFirstCluster := 0; end; useSize := item.Size; if (item.IsDirectory or item.IsVolumeLabel) then begin useSize := 0; end; // Write out the 8.3 entry... stream.WriteString(DOSFilenameTo11Chars(item.FilenameDOS)); stream.WriteByte(item.Attributes); stream.WriteByte($00); // Reserved stream.WriteByte(createTimeFine); // Create time (fine) stream.WriteWORD_LE(createTime); // Create time stream.WriteWORD_LE(createDate); // Create date stream.WriteWORD_LE(lastAccessDate); // Last access date stream.WriteWORD_LE((useFirstCluster and $FFFF0000) shr 16); stream.WriteWORD_LE(lastModTime); // Last modified time stream.WriteWORD_LE(lastModDate); // Last modified date stream.WriteWORD_LE(useFirstCluster and $0000FFFF); stream.WriteDWORD_LE(useSize); // File size; should be 0 for directories and volume labels end; // Seek the first instance of cntNeeded directory entries in dirData which are // unused // Note: This starts searching from the start of dirData function TSDFilesystem_FAT.SeekBlockUnusedDirEntries(cntNeeded: Integer; dirData: TSDUMemoryStream): Boolean; var currRunLength: Integer; runStartOffset: Int64; currEntryOffset: Int64; filenameChar: Byte; begin Result := False; currRunLength := 0; runStartOffset := 0; currEntryOffset := runStartOffset; while (currEntryOffset < dirData.Size) do begin dirData.Position := currEntryOffset + DIR_ENTRY_OFFSET_DOSFILENAME; filenameChar := dirData.ReadByte(); if ((filenameChar = DIR_ENTRY_UNUSED) or (filenameChar = DIR_ENTRY_DELETED)) then begin Inc(currRunLength); if (currRunLength >= cntNeeded) then begin dirData.Position := runStartOffset; Result := True; break; end; end else begin currRunLength := 0; runStartOffset := currEntryOffset + DIR_ENTRY_SIZE; end; currEntryOffset := currEntryOffset + DIR_ENTRY_SIZE; end; end; // Seek an 8.3 DOS filename in raw directory data, setting dirData.Position to // the start of the dir entry // Note: This starts searching from the start function TSDFilesystem_FAT.Seek83FileDirNameInDirData(filename: Ansistring; dirData: TSDUMemoryStream): Boolean; var filename11Char: String; currFilename: String; currAttributes: Byte; recordOffset: Int64; begin Result := False; filename11Char := DOSFilenameTo11Chars(filename); recordOffset := 0; while (recordOffset < dirData.Size) do begin dirData.Position := recordOffset; currFilename := dirData.ReadString(11, (recordOffset + DIR_ENTRY_OFFSET_DOSFILENAME)); if (currFilename = filename11Char) then begin currAttributes := dirData.ReadByte(recordOffset + DIR_ENTRY_OFFSET_FILEATTRS); // Only interested in dirs and files if (((currAttributes and VFAT_ATTRIB_VFAT_ENTRY) <> VFAT_ATTRIB_VFAT_ENTRY) and ((currAttributes and VFAT_ATTRIB_FLAG_VOLLABEL) <> VFAT_ATTRIB_FLAG_VOLLABEL) and ((currAttributes and VFAT_ATTRIB_FLAG_DEVICE) <> VFAT_ATTRIB_FLAG_DEVICE)) then begin // Reset position to start of dir entry dirData.Position := recordOffset; Result := True; break; end; end; recordOffset := recordOffset + DIR_ENTRY_SIZE; end; end; // Extend the specified stream by a cluster filled with zeros procedure TSDFilesystem_FAT.ExtendByEmptyCluster(stream: TSDUMemoryStream); var buffer: Pointer; begin buffer := AllocMem(ClusterSize()); // AllocMem initializes the memory allocated to zeros try stream.Position := stream.Size; stream.Write(buffer^, ClusterSize()); finally FreeMem(buffer); end; end; // Returns TRUE/FALSE, depending on whether clusterID appers in chain or not function TSDFilesystem_FAT.IsClusterInChain(clusterID: DWORD; chain: TSDFATClusterChain): Boolean; var i: Integer; begin Result := False; for i := low(chain) to high(chain) do begin if (chain[i] = clusterID) then begin Result := True; break; end; end; end; // Add the specified cluster to the given chain procedure TSDFilesystem_FAT.AddClusterToChain(clusterID: DWORD; var chain: TSDFATClusterChain); begin SetLength(chain, (length(chain) + 1)); chain[(length(chain) - 1)] := clusterID; end; // Note: This function will update item.FirstCluster to reflect the updated // cluster ID // Note: This function will update item.FilenameDOS to a unique filename within // the dir to be stored in, if it's set to '' on entry // If parentDir is not nil on entry, it will have the dirToStoreIn's details // *assigned* to it function TSDFilesystem_FAT.StoreFileOrDir(dirToStoreIn: WideString; // The dir in which item/data is to be stored item: TSDDirItem_FAT; data: TStream; parentDir: TSDDirItem_FAT = nil): Boolean; var dirToStoreInItem: TSDDirItem_FAT; dirToStoreInChain: TSDFATClusterChain; dirToStoreInData: TSDUMemoryStream; existingItem: TSDDirItem_FAT; itemChain: TSDFATClusterChain; itemChainUnused: TSDFATClusterChain; useFirstCluster: DWORD; clusterReserved: DWORD; useDOSFilename: String; datetimetamp: TDateTime; begin Result := True; if not (CheckWritable()) then begin Result := False; exit; end; existingItem := nil; dirToStoreInItem := nil; dirToStoreInData := nil; useFirstCluster := 0; clusterReserved := ERROR_DWORD; try if Result then begin existingItem := TSDDirItem_FAT.Create(); if not (GetItem_FAT(IncludeTrailingPathDelimiter(dirToStoreIn) + item.Filename, existingItem)) then begin existingItem.Free(); existingItem := nil; end; end; if Result then begin useDOSFilename := item.FilenameDOS; if (existingItem <> nil) then begin useDOSFilename := existingItem.FilenameDOS; end; if (useDOSFilename = '') then begin useDOSFilename := GenerateNew83Filename(IncludeTrailingPathDelimiter( dirToStoreIn) + item.Filename); Result := (useDOSFilename <> ''); end; end; // Sanity check - Can't overwrite file with dir and vice versa if Result then begin if (existingItem <> nil) then begin Result := ((item.IsFile = existingItem.IsFile) and (item.IsDirectory = existingItem.IsDirectory)); end; end; // ------------------------- // Retrieve details of directory item is to be stored in if Result then begin dirToStoreInItem := TSDDirItem_FAT.Create(); Result := GetItem_FAT(dirToStoreIn, dirToStoreInItem); if (Result and (parentDir <> nil)) then begin parentDir.Assign(dirToStoreInItem); end; end; if Result then begin dirToStoreInChain := ExtractClusterChain(dirToStoreInItem.FirstCluster); Result := (length(dirToStoreInChain) > 0); end; if Result then begin dirToStoreInData := TSDUMemoryStream.Create(); Result := ReadWriteClusterChainData(True, dirToStoreInChain, dirToStoreInData); end; // ------------------------- // Reserve a single cluster, in case the directory needs to be extended // Note: This, in conjunction with the AllocateChainForData(...) call a bit // later, ensures that there is enough storage space left to store // the item // IMPORTANT NOTE: This is done *before* the call to // AllocateChainForData(...) as AllocateChainForData(...) // doesn't reserve the clusters it allocates. This has the // effect that this will fragment the filesystem slightly // when the next file is written - fix in later release if Result then begin clusterReserved := ReserveFATEntry(); Result := (clusterReserved <> ERROR_DWORD); end; // ------------------------- // Retrieve chain for any item, if item already exists on filesystem if Result then begin SetLength(itemChain, 0); if (existingItem <> nil) then begin if (existingItem.FirstCluster <> 0) then begin itemChain := ExtractClusterChain(existingItem.FirstCluster); end; end; end; // Extend/truncate item chain as needed // Note: This, in conjunction with the ReserveFATEntry(...) call a bit // earlier, ensures that there is enough storage space left to store // the item if Result then begin data.Position := 0; Result := AllocateChainForData(itemChain, itemChainUnused, data, item.Size); useFirstCluster := 0; if (length(itemChain) > 0) then begin useFirstCluster := itemChain[0]; end; end; // ------------------------- // Setup new item... if Result then begin item.FilenameDOS := useDOSFilename; item.FirstCluster := useFirstCluster; end; // ------------------------- // Delete any existing dir entry, and store our new one if Result then begin if (existingItem <> nil) then begin Result := DeleteEntryFromDir(existingItem.FilenameDOS, dirToStoreInData); end; end; if Result then begin if not (PreserveTimeDateStamps) then begin // Assign to local variable so there's no risk of separate calls // returning slightly different timestamps datetimetamp := Now(); item.TimestampCreation := DateTimeToTimeStamp(datetimetamp); item.TimestampLastModified := DateTimeToTimeStamp(datetimetamp); item.DatestampLastAccess := datetimetamp; end; // Notice: This will set clusterReserved to ERROR_DWORD if it's needed // (i.e. used) Result := AddEntryToDir(item, dirToStoreInChain, dirToStoreInData, clusterReserved, (dirToStoreIn = PATH_SEPARATOR)); end; // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // At this point, nothing has been written out to the partition, nor has // anything written to the in-memory FAT copy // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Update FAT entries for item's and dir's data // Destination items's cluster chain... if Result then begin Result := StoreClusterChain(itemChain); end; // Any previously used part of the cluster chain which is no longer // used (e.g. when truncating a file) if Result then begin Result := FreeClusterChain(itemChainUnused); end; // Cluster chain for the directory the item is stored to... if Result then begin Result := StoreClusterChain(dirToStoreInChain); end; // If reserved cluster not used, mark back as free // Note: This one is *intentionally* not protected by "if result then" // Note: This is intentionally here, as well as the same calls in the // "try...finally...end" part if (clusterReserved <> ERROR_DWORD) then begin UnreserveFATEntry(clusterReserved); clusterReserved := ERROR_DWORD; end; if Result then begin Result := WriteFATToAllCopies(); end; // Write updated dir contents if Result then begin dirToStoreInData.Position := 0; Result := StoreClusterChainData(dirToStoreInChain, dirToStoreInData); end; // Write file contents if Result then begin data.Position := 0; Result := StoreClusterChainData(itemChain, data, item.Size); end; finally if (existingItem <> nil) then begin existingItem.Free(); end; if (dirToStoreInData <> nil) then begin dirToStoreInData.Free(); end; // This is included here as a sanity check in case of exception // This *should* never actually do anything, but it does make sure the // reserved cluster is free'd if it wasn't used in the in-memory FAT copy if (clusterReserved <> ERROR_DWORD) then begin UnreserveFATEntry(clusterReserved); // Next line commented out to prevent compiler hint // clusterReserved := ERROR_DWORD; end; end; end; // This function moves a file/directory from one location to another. // Can also be used as a "rename" function // Operates by creating a new directory item "destItemPath", setting it to point // to the same first cluster as "srcItemPath"'s dir item does, then deleting // "srcItemPath"'s directory entry // Note: "destItemPath" must be the full path and filename of the file/dir to // be moved function TSDFilesystem_FAT.MoveFileOrDir(srcItemPath: WideString; // The path and filename of the file/dir to be moved destItemPath: WideString // The new path and filename ): Boolean; var srcDirItemStoredInItem: TSDDirItem_FAT; destDirItemStoredInItem: TSDDirItem_FAT; srcDirItemStoredInChain: TSDFATClusterChain; destDirItemStoredInChain: TSDFATClusterChain; srcDirItemStoredInData: TSDUMemoryStream; destDirItemStoredInData: TSDUMemoryStream; srcItem: TSDDirItem_FAT; testItem: TSDDirItem_FAT; clusterReserved: DWORD; destDOSFilename: String; sameDirFlag: Boolean; begin Result := True; if not (CheckWritable()) then begin Result := False; exit; end; sameDirFlag := ExtractFilePath(srcItemPath) = ExtractFilePath(destItemPath); srcItem := nil; srcDirItemStoredInItem := nil; destDirItemStoredInItem := nil; srcDirItemStoredInData := nil; destDirItemStoredInData := nil; clusterReserved := ERROR_DWORD; try // Sanity check; destination doesn't already exist if Result then begin testItem := TSDDirItem_FAT.Create(); try if GetItem_FAT(destItemPath, testItem) then begin Result := False; end; finally testItem.Free(); end; end; // Get details of source file/directory if Result then begin srcItem := TSDDirItem_FAT.Create(); if not (GetItem_FAT(srcItemPath, srcItem)) then begin Result := False; end; end; // Generate a dest 8.3 DOS filename, so it doesn't overwrite anything in the // destination dir if Result then begin destDOSFilename := GenerateNew83Filename(destItemPath); Result := (destDOSFilename <> ''); end; // ------------------------- // Retrieve details of directory item is to be stored in (src location) if Result then begin srcDirItemStoredInItem := TSDDirItem_FAT.Create(); Result := GetItem_FAT(ExtractFilePath(srcItemPath), srcDirItemStoredInItem); end; if Result then begin srcDirItemStoredInChain := ExtractClusterChain(srcDirItemStoredInItem.FirstCluster); Result := (length(srcDirItemStoredInChain) > 0); end; if Result then begin srcDirItemStoredInData := TSDUMemoryStream.Create(); Result := ReadWriteClusterChainData(True, srcDirItemStoredInChain, srcDirItemStoredInData); end; // ------------------------- // Retrieve details of directory item is to be stored in (dest location) if not (sameDirFlag) then begin if Result then begin destDirItemStoredInItem := TSDDirItem_FAT.Create(); Result := GetItem_FAT(ExtractFilePath(destItemPath), destDirItemStoredInItem); end; if Result then begin destDirItemStoredInChain := ExtractClusterChain(destDirItemStoredInItem.FirstCluster); Result := (length(destDirItemStoredInChain) > 0); end; if Result then begin destDirItemStoredInData := TSDUMemoryStream.Create(); Result := ReadWriteClusterChainData(True, destDirItemStoredInChain, destDirItemStoredInData); end; end; // ------------------------- // Reserve a single cluster, in case the directory needs to be extended // Note: This, in conjunction with the AllocateChainForData(...) call a bit // later, ensures that there is enough storage space left to store // the item // IMPORTANT NOTE: This is done *before* the call to // AllocateChainForData(...) as AllocateChainForData(...) // doesn't reserve the clusters it allocates. This has the // effect that this will fragment the filesystem slightly // when the next file is written - fix in later release if Result then begin clusterReserved := ReserveFATEntry(); Result := (clusterReserved <> ERROR_DWORD); end; // ------------------------- // Delete entry from source dir, create dest entry in target dir // Note that we're still working with in-memory copies here, so it's just // as safe to delete/add as to add/delete. But! By deleting first, we // (potentially) can reuse the same directory records in the dir structure // - which could make a difference between successfully renaming an item // in the root dir of a FAT12/FAT16 volume - which has limited root dir // entries available if Result then begin Result := DeleteEntryFromDir(srcItem.FilenameDOS, srcDirItemStoredInData); end; // Change filename, so we can reuse the same structure if Result then begin // Note that srcItem.FirstCluster is left alone here srcItem.Filename := ExtractFilename(destItemPath); srcItem.FilenameDOS := destDOSFilename; end; if Result then begin // If in the same dir, we only work with srcDir if sameDirFlag then begin // Notice: This will set clusterReserved to ERROR_DWORD if it's needed // (i.e. used) Result := AddEntryToDir(srcItem, srcDirItemStoredInChain, srcDirItemStoredInData, clusterReserved, (ExtractFilePath(destItemPath) = PATH_SEPARATOR)); end else begin // Notice: This will set clusterReserved to ERROR_DWORD if it's needed // (i.e. used) Result := AddEntryToDir(srcItem, destDirItemStoredInChain, destDirItemStoredInData, clusterReserved, (ExtractFilePath(destItemPath) = PATH_SEPARATOR)); end; end; // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // At this point, nothing has been written out to the partition, nor has // anything written to the in-memory FAT copy // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Update FAT entries for item's and dir's data // Cluster chain for the directory the item is moved to... if Result then begin // If in the same dir, we only work with srcDir if not (sameDirFlag) then begin Result := StoreClusterChain(destDirItemStoredInChain); end; end; // Cluster chain for the directory the item is moved from... if Result then begin Result := StoreClusterChain(srcDirItemStoredInChain); end; // If reserved cluster not used, mark back as free // Note: This one is *intentionally* not protected by "if result then" // Note: This is intentionally here, as well as the same calls in the // "try...finally...end" part if (clusterReserved <> ERROR_DWORD) then begin UnreserveFATEntry(clusterReserved); clusterReserved := ERROR_DWORD; end; if Result then begin Result := WriteFATToAllCopies(); end; // Write updated dir contents if Result then begin // If in the same dir, we only work with srcDir if not (sameDirFlag) then begin destDirItemStoredInData.Position := 0; Result := StoreClusterChainData(destDirItemStoredInChain, destDirItemStoredInData); end; end; if Result then begin srcDirItemStoredInData.Position := 0; Result := StoreClusterChainData(srcDirItemStoredInChain, srcDirItemStoredInData); end; finally if (srcItem <> nil) then begin srcItem.Free(); end; if (srcDirItemStoredInData <> nil) then begin srcDirItemStoredInData.Free(); end; if (destDirItemStoredInData <> nil) then begin destDirItemStoredInData.Free(); end; // This is included here as a sanity check in case of exception // This *should* never actually do anything, but it does make sure the // reserved cluster is free'd if it wasn't used in the in-memory FAT copy if (clusterReserved <> ERROR_DWORD) then begin UnreserveFATEntry(clusterReserved); // Next line commented out to prevent compiler hint // clusterReserved := ERROR_DWORD; end; end; end; // Copy file from one location to another // Note: "destItemPath" must be the full path and filename of the file to be // created function TSDFilesystem_FAT.CopyFile(srcItemPath: WideString; // The path and filename of the file to be copied destItemPath: WideString // The path and filename of the copy ): Boolean; var destDirItemStoredInItem: TSDDirItem_FAT; destDirItemStoredInChain: TSDFATClusterChain; destDirItemStoredInData: TSDUMemoryStream; srcItem: TSDDirItem_FAT; srcChain: TSDFATClusterChain; testItem: TSDDirItem_FAT; destChain: TSDFATClusterChain; destChainUnused: TSDFATClusterChain; useFirstCluster: DWORD; clusterReserved: DWORD; destDOSFilename: String; begin Result := True; if not (CheckWritable()) then begin Result := False; exit; end; srcItem := nil; destDirItemStoredInItem := nil; destDirItemStoredInData := nil; useFirstCluster := 0; clusterReserved := ERROR_DWORD; try // Sanity check; destination doesn't already exist if Result then begin testItem := TSDDirItem_FAT.Create(); try if GetItem_FAT(destItemPath, testItem) then begin Result := False; end; finally testItem.Free(); end; end; // Get details of source file/directory if Result then begin srcItem := TSDDirItem_FAT.Create(); if not (GetItem_FAT(srcItemPath, srcItem)) then begin Result := False; end; end; // Sanity check; source isn't a directory (this function only handles // copying files) if Result then begin Result := not (srcItem.IsDirectory); end; // Generate a new 8.3 DOS filename, so it doesn't overwrite anything in the // destination dir if Result then begin destDOSFilename := GenerateNew83Filename(destItemPath); Result := (destDOSFilename <> ''); end; // ------------------------- // Retrieve details of directory item is to be stored in (new location) if Result then begin destDirItemStoredInItem := TSDDirItem_FAT.Create(); Result := GetItem_FAT(ExtractFilePath(destItemPath), destDirItemStoredInItem); end; if Result then begin destDirItemStoredInChain := ExtractClusterChain(destDirItemStoredInItem.FirstCluster); Result := (length(destDirItemStoredInChain) > 0); end; if Result then begin destDirItemStoredInData := TSDUMemoryStream.Create(); Result := ReadWriteClusterChainData(True, destDirItemStoredInChain, destDirItemStoredInData); end; // ------------------------- // Reserve a single cluster, in case the directory needs to be extended // Note: This, in conjunction with the AllocateChainForData(...) call a bit // later, ensures that there is enough storage space left to store // the item // IMPORTANT NOTE: This is done *before* the call to // AllocateChainForData(...) as AllocateChainForData(...) // doesn't reserve the clusters it allocates. This has the // effect that this will fragment the filesystem slightly // when the next file is written - fix in later release if Result then begin clusterReserved := ReserveFATEntry(); Result := (clusterReserved <> ERROR_DWORD); end; // ------------------------- // Retrieve chain for the item to be copied if Result then begin SetLength(srcChain, 0); if (srcItem.FirstCluster <> 0) then begin srcChain := ExtractClusterChain(srcItem.FirstCluster); end; end; // Create dest chain // Note: This, in conjunction with the ReserveFATEntry(...) call a bit // earlier, ensures that there is enough storage space left to store // the item if Result then begin SetLength(destChain, 0); Result := AllocateChainForData(destChain, destChainUnused, nil, srcItem.Size); useFirstCluster := 0; if (length(destChain) > 0) then begin useFirstCluster := destChain[0]; end; end; // ------------------------- // Setup dest item... if Result then begin // Note: Only the new filename, DOS filename (to ensure it's unique in // the destination dir) and first cluster (to the copy) get changed srcItem.Filename := ExtractFilename(destItemPath); srcItem.FilenameDOS := destDOSFilename; srcItem.FirstCluster := useFirstCluster; end; // ------------------------- // Store our dest dir entry if Result then begin // Notice: This will set clusterReserved to ERROR_DWORD if it's needed // (i.e. used) Result := AddEntryToDir(srcItem, destDirItemStoredInChain, destDirItemStoredInData, clusterReserved, (ExtractFilePath(destItemPath) = PATH_SEPARATOR)); end; // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // At this point, nothing has been written out to the partition, nor has // anything written to the in-memory FAT copy // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Update FAT entries for item's and dir's data // Destination items's cluster chain... if Result then begin Result := StoreClusterChain(destChain); end; // Cluster chain for the directory the item is copied to... if Result then begin Result := StoreClusterChain(destDirItemStoredInChain); end; // If reserved cluster not used, mark back as free // Note: This one is *intentionally* not protected by "if result then" // Note: This is intentionally here, as well as the same calls in the // "try...finally...end" part if (clusterReserved <> ERROR_DWORD) then begin UnreserveFATEntry(clusterReserved); clusterReserved := ERROR_DWORD; end; if Result then begin Result := WriteFATToAllCopies(); end; // Write updated dir contents if Result then begin destDirItemStoredInData.Position := 0; Result := StoreClusterChainData(destDirItemStoredInChain, destDirItemStoredInData); end; // Write file contents if Result then begin Result := CopyClusterChainData(srcChain, destChain); end; finally if (srcItem <> nil) then begin srcItem.Free(); end; if (destDirItemStoredInData <> nil) then begin destDirItemStoredInData.Free(); end; // This is included here as a sanity check in case of exception // This *should* never actually do anything, but it does make sure the // reserved cluster is free'd if it wasn't used in the in-memory FAT copy if (clusterReserved <> ERROR_DWORD) then begin UnreserveFATEntry(clusterReserved); // Next line commented out to prevent compiler hint // clusterReserved := ERROR_DWORD; end; end; end; function TSDFilesystem_FAT.CreateDir(dirToStoreIn: WideString; // The dir in which item/data is to be stored newDirname: WideString; templateDirAttrs: TSDDirItem_FAT = nil): Boolean; var newDirContent: TSDUMemoryStream; parentDirItem: TSDDirItem_FAT; newDirItem: TSDDirItem_FAT; tmpDirItem: TSDDirItem_FAT; existingDirItem: TSDDirItem_FAT; begin Result := True; if not (CheckWritable()) then begin Result := False; exit; end; parentDirItem := TSDDirItem_FAT.Create(); newDirItem := TSDDirItem_FAT.Create(); newDirContent := TSDUMemoryStream.Create(); tmpDirItem := TSDDirItem_FAT.Create(); existingDirItem := TSDDirItem_FAT.Create(); try if Result then begin ExtendByEmptyCluster(newDirContent); end; // Sanity check; ensure dir doesn't already exist if Result then begin Result := not (GetItem_FAT((IncludeTrailingPathDelimiter(dirToStoreIn) + newDirname), existingDirItem)); end; if Result then begin if (templateDirAttrs <> nil) then begin newDirItem.Assign(templateDirAttrs); end else begin newDirItem.TimestampCreation := DateTimeToTimeStamp(now); newDirItem.DatestampLastAccess := Now; newDirItem.TimestampLastModified := DateTimeToTimeStamp(now); end; newDirItem.Filename := newDirname; newDirItem.FilenameDOS := GenerateNew83Filename( IncludeTrailingPathDelimiter(dirToStoreIn) + newDirname); // Note: This will be reset to 0 before writing the dir entry newDirItem.Size := newDirContent.Size; newDirItem.IsDirectory := True; end; if Result then begin // Store the (completely blank) directory placeholder content // Note: This will update newDirItem.FirstCluster as appropriate newDirContent.Position := 0; StoreFileOrDir(dirToStoreIn, newDirItem, newDirContent, parentDirItem); end; if Result then begin // Update the directory contents, adding "." and ".." entries tmpDirItem.Assign(newDirItem); tmpDirItem.Filename := DIR_CURRENT_DIR; tmpDirItem.FilenameDOS := DIR_CURRENT_DIR; tmpDirItem.Size := 0; newDirContent.Position := 0; WriteDirEntry_83(tmpDirItem, newdirContent); tmpDirItem.Assign(parentDirItem); tmpDirItem.Filename := DIR_PARENT_DIR; tmpDirItem.FilenameDOS := DIR_PARENT_DIR; tmpDirItem.Size := 0; newDirContent.Position := DIR_ENTRY_SIZE; WriteDirEntry_83(tmpDirItem, newdirContent); end; if Result then begin newDirContent.Position := 0; Result := StoreClusterData(newDirItem.FirstCluster, newDirContent); end; finally existingDirItem.Free(); newDirContent.Free(); newDirItem.Free(); parentDirItem.Free(); end; end; // Note: This function will update item.FirstCluster to reflect the updated // cluster ID // If parentDir is not nil, it will have the dirToStoreIn's details // *assigned* to it function TSDFilesystem_FAT.DeleteItem(fullPathToItem: WideString): Boolean; var dirStoredInPath: WideString; dirStoredInItem: TSDDirItem_FAT; dirStoredInChain: TSDFATClusterChain; dirStoredInData: TSDUMemoryStream; itemToDelete: TSDDirItem_FAT; begin Result := True; dirStoredInPath := PathParent(fullPathToItem); itemToDelete := TSDDirItem_FAT.Create(); dirStoredInItem := TSDDirItem_FAT.Create(); dirStoredInData := TSDUMemoryStream.Create(); try if Result then begin Result := GetItem_FAT(dirStoredInPath, dirStoredInItem); end; if Result then begin Result := GetItem_FAT(fullPathToItem, itemToDelete); end; if Result then begin dirStoredInChain := ExtractClusterChain(dirStoredInItem.FirstCluster); Result := (length(dirStoredInChain) > 0); end; if Result then begin Result := ExtractClusterChainData(dirStoredInChain, dirStoredInData); end; if Result then begin Result := DeleteEntryFromDir(itemToDelete.FilenameDOS, dirStoredInData); end; if Result then begin dirStoredInData.Position := 0; Result := StoreClusterChainData(dirStoredInChain, dirStoredInData); end; if Result then begin // Mark clusters as free in FAT Result := FreeClusterChain(itemToDelete.FirstCluster); end; if Result then begin // Write out updated FAT Result := WriteFATToAllCopies(); end; finally dirStoredInData.Free(); dirStoredInItem.Free(); itemToDelete.Free(); end; end; function TSDFilesystem_FAT.DeleteFile(fullPathToItem: WideString): Boolean; var itemToDelete: TSDDirItem_FAT; begin Result := True; if not (CheckWritable()) then begin Result := False; exit; end; itemToDelete := TSDDirItem_FAT.Create(); try if Result then begin Result := GetItem_FAT(fullPathToItem, itemToDelete); end; // Sanity check; it *is* a file, right? if Result then begin Result := itemToDelete.IsFile; end; if Result then begin Result := DeleteItem(fullPathToItem); end; finally itemToDelete.Free(); end; end; function TSDFilesystem_FAT.DeleteDir(fullPathToItem: WideString): Boolean; var subItems: TSDDirItemList; itemToDelete: TSDDirItem_FAT; i: Integer; begin Result := True; if not (CheckWritable()) then begin Result := False; exit; end; itemToDelete := TSDDirItem_FAT.Create(); subItems := TSDDirItemList.Create(); try if Result then begin Result := GetItem_FAT(fullPathToItem, itemToDelete); end; // Sanity check; it *is* a dir, right? if Result then begin Result := itemToDelete.IsDirectory; end; // Sanity check - skip stupid if Result then begin Result := ((itemToDelete.Filename <> DIR_CURRENT_DIR) and (itemToDelete.Filename <> DIR_PARENT_DIR)); end; // Get dir contents if Result then begin Result := LoadContentsFromDisk(fullPathToItem, subItems); end; // Delete everything beneath the dir to be deleted if Result then begin for i := 0 to (subItems.Count - 1) do begin if not (DeleteFileOrDir(IncludeTrailingPathDelimiter(fullPathToItem) + subItems[i].Filename)) then begin Result := False; break; end; end; end; // Delete dir if Result then begin Result := DeleteItem(fullPathToItem); end; finally subItems.Free(); itemToDelete.Free(); end; end; function TSDFilesystem_FAT.DeleteFileOrDir(fullPathToItem: WideString): Boolean; var itemToDelete: TSDDirItem_FAT; subItems: TSDDirItemList; begin Result := True; if not (CheckWritable()) then begin Result := False; exit; end; itemToDelete := TSDDirItem_FAT.Create(); subItems := TSDDirItemList.Create(); try if Result then begin Result := GetItem_FAT(fullPathToItem, itemToDelete); end; // Sanity check; it *is* a file, right? if Result then begin if itemToDelete.IsFile then begin Result := DeleteFile(fullPathToItem); end else if (itemToDelete.IsDirectory and (itemToDelete.Filename <> DIR_CURRENT_DIR) and (itemToDelete.Filename <> DIR_PARENT_DIR)) then begin Result := DeleteDir(fullPathToItem); end; end; finally subItems.Free(); itemToDelete.Free(); end; end; // Returns a new, unique, 8.3 DOS filename (without the path) that can be used // as for the DOS filename for the LFN supplied function TSDFilesystem_FAT.GenerateNew83Filename(lfnFilename: WideString): String; var dirToStoreIn: WideString; dirToStoreInItem: TSDDirItem_FAT; dirToStoreInData: TSDUMemoryStream; x: Integer; uniqueFound: Boolean; allOK: Boolean; begin allOK := True; dirToStoreIn := PathParent(lfnFilename); dirToStoreInItem := TSDDirItem_FAT.Create(); dirToStoreInData := TSDUMemoryStream.Create(); try if allOK then begin allOK := GetItem_FAT(dirToStoreIn, dirToStoreInItem); end; // Sanity check; it *is* a dir, right? if allOK then begin allOK := dirToStoreInItem.IsDirectory; end; if allOK then begin allOK := ExtractClusterChainData(dirToStoreInItem.FirstCluster, dirToStoreInData); end; if allOK then begin x := 1; uniqueFound := False; while not (uniqueFound) do begin Result := IntToStr(x); // Blowout if we couldn't find one. If we haven't found one by the time // this kicks out, we've checked 99999999 different DOS filenames - all // of which are in use. User needs to be tought how to organise their // data better. if (length(Result) > DIR_ENTRY_LENGTH_DOSFILENAME) then begin Result := ''; break; end; uniqueFound := not (Seek83FileDirNameInDirData(Result, dirToStoreInData)); Inc(x); end; end; finally dirToStoreInData.Free(); dirToStoreInItem.Free(); end; if not (allOK) then begin Result := ''; end; end; function TSDFilesystem_FAT.Format(): Boolean; var useFATType: TFATType; i: Integer; begin // Determine the best FAT filesystem to use, based on the size of the volume. useFATType := ftFAT16; for i := low(CLUSTERSIZE_BREAKDOWN) to high(CLUSTERSIZE_BREAKDOWN) do begin if (PartitionImage.Size <= CLUSTERSIZE_BREAKDOWN[i].MaxPartitionSize) then begin // Use FAT16, if OK... if (CLUSTERSIZE_BREAKDOWN[i].ClusterSize_FAT12FAT16 <> 0) then begin useFATType := ftFAT16; end; // ...Overriding with FAT32 if possible if (CLUSTERSIZE_BREAKDOWN[i].ClusterSize_FAT32 <> 0) then begin useFATType := ftFAT32; end; break; end; end; Result := _Format(useFATType); end; function TSDFilesystem_FAT._Format(fmtType: TFATType): Boolean; const // We use "MSWIN4.1" as this is supposed to be the most common. *Some* // systems may check for this, even though they shouldn't DEFAULT_OEMNAME: Ansistring = 'MSWIN4.1'; //DEFAULT_OEMNAME: string = 'MSDOS5.0'; // Various sensible defaults DEFAULT_FAT_COPIES = 2; DEFAULT_BYTES_PER_SECTOR = 512; DEFAULT_MEDIA_DESCRIPTOR = $F8; // Hard drive DEFAULT_RESERVED_SECTORS_FAT12FAT16 = 2; // Should be 1?? DEFAULT_RESERVED_SECTORS_FAT32 = 32; DEFAULT_MAX_ROOT_DIR_ENTRIES = 512; // Typical on FAT12/FAT16 // Taken from: FreeOTFE.h; see this file for an explanation of this choice of values DEFAULT_TRACKS_PER_CYLINDER = 64; DEFAULT_SECTORS_PER_TRACK = 32; DEFAULT_FAT_FLAGS = 0; DEFAULT_VERSION = 0; DEFAULT_SECTOR_NO_FS_INFO_SECTOR_FAT1216 = 0; DEFAULT_SECTOR_NO_FS_INFO_SECTOR_FAT32 = 1; DEFAULT_SECTOR_BOOT_SECTOR_COPY_FAT1216 = 0; DEFAULT_SECTOR_BOOT_SECTOR_COPY_FAT32 = 6; DEFAULT_PHYSICAL_DRIVE_NO = 0; DEFAULT_EXTENDED_BOOT_SIG = $29; DEFAULT_VOLUME_LABEL = ' '; FSINFO_SIG_LEAD = $41615252; FSINFO_SIG_STRUCT = $61417272; FSINFO_SIG_TRAIL = $AA550000; FSINFO_UNKNOWN_FREECOUNT = $FFFFFFFF; FSINFO_UNKNOWN_NEXTFREE = $FFFFFFFF; FSINFO_OFFSET_FSINFOSIG = 0; FSINFO_LENGTH_FSINFOSIG = 4; FSINFO_OFFSET_RESERVED1 = 4; FSINFO_LENGTH_RESERVED1 = 480; FSINFO_OFFSET_STRUCTSIG = 484; FSINFO_LENGTH_STRUCTSIG = 4; FSINFO_OFFSET_FREECOUNT = 488; FSINFO_LENGTH_FREECOUNT = 4; FSINFO_OFFSET_NEXTFREE = 492; FSINFO_LENGTH_NEXTFREE = 4; FSINFO_OFFSET_RESERVED2 = 496; FSINFO_LENGTH_RESERVED2 = 12; FSINFO_OFFSET_TRAILSIG = 508; FSINFO_LENGTH_TRAILSIG = 4; var newBootSector: TSDBootSector_FAT; i: DWORD; // j: DWORD; useClusterSize: DWORD; FATStartSectorID: DWORD; stmFAT: TSDUMemoryStream; prevMounted: Boolean; newDirContent: TSDUMemoryStream; tmpDirItem: TSDDirItem_FAT; itemChain: TSDFATClusterChain; itemChainUnused: TSDFATClusterChain; FATEntry_0: DWORD; FATEntry_1: DWORD; RootDirSectors: DWORD; TmpVal1: DWORD; TmpVal2: DWORD; FATSz: DWORD; newFSInfo: TSDUMemoryStream; begin FSerializeCS.Acquire(); try // ======================================================================= // Part 1: Write boot sector // Boot sector information newBootSector.FATType := fmtType; // JMP instruction not used // The JMP instruction can only be one of: // 0xEB, 0x??, 0x90 // 0xE9, 0x??, 0x?? // The 0xEB (short jump) is more common, so we use that one newBootSector.JMP[1] := $EB; newBootSector.JMP[2] := $00; newBootSector.JMP[3] := $90; newBootSector.OEMName := DEFAULT_OEMNAME; newBootSector.BytesPerSector := DEFAULT_BYTES_PER_SECTOR; useClusterSize := 0; for i := low(CLUSTERSIZE_BREAKDOWN) to high(CLUSTERSIZE_BREAKDOWN) do begin if (PartitionImage.Size <= CLUSTERSIZE_BREAKDOWN[i].MaxPartitionSize) then begin if ((newBootSector.FATType = ftFAT12) or (newBootSector.FATType = ftFAT16)) then begin useClusterSize := CLUSTERSIZE_BREAKDOWN[i].ClusterSize_FAT12FAT16; end else begin useClusterSize := CLUSTERSIZE_BREAKDOWN[i].ClusterSize_FAT32; end; break; end; end; Result := (useClusterSize <> 0); newBootSector.SectorsPerCluster := (useClusterSize div newBootSector.BytesPerSector); if ((newBootSector.FATType = ftFAT12) or (newBootSector.FATType = ftFAT16)) then begin newBootSector.ReservedSectorCount := DEFAULT_RESERVED_SECTORS_FAT12FAT16; end else begin newBootSector.ReservedSectorCount := DEFAULT_RESERVED_SECTORS_FAT32; end; newBootSector.FATCount := DEFAULT_FAT_COPIES; if ((newBootSector.FATType = ftFAT12) or (newBootSector.FATType = ftFAT16)) then begin // Note: This should be a multiple of the cluster size newBootSector.MaxRootEntries := DEFAULT_MAX_ROOT_DIR_ENTRIES; end else begin newBootSector.MaxRootEntries := 0; end; newBootSector.TotalSectors := (PartitionImage.Size div newBootSector.BytesPerSector); newBootSector.MediaDescriptor := DEFAULT_MEDIA_DESCRIPTOR; // Only used for FAT12/FAT16 newBootSector.SectorsPerFAT := 0; // From MS FAT spec: // Microsoft Extensible Firmware Initiative FAT32 File System Specification // FAT: General Overview of On-Disk Format // Version 1.03, December 6, 2000 // http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx // // RootDirSectors = ((BPB_RootEntCnt * 32) + (BPB_BytsPerSec – 1)) / BPB_BytsPerSec; // TmpVal1 = DskSize – (BPB_ResvdSecCnt + RootDirSectors); // TmpVal2 = (256 * BPB_SecPerClus) + BPB_NumFATs; // If(FATType == FAT32) // TmpVal2 = TmpVal2 / 2; // FATSz = (TMPVal1 + (TmpVal2 – 1)) / TmpVal2; // If(FATType == FAT32) { // BPB_FATSz16 = 0; // BPB_FATSz32 = FATSz; // } else { // BPB_FATSz16 = LOWORD(FATSz); // /* there is no BPB_FATSz32 in a FAT16 BPB */ // } // // // However, this gives a fat size which is out by quite a bit?!! RootDirSectors := ((newBootSector.MaxRootEntries * 32) + (newBootSector.BytesPerSector - 1)) div newBootSector.BytesPerSector; TmpVal1 := newBootSector.TotalSectors - (newBootSector.ReservedSectorCount + RootDirSectors); TmpVal2 := (256 * newBootSector.SectorsPerCluster) + newBootSector.FATCount; if (newBootSector.FATType = ftFAT32) then begin TmpVal2 := TmpVal2 div 2; end; FATSz := (TMPVal1 + (TmpVal2 - 1)) div TmpVal2; if (newBootSector.FATType = ftFAT32) then begin newBootSector.SectorsPerFAT := FATSz; end else begin newBootSector.SectorsPerFAT := (FATSz and $FFFF); // there is no BPB_FATSz32 in a FAT16 BPB end; newBootSector.SectorsPerTrack := DEFAULT_SECTORS_PER_TRACK; newBootSector.NumberOfHeads := DEFAULT_TRACKS_PER_CYLINDER; // See FreeOTFE.c for explanation of the value used for ".HiddenSectors" // (search for comment "An extra track for hidden sectors") newBootSector.HiddenSectors := newBootSector.SectorsPerTrack; case newBootSector.FATType of ftFAT12: begin newBootSector.FATFilesystemType := SIGNATURE_FAT12; end; ftFAT16: begin newBootSector.FATFilesystemType := SIGNATURE_FAT16; end; ftFAT32: begin newBootSector.FATFilesystemType := SIGNATURE_FAT32; end; else begin Result := False; end; end; if ((newBootSector.FATType = ftFAT12) or (newBootSector.FATType = ftFAT16)) then begin newBootSector.RootDirFirstCluster := FAT1216_ROOT_DIR_FIRST_CLUSTER; newBootSector.SectorNoFSInfoSector := DEFAULT_SECTOR_NO_FS_INFO_SECTOR_FAT1216; newBootSector.SectorNoBootSectorCopy := DEFAULT_SECTOR_BOOT_SECTOR_COPY_FAT1216; newBootSector.PhysicalDriveNo := DEFAULT_PHYSICAL_DRIVE_NO; newBootSector.ExtendedBootSig := DEFAULT_EXTENDED_BOOT_SIG; newBootSector.VolumeLabel := DEFAULT_VOLUME_LABEL; // .FATFilesystemType populated above end else begin // When we write the root dir on a FAT32 system, we'll write it to the first // cluster; cluster 2 newBootSector.RootDirFirstCluster := FAT32_ENTRY_USED_START; newBootSector.FATFlags := DEFAULT_FAT_FLAGS; newBootSector.Version := DEFAULT_VERSION; newBootSector.SectorNoFSInfoSector := DEFAULT_SECTOR_NO_FS_INFO_SECTOR_FAT32; newBootSector.SectorNoBootSectorCopy := DEFAULT_SECTOR_BOOT_SECTOR_COPY_FAT32; newBootSector.PhysicalDriveNo := DEFAULT_PHYSICAL_DRIVE_NO; newBootSector.ExtendedBootSig := DEFAULT_EXTENDED_BOOT_SIG; newBootSector.VolumeLabel := DEFAULT_VOLUME_LABEL; // .FATFilesystemType populated above end; Randomize(); // +1 because random returns values 0 <= X < Range // Note: This *should* be $FFFFFFFF, but random(...) only takes an // integer, so we use $7FFFFFFF (the max value an intege can hold) // instead newBootSector.SerialNumber := (random($7FFFFFFF) + 1); newBootSector.BootSectorSig := FAT_BOOTSECTORSIG; if Result then begin Result := WriteBootSector(newBootSector); end; // Read the boot sector just written out if Result then begin prevMounted := Mounted; FMounted := True; try Result := ReadBootSector(); finally FMounted := prevMounted; end; end; // ======================================================================= // Part XXX: Write FSInfo sector (FAT32 only) if Result then begin if (newBootSector.FATType = ftFAT32) then begin newFSInfo := TSDUMemoryStream.Create(); try // Initialize with all zero bytes... newFSInfo.WriteByte(0, 0, newBootSector.BytesPerSector); newFSInfo.WriteDWORD_LE(FSINFO_SIG_LEAD, FSINFO_OFFSET_FSINFOSIG); newFSInfo.WriteDWORD_LE(FSINFO_SIG_STRUCT, FSINFO_OFFSET_STRUCTSIG); newFSInfo.WriteDWORD_LE(FSINFO_UNKNOWN_FREECOUNT, FSINFO_OFFSET_FREECOUNT); newFSInfo.WriteDWORD_LE(FSINFO_UNKNOWN_NEXTFREE, FSINFO_OFFSET_NEXTFREE); newFSInfo.WriteDWORD_LE(FSINFO_SIG_TRAIL, FSINFO_OFFSET_TRAILSIG); newFSInfo.Position := 0; Result := PartitionImage.WriteSector(newBootSector.SectorNoFSInfoSector, newFSInfo); finally newFSInfo.Free(); end; end; end; // ======================================================================= // Part XXX: Write backup sectors (FAT32 only) if Result then begin if (newBootSector.FATType = ftFAT32) then begin // Backup boot sector... Result := PartitionImage.CopySector(0, newBootSector.SectorNoBootSectorCopy); // Backup FSInfo sector... Result := PartitionImage.CopySector(newBootSector.SectorNoFSInfoSector, (newBootSector.SectorNoBootSectorCopy + 1)); end; end; // ======================================================================= // Part 2: Write FAT if Result then begin stmFAT := TSDUMemoryStream.Create(); try // Fill FAT with zeros // Slow and crude, but since it's a one off and there's not much of it... // "div 4" because we're writing DWORDS (4 bytes) for i := 1 to ((newBootSector.SectorsPerFAT * newBootSector.BytesPerSector) div 4) do begin stmFAT.WriteDWORD_LE(0); end; for i := 1 to newBootSector.FATCount do begin stmFAT.Position := 0; FATStartSectorID := newBootSector.ReservedSectorCount + ((i - 1) * newBootSector.SectorsPerFAT); Result := PartitionImage.WriteConsecutiveSectors(FATStartSectorID, stmFAT, (newBootSector.SectorsPerFAT * newBootSector.BytesPerSector)); end; finally stmFAT.Free(); end; end; // Read the FAT just written back in // This is done so we can use SetFATEntry(...) to set FAT entries for // cluster 0 and 1 if Result then begin prevMounted := Mounted; FMounted := True; try Result := ReadFAT(DEFAULT_FAT); finally FMounted := prevMounted; end; end; if Result then begin // Before any SetFATEntry(...) if called SetupFFATEntryValues(newBootSector.FATType); // FAT entry 0: Media descriptor in LSB + remaining bits set to 1 // (except first 4 MSB bits in FAT32) // FAT entry 1: EOCStart marker - but better as all 1? FATEntry_0 := 0; FATEntry_1 := 0; if (newBootSector.FATType = ftFAT12) then begin FATEntry_0 := $F00; FATEntry_1 := $FFF; end else if (newBootSector.FATType = ftFAT16) then begin FATEntry_0 := $FF00; FATEntry_1 := $FFFF; end else if (newBootSector.FATType = ftFAT32) then begin FATEntry_0 := $0FFFFF00; FATEntry_1 := $FFFFFFFF; end; FATEntry_0 := FATEntry_0 + newBootSector.MediaDescriptor; SetFATEntry(0, FATEntry_0); // This *should* be the EOC marker. // However, for some reason, MS Windows uses 0xFFFFFFFF when // formatting?! (e.g. for FAT32) // SetFATEntry(1, FFATEntryEOCStart); // SetFATEntry(1, FFATEntryEOCEnd); SetFATEntry(1, FATEntry_1); WriteFATToAllCopies(); end; // ======================================================================= // Part 3: Write root directory if Result then begin newDirContent := TSDUMemoryStream.Create(); tmpDirItem := TSDDirItem_FAT.Create(); try if (newBootSector.MaxRootEntries > 0) then begin newDirContent.Size := (newBootSector.MaxRootEntries * DIR_ENTRY_SIZE); end else begin newDirContent.Size := useClusterSize; end; newDirContent.WriteByte(0, 0, newDirContent.Size); newDirContent.Position := 0; Result := StoreClusterData(newBootSector.RootDirFirstCluster, newDirContent); if (newBootSector.FATType = ftFAT32) then begin SetLength(itemChain, 1); itemChain[0] := newBootSector.RootDirFirstCluster; newDirContent.Position := 0; Result := AllocateChainForData(itemChain, itemChainUnused, newDirContent, newDirContent.Size); StoreClusterChain(itemChain); end; WriteFATToAllCopies(); finally tmpDirItem.Free(); newDirContent.Free(); end; end; finally FSerializeCS.Release(); end; end; procedure TSDFilesystem_FAT.SetupFFATEntryValues(SetupAsFATType: TFATType); begin case SetupAsFATType of ftFAT12: begin // FFATEntrySize := FAT12_ENTRY_SIZE; FFATEntrySize := 0; FFATEntryMask := FAT12_ENTRY_MASK; FFATEntryFree := FAT12_ENTRY_FREE; FFATEntryUsedStart := FAT12_ENTRY_USED_START; FFATEntryUsedEnd := FAT12_ENTRY_USED_END; FFATEntryBadSector := FAT12_ENTRY_BAD_SECTOR; FFATEntryEOCStart := FAT12_ENTRY_EOC_START; FFATEntryEOCEnd := FAT12_ENTRY_EOC_END; end; ftFAT16: begin FFATEntrySize := FAT16_ENTRY_SIZE; FFATEntryMask := FAT16_ENTRY_MASK; FFATEntryFree := FAT16_ENTRY_FREE; FFATEntryUsedStart := FAT16_ENTRY_USED_START; FFATEntryUsedEnd := FAT16_ENTRY_USED_END; FFATEntryBadSector := FAT16_ENTRY_BAD_SECTOR; FFATEntryEOCStart := FAT16_ENTRY_EOC_START; FFATEntryEOCEnd := FAT16_ENTRY_EOC_END; end; ftFAT32: begin FFATEntrySize := FAT32_ENTRY_SIZE; FFATEntryMask := FAT32_ENTRY_MASK; FFATEntryFree := FAT32_ENTRY_FREE; FFATEntryUsedStart := FAT32_ENTRY_USED_START; FFATEntryUsedEnd := FAT32_ENTRY_USED_END; FFATEntryBadSector := FAT32_ENTRY_BAD_SECTOR; FFATEntryEOCStart := FAT32_ENTRY_EOC_START; FFATEntryEOCEnd := FAT32_ENTRY_EOC_END; end; end; end; // Given a boot sector, attempt to identify filesystem type; one of // FAT12/FAT16/FAT32 function TSDFilesystem_FAT.DetermineFATType(stmBootSector: TSDUMemoryStream): TFATType; var // fsTypeString: string; BPB_BytsPerSec: DWORD; BPB_RootEntCnt: DWORD; RootDirSectors: DWORD; FATSz: DWORD; TotSec: DWORD; BPB_ResvdSecCnt: Word; BPB_NumFATs: Byte; DataSec: DWORD; CountofClusters: DWORD; BPB_SecPerClus: Byte; begin { // Use the filesystem type string in the boot sector to determine. // Note: THIS METHOD IS WRONG!!! FAT filesystem type should actually be // determined by the number of cluster count! fsTypeString := stmBootSector.ReadString(BOOTSECTOR_LENGTH_FAT32_FATFSTYPE, BOOTSECTOR_OFFSET_FAT32_FATFSTYPE); if (fsTypeString = SIGNATURE_FAT32) then begin Result := ftFAT32; end; fsTypeString := stmBootSector.ReadString(BOOTSECTOR_LENGTH_FAT1216_FATFSTYPE, BOOTSECTOR_OFFSET_FAT1216_FATFSTYPE); if (fsTypeString = SIGNATURE_FAT12) then begin Result := ftFAT12; end else if (fsTypeString = SIGNATURE_FAT16) then begin Result := ftFAT16; end; } // This algorithm for determining FAT type taken from the MS spec: BPB_BytsPerSec := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_BYTESPERSECTOR); BPB_RootEntCnt := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_MAXROOTENTRIES); // Note: This rounds *down* - hence "div" RootDirSectors := ((BPB_RootEntCnt * 32) + (BPB_BytsPerSec - 1)) div BPB_BytsPerSec; FATSz := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_SECTORSPERFAT); if (FATSz = 0) then begin FATSz := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_FAT32_SECTORSPERFAT); end; TotSec := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_TOTALSECTORS_SMALL); if (TotSec = 0) then begin TotSec := stmBootSector.ReadDWORD_LE(BOOTSECTOR_OFFSET_TOTALSECTORS_LARGE); end; BPB_ResvdSecCnt := stmBootSector.ReadWORD_LE(BOOTSECTOR_OFFSET_RESERVEDSECTORCOUNT); BPB_NumFATs := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_FATCOUNT); BPB_SecPerClus := stmBootSector.ReadByte(BOOTSECTOR_OFFSET_SECTORSPERCLUSTER); DataSec := TotSec - (BPB_ResvdSecCnt + (BPB_NumFATs * FATSz) + RootDirSectors); // Note: This rounds *down* - hence "div" CountofClusters := DataSec div BPB_SecPerClus; if (CountofClusters < 4085) then begin // Volume is FAT12 Result := ftFAT12; end else if (CountofClusters < 65525) then begin // Volume is FAT16 Result := ftFAT16; end else begin // Volume is FAT32 Result := ftFAT32; end; end; // Extract FAT12/FAT16 root directory contents function TSDFilesystem_FAT.ExtractFAT1216RootDir(data: TStream): Boolean; begin Result := ReadWriteFAT1216RootDir(True, data); end; // Store FAT12/FAT16 root directory contents function TSDFilesystem_FAT.StoreFAT1216RootDir(data: TStream): Boolean; begin Result := ReadWriteFAT1216RootDir(False, data); end; // Read/write FAT12/FAT16 root directory contents function TSDFilesystem_FAT.ReadWriteFAT1216RootDir(readNotWrite: Boolean; data: TStream): Boolean; var startSectorID: DWORD; bytesRemaining: Integer; sectorMax: Integer; rootDirSizeInBytes: Integer; rootDirSizeInSectors: Integer; begin rootDirSizeInBytes := (MaxRootEntries * DIR_ENTRY_SIZE); rootDirSizeInSectors := (rootDirSizeInBytes div BytesPerSector); // Sanity check on writing... if not (readNotWrite) then begin AssertSufficientData(data, rootDirSizeInBytes); end; bytesRemaining := rootDirSizeInBytes; startSectorID := ReservedSectorCount + (FATCount * SectorsPerFAT); sectorMax := min(bytesRemaining, (BytesPerSector * rootDirSizeInSectors)); if readNotWrite then begin Result := PartitionImage.ReadConsecutiveSectors(startSectorID, data, sectorMax); end else begin Result := PartitionImage.WriteConsecutiveSectors(startSectorID, data, sectorMax); end; bytesRemaining := bytesRemaining - sectorMax; if Result then begin Result := (bytesRemaining = 0); end; end; // This function will delete DOSFilename from dirData function TSDFilesystem_FAT.DeleteEntryFromDir(DOSFilename: String; dirData: TSDUMemoryStream): Boolean; var currAttributes: Byte; recordOffset: Int64; begin Result := True; if Result then begin dirData.Position := 0; Result := Seek83FileDirNameInDirData(DOSFilename, dirData); end; if Result then begin // Update the parent directories contents, marking 8.3 and LFN entries // associated with the deleted item as deleted recordOffset := dirData.Position; // Mark 8.3 dir entry as deleted... dirData.WriteByte(DIR_ENTRY_DELETED); // Work backwards, removing any LFNs associated with the 8.3 dir entry // +1 because the DIR_ENTRY_DELETED byte moved us forward one byte while (recordOffset > 0) do begin recordOffset := recordOffset - DIR_ENTRY_SIZE; dirData.Position := recordOffset; currAttributes := dirData.ReadByte(recordOffset + DIR_ENTRY_OFFSET_FILEATTRS); if ((currAttributes and VFAT_ATTRIB_VFAT_ENTRY) <> VFAT_ATTRIB_VFAT_ENTRY) then begin break; end; // Mark LFN entry as deleted... dirData.Position := recordOffset; dirData.WriteByte(DIR_ENTRY_DELETED); end; end; end; // This function will add a directory entry for newItem to dirData function TSDFilesystem_FAT.AddEntryToDir(itemToAdd: TSDDirItem_FAT; var dirChain: TSDFATClusterChain; dirData: TSDUMemoryStream; var clusterReserved: DWORD; flagDirDataIsRootDirData: Boolean): Boolean; var tmpPos: Int64; cntDirEntriesReq: Integer; begin cntDirEntriesReq := WriteDirEntry(itemToAdd, nil); Result := (cntDirEntriesReq >= 0); if Result then begin if not (SeekBlockUnusedDirEntries(cntDirEntriesReq, dirData)) then begin // The root directory under FAT12/FAT16 can't be extended if (flagDirDataIsRootDirData and ((FATType = ftFAT12) or (FATType = ftFAT16))) then begin // That's it - full root dir; can't store it! Result := False; end else begin tmpPos := dirData.Size; ExtendByEmptyCluster(dirData); AddClusterToChain(clusterReserved, dirChain); // Change clusterReserved so we don't unreserve it clusterReserved := ERROR_DWORD; dirData.Position := tmpPos; end; end; end; if Result then begin WriteDirEntry(itemToAdd, dirData); end; end; function TSDFilesystem_FAT.IsValidFilename(filename: String): Boolean; var i: Integer; filenameNoDots: String; begin Result := True; filename := trim(filename); // Filename must have *some* characters in it if Result then begin Result := (length(filename) > 0); end; // Filename can't just consist of a "." characters if Result then begin filenameNoDots := trim(StringReplace(filename, '.', '', [rfReplaceAll])); Result := (length(filenameNoDots) > 0); end; if Result then begin for i := 1 to length(FAT_INVALID_FILENAME_CHARS) do begin if (Pos(FAT_INVALID_FILENAME_CHARS[i], filename) > 0) then begin Result := False; break; end; end; end; end; function TSDFilesystem_FAT.FilesystemTitle(): String; begin Result := FATTypeTitle(FATType); end; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- end.
{ Clever Internet Suite Version 6.2 Copyright (C) 1999 - 2006 Clever Components www.CleverComponents.com } unit clZLibStreams; interface {$I clVer.inc} uses Classes, SysUtils; type EclZLibError = class(Exception); TZAlloc = function (opaque: Pointer; items, size: Integer): Pointer; TZFree = procedure (opaque, block: Pointer); TZStreamRec = packed record next_in : PChar; // next input byte avail_in : Longint; // number of bytes available at next_in total_in : Longint; // total nb of input bytes read so far next_out : PChar; // next output byte should be put here avail_out: Longint; // remaining free space at next_out total_out: Longint; // total nb of bytes output so far msg : PChar; // last error message, NULL if no error state : Pointer; // not visible by applications zalloc : TZAlloc; // used to allocate the internal state zfree : TZFree; // used to free the internal state opaque : Pointer; // private data object passed to zalloc and zfree data_type: Integer; // best guess about the data type: ascii or binary adler : Longint; // adler32 value of the uncompressed data reserved : Longint; // reserved for future use end; TclCompressionLevel = (clDefault, clNoCompression, clBestSpeed, clBestCompression); TclCompressionStrategy = (csDefault, csFiltered, csHuffman, csRLE, csFixed); TclGZipInflateStream = class(TStream) private FStreamRec: TZStreamRec; FDestination: TStream; FFileCrc: LongWord; FFileSize: LongWord; FRawData: TStream; FIsContent: Boolean; FIsTrailer: Boolean; FTotalWritten: Integer; procedure InitStream; function WriteHeader(const Buffer; Count: Integer; var Offset: Integer): Boolean; function WriteData(const Buffer; Count: Integer; var Offset: Integer): Boolean; function WriteTrailer(const Buffer; Count, Offset: Integer): Boolean; public constructor Create(ADestination: TStream); destructor Destroy; override; function Read(var Buffer; Count: Longint): Longint; override; function Seek(Offset: Longint; Origin: Word): Longint; override; function Write(const Buffer; Count: Longint): Longint; override; end; TclGZipDeflateStream = class(TStream) private FStreamRec: TZStreamRec; FDestination: TStream; FFileCrc: LongWord; FFileSize: LongWord; FBuffer: PChar; FTotalWritten: Integer; procedure WriteHeader(AFlags: Integer); procedure WriteTrailer; procedure InitStream(ADestination: TStream; ALevel: TclCompressionLevel; AStrategy: TclCompressionStrategy; AFlags: Integer); public constructor Create(ADestination: TStream; ALevel: TclCompressionLevel; AStrategy: TclCompressionStrategy; AFlags: Integer); overload; constructor Create(ADestination: TStream); overload; destructor Destroy; override; function Read(var Buffer; Count: Longint): Longint; override; function Seek(Offset: Longint; Origin: Word): Longint; override; function Write(const Buffer; Count: Longint): Longint; override; end; implementation uses Windows; const ZLIB_VERSION = '1.2.3'; Z_NO_FLUSH = 0; Z_PARTIAL_FLUSH = 1; Z_SYNC_FLUSH = 2; Z_FULL_FLUSH = 3; Z_FINISH = 4; Z_BLOCK = 5; Z_OK = 0; Z_STREAM_END = 1; Z_NEED_DICT = 2; Z_ERRNO = (-1); Z_STREAM_ERROR = (-2); Z_DATA_ERROR = (-3); Z_MEM_ERROR = (-4); Z_BUF_ERROR = (-5); Z_VERSION_ERROR = (-6); Z_DEFAULT_COMPRESSION = (-1); Z_NO_COMPRESSION = 0; Z_BEST_SPEED = 1; Z_BEST_COMPRESSION = 9; Z_DEFAULT_STRATEGY = 0; Z_FILTERED = 1; Z_HUFFMAN_ONLY = 2; Z_RLE = 3; Z_FIXED = 4; Z_BINARY = 0; Z_ASCII = 1; Z_TEXT = Z_ASCII; Z_UNKNOWN = 2; Z_DEFLATED = 8; MAX_WBITS = 15; DEF_MEM_LEVEL = 8; Z_BUFSIZE = $4000; _z_errmsg: array[0..9] of PChar = ( 'need dictionary', // Z_NEED_DICT (2) 'stream end', // Z_STREAM_END (1) 'ok', // Z_OK (0) 'file error', // Z_ERRNO (-1) 'stream error', // Z_STREAM_ERROR (-2) 'data error', // Z_DATA_ERROR (-3) 'insufficient memory', // Z_MEM_ERROR (-4) 'buffer error', // Z_BUF_ERROR (-5) 'incompatible version', // Z_VERSION_ERROR (-6) '' ); {$L deflate.obj} {$L inflate.obj} {$L inftrees.obj} {$L infback.obj} {$L inffast.obj} {$L trees.obj} {$L compress.obj} {$L adler32.obj} {$L crc32.obj} function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar; recsize: Integer): Integer; external; function deflateInit2_(var strm: TZStreamRec; level, method, windowBits, memLevel, strategy: Integer; version: PChar; recsize: Integer): Integer; external; function deflate(var strm: TZStreamRec; flush: Integer): Integer; external; function deflateEnd(var strm: TZStreamRec): Integer; external; function inflateInit_(var strm: TZStreamRec; version: PChar; recsize: Integer): Integer; external; function inflateInit2_(var strm: TZStreamRec; windowBits: Integer; version: PChar; recsize: Integer): Integer; external; function inflate(var strm: TZStreamRec; flush: Integer): Integer; external; function inflateEnd(var strm: TZStreamRec): Integer; external; function inflateReset(var strm: TZStreamRec): Integer; external; function crc32(crc : LongWord; buf : Pointer; len : Integer) : LongWord; external; function zcalloc(opaque: Pointer; items, size: Integer): Pointer; begin GetMem(result,items * size); end; procedure zcfree(opaque, block: Pointer); begin FreeMem(block); end; procedure _memset(p: Pointer; b: Byte; count: Integer); cdecl; begin FillChar(p^,count,b); end; procedure _memcpy(dest, source: Pointer; count: Integer); cdecl; begin Move(source^,dest^,count); end; { TclGZipInflateStream } constructor TclGZipInflateStream.Create(ADestination: TStream); begin inherited Create(); FRawData := TMemoryStream.Create(); Assert(ADestination <> nil); FDestination := ADestination; inflateInit2_(FStreamRec, -MAX_WBITS, ZLIB_VERSION, SizeOf(TZStreamRec)); InitStream(); FTotalWritten := 0; end; destructor TclGZipInflateStream.Destroy; begin inflateEnd(FStreamRec); FRawData.Free(); inherited Destroy(); end; function TclGZipInflateStream.Read(var Buffer; Count: Integer): Longint; begin Result := 0; end; function TclGZipInflateStream.Seek(Offset: Integer; Origin: Word): Longint; begin case Origin of soFromBeginning: Result := Offset; soFromCurrent: Result := FTotalWritten + Offset; soFromEnd: Result := FTotalWritten - Offset else Result := 0; end; if (Result <> FTotalWritten) then begin raise EclZLibError.Create('Invalid Stream operation'); end; end; function TclGZipInflateStream.WriteHeader(const Buffer; Count: Integer; var Offset: Integer): Boolean; var flags: Byte; extra: Word; b: Byte; begin Offset := 0; Result := False; FRawData.Seek(0, soFromEnd); FRawData.Write(Buffer, Count); FRawData.Position := 0; if FRawData.Size < 10 then begin Result := False; Exit; end; FRawData.Seek(3, soFromCurrent); FRawData.Read(flags, 1); FRawData.Seek(6, soFromCurrent); if flags and $4 = $4 then begin // FEXTRA if FRawData.Size - FRawData.Position < 2 then Exit; FRawData.Read(extra, 2); if FRawData.Size - FRawData.Position < extra then Exit; FRawData.Seek(extra, soFromCurrent); end; if flags and $8 = $8 then begin // FNAME repeat if FRawData.Read(b, 1) = 0 then Exit; until (b = 0); end; if flags and $10 = $10 then begin // FCOMMENT repeat if FRawData.Read(b, 1) = 0 then Exit; until (b = 0); end; if flags and $2 = $2 then begin // FHCRC if FRawData.Size - FRawData.Position < 2 then Exit; FRawData.Seek(2, soFromCurrent); end; Offset := FRawData.Position - FRawData.Size + Count; FRawData.Size := 0; FRawData.Position := 0; Result := True; end; function TclGZipInflateStream.WriteData(const Buffer; Count: Integer; var Offset: Integer): Boolean; var res: Integer; buf: PChar; begin Result := False; if (Offset >= Count) then Exit; FStreamRec.next_in := PChar(Integer(@Buffer) + offset); FStreamRec.avail_in := Count - offset; GetMem(buf, Z_BUFSIZE); try res := Z_OK; while (FStreamRec.avail_in > 0) and (res = Z_OK) do begin FStreamRec.next_out := buf; FStreamRec.avail_out := Z_BUFSIZE; res := inflate(FStreamRec, Z_NO_FLUSH); FDestination.Write(buf^, Z_BUFSIZE - FStreamRec.avail_out); FFileCrc := crc32(FFileCrc, Pointer(buf), Z_BUFSIZE - FStreamRec.avail_out); FFileSize := FFileSize + Z_BUFSIZE - LongWord(FStreamRec.avail_out); end; if (res <> Z_OK) and (res <> Z_STREAM_END) then begin raise EclZLibError.Create('Uncompressing error - ' + FStreamRec.msg); end; Result := (res = Z_STREAM_END); Offset := Integer(FStreamRec.next_in) - Integer(@Buffer); finally FreeMem(buf); end; end; function TclGZipInflateStream.WriteTrailer(const Buffer; Count, Offset: Integer): Boolean; var crc, size: LongWord; begin Result := False; if (Offset >= Count) then Exit; FRawData.Seek(0, soFromEnd); FRawData.Write(PChar(Integer(@Buffer) + Offset)^, Count - Offset); FRawData.Position := 0; if (FRawData.Size >= SizeOf(crc) + SizeOf(size)) then begin FRawData.Read(crc, SizeOf(crc)); FRawData.Read(size, SizeOf(size)); if (crc <> FFileCrc) then begin raise EclZLibError.Create('Uncompressing error - invalid crc'); end; if (size <> FFileSize) then begin raise EclZLibError.Create('Uncompressing error - invalid data size'); end; Result := True; end; end; function TclGZipInflateStream.Write(const Buffer; Count: Integer): Longint; var offset: Integer; begin Result := Count; FTotalWritten := FTotalWritten + Result; offset := 0; if not FIsContent then begin if not WriteHeader(Buffer, Count, offset) then Exit; FIsContent := True; end; if (not FIsTrailer) then begin FIsTrailer := WriteData(Buffer, Count, offset); end; if FIsTrailer then begin if WriteTrailer(Buffer, Count, offset) then begin InitStream(); end; end; end; procedure TclGZipInflateStream.InitStream; begin FFileCrc := 0; FFileSize := 0; FRawData.Size := 0; FRawData.Position := 0; FIsContent := False; FIsTrailer := False; end; { TclGZipDeflateStream } procedure TclGZipDeflateStream.InitStream(ADestination: TStream; ALevel: TclCompressionLevel; AStrategy: TclCompressionStrategy; AFlags: Integer); const compressionLevels: array[TclCompressionLevel] of Integer = ( Z_DEFAULT_COMPRESSION, Z_NO_COMPRESSION, Z_BEST_SPEED, Z_BEST_COMPRESSION); begin FFileCrc := 0; FFileSize := 0; FTotalWritten := 0; Assert(ADestination <> nil); FDestination := ADestination; deflateInit2_(FStreamRec, compressionLevels[ALevel], Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, Integer(AStrategy), ZLIB_VERSION, SizeOf(TZStreamRec)); WriteHeader(AFlags); GetMem(FBuffer, Z_BUFSIZE); FStreamRec.next_out := FBuffer; FStreamRec.avail_out := Z_BUFSIZE; end; constructor TclGZipDeflateStream.Create(ADestination: TStream; ALevel: TclCompressionLevel; AStrategy: TclCompressionStrategy; AFlags: Integer); begin inherited Create(); InitStream(ADestination, ALevel, AStrategy, AFlags); end; constructor TclGZipDeflateStream.Create(ADestination: TStream); begin inherited Create(); InitStream(ADestination, clDefault, csDefault, 0); end; destructor TclGZipDeflateStream.Destroy; begin try WriteTrailer(); finally FreeMem(FBuffer); deflateEnd(FStreamRec); inherited Destroy(); end; end; function TclGZipDeflateStream.Read(var Buffer; Count: Integer): Longint; begin Result := 0; end; function TclGZipDeflateStream.Seek(Offset: Integer; Origin: Word): Longint; begin case Origin of soFromBeginning: Result := Offset; soFromCurrent: Result := FTotalWritten + Offset; soFromEnd: Result := FTotalWritten - Offset else Result := 0; end; if (Result <> FTotalWritten) then begin raise EclZLibError.Create('Invalid Stream operation'); end; end; function TclGZipDeflateStream.Write(const Buffer; Count: Integer): Longint; begin Result := Count; FTotalWritten := FTotalWritten + Result; FStreamRec.next_in := @Buffer; FStreamRec.avail_in := Count; while FStreamRec.avail_in > 0 do begin if FStreamRec.avail_out = 0 then begin if (FDestination.Write(FBuffer^, Z_BUFSIZE) <> Z_BUFSIZE) then begin raise EclZLibError.Create('Compressing error - can not write to Stream'); end; FStreamRec.next_out := FBuffer; FStreamRec.avail_out := Z_BUFSIZE; end; if (deflate(FStreamRec, Z_NO_FLUSH) <> Z_OK) then begin raise EclZLibError.Create('Compressing error - ' + FStreamRec.msg); end; end; FFileCrc := crc32(FFileCrc, @Buffer, Count); FFileSize := FFileSize + LongWord(Count); end; procedure TclGZipDeflateStream.WriteHeader(AFlags: Integer); var gzheader: array[0..9] of Byte; begin ZeroMemory(@gzheader, SizeOf(gzheader)); gzheader[0] := $1F; gzheader[1] := $8B; gzheader[2] := Z_DEFLATED; gzheader[3] := Byte(AFlags); FDestination.Write(gzheader, SizeOf(gzheader)); end; procedure TclGZipDeflateStream.WriteTrailer; var len, res: Integer; done: Boolean; begin FStreamRec.avail_in := 0; done := False; repeat len := Z_BUFSIZE - FStreamRec.avail_out; if (len <> 0) then begin if (FDestination.Write(FBuffer^, len) <> len) then begin raise EclZLibError.Create('Compressing error - can not write to Stream'); end; FStreamRec.next_out := FBuffer; FStreamRec.avail_out := Z_BUFSIZE; end; if done then Break; res := deflate(FStreamRec, Z_FINISH); if (len = 0) and (res = Z_BUF_ERROR) then begin res := Z_OK; end; done := (FStreamRec.avail_out <> 0) or (res = Z_STREAM_END); if (res <> Z_OK) and (res <> Z_STREAM_END) then begin raise EclZLibError.Create('Compressing error - ' + FStreamRec.msg); end; until False; FDestination.Write(FFileCrc, SizeOf(FFileCrc)); FDestination.Write(FFileSize, SizeOf(FFileSize)); end; end.
unit Objekt.Backup; interface uses SysUtils, Classes, IBX.IBServices, Objekt.Option, Vcl.Forms, Vcl.Controls; type TStartBackupEvent = procedure(Sender: TObject; aOption: TOption) of object; TEndBackupEvent = procedure(Sender: TObject; aOption: TOption) of object; TBackupErrorEvent = procedure(Sender: TObject; aOption: TOption; aError: string) of object; type TBackup = class private fBackupFilenameList: TStringList; fBackupProtokollPfad: string; fOnStartBackup: TStartBackupEvent; fOnEndBackup: TEndBackupEvent; fOnBackupError: TBackupErrorEvent; function getBackupFilename(aValue: string): string; function getBackupProtokollFilename(aValue:string): string; public constructor Create; destructor Destroy; override; function StartBackup(aOption: TOption): string; procedure LeseBackupsInList(aValue: string); procedure CheckAndDeleteOldestFile(aValue: string; aMaxAnzahl: Integer); property BackupProtokollPfad: string read fBackupProtokollPfad write fBackupProtokollPfad; property OnStartBackup: TStartBackupEvent read fOnStartBackup write fOnStartBackup; property OnEndBackup: TEndBackupEvent read fOnEndBackup write fOnEndBackup; property OnBackupError: TBackupErrorEvent read fOnBackupError write fOnBackupError; end; implementation { TBackup } uses Allgemein.System, Objekt.Allgemein; constructor TBackup.Create; begin fBackupFilenameList := TStringList.Create; fBackupFilenameList.Sorted := true; fBackupProtokollPfad := ''; end; destructor TBackup.Destroy; begin FreeAndNil(fBackupFilenameList); inherited; end; function TBackup.StartBackup(aOption: TOption): string; var s: string[255]; Backup: TIBBackupService; BackupFilename: string; BackupProtokollFilename: string; BackupProtokoll: TStringList; Cur: TCursor; begin Cur := Screen.Cursor; Result := ''; if aOption = nil then exit; Backup := TIBBackupService.Create(nil); try BackupFilename := aOption.Backupdatei; BackupProtokollFilename := getBackupProtokollFilename(BackupFilename); DeleteFile(BackupProtokollFilename); if (aOption.Zeitstempel) or ((aOption.MaxAnzahlBackupDateien) and (aOption.MaxAnzahlBackup > 0)) then BackupFilename := getBackupFilename(aOption.Backupdatei); if ((aOption.MaxAnzahlBackupDateien) and (aOption.MaxAnzahlBackup > 0)) then CheckAndDeleteOldestFile(aOption.Backupdatei, aOption.MaxAnzahlBackup); if Trim(BackupFilename) = '' then begin AllgemeinObj.Log.DebugInfo('Es wird kein Backup durchgeführt, da Backupdateiname leer ist.'); exit; end; if FileExists(BackupFilename) then AllgemeinObj.Log.DebugInfo('Datei wird gelöscht(2):' + BackupFilename); DeleteFile(BackupFilename); s := aOption.Servername + ':' + aOption.Datenbank; Backup.ServerName := aOption.Servername; Backup.DatabaseName := aOption.Datenbank; Backup.BackupFile.Text := BackupFilename; Backup.LoginPrompt := false; Backup.Options := []; Backup.Params.Add('password='+aOption.Passwort); Backup.Params.Add('user_name='+aOption.User); try if Assigned(fOnStartBackup) then fOnStartBackup(Self, aOption); Screen.Cursor := crHourglass; Backup.Verbose := true; Backup.Active := true; Backup.ServiceStart; BackupProtokoll := TStringList.Create; try while not Backup.Eof do BackupProtokoll.Add(Backup.GetNextLine); BackupProtokoll.SaveToFile(BackupProtokollFilename); finally FreeAndNil(BackupProtokoll); end; if Assigned(fOnEndBackup) then fOnEndBackup(Self, aOption); except on E:Exception do begin Result := 'Fehler beim Durchführen der Sicherung: ' + E.Message; if Assigned(fOnBackupError) then fOnBackupError(Self, aOption, E.Message); end; end; Backup.Active := false; finally FreeAndNil(Backup); Screen.Cursor := Cur; end; end; function TBackup.getBackupFilename(aValue: string): string; var ext: string; NewFilename: string; begin ext := ExtractFileExt(aValue); NewFilename := copy(aValue, 1, Length(aValue)- Length(ext)); NewFilename := NewFilename + '_' + FormatDateTime('yyyymmddhhnn', now)+ ext; Result := NewFilename; end; procedure TBackup.LeseBackupsInList(aValue: string); var i1: Integer; ext: string; Pfad: string; Filename: string; RawFilename: string; VglFilename: string; FilenameList: TStringList; DateiDatum: TDateTime; begin fBackupFilenameList.Clear; Pfad := ExtractFilePath(aValue); Filename := ExtractFileName(aValue); ext := ExtractFileExt(Filename); if SameText('.fdb', ext) then exit; // Nur zur Sicherheit, dass keine Datenbanken gelöscht werden RawFilename := copy(Filename, 1, Length(Filename)-Length(ext)); FilenameList := TStringList.Create; try GetAllFiles(Pfad, FilenameList, true, false, '*'+ext); for i1 := 0 to Filenamelist.Count -1 do begin VglFilename := ExtractFileName(FilenameList.Strings[i1]); VglFilename := copy(VglFilename, 1, Length(RawFilename)); if SameText(RawFilename, VglFilename) then begin DateiDatum := getFileAge(FilenameList.Strings[i1]); fBackupFilenameList.Add(FormatDateTime('yyyymmddhhnnss', DateiDatum)+'='+FilenameList.Strings[i1]); end; end; finally FreeAndNil(FilenameList); end; end; procedure TBackup.CheckAndDeleteOldestFile(aValue: string; aMaxAnzahl: Integer); var Filename: string; ext: string; begin LeseBackupsInList(aValue); if (fBackupFilenameList.Count = 0) then AllgemeinObj.Log.DebugInfo('Keine älteren Backupdatein zum Löschen gefunden'); // AllgemeinObj.Log.DebugInfo('Anz der Backupdateien:' + IntToStr(fBackupFilenameList.Count) + ' / ' + // 'Anz der max. Backupdateien:' + IntToStr(aMaxAnzahl)); if (fBackupFilenameList.Count = 0) or (fBackupFilenameList.Count < aMaxAnzahl) then exit; Filename := fBackupFilenameList.ValueFromIndex[0]; ext := ExtractFileExt(Filename); if SameText('.fdb', ext) then begin AllgemeinObj.Log.DebugInfo('Eine Backupdatei mit der Erweiterung ".fdb" ist nicht zulässig:'+aValue); exit; // Nur zur Sicherheit, dass keine Datenbanken gelöscht werden end; AllgemeinObj.Log.DebugInfo('Datei wird gelöscht(1):' + Filename); DeleteFile(Filename); end; function TBackUp.getBackupProtokollFilename(aValue:string): string; var Filename: string; RawFilename: string; ext: string; Path: string; begin Path := ExtractFilePath(aValue); if (fBackupProtokollPfad > '') and (DirectoryExists(fBackupProtokollPfad)) then Path := fBackupProtokollPfad; Filename := ExtractFileName(aValue); ext := ExtractFileExt(Filename); RawFilename := copy(Filename, 1, Length(Filename)-Length(ext)); Result := Path + RawFilename + '_BackupProtokoll.txt'; end; end.
// // Generated by JavaToPas v1.5 20171018 - 170938 //////////////////////////////////////////////////////////////////////////////// unit android.media.PlaybackParams; interface uses AndroidAPI.JNIBridge, Androidapi.JNI.JavaTypes, Androidapi.JNI.os; type JPlaybackParams = interface; JPlaybackParamsClass = interface(JObjectClass) ['{B7E70CDA-83FC-451D-9FF0-14312A53D2CF}'] function _GetAUDIO_FALLBACK_MODE_DEFAULT : Integer; cdecl; // A: $19 function _GetAUDIO_FALLBACK_MODE_FAIL : Integer; cdecl; // A: $19 function _GetAUDIO_FALLBACK_MODE_MUTE : Integer; cdecl; // A: $19 function _GetCREATOR : JParcelable_Creator; cdecl; // A: $19 function allowDefaults : JPlaybackParams; cdecl; // ()Landroid/media/PlaybackParams; A: $1 function describeContents : Integer; cdecl; // ()I A: $1 function getAudioFallbackMode : Integer; cdecl; // ()I A: $1 function getPitch : Single; cdecl; // ()F A: $1 function getSpeed : Single; cdecl; // ()F A: $1 function init : JPlaybackParams; cdecl; // ()V A: $1 function setAudioFallbackMode(audioFallbackMode : Integer) : JPlaybackParams; cdecl;// (I)Landroid/media/PlaybackParams; A: $1 function setPitch(pitch : Single) : JPlaybackParams; cdecl; // (F)Landroid/media/PlaybackParams; A: $1 function setSpeed(speed : Single) : JPlaybackParams; cdecl; // (F)Landroid/media/PlaybackParams; A: $1 procedure writeToParcel(dest : JParcel; flags : Integer) ; cdecl; // (Landroid/os/Parcel;I)V A: $1 property AUDIO_FALLBACK_MODE_DEFAULT : Integer read _GetAUDIO_FALLBACK_MODE_DEFAULT;// I A: $19 property AUDIO_FALLBACK_MODE_FAIL : Integer read _GetAUDIO_FALLBACK_MODE_FAIL;// I A: $19 property AUDIO_FALLBACK_MODE_MUTE : Integer read _GetAUDIO_FALLBACK_MODE_MUTE;// I A: $19 property CREATOR : JParcelable_Creator read _GetCREATOR; // Landroid/os/Parcelable$Creator; A: $19 end; [JavaSignature('android/media/PlaybackParams')] JPlaybackParams = interface(JObject) ['{A60AA917-F462-4D5A-9FF4-FAFFE43742FB}'] function allowDefaults : JPlaybackParams; cdecl; // ()Landroid/media/PlaybackParams; A: $1 function describeContents : Integer; cdecl; // ()I A: $1 function getAudioFallbackMode : Integer; cdecl; // ()I A: $1 function getPitch : Single; cdecl; // ()F A: $1 function getSpeed : Single; cdecl; // ()F A: $1 function setAudioFallbackMode(audioFallbackMode : Integer) : JPlaybackParams; cdecl;// (I)Landroid/media/PlaybackParams; A: $1 function setPitch(pitch : Single) : JPlaybackParams; cdecl; // (F)Landroid/media/PlaybackParams; A: $1 function setSpeed(speed : Single) : JPlaybackParams; cdecl; // (F)Landroid/media/PlaybackParams; A: $1 procedure writeToParcel(dest : JParcel; flags : Integer) ; cdecl; // (Landroid/os/Parcel;I)V A: $1 end; TJPlaybackParams = class(TJavaGenericImport<JPlaybackParamsClass, JPlaybackParams>) end; const TJPlaybackParamsAUDIO_FALLBACK_MODE_DEFAULT = 0; TJPlaybackParamsAUDIO_FALLBACK_MODE_FAIL = 2; TJPlaybackParamsAUDIO_FALLBACK_MODE_MUTE = 1; implementation end.
// Generated from CLDR data. Do not edit. unit NtNumberData; interface uses NtNumber, NtPattern; const // Afrikaans AF_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 duisend'), (Range: 1000; Plural: pfOther; Value: '0 duisend'), (Range: 10000; Plural: pfOne; Value: '00 duisend'), (Range: 10000; Plural: pfOther; Value: '00 duisend'), (Range: 100000; Plural: pfOne; Value: '000 duisend'), (Range: 100000; Plural: pfOther; Value: '000 duisend'), (Range: 1000000; Plural: pfOne; Value: '0 miljoen'), (Range: 1000000; Plural: pfOther; Value: '0 miljoen'), (Range: 10000000; Plural: pfOne; Value: '00 miljoen'), (Range: 10000000; Plural: pfOther; Value: '00 miljoen'), (Range: 100000000; Plural: pfOne; Value: '000 miljoen'), (Range: 100000000; Plural: pfOther; Value: '000 miljoen'), (Range: 1000000000; Plural: pfOne; Value: '0 miljard'), (Range: 1000000000; Plural: pfOther; Value: '0 miljard'), (Range: 10000000000; Plural: pfOne; Value: '00 miljard'), (Range: 10000000000; Plural: pfOther; Value: '00 miljard'), (Range: 100000000000; Plural: pfOne; Value: '000 miljard'), (Range: 100000000000; Plural: pfOther; Value: '000 miljard'), (Range: 1000000000000; Plural: pfOne; Value: '0 biljoen'), (Range: 1000000000000; Plural: pfOther; Value: '0 biljoen'), (Range: 10000000000000; Plural: pfOne; Value: '00 biljoen'), (Range: 10000000000000; Plural: pfOther; Value: '00 biljoen'), (Range: 100000000000000; Plural: pfOne; Value: '000 biljoen'), (Range: 100000000000000; Plural: pfOther; Value: '000 biljoen') ); AF_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0'), (Range: 100000; Plural: pfOne; Value: '0'), (Range: 100000; Plural: pfOther; Value: '0'), (Range: 1000000; Plural: pfOne; Value: '0 m'), (Range: 1000000; Plural: pfOther; Value: '0 m'), (Range: 10000000; Plural: pfOne; Value: '00 m'), (Range: 10000000; Plural: pfOther; Value: '00 m'), (Range: 100000000; Plural: pfOne; Value: '000 m'), (Range: 100000000; Plural: pfOther; Value: '000 m'), (Range: 1000000000; Plural: pfOne; Value: '0 mjd'), (Range: 1000000000; Plural: pfOther; Value: '0 mjd'), (Range: 10000000000; Plural: pfOne; Value: '00 mjd'), (Range: 10000000000; Plural: pfOther; Value: '00 mjd'), (Range: 100000000000; Plural: pfOne; Value: '000 mjd'), (Range: 100000000000; Plural: pfOther; Value: '000 mjd'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn') ); AF_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤0 m'), (Range: 1000000; Plural: pfOther; Value: '¤0 m'), (Range: 10000000; Plural: pfOne; Value: '¤00 m'), (Range: 10000000; Plural: pfOther; Value: '¤00 m'), (Range: 100000000; Plural: pfOne; Value: '¤000 m'), (Range: 100000000; Plural: pfOther; Value: '¤000 m'), (Range: 1000000000; Plural: pfOne; Value: '¤0 mjd'), (Range: 1000000000; Plural: pfOther; Value: '¤0 mjd'), (Range: 10000000000; Plural: pfOne; Value: '¤00 mjd'), (Range: 10000000000; Plural: pfOther; Value: '¤00 mjd'), (Range: 100000000000; Plural: pfOne; Value: '¤000 mjd'), (Range: 100000000000; Plural: pfOther; Value: '¤000 mjd'), (Range: 1000000000000; Plural: pfOne; Value: '¤0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '¤00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '¤000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 bn') ); // Aghem AGQ_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Akan AK_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Amharic AM_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ሺ'), (Range: 1000; Plural: pfOther; Value: '0 ሺ'), (Range: 10000; Plural: pfOne; Value: '00 ሺ'), (Range: 10000; Plural: pfOther; Value: '00 ሺ'), (Range: 100000; Plural: pfOne; Value: '000 ሺ'), (Range: 100000; Plural: pfOther; Value: '000 ሺ'), (Range: 1000000; Plural: pfOne; Value: '0 ሚሊዮን'), (Range: 1000000; Plural: pfOther; Value: '0 ሚሊዮን'), (Range: 10000000; Plural: pfOne; Value: '00 ሚሊዮን'), (Range: 10000000; Plural: pfOther; Value: '00 ሚሊዮን'), (Range: 100000000; Plural: pfOne; Value: '000 ሚሊዮን'), (Range: 100000000; Plural: pfOther; Value: '000 ሚሊዮን'), (Range: 1000000000; Plural: pfOne; Value: '0 ቢሊዮን'), (Range: 1000000000; Plural: pfOther; Value: '0 ቢሊዮን'), (Range: 10000000000; Plural: pfOne; Value: '00 ቢሊዮን'), (Range: 10000000000; Plural: pfOther; Value: '00 ቢሊዮን'), (Range: 100000000000; Plural: pfOne; Value: '000 ቢሊዮን'), (Range: 100000000000; Plural: pfOther; Value: '000 ቢሊዮን'), (Range: 1000000000000; Plural: pfOne; Value: '0 ትሪሊዮን'), (Range: 1000000000000; Plural: pfOther; Value: '0 ትሪሊዮን'), (Range: 10000000000000; Plural: pfOne; Value: '00 ትሪሊዮን'), (Range: 10000000000000; Plural: pfOther; Value: '00 ትሪሊዮን'), (Range: 100000000000000; Plural: pfOne; Value: '000 ትሪሊዮን'), (Range: 100000000000000; Plural: pfOther; Value: '000 ትሪሊዮን') ); AM_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ሺ'), (Range: 1000; Plural: pfOther; Value: '0 ሺ'), (Range: 10000; Plural: pfOne; Value: '00 ሺ'), (Range: 10000; Plural: pfOther; Value: '00 ሺ'), (Range: 100000; Plural: pfOne; Value: '000 ሺ'), (Range: 100000; Plural: pfOther; Value: '000 ሺ'), (Range: 1000000; Plural: pfOne; Value: '0 ሜትር'), (Range: 1000000; Plural: pfOther; Value: '0 ሜትር'), (Range: 10000000; Plural: pfOne; Value: '00 ሜትር'), (Range: 10000000; Plural: pfOther; Value: '00 ሜትር'), (Range: 100000000; Plural: pfOne; Value: '000ሜ'), (Range: 100000000; Plural: pfOther; Value: '000ሜ'), (Range: 1000000000; Plural: pfOne; Value: '0 ቢ'), (Range: 1000000000; Plural: pfOther; Value: '0 ቢ'), (Range: 10000000000; Plural: pfOne; Value: '00 ቢ'), (Range: 10000000000; Plural: pfOther; Value: '00 ቢ'), (Range: 100000000000; Plural: pfOne; Value: '000 ቢ'), (Range: 100000000000; Plural: pfOther; Value: '000 ቢ'), (Range: 1000000000000; Plural: pfOne; Value: '0 ት'), (Range: 1000000000000; Plural: pfOther; Value: '0 ት'), (Range: 10000000000000; Plural: pfOne; Value: '00 ት'), (Range: 10000000000000; Plural: pfOther; Value: '00 ት'), (Range: 100000000000000; Plural: pfOne; Value: '000 ት'), (Range: 100000000000000; Plural: pfOther; Value: '000 ት') ); AM_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0 ሺ'), (Range: 1000; Plural: pfOther; Value: '¤0 ሺ'), (Range: 10000; Plural: pfOne; Value: '¤00 ሺ'), (Range: 10000; Plural: pfOther; Value: '¤00 ሺ'), (Range: 100000; Plural: pfOne; Value: '¤000 ሺ'), (Range: 100000; Plural: pfOther; Value: '¤000 ሺ'), (Range: 1000000; Plural: pfOne; Value: '¤0 ሜትር'), (Range: 1000000; Plural: pfOther; Value: '¤0 ሜትር'), (Range: 10000000; Plural: pfOne; Value: '¤00 ሜትር'), (Range: 10000000; Plural: pfOther; Value: '¤00 ሜትር'), (Range: 100000000; Plural: pfOne; Value: '¤000 ሜትር'), (Range: 100000000; Plural: pfOther; Value: '¤000 ሜትር'), (Range: 1000000000; Plural: pfOne; Value: '¤0 ቢ'), (Range: 1000000000; Plural: pfOther; Value: '¤0 ቢ'), (Range: 10000000000; Plural: pfOne; Value: '¤00 ቢ'), (Range: 10000000000; Plural: pfOther; Value: '¤00 ቢ'), (Range: 100000000000; Plural: pfOne; Value: '¤000 ቢ'), (Range: 100000000000; Plural: pfOther; Value: '¤000 ቢ'), (Range: 1000000000000; Plural: pfOne; Value: '¤0 ት'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 ት'), (Range: 10000000000000; Plural: pfOne; Value: '¤00 ት'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 ት'), (Range: 100000000000000; Plural: pfOne; Value: '¤000 ት'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 ት') ); // Arabic AR_LONG: array[0..71] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 ألف'), (Range: 1000; Plural: pfOne; Value: '0 ألف'), (Range: 1000; Plural: pfTwo; Value: '0 ألف'), (Range: 1000; Plural: pfFew; Value: '0 آلاف'), (Range: 1000; Plural: pfMany; Value: '0 ألف'), (Range: 1000; Plural: pfOther; Value: '0 ألف'), (Range: 10000; Plural: pfZero; Value: '00 ألف'), (Range: 10000; Plural: pfOne; Value: '00 ألف'), (Range: 10000; Plural: pfTwo; Value: '00 ألف'), (Range: 10000; Plural: pfFew; Value: '00 ألف'), (Range: 10000; Plural: pfMany; Value: '00 ألف'), (Range: 10000; Plural: pfOther; Value: '00 ألف'), (Range: 100000; Plural: pfZero; Value: '000 ألف'), (Range: 100000; Plural: pfOne; Value: '000 ألف'), (Range: 100000; Plural: pfTwo; Value: '000 ألف'), (Range: 100000; Plural: pfFew; Value: '000 ألف'), (Range: 100000; Plural: pfMany; Value: '000 ألف'), (Range: 100000; Plural: pfOther; Value: '000 ألف'), (Range: 1000000; Plural: pfZero; Value: '0 مليون'), (Range: 1000000; Plural: pfOne; Value: '0 مليون'), (Range: 1000000; Plural: pfTwo; Value: '0 مليون'), (Range: 1000000; Plural: pfFew; Value: '0 ملايين'), (Range: 1000000; Plural: pfMany; Value: '0 مليون'), (Range: 1000000; Plural: pfOther; Value: '0 مليون'), (Range: 10000000; Plural: pfZero; Value: '00 مليون'), (Range: 10000000; Plural: pfOne; Value: '00 مليون'), (Range: 10000000; Plural: pfTwo; Value: '00 مليون'), (Range: 10000000; Plural: pfFew; Value: '00 ملايين'), (Range: 10000000; Plural: pfMany; Value: '00 مليون'), (Range: 10000000; Plural: pfOther; Value: '00 مليون'), (Range: 100000000; Plural: pfZero; Value: '000 مليون'), (Range: 100000000; Plural: pfOne; Value: '000 مليون'), (Range: 100000000; Plural: pfTwo; Value: '000 مليون'), (Range: 100000000; Plural: pfFew; Value: '000 مليون'), (Range: 100000000; Plural: pfMany; Value: '000 مليون'), (Range: 100000000; Plural: pfOther; Value: '000 مليون'), (Range: 1000000000; Plural: pfZero; Value: '0 مليار'), (Range: 1000000000; Plural: pfOne; Value: '0 مليار'), (Range: 1000000000; Plural: pfTwo; Value: '0 مليار'), (Range: 1000000000; Plural: pfFew; Value: '0 مليار'), (Range: 1000000000; Plural: pfMany; Value: '0 مليار'), (Range: 1000000000; Plural: pfOther; Value: '0 مليار'), (Range: 10000000000; Plural: pfZero; Value: '00 مليار'), (Range: 10000000000; Plural: pfOne; Value: '00 مليار'), (Range: 10000000000; Plural: pfTwo; Value: '00 مليار'), (Range: 10000000000; Plural: pfFew; Value: '00 مليار'), (Range: 10000000000; Plural: pfMany; Value: '00 مليار'), (Range: 10000000000; Plural: pfOther; Value: '00 مليار'), (Range: 100000000000; Plural: pfZero; Value: '000 مليار'), (Range: 100000000000; Plural: pfOne; Value: '000 مليار'), (Range: 100000000000; Plural: pfTwo; Value: '000 مليار'), (Range: 100000000000; Plural: pfFew; Value: '000 مليار'), (Range: 100000000000; Plural: pfMany; Value: '000 مليار'), (Range: 100000000000; Plural: pfOther; Value: '000 مليار'), (Range: 1000000000000; Plural: pfZero; Value: '0 تريليون'), (Range: 1000000000000; Plural: pfOne; Value: '0 تريليون'), (Range: 1000000000000; Plural: pfTwo; Value: '0 تريليون'), (Range: 1000000000000; Plural: pfFew; Value: '0 تريليونات'), (Range: 1000000000000; Plural: pfMany; Value: '0 تريليون'), (Range: 1000000000000; Plural: pfOther; Value: '0 تريليون'), (Range: 10000000000000; Plural: pfZero; Value: '00 تريليون'), (Range: 10000000000000; Plural: pfOne; Value: '00 تريليون'), (Range: 10000000000000; Plural: pfTwo; Value: '00 تريليون'), (Range: 10000000000000; Plural: pfFew; Value: '00 تريليون'), (Range: 10000000000000; Plural: pfMany; Value: '00 تريليون'), (Range: 10000000000000; Plural: pfOther; Value: '00 تريليون'), (Range: 100000000000000; Plural: pfZero; Value: '000 تريليون'), (Range: 100000000000000; Plural: pfOne; Value: '000 تريليون'), (Range: 100000000000000; Plural: pfTwo; Value: '000 تريليون'), (Range: 100000000000000; Plural: pfFew; Value: '000 تريليون'), (Range: 100000000000000; Plural: pfMany; Value: '000 تريليون'), (Range: 100000000000000; Plural: pfOther; Value: '000 تريليون') ); AR_SHORT: array[0..71] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 ألف'), (Range: 1000; Plural: pfOne; Value: '0 ألف'), (Range: 1000; Plural: pfTwo; Value: '0 ألف'), (Range: 1000; Plural: pfFew; Value: '0 آلاف'), (Range: 1000; Plural: pfMany; Value: '0 ألف'), (Range: 1000; Plural: pfOther; Value: '0 ألف'), (Range: 10000; Plural: pfZero; Value: '00 ألف'), (Range: 10000; Plural: pfOne; Value: '00 ألف'), (Range: 10000; Plural: pfTwo; Value: '00 ألف'), (Range: 10000; Plural: pfFew; Value: '00 ألف'), (Range: 10000; Plural: pfMany; Value: '00 ألف'), (Range: 10000; Plural: pfOther; Value: '00 ألف'), (Range: 100000; Plural: pfZero; Value: '000 ألف'), (Range: 100000; Plural: pfOne; Value: '000 ألف'), (Range: 100000; Plural: pfTwo; Value: '000 ألف'), (Range: 100000; Plural: pfFew; Value: '000 ألف'), (Range: 100000; Plural: pfMany; Value: '000 ألف'), (Range: 100000; Plural: pfOther; Value: '000 ألف'), (Range: 1000000; Plural: pfZero; Value: '0 مليو'), (Range: 1000000; Plural: pfOne; Value: '0 مليو'), (Range: 1000000; Plural: pfTwo; Value: '0 مليو'), (Range: 1000000; Plural: pfFew; Value: '0 مليو'), (Range: 1000000; Plural: pfMany; Value: '0 مليو'), (Range: 1000000; Plural: pfOther; Value: '0 مليو'), (Range: 10000000; Plural: pfZero; Value: '00 مليو'), (Range: 10000000; Plural: pfOne; Value: '00 مليو'), (Range: 10000000; Plural: pfTwo; Value: '00 مليو'), (Range: 10000000; Plural: pfFew; Value: '00 مليو'), (Range: 10000000; Plural: pfMany; Value: '00 مليو'), (Range: 10000000; Plural: pfOther; Value: '00 مليو'), (Range: 100000000; Plural: pfZero; Value: '000 مليو'), (Range: 100000000; Plural: pfOne; Value: '000 مليو'), (Range: 100000000; Plural: pfTwo; Value: '000 مليو'), (Range: 100000000; Plural: pfFew; Value: '000 مليو'), (Range: 100000000; Plural: pfMany; Value: '000 مليو'), (Range: 100000000; Plural: pfOther; Value: '000 مليو'), (Range: 1000000000; Plural: pfZero; Value: '0 مليا'), (Range: 1000000000; Plural: pfOne; Value: '0 مليا'), (Range: 1000000000; Plural: pfTwo; Value: '0 مليا'), (Range: 1000000000; Plural: pfFew; Value: '0 مليا'), (Range: 1000000000; Plural: pfMany; Value: '0 مليا'), (Range: 1000000000; Plural: pfOther; Value: '0 مليا'), (Range: 10000000000; Plural: pfZero; Value: '00 مليا'), (Range: 10000000000; Plural: pfOne; Value: '00 مليا'), (Range: 10000000000; Plural: pfTwo; Value: '00 مليا'), (Range: 10000000000; Plural: pfFew; Value: '00 مليا'), (Range: 10000000000; Plural: pfMany; Value: '00 مليا'), (Range: 10000000000; Plural: pfOther; Value: '00 مليا'), (Range: 100000000000; Plural: pfZero; Value: '000 مليا'), (Range: 100000000000; Plural: pfOne; Value: '000 مليا'), (Range: 100000000000; Plural: pfTwo; Value: '000 مليا'), (Range: 100000000000; Plural: pfFew; Value: '000 مليا'), (Range: 100000000000; Plural: pfMany; Value: '000 مليا'), (Range: 100000000000; Plural: pfOther; Value: '000 مليا'), (Range: 1000000000000; Plural: pfZero; Value: '0 ترليو'), (Range: 1000000000000; Plural: pfOne; Value: '0 ترليو'), (Range: 1000000000000; Plural: pfTwo; Value: '0 ترليو'), (Range: 1000000000000; Plural: pfFew; Value: '0 ترليو'), (Range: 1000000000000; Plural: pfMany; Value: '0 ترليو'), (Range: 1000000000000; Plural: pfOther; Value: '0 ترليو'), (Range: 10000000000000; Plural: pfZero; Value: '00 ترليو'), (Range: 10000000000000; Plural: pfOne; Value: '00 ترليو'), (Range: 10000000000000; Plural: pfTwo; Value: '00 ترليو'), (Range: 10000000000000; Plural: pfFew; Value: '00 ترليو'), (Range: 10000000000000; Plural: pfMany; Value: '00 ترليو'), (Range: 10000000000000; Plural: pfOther; Value: '00 ترليو'), (Range: 100000000000000; Plural: pfZero; Value: '000 ترليو'), (Range: 100000000000000; Plural: pfOne; Value: '000 ترليو'), (Range: 100000000000000; Plural: pfTwo; Value: '000 ترليو'), (Range: 100000000000000; Plural: pfFew; Value: '000 ترليو'), (Range: 100000000000000; Plural: pfMany; Value: '000 ترليو'), (Range: 100000000000000; Plural: pfOther; Value: '000 ترليو') ); // Assamese AS_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Asu ASA_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Asturian AST_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 millar'), (Range: 1000; Plural: pfOther; Value: '0 millares'), (Range: 10000; Plural: pfOne; Value: '00 millares'), (Range: 10000; Plural: pfOther; Value: '00 millares'), (Range: 100000; Plural: pfOne; Value: '000 millares'), (Range: 100000; Plural: pfOther; Value: '000 millares'), (Range: 1000000; Plural: pfOne; Value: '0 millón'), (Range: 1000000; Plural: pfOther; Value: '0 millones'), (Range: 10000000; Plural: pfOne; Value: '00 millones'), (Range: 10000000; Plural: pfOther; Value: '00 millones'), (Range: 100000000; Plural: pfOne; Value: '000 millones'), (Range: 100000000; Plural: pfOther; Value: '000 millones'), (Range: 1000000000; Plural: pfOne; Value: '0G'), (Range: 1000000000; Plural: pfOther; Value: '0G'), (Range: 10000000000; Plural: pfOne; Value: '00G'), (Range: 10000000000; Plural: pfOther; Value: '00G'), (Range: 100000000000; Plural: pfOne; Value: '000G'), (Range: 100000000000; Plural: pfOther; Value: '000G'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); AST_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0G'), (Range: 1000000000; Plural: pfOther; Value: '0G'), (Range: 10000000000; Plural: pfOne; Value: '00G'), (Range: 10000000000; Plural: pfOther; Value: '00G'), (Range: 100000000000; Plural: pfOne; Value: '000G'), (Range: 100000000000; Plural: pfOther; Value: '000G'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); // Azerbaijani, Latin AZ_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0G'), (Range: 1000000000; Plural: pfOther; Value: '0G'), (Range: 10000000000; Plural: pfOne; Value: '00G'), (Range: 10000000000; Plural: pfOther; Value: '00G'), (Range: 100000000000; Plural: pfOne; Value: '000G'), (Range: 100000000000; Plural: pfOther; Value: '000G'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); AZ_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0G'), (Range: 1000000000; Plural: pfOther; Value: '0G'), (Range: 10000000000; Plural: pfOne; Value: '00G'), (Range: 10000000000; Plural: pfOther; Value: '00G'), (Range: 100000000000; Plural: pfOne; Value: '000G'), (Range: 100000000000; Plural: pfOther; Value: '000G'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); AZ_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Azerbaijani, Cyrillic AZ_CYRL_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Basaa BAS_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Belarusian BE_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тысяча'), (Range: 1000; Plural: pfFew; Value: '0 тысячы'), (Range: 1000; Plural: pfMany; Value: '0 тысяч'), (Range: 1000; Plural: pfOther; Value: '0 тысячы'), (Range: 10000; Plural: pfOne; Value: '00 тысяча'), (Range: 10000; Plural: pfFew; Value: '00 тысячы'), (Range: 10000; Plural: pfMany; Value: '00 тысяч'), (Range: 10000; Plural: pfOther; Value: '00 тысячы'), (Range: 100000; Plural: pfOne; Value: '000 тысяча'), (Range: 100000; Plural: pfFew; Value: '000 тысячы'), (Range: 100000; Plural: pfMany; Value: '000 тысяч'), (Range: 100000; Plural: pfOther; Value: '000 тысячы'), (Range: 1000000; Plural: pfOne; Value: '0 мільён'), (Range: 1000000; Plural: pfFew; Value: '0 мільёны'), (Range: 1000000; Plural: pfMany; Value: '0 мільёнаў'), (Range: 1000000; Plural: pfOther; Value: '0 мільёна'), (Range: 10000000; Plural: pfOne; Value: '00 мільён'), (Range: 10000000; Plural: pfFew; Value: '00 мільёны'), (Range: 10000000; Plural: pfMany; Value: '00 мільёнаў'), (Range: 10000000; Plural: pfOther; Value: '00 мільёна'), (Range: 100000000; Plural: pfOne; Value: '000 мільён'), (Range: 100000000; Plural: pfFew; Value: '000 мільёны'), (Range: 100000000; Plural: pfMany; Value: '000 мільёнаў'), (Range: 100000000; Plural: pfOther; Value: '000 мільёна'), (Range: 1000000000; Plural: pfOne; Value: '0 мільярд'), (Range: 1000000000; Plural: pfFew; Value: '0 мільярды'), (Range: 1000000000; Plural: pfMany; Value: '0 мільярдаў'), (Range: 1000000000; Plural: pfOther; Value: '0 мільярда'), (Range: 10000000000; Plural: pfOne; Value: '00 мільярд'), (Range: 10000000000; Plural: pfFew; Value: '00 мільярды'), (Range: 10000000000; Plural: pfMany; Value: '00 мільярдаў'), (Range: 10000000000; Plural: pfOther; Value: '00 мільярда'), (Range: 100000000000; Plural: pfOne; Value: '000 мільярд'), (Range: 100000000000; Plural: pfFew; Value: '000 мільярды'), (Range: 100000000000; Plural: pfMany; Value: '000 мільярдаў'), (Range: 100000000000; Plural: pfOther; Value: '000 мільярда'), (Range: 1000000000000; Plural: pfOne; Value: '0 трыльён'), (Range: 1000000000000; Plural: pfFew; Value: '0 трыльёны'), (Range: 1000000000000; Plural: pfMany; Value: '0 трыльёнаў'), (Range: 1000000000000; Plural: pfOther; Value: '0 трыльёна'), (Range: 10000000000000; Plural: pfOne; Value: '00 трыльён'), (Range: 10000000000000; Plural: pfFew; Value: '00 трыльёны'), (Range: 10000000000000; Plural: pfMany; Value: '00 трыльёнаў'), (Range: 10000000000000; Plural: pfOther; Value: '00 трыльёна'), (Range: 100000000000000; Plural: pfOne; Value: '000 трыльён'), (Range: 100000000000000; Plural: pfFew; Value: '000 трыльёны'), (Range: 100000000000000; Plural: pfMany; Value: '000 трыльёнаў'), (Range: 100000000000000; Plural: pfOther; Value: '000 трыльёна') ); BE_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тыс.'), (Range: 1000; Plural: pfFew; Value: '0 тыс.'), (Range: 1000; Plural: pfMany; Value: '0 тыс.'), (Range: 1000; Plural: pfOther; Value: '0 тыс.'), (Range: 10000; Plural: pfOne; Value: '00 тыс.'), (Range: 10000; Plural: pfFew; Value: '00 тыс.'), (Range: 10000; Plural: pfMany; Value: '00 тыс.'), (Range: 10000; Plural: pfOther; Value: '00 тыс.'), (Range: 100000; Plural: pfOne; Value: '000 тыс.'), (Range: 100000; Plural: pfFew; Value: '000 тыс.'), (Range: 100000; Plural: pfMany; Value: '000 тыс.'), (Range: 100000; Plural: pfOther; Value: '000 тыс.'), (Range: 1000000; Plural: pfOne; Value: '0 млн'), (Range: 1000000; Plural: pfFew; Value: '0 млн'), (Range: 1000000; Plural: pfMany; Value: '0 млн'), (Range: 1000000; Plural: pfOther; Value: '0 млн'), (Range: 10000000; Plural: pfOne; Value: '00 млн'), (Range: 10000000; Plural: pfFew; Value: '00 млн'), (Range: 10000000; Plural: pfMany; Value: '00 млн'), (Range: 10000000; Plural: pfOther; Value: '00 млн'), (Range: 100000000; Plural: pfOne; Value: '000 млн'), (Range: 100000000; Plural: pfFew; Value: '000 млн'), (Range: 100000000; Plural: pfMany; Value: '000 млн'), (Range: 100000000; Plural: pfOther; Value: '000 млн'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд'), (Range: 1000000000; Plural: pfMany; Value: '0 млрд'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд'), (Range: 10000000000; Plural: pfMany; Value: '00 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд'), (Range: 100000000000; Plural: pfMany; Value: '000 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн'), (Range: 1000000000000; Plural: pfFew; Value: '0 трлн'), (Range: 1000000000000; Plural: pfMany; Value: '0 трлн'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн'), (Range: 10000000000000; Plural: pfFew; Value: '00 трлн'), (Range: 10000000000000; Plural: pfMany; Value: '00 трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн'), (Range: 100000000000000; Plural: pfFew; Value: '000 трлн'), (Range: 100000000000000; Plural: pfMany; Value: '000 трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн') ); BE_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тыс. ¤'), (Range: 1000; Plural: pfFew; Value: '0 тыс. ¤'), (Range: 1000; Plural: pfMany; Value: '0 тыс. ¤'), (Range: 1000; Plural: pfOther; Value: '0 тыс. ¤'), (Range: 10000; Plural: pfOne; Value: '00 тыс. ¤'), (Range: 10000; Plural: pfFew; Value: '00 тыс. ¤'), (Range: 10000; Plural: pfMany; Value: '00 тыс. ¤'), (Range: 10000; Plural: pfOther; Value: '00 тыс. ¤'), (Range: 100000; Plural: pfOne; Value: '000 тыс. ¤'), (Range: 100000; Plural: pfFew; Value: '000 тыс. ¤'), (Range: 100000; Plural: pfMany; Value: '000 тыс. ¤'), (Range: 100000; Plural: pfOther; Value: '000 тыс. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 млн ¤'), (Range: 1000000; Plural: pfFew; Value: '0 млн ¤'), (Range: 1000000; Plural: pfMany; Value: '0 млн ¤'), (Range: 1000000; Plural: pfOther; Value: '0 млн ¤'), (Range: 10000000; Plural: pfOne; Value: '00 млн ¤'), (Range: 10000000; Plural: pfFew; Value: '00 млн ¤'), (Range: 10000000; Plural: pfMany; Value: '00 млн ¤'), (Range: 10000000; Plural: pfOther; Value: '00 млн ¤'), (Range: 100000000; Plural: pfOne; Value: '000 млн ¤'), (Range: 100000000; Plural: pfFew; Value: '000 млн ¤'), (Range: 100000000; Plural: pfMany; Value: '000 млн ¤'), (Range: 100000000; Plural: pfOther; Value: '000 млн ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfMany; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfMany; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfMany; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн ¤') ); // Bemba BEM_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Bena BEZ_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Bulgarian BG_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 хил.'), (Range: 1000; Plural: pfOther; Value: '0 хиляди'), (Range: 10000; Plural: pfOne; Value: '00 хиляди'), (Range: 10000; Plural: pfOther; Value: '00 хиляди'), (Range: 100000; Plural: pfOne; Value: '000 хиляди'), (Range: 100000; Plural: pfOther; Value: '000 хиляди'), (Range: 1000000; Plural: pfOne; Value: '0 милион'), (Range: 1000000; Plural: pfOther; Value: '0 милиона'), (Range: 10000000; Plural: pfOne; Value: '00 милиона'), (Range: 10000000; Plural: pfOther; Value: '00 милиона'), (Range: 100000000; Plural: pfOne; Value: '000 милиона'), (Range: 100000000; Plural: pfOther; Value: '000 милиона'), (Range: 1000000000; Plural: pfOne; Value: '0 милиард'), (Range: 1000000000; Plural: pfOther; Value: '0 милиарда'), (Range: 10000000000; Plural: pfOne; Value: '00 милиарда'), (Range: 10000000000; Plural: pfOther; Value: '00 милиарда'), (Range: 100000000000; Plural: pfOne; Value: '000 милиарда'), (Range: 100000000000; Plural: pfOther; Value: '000 милиарда'), (Range: 1000000000000; Plural: pfOne; Value: '0 трилион'), (Range: 1000000000000; Plural: pfOther; Value: '0 трилиона'), (Range: 10000000000000; Plural: pfOne; Value: '00 трилиона'), (Range: 10000000000000; Plural: pfOther; Value: '00 трилиона'), (Range: 100000000000000; Plural: pfOne; Value: '000 трилиона'), (Range: 100000000000000; Plural: pfOther; Value: '000 трилиона') ); BG_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 хил.'), (Range: 1000; Plural: pfOther; Value: '0 хил.'), (Range: 10000; Plural: pfOne; Value: '00 хил.'), (Range: 10000; Plural: pfOther; Value: '00 хил.'), (Range: 100000; Plural: pfOne; Value: '000 хил.'), (Range: 100000; Plural: pfOther; Value: '000 хил.'), (Range: 1000000; Plural: pfOne; Value: '0 млн.'), (Range: 1000000; Plural: pfOther; Value: '0 млн.'), (Range: 10000000; Plural: pfOne; Value: '00 млн.'), (Range: 10000000; Plural: pfOther; Value: '00 млн.'), (Range: 100000000; Plural: pfOne; Value: '000 млн'), (Range: 100000000; Plural: pfOther; Value: '000 млн'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд.'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд.'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд.'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд.'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд.'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд.'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн.'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн.'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн.'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн.'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн.'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн.') ); BG_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 хил. ¤'), (Range: 1000; Plural: pfOther; Value: '0 хил. ¤'), (Range: 10000; Plural: pfOne; Value: '00 хил. ¤'), (Range: 10000; Plural: pfOther; Value: '00 хил. ¤'), (Range: 100000; Plural: pfOne; Value: '000 хил. ¤'), (Range: 100000; Plural: pfOther; Value: '000 хил. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 млн. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 млн. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 млн. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 млн. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 млн. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 млн. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн. ¤') ); // Bamanankan BM_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Bangla BN_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 হাজার'), (Range: 1000; Plural: pfOther; Value: '0 হাজার'), (Range: 10000; Plural: pfOne; Value: '00 হাজার'), (Range: 10000; Plural: pfOther; Value: '00 হাজার'), (Range: 100000; Plural: pfOne; Value: '0 লাখ'), (Range: 100000; Plural: pfOther; Value: '0 লাখ'), (Range: 1000000; Plural: pfOne; Value: '0 মিলিয়ন'), (Range: 1000000; Plural: pfOther; Value: '0 মিলিয়ন'), (Range: 10000000; Plural: pfOne; Value: '00 মিলিয়ন'), (Range: 10000000; Plural: pfOther; Value: '00 মিলিয়ন'), (Range: 100000000; Plural: pfOne; Value: '000 মিলিয়ন'), (Range: 100000000; Plural: pfOther; Value: '000 মিলিয়ন'), (Range: 1000000000; Plural: pfOne; Value: '0 বিলিয়ন'), (Range: 1000000000; Plural: pfOther; Value: '0 বিলিয়ন'), (Range: 10000000000; Plural: pfOne; Value: '00 বিলিয়ন'), (Range: 10000000000; Plural: pfOther; Value: '00 বিলিয়ন'), (Range: 100000000000; Plural: pfOne; Value: '000 বিলিয়ন'), (Range: 100000000000; Plural: pfOther; Value: '000 বিলিয়ন'), (Range: 1000000000000; Plural: pfOne; Value: '0 ট্রিলিয়ন'), (Range: 1000000000000; Plural: pfOther; Value: '0 ট্রিলিয়ন'), (Range: 10000000000000; Plural: pfOne; Value: '00 ট্রিলিয়ন'), (Range: 10000000000000; Plural: pfOther; Value: '00 ট্রিলিয়ন'), (Range: 100000000000000; Plural: pfOne; Value: '000 ট্রিলিয়ন'), (Range: 100000000000000; Plural: pfOther; Value: '000 ট্রিলিয়ন') ); BN_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 হাজার'), (Range: 1000; Plural: pfOther; Value: '0 হাজার'), (Range: 10000; Plural: pfOne; Value: '00 হাজার'), (Range: 10000; Plural: pfOther; Value: '00 হাজার'), (Range: 100000; Plural: pfOne; Value: '0 লাখ'), (Range: 100000; Plural: pfOther; Value: '0 লাখ'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); // Tibetan BO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Breton BR_CURRENCY: array[0..59] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfTwo; Value: '0K ¤'), (Range: 1000; Plural: pfFew; Value: '0K ¤'), (Range: 1000; Plural: pfMany; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfTwo; Value: '00K ¤'), (Range: 10000; Plural: pfFew; Value: '00K ¤'), (Range: 10000; Plural: pfMany; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfTwo; Value: '000K ¤'), (Range: 100000; Plural: pfFew; Value: '000K ¤'), (Range: 100000; Plural: pfMany; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfTwo; Value: '0M ¤'), (Range: 1000000; Plural: pfFew; Value: '0M ¤'), (Range: 1000000; Plural: pfMany; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfTwo; Value: '00M ¤'), (Range: 10000000; Plural: pfFew; Value: '00M ¤'), (Range: 10000000; Plural: pfMany; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfTwo; Value: '000M ¤'), (Range: 100000000; Plural: pfFew; Value: '000M ¤'), (Range: 100000000; Plural: pfMany; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfTwo; Value: '0G ¤'), (Range: 1000000000; Plural: pfFew; Value: '0G ¤'), (Range: 1000000000; Plural: pfMany; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfTwo; Value: '00G ¤'), (Range: 10000000000; Plural: pfFew; Value: '00G ¤'), (Range: 10000000000; Plural: pfMany; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfTwo; Value: '000G ¤'), (Range: 100000000000; Plural: pfFew; Value: '000G ¤'), (Range: 100000000000; Plural: pfMany; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfTwo; Value: '0T ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0T ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfTwo; Value: '00T ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00T ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfTwo; Value: '000T ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000T ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Bodo BRX_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Bosnian, Latin BS_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 hiljada'), (Range: 1000; Plural: pfFew; Value: '0 hiljade'), (Range: 1000; Plural: pfOther; Value: '0 hiljada'), (Range: 10000; Plural: pfOne; Value: '00 hiljada'), (Range: 10000; Plural: pfFew; Value: '00 hiljade'), (Range: 10000; Plural: pfOther; Value: '00 hiljada'), (Range: 100000; Plural: pfOne; Value: '000 hiljada'), (Range: 100000; Plural: pfFew; Value: '000 hiljade'), (Range: 100000; Plural: pfOther; Value: '000 hiljada'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfFew; Value: '0 miliona'), (Range: 1000000; Plural: pfOther; Value: '0 miliona'), (Range: 10000000; Plural: pfOne; Value: '00 milion'), (Range: 10000000; Plural: pfFew; Value: '00 miliona'), (Range: 10000000; Plural: pfOther; Value: '00 miliona'), (Range: 100000000; Plural: pfOne; Value: '000 milion'), (Range: 100000000; Plural: pfFew; Value: '000 miliona'), (Range: 100000000; Plural: pfOther; Value: '000 miliona'), (Range: 1000000000; Plural: pfOne; Value: '0 milijarda'), (Range: 1000000000; Plural: pfFew; Value: '0 milijarde'), (Range: 1000000000; Plural: pfOther; Value: '0 milijardi'), (Range: 10000000000; Plural: pfOne; Value: '00 milijarda'), (Range: 10000000000; Plural: pfFew; Value: '00 milijarde'), (Range: 10000000000; Plural: pfOther; Value: '00 milijardi'), (Range: 100000000000; Plural: pfOne; Value: '000 milijarda'), (Range: 100000000000; Plural: pfFew; Value: '000 milijarde'), (Range: 100000000000; Plural: pfOther; Value: '000 milijardi'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilion'), (Range: 1000000000000; Plural: pfFew; Value: '0 biliona'), (Range: 1000000000000; Plural: pfOther; Value: '0 biliona'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilion'), (Range: 10000000000000; Plural: pfFew; Value: '00 biliona'), (Range: 10000000000000; Plural: pfOther; Value: '00 biliona'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilion'), (Range: 100000000000000; Plural: pfFew; Value: '000 biliona'), (Range: 100000000000000; Plural: pfOther; Value: '000 biliona') ); BS_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 hilj.'), (Range: 1000; Plural: pfFew; Value: '0 hilj.'), (Range: 1000; Plural: pfOther; Value: '0 hilj.'), (Range: 10000; Plural: pfOne; Value: '00 hilj.'), (Range: 10000; Plural: pfFew; Value: '00 hilj.'), (Range: 10000; Plural: pfOther; Value: '00 hilj.'), (Range: 100000; Plural: pfOne; Value: '000 hilj.'), (Range: 100000; Plural: pfFew; Value: '000 hilj.'), (Range: 100000; Plural: pfOther; Value: '000 hilj.'), (Range: 1000000; Plural: pfOne; Value: '0 mil.'), (Range: 1000000; Plural: pfFew; Value: '0 mil.'), (Range: 1000000; Plural: pfOther; Value: '0 mil.'), (Range: 10000000; Plural: pfOne; Value: '00 mil.'), (Range: 10000000; Plural: pfFew; Value: '00 mil.'), (Range: 10000000; Plural: pfOther; Value: '00 mil.'), (Range: 100000000; Plural: pfOne; Value: '000 mil.'), (Range: 100000000; Plural: pfFew; Value: '000 mil.'), (Range: 100000000; Plural: pfOther; Value: '000 mil.'), (Range: 1000000000; Plural: pfOne; Value: '0 mlr.'), (Range: 1000000000; Plural: pfFew; Value: '0 mlr.'), (Range: 1000000000; Plural: pfOther; Value: '0 mlr.'), (Range: 10000000000; Plural: pfOne; Value: '00 mlr.'), (Range: 10000000000; Plural: pfFew; Value: '00 mlr.'), (Range: 10000000000; Plural: pfOther; Value: '00 mlr.'), (Range: 100000000000; Plural: pfOne; Value: '000 mlr.'), (Range: 100000000000; Plural: pfFew; Value: '000 mlr.'), (Range: 100000000000; Plural: pfOther; Value: '000 mlr.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); BS_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 hilj. ¤'), (Range: 1000; Plural: pfFew; Value: '0 hilj. ¤'), (Range: 1000; Plural: pfOther; Value: '0 hilj. ¤'), (Range: 10000; Plural: pfOne; Value: '00 hilj. ¤'), (Range: 10000; Plural: pfFew; Value: '00 hilj. ¤'), (Range: 10000; Plural: pfOther; Value: '00 hilj. ¤'), (Range: 100000; Plural: pfOne; Value: '000 hilj. ¤'), (Range: 100000; Plural: pfFew; Value: '000 hilj. ¤'), (Range: 100000; Plural: pfOther; Value: '000 hilj. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mil. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mil. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mil. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mlr. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mlr. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mlr. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mlr. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mlr. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mlr. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mlr. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mlr. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mlr. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Bosnian, Cyrillic BS_CYRL_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfFew; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '00 хиљ'), (Range: 10000; Plural: pfFew; Value: '00 хиљ'), (Range: 10000; Plural: pfOther; Value: '00 хиљ'), (Range: 100000; Plural: pfOne; Value: '000 хиљ'), (Range: 100000; Plural: pfFew; Value: '000 хиљ'), (Range: 100000; Plural: pfOther; Value: '000 хиљ'), (Range: 1000000; Plural: pfOne; Value: '0 мил'), (Range: 1000000; Plural: pfFew; Value: '0 мил'), (Range: 1000000; Plural: pfOther; Value: '0 мил'), (Range: 10000000; Plural: pfOne; Value: '00 мил'), (Range: 10000000; Plural: pfFew; Value: '00 мил'), (Range: 10000000; Plural: pfOther; Value: '00 мил'), (Range: 100000000; Plural: pfOne; Value: '000 мил'), (Range: 100000000; Plural: pfFew; Value: '000 мил'), (Range: 100000000; Plural: pfOther; Value: '000 мил'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0 бил'), (Range: 1000000000000; Plural: pfFew; Value: '0 бил'), (Range: 1000000000000; Plural: pfOther; Value: '0 бил'), (Range: 10000000000000; Plural: pfOne; Value: '00 бил'), (Range: 10000000000000; Plural: pfFew; Value: '00 бил'), (Range: 10000000000000; Plural: pfOther; Value: '00 бил'), (Range: 100000000000000; Plural: pfOne; Value: '000 бил'), (Range: 100000000000000; Plural: pfFew; Value: '000 бил'), (Range: 100000000000000; Plural: pfOther; Value: '000 бил') ); BS_CYRL_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfFew; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '00 хиљ'), (Range: 10000; Plural: pfFew; Value: '00 хиљ'), (Range: 10000; Plural: pfOther; Value: '00 хиљ'), (Range: 100000; Plural: pfOne; Value: '000 хиљ'), (Range: 100000; Plural: pfFew; Value: '000 хиљ'), (Range: 100000; Plural: pfOther; Value: '000 хиљ'), (Range: 1000000; Plural: pfOne; Value: '0 мил'), (Range: 1000000; Plural: pfFew; Value: '0 мил'), (Range: 1000000; Plural: pfOther; Value: '0 мил'), (Range: 10000000; Plural: pfOne; Value: '00 мил'), (Range: 10000000; Plural: pfFew; Value: '00 мил'), (Range: 10000000; Plural: pfOther; Value: '00 мил'), (Range: 100000000; Plural: pfOne; Value: '000 мил'), (Range: 100000000; Plural: pfFew; Value: '000 мил'), (Range: 100000000; Plural: pfOther; Value: '000 мил'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0 бил'), (Range: 1000000000000; Plural: pfFew; Value: '0 бил'), (Range: 1000000000000; Plural: pfOther; Value: '0 бил'), (Range: 10000000000000; Plural: pfOne; Value: '00 бил'), (Range: 10000000000000; Plural: pfFew; Value: '00 бил'), (Range: 10000000000000; Plural: pfOther; Value: '00 бил'), (Range: 100000000000000; Plural: pfOne; Value: '000 бил'), (Range: 100000000000000; Plural: pfFew; Value: '000 бил'), (Range: 100000000000000; Plural: pfOther; Value: '000 бил') ); BS_CYRL_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfFew; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '00 хиљ ¤'), (Range: 10000; Plural: pfFew; Value: '00 хиљ ¤'), (Range: 10000; Plural: pfOther; Value: '00 хиљ ¤'), (Range: 100000; Plural: pfOne; Value: '000 хиљ ¤'), (Range: 100000; Plural: pfFew; Value: '000 хиљ ¤'), (Range: 100000; Plural: pfOther; Value: '000 хиљ ¤'), (Range: 1000000; Plural: pfOne; Value: '0 мил ¤'), (Range: 1000000; Plural: pfFew; Value: '0 мил ¤'), (Range: 1000000; Plural: pfOther; Value: '0 мил ¤'), (Range: 10000000; Plural: pfOne; Value: '00 мил ¤'), (Range: 10000000; Plural: pfFew; Value: '00 мил ¤'), (Range: 10000000; Plural: pfOther; Value: '00 мил ¤'), (Range: 100000000; Plural: pfOne; Value: '000 мил ¤'), (Range: 100000000; Plural: pfFew; Value: '000 мил ¤'), (Range: 100000000; Plural: pfOther; Value: '000 мил ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 бил ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 бил ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 бил ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 бил ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 бил ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 бил ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 бил ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 бил ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 бил ¤') ); // Catalan CA_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 miler'), (Range: 1000; Plural: pfOther; Value: '0 milers'), (Range: 10000; Plural: pfOne; Value: '00 milers'), (Range: 10000; Plural: pfOther; Value: '00 milers'), (Range: 100000; Plural: pfOne; Value: '000 milers'), (Range: 100000; Plural: pfOther; Value: '000 milers'), (Range: 1000000; Plural: pfOne; Value: '0 milió'), (Range: 1000000; Plural: pfOther; Value: '0 milions'), (Range: 10000000; Plural: pfOne; Value: '00 milions'), (Range: 10000000; Plural: pfOther; Value: '00 milions'), (Range: 100000000; Plural: pfOne; Value: '000 milions'), (Range: 100000000; Plural: pfOther; Value: '000 milions'), (Range: 1000000000; Plural: pfOne; Value: '0 miler de milions'), (Range: 1000000000; Plural: pfOther; Value: '0 milers de milions'), (Range: 10000000000; Plural: pfOne; Value: '00 milers de milions'), (Range: 10000000000; Plural: pfOther; Value: '00 milers de milions'), (Range: 100000000000; Plural: pfOne; Value: '000 milers de milions'), (Range: 100000000000; Plural: pfOther; Value: '000 milers de milions'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilió'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilions'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilions'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilions'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilions'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilions') ); CA_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0m'), (Range: 1000; Plural: pfOther; Value: '0m'), (Range: 10000; Plural: pfOne; Value: '00m'), (Range: 10000; Plural: pfOther; Value: '00m'), (Range: 100000; Plural: pfOne; Value: '000m'), (Range: 100000; Plural: pfOther; Value: '000m'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00 M'), (Range: 10000000; Plural: pfOther; Value: '00 M'), (Range: 100000000; Plural: pfOne; Value: '000 M'), (Range: 100000000; Plural: pfOther; Value: '000 M'), (Range: 1000000000; Plural: pfOne; Value: '0000 M'), (Range: 1000000000; Plural: pfOther; Value: '0000 M'), (Range: 10000000000; Plural: pfOne; Value: '00mM'), (Range: 10000000000; Plural: pfOther; Value: '00mM'), (Range: 100000000000; Plural: pfOne; Value: '000mM'), (Range: 100000000000; Plural: pfOther; Value: '000mM'), (Range: 1000000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000000; Plural: pfOne; Value: '00 B'), (Range: 10000000000000; Plural: pfOther; Value: '00 B'), (Range: 100000000000000; Plural: pfOne; Value: '000 B'), (Range: 100000000000000; Plural: pfOther; Value: '000 B') ); CA_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0m ¤'), (Range: 1000; Plural: pfOther; Value: '0m ¤'), (Range: 10000; Plural: pfOne; Value: '00m ¤'), (Range: 10000; Plural: pfOther; Value: '00m ¤'), (Range: 100000; Plural: pfOne; Value: '000m ¤'), (Range: 100000; Plural: pfOther; Value: '000m ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00 M ¤'), (Range: 10000000; Plural: pfOther; Value: '00 M ¤'), (Range: 100000000; Plural: pfOne; Value: '000 M ¤'), (Range: 100000000; Plural: pfOther; Value: '000 M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0000 M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0000 M ¤'), (Range: 10000000000; Plural: pfOne; Value: '00mM ¤'), (Range: 10000000000; Plural: pfOther; Value: '00mM ¤'), (Range: 100000000000; Plural: pfOne; Value: '000mM ¤'), (Range: 100000000000; Plural: pfOther; Value: '000mM ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0B ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0B ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 B ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 B ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 B ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 B ¤') ); // Chechen CE_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 эзар'), (Range: 1000; Plural: pfOther; Value: '0 эзар'), (Range: 10000; Plural: pfOne; Value: '00 эзар'), (Range: 10000; Plural: pfOther; Value: '00 эзар'), (Range: 100000; Plural: pfOne; Value: '000 эзар'), (Range: 100000; Plural: pfOther; Value: '000 эзар'), (Range: 1000000; Plural: pfOne; Value: '0 миллион'), (Range: 1000000; Plural: pfOther; Value: '0 миллион'), (Range: 10000000; Plural: pfOne; Value: '00 миллион'), (Range: 10000000; Plural: pfOther; Value: '00 миллион'), (Range: 100000000; Plural: pfOne; Value: '000 миллион'), (Range: 100000000; Plural: pfOther; Value: '000 миллион'), (Range: 1000000000; Plural: pfOne; Value: '0 миллиард'), (Range: 1000000000; Plural: pfOther; Value: '0 миллиард'), (Range: 10000000000; Plural: pfOne; Value: '00 миллиард'), (Range: 10000000000; Plural: pfOther; Value: '00 миллиард'), (Range: 100000000000; Plural: pfOne; Value: '000 миллиард'), (Range: 100000000000; Plural: pfOther; Value: '000 миллиард'), (Range: 1000000000000; Plural: pfOne; Value: '0 триллион'), (Range: 1000000000000; Plural: pfOther; Value: '0 триллион'), (Range: 10000000000000; Plural: pfOne; Value: '00 триллион'), (Range: 10000000000000; Plural: pfOther; Value: '00 триллион'), (Range: 100000000000000; Plural: pfOne; Value: '000 триллион'), (Range: 100000000000000; Plural: pfOther; Value: '000 триллион') ); CE_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 эзар'), (Range: 1000; Plural: pfOther; Value: '0 эзар'), (Range: 10000; Plural: pfOne; Value: '00 эзар'), (Range: 10000; Plural: pfOther; Value: '00 эзар'), (Range: 100000; Plural: pfOne; Value: '000 эзар'), (Range: 100000; Plural: pfOther; Value: '000 эзар'), (Range: 1000000; Plural: pfOne; Value: '0 млн'), (Range: 1000000; Plural: pfOther; Value: '0 млн'), (Range: 10000000; Plural: pfOne; Value: '00 млн'), (Range: 10000000; Plural: pfOther; Value: '00 млн'), (Range: 100000000; Plural: pfOne; Value: '000 млн'), (Range: 100000000; Plural: pfOther; Value: '000 млн'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн') ); CE_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 эзар ¤'), (Range: 1000; Plural: pfOther; Value: '0 эзар ¤'), (Range: 10000; Plural: pfOne; Value: '00 эзар ¤'), (Range: 10000; Plural: pfOther; Value: '00 эзар ¤'), (Range: 100000; Plural: pfOne; Value: '000 эзар ¤'), (Range: 100000; Plural: pfOther; Value: '000 эзар ¤'), (Range: 1000000; Plural: pfOne; Value: '0 млн ¤'), (Range: 1000000; Plural: pfOther; Value: '0 млн ¤'), (Range: 10000000; Plural: pfOne; Value: '00 млн ¤'), (Range: 10000000; Plural: pfOther; Value: '00 млн ¤'), (Range: 100000000; Plural: pfOne; Value: '000 млн ¤'), (Range: 100000000; Plural: pfOther; Value: '000 млн ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн ¤') ); // Chiga CGG_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Cherokee CHR_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ᎢᏯᎦᏴᎵ'), (Range: 1000; Plural: pfOther; Value: '0 ᎢᏯᎦᏴᎵ'), (Range: 10000; Plural: pfOne; Value: '00 ᎢᏯᎦᏴᎵ'), (Range: 10000; Plural: pfOther; Value: '00 ᎢᏯᎦᏴᎵ'), (Range: 100000; Plural: pfOne; Value: '000 ᎢᏯᎦᏴᎵ'), (Range: 100000; Plural: pfOther; Value: '000 ᎢᏯᎦᏴᎵ'), (Range: 1000000; Plural: pfOne; Value: '0 ᎢᏳᏆᏗᏅᏛ'), (Range: 1000000; Plural: pfOther; Value: '0 ᎢᏳᏆᏗᏅᏛ'), (Range: 10000000; Plural: pfOne; Value: '00 ᎢᏳᏆᏗᏅᏛ'), (Range: 10000000; Plural: pfOther; Value: '00 ᎢᏳᏆᏗᏅᏛ'), (Range: 100000000; Plural: pfOne; Value: '000 ᎢᏳᏆᏗᏅᏛ'), (Range: 100000000; Plural: pfOther; Value: '000 ᎢᏳᏆᏗᏅᏛ'), (Range: 1000000000; Plural: pfOne; Value: '0 ᎢᏯᏔᎳᏗᏅᏛ'), (Range: 1000000000; Plural: pfOther; Value: '0 ᎢᏯᏔᎳᏗᏅᏛ'), (Range: 10000000000; Plural: pfOne; Value: '00 ᎢᏯᏔᎳᏗᏅᏛ'), (Range: 10000000000; Plural: pfOther; Value: '00 ᎢᏯᏔᎳᏗᏅᏛ'), (Range: 100000000000; Plural: pfOne; Value: '000 ᎢᏯᏔᎳᏗᏅᏛ'), (Range: 100000000000; Plural: pfOther; Value: '000 ᎢᏯᏔᎳᏗᏅᏛ'), (Range: 1000000000000; Plural: pfOne; Value: '0 ᎢᏯᏦᎠᏗᏅᏛ'), (Range: 1000000000000; Plural: pfOther; Value: '0 ᎢᏯᏦᎠᏗᏅᏛ'), (Range: 10000000000000; Plural: pfOne; Value: '00 ᎢᏯᏦᎠᏗᏅᏛ'), (Range: 10000000000000; Plural: pfOther; Value: '00 ᎢᏯᏦᎠᏗᏅᏛ'), (Range: 100000000000000; Plural: pfOne; Value: '000 ᎢᏯᏦᎠᏗᏅᏛ'), (Range: 100000000000000; Plural: pfOther; Value: '000 ᎢᏯᏦᎠᏗᏅᏛ') ); CHR_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); CHR_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Czech CS_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tisíc'), (Range: 1000; Plural: pfFew; Value: '0 tisíce'), (Range: 1000; Plural: pfMany; Value: '0 tisíce'), (Range: 1000; Plural: pfOther; Value: '0 tisíc'), (Range: 10000; Plural: pfOne; Value: '00 tisíc'), (Range: 10000; Plural: pfFew; Value: '00 tisíc'), (Range: 10000; Plural: pfMany; Value: '00 tisíce'), (Range: 10000; Plural: pfOther; Value: '00 tisíc'), (Range: 100000; Plural: pfOne; Value: '000 tisíc'), (Range: 100000; Plural: pfFew; Value: '000 tisíc'), (Range: 100000; Plural: pfMany; Value: '000 tisíce'), (Range: 100000; Plural: pfOther; Value: '000 tisíc'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfFew; Value: '0 miliony'), (Range: 1000000; Plural: pfMany; Value: '0 milionu'), (Range: 1000000; Plural: pfOther; Value: '0 milionů'), (Range: 10000000; Plural: pfOne; Value: '00 milionů'), (Range: 10000000; Plural: pfFew; Value: '00 milionů'), (Range: 10000000; Plural: pfMany; Value: '00 milionu'), (Range: 10000000; Plural: pfOther; Value: '00 milionů'), (Range: 100000000; Plural: pfOne; Value: '000 milionů'), (Range: 100000000; Plural: pfFew; Value: '000 milionů'), (Range: 100000000; Plural: pfMany; Value: '000 milionu'), (Range: 100000000; Plural: pfOther; Value: '000 milionů'), (Range: 1000000000; Plural: pfOne; Value: '0 miliarda'), (Range: 1000000000; Plural: pfFew; Value: '0 miliardy'), (Range: 1000000000; Plural: pfMany; Value: '0 miliardy'), (Range: 1000000000; Plural: pfOther; Value: '0 miliard'), (Range: 10000000000; Plural: pfOne; Value: '00 miliard'), (Range: 10000000000; Plural: pfFew; Value: '00 miliard'), (Range: 10000000000; Plural: pfMany; Value: '00 miliardy'), (Range: 10000000000; Plural: pfOther; Value: '00 miliard'), (Range: 100000000000; Plural: pfOne; Value: '000 miliard'), (Range: 100000000000; Plural: pfFew; Value: '000 miliard'), (Range: 100000000000; Plural: pfMany; Value: '000 miliardy'), (Range: 100000000000; Plural: pfOther; Value: '000 miliard'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilion'), (Range: 1000000000000; Plural: pfFew; Value: '0 biliony'), (Range: 1000000000000; Plural: pfMany; Value: '0 bilionu'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilionů'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilionů'), (Range: 10000000000000; Plural: pfFew; Value: '00 bilionů'), (Range: 10000000000000; Plural: pfMany; Value: '00 bilionu'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilionů'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilionů'), (Range: 100000000000000; Plural: pfFew; Value: '000 bilionů'), (Range: 100000000000000; Plural: pfMany; Value: '000 bilionu'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilionů') ); CS_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tis.'), (Range: 1000; Plural: pfFew; Value: '0 tis.'), (Range: 1000; Plural: pfMany; Value: '0 tis.'), (Range: 1000; Plural: pfOther; Value: '0 tis.'), (Range: 10000; Plural: pfOne; Value: '00 tis.'), (Range: 10000; Plural: pfFew; Value: '00 tis.'), (Range: 10000; Plural: pfMany; Value: '00 tis.'), (Range: 10000; Plural: pfOther; Value: '00 tis.'), (Range: 100000; Plural: pfOne; Value: '000 tis.'), (Range: 100000; Plural: pfFew; Value: '000 tis.'), (Range: 100000; Plural: pfMany; Value: '000 tis.'), (Range: 100000; Plural: pfOther; Value: '000 tis.'), (Range: 1000000; Plural: pfOne; Value: '0 mil.'), (Range: 1000000; Plural: pfFew; Value: '0 mil.'), (Range: 1000000; Plural: pfMany; Value: '0 mil.'), (Range: 1000000; Plural: pfOther; Value: '0 mil.'), (Range: 10000000; Plural: pfOne; Value: '00 mil.'), (Range: 10000000; Plural: pfFew; Value: '00 mil.'), (Range: 10000000; Plural: pfMany; Value: '00 mil.'), (Range: 10000000; Plural: pfOther; Value: '00 mil.'), (Range: 100000000; Plural: pfOne; Value: '000 mil.'), (Range: 100000000; Plural: pfFew; Value: '000 mil.'), (Range: 100000000; Plural: pfMany; Value: '000 mil.'), (Range: 100000000; Plural: pfOther; Value: '000 mil.'), (Range: 1000000000; Plural: pfOne; Value: '0 mld.'), (Range: 1000000000; Plural: pfFew; Value: '0 mld.'), (Range: 1000000000; Plural: pfMany; Value: '0 mld.'), (Range: 1000000000; Plural: pfOther; Value: '0 mld.'), (Range: 10000000000; Plural: pfOne; Value: '00 mld.'), (Range: 10000000000; Plural: pfFew; Value: '00 mld.'), (Range: 10000000000; Plural: pfMany; Value: '00 mld.'), (Range: 10000000000; Plural: pfOther; Value: '00 mld.'), (Range: 100000000000; Plural: pfOne; Value: '000 mld.'), (Range: 100000000000; Plural: pfFew; Value: '000 mld.'), (Range: 100000000000; Plural: pfMany; Value: '000 mld.'), (Range: 100000000000; Plural: pfOther; Value: '000 mld.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfMany; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfMany; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfMany; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); CS_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tis. ¤'), (Range: 1000; Plural: pfFew; Value: '0 tis. ¤'), (Range: 1000; Plural: pfMany; Value: '0 tis. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tis. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tis. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tis. ¤'), (Range: 10000; Plural: pfMany; Value: '00 tis. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tis. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tis. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tis. ¤'), (Range: 100000; Plural: pfMany; Value: '000 tis. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tis. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfMany; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mil. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfMany; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mil. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfMany; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mil. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfMany; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mld. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfMany; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mld. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfMany; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mld. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Welsh CY_LONG: array[0..71] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 mil'), (Range: 1000; Plural: pfOne; Value: '0 mil'), (Range: 1000; Plural: pfTwo; Value: '0 fil'), (Range: 1000; Plural: pfFew; Value: '0 mil'), (Range: 1000; Plural: pfMany; Value: '0 mil'), (Range: 1000; Plural: pfOther; Value: '0 mil'), (Range: 10000; Plural: pfZero; Value: '00 mil'), (Range: 10000; Plural: pfOne; Value: '00 mil'), (Range: 10000; Plural: pfTwo; Value: '00 mil'), (Range: 10000; Plural: pfFew; Value: '00 mil'), (Range: 10000; Plural: pfMany; Value: '00 mil'), (Range: 10000; Plural: pfOther; Value: '00 mil'), (Range: 100000; Plural: pfZero; Value: '000 mil'), (Range: 100000; Plural: pfOne; Value: '000 mil'), (Range: 100000; Plural: pfTwo; Value: '000 mil'), (Range: 100000; Plural: pfFew; Value: '000 mil'), (Range: 100000; Plural: pfMany; Value: '000 mil'), (Range: 100000; Plural: pfOther; Value: '000 mil'), (Range: 1000000; Plural: pfZero; Value: '0 miliwn'), (Range: 1000000; Plural: pfOne; Value: '0 miliwn'), (Range: 1000000; Plural: pfTwo; Value: '0 filiwn'), (Range: 1000000; Plural: pfFew; Value: '0 miliwn'), (Range: 1000000; Plural: pfMany; Value: '0 miliwn'), (Range: 1000000; Plural: pfOther; Value: '0 miliwn'), (Range: 10000000; Plural: pfZero; Value: '00 miliwn'), (Range: 10000000; Plural: pfOne; Value: '00 miliwn'), (Range: 10000000; Plural: pfTwo; Value: '00 miliwn'), (Range: 10000000; Plural: pfFew; Value: '00 miliwn'), (Range: 10000000; Plural: pfMany; Value: '00 miliwn'), (Range: 10000000; Plural: pfOther; Value: '00 miliwn'), (Range: 100000000; Plural: pfZero; Value: '000 miliwn'), (Range: 100000000; Plural: pfOne; Value: '000 miliwn'), (Range: 100000000; Plural: pfTwo; Value: '000 miliwn'), (Range: 100000000; Plural: pfFew; Value: '000 miliwn'), (Range: 100000000; Plural: pfMany; Value: '000 miliwn'), (Range: 100000000; Plural: pfOther; Value: '000 miliwn'), (Range: 1000000000; Plural: pfZero; Value: '0 biliwn'), (Range: 1000000000; Plural: pfOne; Value: '0 biliwn'), (Range: 1000000000; Plural: pfTwo; Value: '0 biliwn'), (Range: 1000000000; Plural: pfFew; Value: '0 biliwn'), (Range: 1000000000; Plural: pfMany; Value: '0 biliwn'), (Range: 1000000000; Plural: pfOther; Value: '0 biliwn'), (Range: 10000000000; Plural: pfZero; Value: '00 biliwn'), (Range: 10000000000; Plural: pfOne; Value: '00 biliwn'), (Range: 10000000000; Plural: pfTwo; Value: '00 biliwn'), (Range: 10000000000; Plural: pfFew; Value: '00 biliwn'), (Range: 10000000000; Plural: pfMany; Value: '00 biliwn'), (Range: 10000000000; Plural: pfOther; Value: '00 biliwn'), (Range: 100000000000; Plural: pfZero; Value: '000 biliwn'), (Range: 100000000000; Plural: pfOne; Value: '000 biliwn'), (Range: 100000000000; Plural: pfTwo; Value: '000 biliwn'), (Range: 100000000000; Plural: pfFew; Value: '000 biliwn'), (Range: 100000000000; Plural: pfMany; Value: '000 biliwn'), (Range: 100000000000; Plural: pfOther; Value: '000 biliwn'), (Range: 1000000000000; Plural: pfZero; Value: '0 triliwn'), (Range: 1000000000000; Plural: pfOne; Value: '0 triliwn'), (Range: 1000000000000; Plural: pfTwo; Value: '0 driliwn'), (Range: 1000000000000; Plural: pfFew; Value: '0 thriliwn'), (Range: 1000000000000; Plural: pfMany; Value: '0 thriliwn'), (Range: 1000000000000; Plural: pfOther; Value: '0 triliwn'), (Range: 10000000000000; Plural: pfZero; Value: '00 triliwn'), (Range: 10000000000000; Plural: pfOne; Value: '00 triliwn'), (Range: 10000000000000; Plural: pfTwo; Value: '00 triliwn'), (Range: 10000000000000; Plural: pfFew; Value: '00 triliwn'), (Range: 10000000000000; Plural: pfMany; Value: '00 triliwn'), (Range: 10000000000000; Plural: pfOther; Value: '00 triliwn'), (Range: 100000000000000; Plural: pfZero; Value: '000 triliwn'), (Range: 100000000000000; Plural: pfOne; Value: '000 triliwn'), (Range: 100000000000000; Plural: pfTwo; Value: '000 triliwn'), (Range: 100000000000000; Plural: pfFew; Value: '000 triliwn'), (Range: 100000000000000; Plural: pfMany; Value: '000 triliwn'), (Range: 100000000000000; Plural: pfOther; Value: '000 triliwn') ); CY_SHORT: array[0..71] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0K'), (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfTwo; Value: '0K'), (Range: 1000; Plural: pfFew; Value: '0K'), (Range: 1000; Plural: pfMany; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfZero; Value: '00K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfTwo; Value: '00K'), (Range: 10000; Plural: pfFew; Value: '00K'), (Range: 10000; Plural: pfMany; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfZero; Value: '000K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfTwo; Value: '000K'), (Range: 100000; Plural: pfFew; Value: '000K'), (Range: 100000; Plural: pfMany; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfZero; Value: '0M'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfTwo; Value: '0M'), (Range: 1000000; Plural: pfFew; Value: '0M'), (Range: 1000000; Plural: pfMany; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfZero; Value: '00M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfTwo; Value: '00M'), (Range: 10000000; Plural: pfFew; Value: '00M'), (Range: 10000000; Plural: pfMany; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfZero; Value: '000M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfTwo; Value: '000M'), (Range: 100000000; Plural: pfFew; Value: '000M'), (Range: 100000000; Plural: pfMany; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfZero; Value: '0B'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfTwo; Value: '0B'), (Range: 1000000000; Plural: pfFew; Value: '0B'), (Range: 1000000000; Plural: pfMany; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfZero; Value: '00B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfTwo; Value: '00B'), (Range: 10000000000; Plural: pfFew; Value: '00B'), (Range: 10000000000; Plural: pfMany; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfZero; Value: '000B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfTwo; Value: '000B'), (Range: 100000000000; Plural: pfFew; Value: '000B'), (Range: 100000000000; Plural: pfMany; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfZero; Value: '0T'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfTwo; Value: '0T'), (Range: 1000000000000; Plural: pfFew; Value: '0T'), (Range: 1000000000000; Plural: pfMany; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfZero; Value: '00T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfTwo; Value: '00T'), (Range: 10000000000000; Plural: pfFew; Value: '00T'), (Range: 10000000000000; Plural: pfMany; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfZero; Value: '000T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfTwo; Value: '000T'), (Range: 100000000000000; Plural: pfFew; Value: '000T'), (Range: 100000000000000; Plural: pfMany; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); CY_CURRENCY: array[0..71] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '¤0 mil'), (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfTwo; Value: '¤0K'), (Range: 1000; Plural: pfFew; Value: '¤0K'), (Range: 1000; Plural: pfMany; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfZero; Value: '¤00K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfTwo; Value: '¤00K'), (Range: 10000; Plural: pfFew; Value: '¤00K'), (Range: 10000; Plural: pfMany; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfZero; Value: '¤000K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfTwo; Value: '¤000K'), (Range: 100000; Plural: pfFew; Value: '¤000K'), (Range: 100000; Plural: pfMany; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfZero; Value: '¤0M'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfTwo; Value: '¤0M'), (Range: 1000000; Plural: pfFew; Value: '¤0M'), (Range: 1000000; Plural: pfMany; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfZero; Value: '¤00M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfTwo; Value: '¤00M'), (Range: 10000000; Plural: pfFew; Value: '¤00M'), (Range: 10000000; Plural: pfMany; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfZero; Value: '¤000M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfTwo; Value: '¤000M'), (Range: 100000000; Plural: pfFew; Value: '¤000M'), (Range: 100000000; Plural: pfMany; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfZero; Value: '¤0B'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfTwo; Value: '¤0B'), (Range: 1000000000; Plural: pfFew; Value: '¤0B'), (Range: 1000000000; Plural: pfMany; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfZero; Value: '¤00B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfTwo; Value: '¤00B'), (Range: 10000000000; Plural: pfFew; Value: '¤00B'), (Range: 10000000000; Plural: pfMany; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfZero; Value: '¤000B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfTwo; Value: '¤000B'), (Range: 100000000000; Plural: pfFew; Value: '¤000B'), (Range: 100000000000; Plural: pfMany; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfZero; Value: '¤0T'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfTwo; Value: '¤0T'), (Range: 1000000000000; Plural: pfFew; Value: '¤0T'), (Range: 1000000000000; Plural: pfMany; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfZero; Value: '¤00T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfTwo; Value: '¤00T'), (Range: 10000000000000; Plural: pfFew; Value: '¤00T'), (Range: 10000000000000; Plural: pfMany; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfZero; Value: '¤000T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfTwo; Value: '¤000T'), (Range: 100000000000000; Plural: pfFew; Value: '¤000T'), (Range: 100000000000000; Plural: pfMany; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Danish DA_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tusind'), (Range: 1000; Plural: pfOther; Value: '0 tusind'), (Range: 10000; Plural: pfOne; Value: '00 tusind'), (Range: 10000; Plural: pfOther; Value: '00 tusind'), (Range: 100000; Plural: pfOne; Value: '000 tusind'), (Range: 100000; Plural: pfOther; Value: '000 tusind'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 millioner'), (Range: 10000000; Plural: pfOne; Value: '00 millioner'), (Range: 10000000; Plural: pfOther; Value: '00 millioner'), (Range: 100000000; Plural: pfOne; Value: '000 millioner'), (Range: 100000000; Plural: pfOther; Value: '000 millioner'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliarder'), (Range: 10000000000; Plural: pfOne; Value: '00 milliarder'), (Range: 10000000000; Plural: pfOther; Value: '00 milliarder'), (Range: 100000000000; Plural: pfOne; Value: '000 milliarder'), (Range: 100000000000; Plural: pfOther; Value: '000 milliarder'), (Range: 1000000000000; Plural: pfOne; Value: '0 billion'), (Range: 1000000000000; Plural: pfOther; Value: '0 billioner'), (Range: 10000000000000; Plural: pfOne; Value: '00 billioner'), (Range: 10000000000000; Plural: pfOther; Value: '00 billioner'), (Range: 100000000000000; Plural: pfOne; Value: '000 billioner'), (Range: 100000000000000; Plural: pfOther; Value: '000 billioner') ); DA_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 td'), (Range: 1000; Plural: pfOther; Value: '0 td'), (Range: 10000; Plural: pfOne; Value: '00 td'), (Range: 10000; Plural: pfOther; Value: '00 td'), (Range: 100000; Plural: pfOne; Value: '000 td'), (Range: 100000; Plural: pfOther; Value: '000 td'), (Range: 1000000; Plural: pfOne; Value: '0 mio'), (Range: 1000000; Plural: pfOther; Value: '0 mio'), (Range: 10000000; Plural: pfOne; Value: '00 mio'), (Range: 10000000; Plural: pfOther; Value: '00 mio'), (Range: 100000000; Plural: pfOne; Value: '000 mio'), (Range: 100000000; Plural: pfOther; Value: '000 mio'), (Range: 1000000000; Plural: pfOne; Value: '0 mia'), (Range: 1000000000; Plural: pfOther; Value: '0 mia'), (Range: 10000000000; Plural: pfOne; Value: '00 mia'), (Range: 10000000000; Plural: pfOther; Value: '00 mia'), (Range: 100000000000; Plural: pfOne; Value: '000 mia'), (Range: 100000000000; Plural: pfOther; Value: '000 mia'), (Range: 1000000000000; Plural: pfOne; Value: '0 bio'), (Range: 1000000000000; Plural: pfOther; Value: '0 bio'), (Range: 10000000000000; Plural: pfOne; Value: '00 bio'), (Range: 10000000000000; Plural: pfOther; Value: '00 bio'), (Range: 100000000000000; Plural: pfOne; Value: '000 bio'), (Range: 100000000000000; Plural: pfOther; Value: '000 bio') ); DA_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 td ¤'), (Range: 1000; Plural: pfOther; Value: '0 td ¤'), (Range: 10000; Plural: pfOne; Value: '00 td ¤'), (Range: 10000; Plural: pfOther; Value: '00 td ¤'), (Range: 100000; Plural: pfOne; Value: '000 td ¤'), (Range: 100000; Plural: pfOther; Value: '000 td ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mio ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mio ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mio ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mio ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mio ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mio ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mia ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mia ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mia ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mia ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mia ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mia ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bio ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bio ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bio ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bio ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bio ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bio ¤') ); // Taita DAV_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // German DE_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 Tausend'), (Range: 1000; Plural: pfOther; Value: '0 Tausend'), (Range: 10000; Plural: pfOne; Value: '00 Tausend'), (Range: 10000; Plural: pfOther; Value: '00 Tausend'), (Range: 100000; Plural: pfOne; Value: '000 Tausend'), (Range: 100000; Plural: pfOther; Value: '000 Tausend'), (Range: 1000000; Plural: pfOne; Value: '0 Million'), (Range: 1000000; Plural: pfOther; Value: '0 Millionen'), (Range: 10000000; Plural: pfOne; Value: '00 Millionen'), (Range: 10000000; Plural: pfOther; Value: '00 Millionen'), (Range: 100000000; Plural: pfOne; Value: '000 Millionen'), (Range: 100000000; Plural: pfOther; Value: '000 Millionen'), (Range: 1000000000; Plural: pfOne; Value: '0 Milliarde'), (Range: 1000000000; Plural: pfOther; Value: '0 Milliarden'), (Range: 10000000000; Plural: pfOne; Value: '00 Milliarden'), (Range: 10000000000; Plural: pfOther; Value: '00 Milliarden'), (Range: 100000000000; Plural: pfOne; Value: '000 Milliarden'), (Range: 100000000000; Plural: pfOther; Value: '000 Milliarden'), (Range: 1000000000000; Plural: pfOne; Value: '0 Billion'), (Range: 1000000000000; Plural: pfOther; Value: '0 Billionen'), (Range: 10000000000000; Plural: pfOne; Value: '00 Billionen'), (Range: 10000000000000; Plural: pfOther; Value: '00 Billionen'), (Range: 100000000000000; Plural: pfOne; Value: '000 Billionen'), (Range: 100000000000000; Plural: pfOther; Value: '000 Billionen') ); DE_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 Tsd.'), (Range: 1000; Plural: pfOther; Value: '0 Tsd.'), (Range: 10000; Plural: pfOne; Value: '00 Tsd.'), (Range: 10000; Plural: pfOther; Value: '00 Tsd.'), (Range: 100000; Plural: pfOne; Value: '000 Tsd.'), (Range: 100000; Plural: pfOther; Value: '000 Tsd.'), (Range: 1000000; Plural: pfOne; Value: '0 Mio.'), (Range: 1000000; Plural: pfOther; Value: '0 Mio.'), (Range: 10000000; Plural: pfOne; Value: '00 Mio.'), (Range: 10000000; Plural: pfOther; Value: '00 Mio.'), (Range: 100000000; Plural: pfOne; Value: '000 Mio.'), (Range: 100000000; Plural: pfOther; Value: '000 Mio.'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio.'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio.'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio.'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio.'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio.'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio.') ); DE_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 Tsd. ¤'), (Range: 1000; Plural: pfOther; Value: '0 Tsd. ¤'), (Range: 10000; Plural: pfOne; Value: '00 Tsd. ¤'), (Range: 10000; Plural: pfOther; Value: '00 Tsd. ¤'), (Range: 100000; Plural: pfOne; Value: '000 Tsd. ¤'), (Range: 100000; Plural: pfOther; Value: '000 Tsd. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 Mio. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Mio. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 Mio. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Mio. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 Mio. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Mio. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio. ¤') ); // Zarma DJE_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Lower Sorbian DSB_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tysac'), (Range: 1000; Plural: pfTwo; Value: '0 tysac'), (Range: 1000; Plural: pfFew; Value: '0 tysac'), (Range: 1000; Plural: pfOther; Value: '0 tysac'), (Range: 10000; Plural: pfOne; Value: '00 tysac'), (Range: 10000; Plural: pfTwo; Value: '00 tysac'), (Range: 10000; Plural: pfFew; Value: '00 tysac'), (Range: 10000; Plural: pfOther; Value: '00 tysac'), (Range: 100000; Plural: pfOne; Value: '000 tysac'), (Range: 100000; Plural: pfTwo; Value: '000 tysac'), (Range: 100000; Plural: pfFew; Value: '000 tysac'), (Range: 100000; Plural: pfOther; Value: '000 tysac'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfTwo; Value: '0 miliona'), (Range: 1000000; Plural: pfFew; Value: '0 miliony'), (Range: 1000000; Plural: pfOther; Value: '0 milionow'), (Range: 10000000; Plural: pfOne; Value: '00 milionow'), (Range: 10000000; Plural: pfTwo; Value: '00 milionow'), (Range: 10000000; Plural: pfFew; Value: '00 milionow'), (Range: 10000000; Plural: pfOther; Value: '00 milionow'), (Range: 100000000; Plural: pfOne; Value: '000 milionow'), (Range: 100000000; Plural: pfTwo; Value: '000 milionow'), (Range: 100000000; Plural: pfFew; Value: '000 milionow'), (Range: 100000000; Plural: pfOther; Value: '000 milionow'), (Range: 1000000000; Plural: pfOne; Value: '0 miliarda'), (Range: 1000000000; Plural: pfTwo; Value: '0 miliarźe'), (Range: 1000000000; Plural: pfFew; Value: '0 miliardy'), (Range: 1000000000; Plural: pfOther; Value: '0 miliardow'), (Range: 10000000000; Plural: pfOne; Value: '00 miliardow'), (Range: 10000000000; Plural: pfTwo; Value: '00 miliardow'), (Range: 10000000000; Plural: pfFew; Value: '00 miliardow'), (Range: 10000000000; Plural: pfOther; Value: '00 miliardow'), (Range: 100000000000; Plural: pfOne; Value: '000 miliardow'), (Range: 100000000000; Plural: pfTwo; Value: '000 miliardow'), (Range: 100000000000; Plural: pfFew; Value: '000 miliardow'), (Range: 100000000000; Plural: pfOther; Value: '000 miliardow'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilion'), (Range: 1000000000000; Plural: pfTwo; Value: '0 biliona'), (Range: 1000000000000; Plural: pfFew; Value: '0 biliony'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilionow'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilionow'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bilionow'), (Range: 10000000000000; Plural: pfFew; Value: '00 bilionow'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilionow'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilionow'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bilionow'), (Range: 100000000000000; Plural: pfFew; Value: '000 bilionow'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilionow') ); DSB_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tys.'), (Range: 1000; Plural: pfTwo; Value: '0 tys.'), (Range: 1000; Plural: pfFew; Value: '0 tys.'), (Range: 1000; Plural: pfOther; Value: '0 tys.'), (Range: 10000; Plural: pfOne; Value: '00 tys.'), (Range: 10000; Plural: pfTwo; Value: '00 tys.'), (Range: 10000; Plural: pfFew; Value: '00 tys.'), (Range: 10000; Plural: pfOther; Value: '00 tys.'), (Range: 100000; Plural: pfOne; Value: '000 tys.'), (Range: 100000; Plural: pfTwo; Value: '000 tys.'), (Range: 100000; Plural: pfFew; Value: '000 tys.'), (Range: 100000; Plural: pfOther; Value: '000 tys.'), (Range: 1000000; Plural: pfOne; Value: '0 mio.'), (Range: 1000000; Plural: pfTwo; Value: '0 mio.'), (Range: 1000000; Plural: pfFew; Value: '0 mio.'), (Range: 1000000; Plural: pfOther; Value: '0 mio.'), (Range: 10000000; Plural: pfOne; Value: '00 mio.'), (Range: 10000000; Plural: pfTwo; Value: '00 mio.'), (Range: 10000000; Plural: pfFew; Value: '00 mio.'), (Range: 10000000; Plural: pfOther; Value: '00 mio.'), (Range: 100000000; Plural: pfOne; Value: '000 mio.'), (Range: 100000000; Plural: pfTwo; Value: '000 mio.'), (Range: 100000000; Plural: pfFew; Value: '000 mio.'), (Range: 100000000; Plural: pfOther; Value: '000 mio.'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd.'), (Range: 1000000000; Plural: pfTwo; Value: '0 mrd.'), (Range: 1000000000; Plural: pfFew; Value: '0 mrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd.'), (Range: 10000000000; Plural: pfTwo; Value: '00 mrd.'), (Range: 10000000000; Plural: pfFew; Value: '00 mrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd.'), (Range: 100000000000; Plural: pfTwo; Value: '000 mrd.'), (Range: 100000000000; Plural: pfFew; Value: '000 mrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); DSB_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tys. ¤'), (Range: 1000; Plural: pfTwo; Value: '0 tys. ¤'), (Range: 1000; Plural: pfFew; Value: '0 tys. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tys. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tys. ¤'), (Range: 10000; Plural: pfTwo; Value: '00 tys. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tys. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tys. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tys. ¤'), (Range: 100000; Plural: pfTwo; Value: '000 tys. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tys. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tys. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfTwo; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mio. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfTwo; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mio. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfTwo; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mio. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfTwo; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfTwo; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfTwo; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Duala DUA_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Jola-Fonyi DYO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Dzongkha DZ_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: 'སྟོང་ཕྲག 0'), (Range: 10000; Plural: pfOther; Value: 'ཁྲི་ཕྲག 0'), (Range: 100000; Plural: pfOther; Value: 'འབུམ་ཕྲག 0'), (Range: 1000000; Plural: pfOther; Value: 'ས་ཡ་ 0'), (Range: 10000000; Plural: pfOther; Value: 'བྱེ་བ་ 0'), (Range: 100000000; Plural: pfOther; Value: 'དུང་ཕྱུར་ 0'), (Range: 1000000000; Plural: pfOther; Value: 'དུང་ཕྱུར་ 00'), (Range: 10000000000; Plural: pfOther; Value: 'དུང་ཕྱུར་བརྒྱ་ 0'), (Range: 100000000000; Plural: pfOther; Value: 'དུང་ཕྱུར་སྟོང 0'), (Range: 1000000000000; Plural: pfOther; Value: 'དུང་ཕྱུར་ཁྲི་ 0'), (Range: 10000000000000; Plural: pfOther; Value: 'དུང་ཕྱུར་འབུམ་ 0'), (Range: 100000000000000; Plural: pfOther; Value: 'དུང་ཕྱུར་ས་ཡ་ 0') ); DZ_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Embu EBU_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Ewe EE_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: 'akpe 0'), (Range: 1000; Plural: pfOther; Value: 'akpe 0'), (Range: 10000; Plural: pfOne; Value: 'akpe 00'), (Range: 10000; Plural: pfOther; Value: 'akpe 00'), (Range: 100000; Plural: pfOne; Value: 'akpe 000'), (Range: 100000; Plural: pfOther; Value: 'akpe 000'), (Range: 1000000; Plural: pfOne; Value: 'miliɔn 0'), (Range: 1000000; Plural: pfOther; Value: 'miliɔn 0'), (Range: 10000000; Plural: pfOne; Value: 'miliɔn 00'), (Range: 10000000; Plural: pfOther; Value: 'miliɔn 00'), (Range: 100000000; Plural: pfOne; Value: 'miliɔn 000'), (Range: 100000000; Plural: pfOther; Value: 'miliɔn 000'), (Range: 1000000000; Plural: pfOne; Value: 'miliɔn 0000'), (Range: 1000000000; Plural: pfOther; Value: 'miliɔn 0000'), (Range: 10000000000; Plural: pfOne; Value: 'miliɔn 00000'), (Range: 10000000000; Plural: pfOther; Value: 'miliɔn 00000'), (Range: 100000000000; Plural: pfOne; Value: 'miliɔn 000000'), (Range: 100000000000; Plural: pfOther; Value: 'miliɔn 000000'), (Range: 1000000000000; Plural: pfOne; Value: 'biliɔn 0'), (Range: 1000000000000; Plural: pfOther; Value: 'biliɔn 0'), (Range: 10000000000000; Plural: pfOne; Value: 'biliɔn 00'), (Range: 10000000000000; Plural: pfOther; Value: 'biliɔn 00'), (Range: 100000000000000; Plural: pfOne; Value: 'biliɔn 000'), (Range: 100000000000000; Plural: pfOther; Value: 'biliɔn 000') ); EE_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0000M'), (Range: 1000000000; Plural: pfOther; Value: '0000M'), (Range: 10000000000; Plural: pfOne; Value: '00000M'), (Range: 10000000000; Plural: pfOther; Value: '00000M'), (Range: 100000000000; Plural: pfOne; Value: '000000M'), (Range: 100000000000; Plural: pfOther; Value: '000000M'), (Range: 1000000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000000; Plural: pfOther; Value: '000B') ); EE_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0000M'), (Range: 10000000000; Plural: pfOne; Value: '¤00000M'), (Range: 10000000000; Plural: pfOther; Value: '¤00000M'), (Range: 100000000000; Plural: pfOne; Value: '¤000000M'), (Range: 100000000000; Plural: pfOther; Value: '¤000000M'), (Range: 1000000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000000; Plural: pfOther; Value: '¤000B') ); // Greek EL_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 χιλιάδα'), (Range: 1000; Plural: pfOther; Value: '0 χιλιάδες'), (Range: 10000; Plural: pfOne; Value: '00 χιλιάδες'), (Range: 10000; Plural: pfOther; Value: '00 χιλιάδες'), (Range: 100000; Plural: pfOne; Value: '000 χιλιάδες'), (Range: 100000; Plural: pfOther; Value: '000 χιλιάδες'), (Range: 1000000; Plural: pfOne; Value: '0 εκατομμύριο'), (Range: 1000000; Plural: pfOther; Value: '0 εκατομμύρια'), (Range: 10000000; Plural: pfOne; Value: '00 εκατομμύρια'), (Range: 10000000; Plural: pfOther; Value: '00 εκατομμύρια'), (Range: 100000000; Plural: pfOne; Value: '000 εκατομμύρια'), (Range: 100000000; Plural: pfOther; Value: '000 εκατομμύρια'), (Range: 1000000000; Plural: pfOne; Value: '0 δισεκατομμύριο'), (Range: 1000000000; Plural: pfOther; Value: '0 δισεκατομμύρια'), (Range: 10000000000; Plural: pfOne; Value: '00 δισεκατομμύρια'), (Range: 10000000000; Plural: pfOther; Value: '00 δισεκατομμύρια'), (Range: 100000000000; Plural: pfOne; Value: '000 δισεκατομμύρια'), (Range: 100000000000; Plural: pfOther; Value: '000 δισεκατομμύρια'), (Range: 1000000000000; Plural: pfOne; Value: '0 τρισεκατομμύριο'), (Range: 1000000000000; Plural: pfOther; Value: '0 τρισεκατομμύρια'), (Range: 10000000000000; Plural: pfOne; Value: '00 τρισεκατομμύρια'), (Range: 10000000000000; Plural: pfOther; Value: '00 τρισεκατομμύρια'), (Range: 100000000000000; Plural: pfOne; Value: '000 τρισεκατομμύρια'), (Range: 100000000000000; Plural: pfOther; Value: '000 τρισεκατομμύρια') ); EL_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 χιλ.'), (Range: 1000; Plural: pfOther; Value: '0 χιλ.'), (Range: 10000; Plural: pfOne; Value: '00 χιλ.'), (Range: 10000; Plural: pfOther; Value: '00 χιλ.'), (Range: 100000; Plural: pfOne; Value: '000 χιλ.'), (Range: 100000; Plural: pfOther; Value: '000 χιλ.'), (Range: 1000000; Plural: pfOne; Value: '0 εκ.'), (Range: 1000000; Plural: pfOther; Value: '0 εκ.'), (Range: 10000000; Plural: pfOne; Value: '00 εκ.'), (Range: 10000000; Plural: pfOther; Value: '00 εκ.'), (Range: 100000000; Plural: pfOne; Value: '000 εκ.'), (Range: 100000000; Plural: pfOther; Value: '000 εκ.'), (Range: 1000000000; Plural: pfOne; Value: '0 δισ.'), (Range: 1000000000; Plural: pfOther; Value: '0 δισ.'), (Range: 10000000000; Plural: pfOne; Value: '00 δισ.'), (Range: 10000000000; Plural: pfOther; Value: '00 δισ.'), (Range: 100000000000; Plural: pfOne; Value: '000 δισ.'), (Range: 100000000000; Plural: pfOther; Value: '000 δισ.'), (Range: 1000000000000; Plural: pfOne; Value: '0 τρισ.'), (Range: 1000000000000; Plural: pfOther; Value: '0 τρισ.'), (Range: 10000000000000; Plural: pfOne; Value: '00 τρισ.'), (Range: 10000000000000; Plural: pfOther; Value: '00 τρισ.'), (Range: 100000000000000; Plural: pfOne; Value: '000 τρισ.'), (Range: 100000000000000; Plural: pfOther; Value: '000 τρισ.') ); EL_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 χιλ. ¤'), (Range: 1000; Plural: pfOther; Value: '0 χιλ. ¤'), (Range: 10000; Plural: pfOne; Value: '00 χιλ. ¤'), (Range: 10000; Plural: pfOther; Value: '00 χιλ. ¤'), (Range: 100000; Plural: pfOne; Value: '000 χιλ. ¤'), (Range: 100000; Plural: pfOther; Value: '000 χιλ. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 εκ. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 εκ. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 εκ. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 εκ. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 εκ. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 εκ. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 δισ. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 δισ. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 δισ. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 δισ. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 δισ. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 δισ. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 τρισ. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 τρισ. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 τρισ. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 τρισ. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 τρισ. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 τρισ. ¤') ); // English EN_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 thousand'), (Range: 1000; Plural: pfOther; Value: '0 thousand'), (Range: 10000; Plural: pfOne; Value: '00 thousand'), (Range: 10000; Plural: pfOther; Value: '00 thousand'), (Range: 100000; Plural: pfOne; Value: '000 thousand'), (Range: 100000; Plural: pfOther; Value: '000 thousand'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 million'), (Range: 10000000; Plural: pfOne; Value: '00 million'), (Range: 10000000; Plural: pfOther; Value: '00 million'), (Range: 100000000; Plural: pfOne; Value: '000 million'), (Range: 100000000; Plural: pfOther; Value: '000 million'), (Range: 1000000000; Plural: pfOne; Value: '0 billion'), (Range: 1000000000; Plural: pfOther; Value: '0 billion'), (Range: 10000000000; Plural: pfOne; Value: '00 billion'), (Range: 10000000000; Plural: pfOther; Value: '00 billion'), (Range: 100000000000; Plural: pfOne; Value: '000 billion'), (Range: 100000000000; Plural: pfOther; Value: '000 billion'), (Range: 1000000000000; Plural: pfOne; Value: '0 trillion'), (Range: 1000000000000; Plural: pfOther; Value: '0 trillion'), (Range: 10000000000000; Plural: pfOne; Value: '00 trillion'), (Range: 10000000000000; Plural: pfOther; Value: '00 trillion'), (Range: 100000000000000; Plural: pfOne; Value: '000 trillion'), (Range: 100000000000000; Plural: pfOther; Value: '000 trillion') ); EN_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); EN_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Esperanto EO_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Spanish ES_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mil'), (Range: 1000; Plural: pfOther; Value: '0 mil'), (Range: 10000; Plural: pfOne; Value: '00 mil'), (Range: 10000; Plural: pfOther; Value: '00 mil'), (Range: 100000; Plural: pfOne; Value: '000 mil'), (Range: 100000; Plural: pfOther; Value: '000 mil'), (Range: 1000000; Plural: pfOne; Value: '0 millón'), (Range: 1000000; Plural: pfOther; Value: '0 millones'), (Range: 10000000; Plural: pfOne; Value: '00 millones'), (Range: 10000000; Plural: pfOther; Value: '00 millones'), (Range: 100000000; Plural: pfOne; Value: '000 millones'), (Range: 100000000; Plural: pfOther; Value: '000 millones'), (Range: 1000000000; Plural: pfOne; Value: '0 mil millones'), (Range: 1000000000; Plural: pfOther; Value: '0 mil millones'), (Range: 10000000000; Plural: pfOne; Value: '00 mil millones'), (Range: 10000000000; Plural: pfOther; Value: '00 mil millones'), (Range: 100000000000; Plural: pfOne; Value: '000 mil millones'), (Range: 100000000000; Plural: pfOther; Value: '000 mil millones'), (Range: 1000000000000; Plural: pfOne; Value: '0 billón'), (Range: 1000000000000; Plural: pfOther; Value: '0 billones'), (Range: 10000000000000; Plural: pfOne; Value: '00 billones'), (Range: 10000000000000; Plural: pfOther; Value: '00 billones'), (Range: 100000000000000; Plural: pfOne; Value: '000 billones'), (Range: 100000000000000; Plural: pfOther; Value: '000 billones') ); ES_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 K'), (Range: 1000; Plural: pfOther; Value: '0 K'), (Range: 10000; Plural: pfOne; Value: '00 K'), (Range: 10000; Plural: pfOther; Value: '00 K'), (Range: 100000; Plural: pfOne; Value: '000 K'), (Range: 100000; Plural: pfOther; Value: '000 K'), (Range: 1000000; Plural: pfOne; Value: '0 M'), (Range: 1000000; Plural: pfOther; Value: '0 M'), (Range: 10000000; Plural: pfOne; Value: '00 M'), (Range: 10000000; Plural: pfOther; Value: '00 M'), (Range: 100000000; Plural: pfOne; Value: '000 M'), (Range: 100000000; Plural: pfOther; Value: '000 M'), (Range: 1000000000; Plural: pfOne; Value: '0000 M'), (Range: 1000000000; Plural: pfOther; Value: '0000 M'), (Range: 10000000000; Plural: pfOne; Value: '00 MRD'), (Range: 10000000000; Plural: pfOther; Value: '00 MRD'), (Range: 100000000000; Plural: pfOne; Value: '000 MRD'), (Range: 100000000000; Plural: pfOther; Value: '000 MRD'), (Range: 1000000000000; Plural: pfOne; Value: '0 B'), (Range: 1000000000000; Plural: pfOther; Value: '0 B'), (Range: 10000000000000; Plural: pfOne; Value: '00 B'), (Range: 10000000000000; Plural: pfOther; Value: '00 B'), (Range: 100000000000000; Plural: pfOne; Value: '000 B'), (Range: 100000000000000; Plural: pfOther; Value: '000 B') ); ES_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 K ¤'), (Range: 1000; Plural: pfOther; Value: '0 K ¤'), (Range: 10000; Plural: pfOne; Value: '00 K ¤'), (Range: 10000; Plural: pfOther; Value: '00 K ¤'), (Range: 100000; Plural: pfOne; Value: '000 K ¤'), (Range: 100000; Plural: pfOther; Value: '000 K ¤'), (Range: 1000000; Plural: pfOne; Value: '0 M ¤'), (Range: 1000000; Plural: pfOther; Value: '0 M ¤'), (Range: 10000000; Plural: pfOne; Value: '00 M ¤'), (Range: 10000000; Plural: pfOther; Value: '00 M ¤'), (Range: 100000000; Plural: pfOne; Value: '000 M ¤'), (Range: 100000000; Plural: pfOther; Value: '000 M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0000 M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0000 M ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 MRD ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 MRD ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 MRD ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 MRD ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 B ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 B ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 B ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 B ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 B ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 B ¤') ); // Estonian ET_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tuhat'), (Range: 1000; Plural: pfOther; Value: '0 tuhat'), (Range: 10000; Plural: pfOne; Value: '00 tuhat'), (Range: 10000; Plural: pfOther; Value: '00 tuhat'), (Range: 100000; Plural: pfOne; Value: '000 tuhat'), (Range: 100000; Plural: pfOther; Value: '000 tuhat'), (Range: 1000000; Plural: pfOne; Value: '0 miljon'), (Range: 1000000; Plural: pfOther; Value: '0 miljonit'), (Range: 10000000; Plural: pfOne; Value: '00 miljon'), (Range: 10000000; Plural: pfOther; Value: '00 miljonit'), (Range: 100000000; Plural: pfOne; Value: '000 miljon'), (Range: 100000000; Plural: pfOther; Value: '000 miljonit'), (Range: 1000000000; Plural: pfOne; Value: '0 miljard'), (Range: 1000000000; Plural: pfOther; Value: '0 miljardit'), (Range: 10000000000; Plural: pfOne; Value: '00 miljard'), (Range: 10000000000; Plural: pfOther; Value: '00 miljardit'), (Range: 100000000000; Plural: pfOne; Value: '000 miljard'), (Range: 100000000000; Plural: pfOther; Value: '000 miljardit'), (Range: 1000000000000; Plural: pfOne; Value: '0 triljon'), (Range: 1000000000000; Plural: pfOther; Value: '0 triljonit'), (Range: 10000000000000; Plural: pfOne; Value: '00 triljon'), (Range: 10000000000000; Plural: pfOther; Value: '00 triljonit'), (Range: 100000000000000; Plural: pfOne; Value: '000 triljon'), (Range: 100000000000000; Plural: pfOther; Value: '000 triljonit') ); ET_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tuh'), (Range: 1000; Plural: pfOther; Value: '0 tuh'), (Range: 10000; Plural: pfOne; Value: '00 tuh'), (Range: 10000; Plural: pfOther; Value: '00 tuh'), (Range: 100000; Plural: pfOne; Value: '000 tuh'), (Range: 100000; Plural: pfOther; Value: '000 tuh'), (Range: 1000000; Plural: pfOne; Value: '0 mln'), (Range: 1000000; Plural: pfOther; Value: '0 mln'), (Range: 10000000; Plural: pfOne; Value: '00 mln'), (Range: 10000000; Plural: pfOther; Value: '00 mln'), (Range: 100000000; Plural: pfOne; Value: '000 mln'), (Range: 100000000; Plural: pfOther; Value: '000 mln'), (Range: 1000000000; Plural: pfOne; Value: '0 mld'), (Range: 1000000000; Plural: pfOther; Value: '0 mld'), (Range: 10000000000; Plural: pfOne; Value: '00 mld'), (Range: 10000000000; Plural: pfOther; Value: '00 mld'), (Range: 100000000000; Plural: pfOne; Value: '000 mld'), (Range: 100000000000; Plural: pfOther; Value: '000 mld'), (Range: 1000000000000; Plural: pfOne; Value: '0 trl'), (Range: 1000000000000; Plural: pfOther; Value: '0 trl'), (Range: 10000000000000; Plural: pfOne; Value: '00 trl'), (Range: 10000000000000; Plural: pfOther; Value: '00 trl'), (Range: 100000000000000; Plural: pfOne; Value: '000 trl'), (Range: 100000000000000; Plural: pfOther; Value: '000 trl') ); ET_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tuh ¤'), (Range: 1000; Plural: pfOther; Value: '0 tuh ¤'), (Range: 10000; Plural: pfOne; Value: '00 tuh ¤'), (Range: 10000; Plural: pfOther; Value: '00 tuh ¤'), (Range: 100000; Plural: pfOne; Value: '000 tuh ¤'), (Range: 100000; Plural: pfOther; Value: '000 tuh ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mln ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mln ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mln ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mln ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mln ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mln ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mld ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mld ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mld ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mld ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mld ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mld ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 trl ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 trl ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 trl ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 trl ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 trl ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 trl ¤') ); // Basque EU_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0000'), (Range: 1000; Plural: pfOther; Value: '0000'), (Range: 10000; Plural: pfOne; Value: '00000'), (Range: 10000; Plural: pfOther; Value: '00000'), (Range: 100000; Plural: pfOne; Value: '000000'), (Range: 100000; Plural: pfOther; Value: '000000'), (Range: 1000000; Plural: pfOne; Value: '0 milioi'), (Range: 1000000; Plural: pfOther; Value: '0 milioi'), (Range: 10000000; Plural: pfOne; Value: '00 milioi'), (Range: 10000000; Plural: pfOther; Value: '00 milioi'), (Range: 100000000; Plural: pfOne; Value: '000 milioi'), (Range: 100000000; Plural: pfOther; Value: '000 milioi'), (Range: 1000000000; Plural: pfOne; Value: '0000 milioi'), (Range: 1000000000; Plural: pfOther; Value: '0000 milioi'), (Range: 10000000000; Plural: pfOne; Value: '00000 milioi'), (Range: 10000000000; Plural: pfOther; Value: '00000 milioi'), (Range: 100000000000; Plural: pfOne; Value: '000000 milioi'), (Range: 100000000000; Plural: pfOther; Value: '000000 milioi'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilioi'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilioi'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilioi'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilioi'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilioi'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilioi') ); EU_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0000'), (Range: 1000; Plural: pfOther; Value: '0000'), (Range: 10000; Plural: pfOne; Value: '00000'), (Range: 10000; Plural: pfOther; Value: '00000'), (Range: 100000; Plural: pfOne; Value: '000000'), (Range: 100000; Plural: pfOther; Value: '000000'), (Range: 1000000; Plural: pfOne; Value: '0 M'), (Range: 1000000; Plural: pfOther; Value: '0 M'), (Range: 10000000; Plural: pfOne; Value: '00 M'), (Range: 10000000; Plural: pfOther; Value: '00 M'), (Range: 100000000; Plural: pfOne; Value: '000 M'), (Range: 100000000; Plural: pfOther; Value: '000 M'), (Range: 1000000000; Plural: pfOne; Value: '0000 M'), (Range: 1000000000; Plural: pfOther; Value: '0000 M'), (Range: 10000000000; Plural: pfOne; Value: '00000 M'), (Range: 10000000000; Plural: pfOther; Value: '00000 M'), (Range: 100000000000; Plural: pfOne; Value: '000000 M'), (Range: 100000000000; Plural: pfOther; Value: '000000 M'), (Range: 1000000000000; Plural: pfOne; Value: '0 B'), (Range: 1000000000000; Plural: pfOther; Value: '0 B'), (Range: 10000000000000; Plural: pfOne; Value: '00 B'), (Range: 10000000000000; Plural: pfOther; Value: '00 B'), (Range: 100000000000000; Plural: pfOne; Value: '000 B'), (Range: 100000000000000; Plural: pfOther; Value: '000 B') ); EU_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0000 ¤'), (Range: 1000; Plural: pfOther; Value: '0000 ¤'), (Range: 10000; Plural: pfOne; Value: '00000 ¤'), (Range: 10000; Plural: pfOther; Value: '00000 ¤'), (Range: 100000; Plural: pfOne; Value: '000000 ¤'), (Range: 100000; Plural: pfOther; Value: '000000 ¤'), (Range: 1000000; Plural: pfOne; Value: '0 M ¤'), (Range: 1000000; Plural: pfOther; Value: '0 M ¤'), (Range: 10000000; Plural: pfOne; Value: '00 M ¤'), (Range: 10000000; Plural: pfOther; Value: '00 M ¤'), (Range: 100000000; Plural: pfOne; Value: '000 M ¤'), (Range: 100000000; Plural: pfOther; Value: '000 M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0000 M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0000 M ¤'), (Range: 10000000000; Plural: pfOne; Value: '00000 M ¤'), (Range: 10000000000; Plural: pfOther; Value: '00000 M ¤'), (Range: 100000000000; Plural: pfOne; Value: '000000 M ¤'), (Range: 100000000000; Plural: pfOther; Value: '000000 M ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 B ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 B ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 B ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 B ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 B ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 B ¤') ); // Ewondo EWO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Persian FA_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 هزار'), (Range: 1000; Plural: pfOther; Value: '0 هزار'), (Range: 10000; Plural: pfOne; Value: '00 هزار'), (Range: 10000; Plural: pfOther; Value: '00 هزار'), (Range: 100000; Plural: pfOne; Value: '000 هزار'), (Range: 100000; Plural: pfOther; Value: '000 هزار'), (Range: 1000000; Plural: pfOne; Value: '0 میلیون'), (Range: 1000000; Plural: pfOther; Value: '0 میلیون'), (Range: 10000000; Plural: pfOne; Value: '00 میلیون'), (Range: 10000000; Plural: pfOther; Value: '00 میلیون'), (Range: 100000000; Plural: pfOne; Value: '000 میلیون'), (Range: 100000000; Plural: pfOther; Value: '000 میلیون'), (Range: 1000000000; Plural: pfOne; Value: '0 میلیارد'), (Range: 1000000000; Plural: pfOther; Value: '0 میلیارد'), (Range: 10000000000; Plural: pfOne; Value: '00 میلیارد'), (Range: 10000000000; Plural: pfOther; Value: '00 میلیارد'), (Range: 100000000000; Plural: pfOne; Value: '000 میلیارد'), (Range: 100000000000; Plural: pfOther; Value: '000 میلیارد'), (Range: 1000000000000; Plural: pfOne; Value: '0 هزارمیلیارد'), (Range: 1000000000000; Plural: pfOther; Value: '0 هزارمیلیارد'), (Range: 10000000000000; Plural: pfOne; Value: '00 هزارمیلیارد'), (Range: 10000000000000; Plural: pfOther; Value: '00 هزارمیلیارد'), (Range: 100000000000000; Plural: pfOne; Value: '000 هزارمیلیارد'), (Range: 100000000000000; Plural: pfOther; Value: '000 هزارمیلیارد') ); FA_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 هزار'), (Range: 1000; Plural: pfOther; Value: '0 هزار'), (Range: 10000; Plural: pfOne; Value: '00 هزار'), (Range: 10000; Plural: pfOther; Value: '00 هزار'), (Range: 100000; Plural: pfOne; Value: '000 هزار'), (Range: 100000; Plural: pfOther; Value: '000 هزار'), (Range: 1000000; Plural: pfOne; Value: '0 میلیون'), (Range: 1000000; Plural: pfOther; Value: '0 میلیون'), (Range: 10000000; Plural: pfOne; Value: '00 میلیون'), (Range: 10000000; Plural: pfOther; Value: '00 میلیون'), (Range: 100000000; Plural: pfOne; Value: '000 م'), (Range: 100000000; Plural: pfOther; Value: '000 م'), (Range: 1000000000; Plural: pfOne; Value: '0 م'), (Range: 1000000000; Plural: pfOther; Value: '0 م'), (Range: 10000000000; Plural: pfOne; Value: '00 م'), (Range: 10000000000; Plural: pfOther; Value: '00 م'), (Range: 100000000000; Plural: pfOne; Value: '000 میلیارد'), (Range: 100000000000; Plural: pfOther; Value: '000 میلیارد'), (Range: 1000000000000; Plural: pfOne; Value: '0 تریلیون'), (Range: 1000000000000; Plural: pfOther; Value: '0 تریلیون'), (Range: 10000000000000; Plural: pfOne; Value: '00 ت'), (Range: 10000000000000; Plural: pfOther; Value: '00 ت'), (Range: 100000000000000; Plural: pfOne; Value: '000 ت'), (Range: 100000000000000; Plural: pfOther; Value: '000 ت') ); // Fulah FF_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Finnish FI_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tuhat'), (Range: 1000; Plural: pfOther; Value: '0 tuhatta'), (Range: 10000; Plural: pfOne; Value: '00 tuhatta'), (Range: 10000; Plural: pfOther; Value: '00 tuhatta'), (Range: 100000; Plural: pfOne; Value: '000 tuhatta'), (Range: 100000; Plural: pfOther; Value: '000 tuhatta'), (Range: 1000000; Plural: pfOne; Value: '0 miljoona'), (Range: 1000000; Plural: pfOther; Value: '0 miljoonaa'), (Range: 10000000; Plural: pfOne; Value: '00 miljoonaa'), (Range: 10000000; Plural: pfOther; Value: '00 miljoonaa'), (Range: 100000000; Plural: pfOne; Value: '000 miljoonaa'), (Range: 100000000; Plural: pfOther; Value: '000 miljoonaa'), (Range: 1000000000; Plural: pfOne; Value: '0 miljardi'), (Range: 1000000000; Plural: pfOther; Value: '0 miljardia'), (Range: 10000000000; Plural: pfOne; Value: '00 miljardia'), (Range: 10000000000; Plural: pfOther; Value: '00 miljardia'), (Range: 100000000000; Plural: pfOne; Value: '000 miljardia'), (Range: 100000000000; Plural: pfOther; Value: '000 miljardia'), (Range: 1000000000000; Plural: pfOne; Value: '0 biljoona'), (Range: 1000000000000; Plural: pfOther; Value: '0 biljoonaa'), (Range: 10000000000000; Plural: pfOne; Value: '00 biljoonaa'), (Range: 10000000000000; Plural: pfOther; Value: '00 biljoonaa'), (Range: 100000000000000; Plural: pfOne; Value: '000 biljoonaa'), (Range: 100000000000000; Plural: pfOther; Value: '000 biljoonaa') ); FI_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 t.'), (Range: 1000; Plural: pfOther; Value: '0 t.'), (Range: 10000; Plural: pfOne; Value: '00 t.'), (Range: 10000; Plural: pfOther; Value: '00 t.'), (Range: 100000; Plural: pfOne; Value: '000 t.'), (Range: 100000; Plural: pfOther; Value: '000 t.'), (Range: 1000000; Plural: pfOne; Value: '0 milj.'), (Range: 1000000; Plural: pfOther; Value: '0 milj.'), (Range: 10000000; Plural: pfOne; Value: '00 milj.'), (Range: 10000000; Plural: pfOther; Value: '00 milj.'), (Range: 100000000; Plural: pfOne; Value: '000 milj.'), (Range: 100000000; Plural: pfOther; Value: '000 milj.'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilj.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilj.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilj.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilj.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilj.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilj.') ); FI_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 t. ¤'), (Range: 1000; Plural: pfOther; Value: '0 t. ¤'), (Range: 10000; Plural: pfOne; Value: '00 t. ¤'), (Range: 10000; Plural: pfOther; Value: '00 t. ¤'), (Range: 100000; Plural: pfOne; Value: '000 t. ¤'), (Range: 100000; Plural: pfOther; Value: '000 t. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 milj. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 milj. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 milj. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 milj. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 milj. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 milj. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilj. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilj. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilj. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilj. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilj. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilj. ¤') ); // Filipino FIL_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 libo'), (Range: 1000; Plural: pfOther; Value: '0 na libo'), (Range: 10000; Plural: pfOne; Value: '00 libo'), (Range: 10000; Plural: pfOther; Value: '00 na libo'), (Range: 100000; Plural: pfOne; Value: '000 libo'), (Range: 100000; Plural: pfOther; Value: '000 na libo'), (Range: 1000000; Plural: pfOne; Value: '0 milyon'), (Range: 1000000; Plural: pfOther; Value: '0 na milyon'), (Range: 10000000; Plural: pfOne; Value: '00 milyon'), (Range: 10000000; Plural: pfOther; Value: '00 na milyon'), (Range: 100000000; Plural: pfOne; Value: '000 milyon'), (Range: 100000000; Plural: pfOther; Value: '000 na milyon'), (Range: 1000000000; Plural: pfOne; Value: '0 bilyon'), (Range: 1000000000; Plural: pfOther; Value: '0 na bilyon'), (Range: 10000000000; Plural: pfOne; Value: '00 bilyon'), (Range: 10000000000; Plural: pfOther; Value: '00 na bilyon'), (Range: 100000000000; Plural: pfOne; Value: '000 bilyon'), (Range: 100000000000; Plural: pfOther; Value: '000 na bilyon'), (Range: 1000000000000; Plural: pfOne; Value: '0 trilyon'), (Range: 1000000000000; Plural: pfOther; Value: '0 na trilyon'), (Range: 10000000000000; Plural: pfOne; Value: '00 trilyon'), (Range: 10000000000000; Plural: pfOther; Value: '00 na trilyon'), (Range: 100000000000000; Plural: pfOne; Value: '000 trilyon'), (Range: 100000000000000; Plural: pfOther; Value: '000 na trilyon') ); FIL_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); FIL_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Faroese FO_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 túsund'), (Range: 1000; Plural: pfOther; Value: '0 túsund'), (Range: 10000; Plural: pfOne; Value: '00 túsund'), (Range: 10000; Plural: pfOther; Value: '00 túsund'), (Range: 100000; Plural: pfOne; Value: '000 túsund'), (Range: 100000; Plural: pfOther; Value: '000 túsund'), (Range: 1000000; Plural: pfOne; Value: '0 millión'), (Range: 1000000; Plural: pfOther; Value: '0 milliónir'), (Range: 10000000; Plural: pfOne; Value: '00 milliónir'), (Range: 10000000; Plural: pfOther; Value: '00 milliónir'), (Range: 100000000; Plural: pfOne; Value: '000 milliónir'), (Range: 100000000; Plural: pfOther; Value: '000 milliónir'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliardir'), (Range: 10000000000; Plural: pfOne; Value: '00 milliardir'), (Range: 10000000000; Plural: pfOther; Value: '00 milliardir'), (Range: 100000000000; Plural: pfOne; Value: '000 milliardir'), (Range: 100000000000; Plural: pfOther; Value: '000 milliardir'), (Range: 1000000000000; Plural: pfOne; Value: '0 billión'), (Range: 1000000000000; Plural: pfOther; Value: '0 billiónir'), (Range: 10000000000000; Plural: pfOne; Value: '00 billiónir'), (Range: 10000000000000; Plural: pfOther; Value: '00 billiónir'), (Range: 100000000000000; Plural: pfOne; Value: '000 billiónir'), (Range: 100000000000000; Plural: pfOther; Value: '000 billiónir') ); FO_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tús.'), (Range: 1000; Plural: pfOther; Value: '0 tús.'), (Range: 10000; Plural: pfOne; Value: '00 tús.'), (Range: 10000; Plural: pfOther; Value: '00 tús.'), (Range: 100000; Plural: pfOne; Value: '000 tús.'), (Range: 100000; Plural: pfOther; Value: '000 tús.'), (Range: 1000000; Plural: pfOne; Value: '0 mió.'), (Range: 1000000; Plural: pfOther; Value: '0 mió.'), (Range: 10000000; Plural: pfOne; Value: '00 mió.'), (Range: 10000000; Plural: pfOther; Value: '00 mió.'), (Range: 100000000; Plural: pfOne; Value: '000 mió.'), (Range: 100000000; Plural: pfOther; Value: '000 mió.'), (Range: 1000000000; Plural: pfOne; Value: '0 mia.'), (Range: 1000000000; Plural: pfOther; Value: '0 mia.'), (Range: 10000000000; Plural: pfOne; Value: '00 mia.'), (Range: 10000000000; Plural: pfOther; Value: '00 mia.'), (Range: 100000000000; Plural: pfOne; Value: '000 mia.'), (Range: 100000000000; Plural: pfOther; Value: '000 mia.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bió.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bió.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bió.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bió.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bió.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bió.') ); FO_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tús. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tús. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tús. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tús. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tús. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tús. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mió. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mió. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mió. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mió. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mió. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mió. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mia. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mia. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mia. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mia. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mia. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mia. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bió. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bió. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bió. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bió. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bió. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bió. ¤') ); // French FR_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 millier'), (Range: 1000; Plural: pfOther; Value: '0 mille'), (Range: 10000; Plural: pfOne; Value: '00 mille'), (Range: 10000; Plural: pfOther; Value: '00 mille'), (Range: 100000; Plural: pfOne; Value: '000 mille'), (Range: 100000; Plural: pfOther; Value: '000 mille'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 millions'), (Range: 10000000; Plural: pfOne; Value: '00 million'), (Range: 10000000; Plural: pfOther; Value: '00 millions'), (Range: 100000000; Plural: pfOne; Value: '000 million'), (Range: 100000000; Plural: pfOther; Value: '000 millions'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliards'), (Range: 10000000000; Plural: pfOne; Value: '00 milliard'), (Range: 10000000000; Plural: pfOther; Value: '00 milliards'), (Range: 100000000000; Plural: pfOne; Value: '000 milliards'), (Range: 100000000000; Plural: pfOther; Value: '000 milliards'), (Range: 1000000000000; Plural: pfOne; Value: '0 billion'), (Range: 1000000000000; Plural: pfOther; Value: '0 billions'), (Range: 10000000000000; Plural: pfOne; Value: '00 billions'), (Range: 10000000000000; Plural: pfOther; Value: '00 billions'), (Range: 100000000000000; Plural: pfOne; Value: '000 billions'), (Range: 100000000000000; Plural: pfOther; Value: '000 billions') ); FR_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 k'), (Range: 1000; Plural: pfOther; Value: '0 k'), (Range: 10000; Plural: pfOne; Value: '00 k'), (Range: 10000; Plural: pfOther; Value: '00 k'), (Range: 100000; Plural: pfOne; Value: '000 k'), (Range: 100000; Plural: pfOther; Value: '000 k'), (Range: 1000000; Plural: pfOne; Value: '0 M'), (Range: 1000000; Plural: pfOther; Value: '0 M'), (Range: 10000000; Plural: pfOne; Value: '00 M'), (Range: 10000000; Plural: pfOther; Value: '00 M'), (Range: 100000000; Plural: pfOne; Value: '000 M'), (Range: 100000000; Plural: pfOther; Value: '000 M'), (Range: 1000000000; Plural: pfOne; Value: '0 Md'), (Range: 1000000000; Plural: pfOther; Value: '0 Md'), (Range: 10000000000; Plural: pfOne; Value: '00 Md'), (Range: 10000000000; Plural: pfOther; Value: '00 Md'), (Range: 100000000000; Plural: pfOne; Value: '000 Md'), (Range: 100000000000; Plural: pfOther; Value: '000 Md'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bn'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bn'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bn'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bn'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bn'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bn') ); FR_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 k ¤'), (Range: 1000; Plural: pfOther; Value: '0 k ¤'), (Range: 10000; Plural: pfOne; Value: '00 k ¤'), (Range: 10000; Plural: pfOther; Value: '00 k ¤'), (Range: 100000; Plural: pfOne; Value: '000 k ¤'), (Range: 100000; Plural: pfOther; Value: '000 k ¤'), (Range: 1000000; Plural: pfOne; Value: '0 M ¤'), (Range: 1000000; Plural: pfOther; Value: '0 M ¤'), (Range: 10000000; Plural: pfOne; Value: '00 M ¤'), (Range: 10000000; Plural: pfOther; Value: '00 M ¤'), (Range: 100000000; Plural: pfOne; Value: '000 M ¤'), (Range: 100000000; Plural: pfOther; Value: '000 M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Md ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Md ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Md ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Md ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Md ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Md ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bn ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bn ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bn ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bn ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bn ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bn ¤') ); // Friulian FUR_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Western Frisian FY_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tûzen'), (Range: 1000; Plural: pfOther; Value: '0 tûzen'), (Range: 10000; Plural: pfOne; Value: '00 tûzen'), (Range: 10000; Plural: pfOther; Value: '00 tûzen'), (Range: 100000; Plural: pfOne; Value: '000 tûzen'), (Range: 100000; Plural: pfOther; Value: '000 tûzen'), (Range: 1000000; Plural: pfOne; Value: '0 miljoen'), (Range: 1000000; Plural: pfOther; Value: '0 miljoen'), (Range: 10000000; Plural: pfOne; Value: '00 miljoen'), (Range: 10000000; Plural: pfOther; Value: '00 miljoen'), (Range: 100000000; Plural: pfOne; Value: '000 miljoen'), (Range: 100000000; Plural: pfOther; Value: '000 miljoen'), (Range: 1000000000; Plural: pfOne; Value: '0 miljard'), (Range: 1000000000; Plural: pfOther; Value: '0 miljard'), (Range: 10000000000; Plural: pfOne; Value: '00 miljard'), (Range: 10000000000; Plural: pfOther; Value: '00 miljard'), (Range: 100000000000; Plural: pfOne; Value: '000 miljard'), (Range: 100000000000; Plural: pfOther; Value: '000 miljard'), (Range: 1000000000000; Plural: pfOne; Value: '0 biljoen'), (Range: 1000000000000; Plural: pfOther; Value: '0 biljoen'), (Range: 10000000000000; Plural: pfOne; Value: '00 biljoen'), (Range: 10000000000000; Plural: pfOther; Value: '00 biljoen'), (Range: 100000000000000; Plural: pfOne; Value: '000 biljoen'), (Range: 100000000000000; Plural: pfOther; Value: '000 biljoen') ); FY_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0 mln.'), (Range: 1000000; Plural: pfOther; Value: '0 mln.'), (Range: 10000000; Plural: pfOne; Value: '00 mln.'), (Range: 10000000; Plural: pfOther; Value: '00 mln.'), (Range: 100000000; Plural: pfOne; Value: '000 mln.'), (Range: 100000000; Plural: pfOther; Value: '000 mln.'), (Range: 1000000000; Plural: pfOne; Value: '0 mld.'), (Range: 1000000000; Plural: pfOther; Value: '0 mld.'), (Range: 10000000000; Plural: pfOne; Value: '00 mld.'), (Range: 10000000000; Plural: pfOther; Value: '00 mld.'), (Range: 100000000000; Plural: pfOne; Value: '000 mld.'), (Range: 100000000000; Plural: pfOther; Value: '000 mld.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bln.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bln.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bln.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bln.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bln.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bln.') ); FY_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0 mln.'), (Range: 1000000; Plural: pfOther; Value: '¤ 0 mln.'), (Range: 10000000; Plural: pfOne; Value: '¤ 00 mln.'), (Range: 10000000; Plural: pfOther; Value: '¤ 00 mln.'), (Range: 100000000; Plural: pfOne; Value: '¤ 000 mln.'), (Range: 100000000; Plural: pfOther; Value: '¤ 000 mln.'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0 mld.'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0 mld.'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00 mld.'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00 mld.'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000 mld.'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000 mld.'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0 bln.'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0 bln.'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00 bln.'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00 bln.'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000 bln.'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000 bln.') ); // Irish GA_LONG: array[0..59] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mhíle'), (Range: 1000; Plural: pfTwo; Value: '0 mhíle'), (Range: 1000; Plural: pfFew; Value: '0 mhíle'), (Range: 1000; Plural: pfMany; Value: '0 míle'), (Range: 1000; Plural: pfOther; Value: '0 míle'), (Range: 10000; Plural: pfOne; Value: '00 míle'), (Range: 10000; Plural: pfTwo; Value: '00 míle'), (Range: 10000; Plural: pfFew; Value: '00 míle'), (Range: 10000; Plural: pfMany; Value: '00 míle'), (Range: 10000; Plural: pfOther; Value: '00 míle'), (Range: 100000; Plural: pfOne; Value: '000 míle'), (Range: 100000; Plural: pfTwo; Value: '000 míle'), (Range: 100000; Plural: pfFew; Value: '000 míle'), (Range: 100000; Plural: pfMany; Value: '000 míle'), (Range: 100000; Plural: pfOther; Value: '000 míle'), (Range: 1000000; Plural: pfOne; Value: '0 mhilliún'), (Range: 1000000; Plural: pfTwo; Value: '0 mhilliún'), (Range: 1000000; Plural: pfFew; Value: '0 mhilliún'), (Range: 1000000; Plural: pfMany; Value: '0 milliún'), (Range: 1000000; Plural: pfOther; Value: '0 milliún'), (Range: 10000000; Plural: pfOne; Value: '00 milliún'), (Range: 10000000; Plural: pfTwo; Value: '00 milliún'), (Range: 10000000; Plural: pfFew; Value: '00 milliún'), (Range: 10000000; Plural: pfMany; Value: '00 milliún'), (Range: 10000000; Plural: pfOther; Value: '00 milliún'), (Range: 100000000; Plural: pfOne; Value: '000 milliún'), (Range: 100000000; Plural: pfTwo; Value: '000 milliún'), (Range: 100000000; Plural: pfFew; Value: '000 milliún'), (Range: 100000000; Plural: pfMany; Value: '000 milliún'), (Range: 100000000; Plural: pfOther; Value: '000 milliún'), (Range: 1000000000; Plural: pfOne; Value: '0 bhilliún'), (Range: 1000000000; Plural: pfTwo; Value: '0 bhilliún'), (Range: 1000000000; Plural: pfFew; Value: '0 bhilliún'), (Range: 1000000000; Plural: pfMany; Value: '0 mbilliún'), (Range: 1000000000; Plural: pfOther; Value: '0 billiún'), (Range: 10000000000; Plural: pfOne; Value: '00 billiún'), (Range: 10000000000; Plural: pfTwo; Value: '00 billiún'), (Range: 10000000000; Plural: pfFew; Value: '00 billiún'), (Range: 10000000000; Plural: pfMany; Value: '00 mbilliún'), (Range: 10000000000; Plural: pfOther; Value: '00 billiún'), (Range: 100000000000; Plural: pfOne; Value: '000 billiún'), (Range: 100000000000; Plural: pfTwo; Value: '000 billiún'), (Range: 100000000000; Plural: pfFew; Value: '000 billiún'), (Range: 100000000000; Plural: pfMany; Value: '000 billiún'), (Range: 100000000000; Plural: pfOther; Value: '000 billiún'), (Range: 1000000000000; Plural: pfOne; Value: '0 trilliún'), (Range: 1000000000000; Plural: pfTwo; Value: '0 thrilliún'), (Range: 1000000000000; Plural: pfFew; Value: '0 thrilliún'), (Range: 1000000000000; Plural: pfMany; Value: '0 dtrilliún'), (Range: 1000000000000; Plural: pfOther; Value: '0 trilliún'), (Range: 10000000000000; Plural: pfOne; Value: '00 trilliún'), (Range: 10000000000000; Plural: pfTwo; Value: '00 trilliún'), (Range: 10000000000000; Plural: pfFew; Value: '00 trilliún'), (Range: 10000000000000; Plural: pfMany; Value: '00 dtrilliún'), (Range: 10000000000000; Plural: pfOther; Value: '00 trilliún'), (Range: 100000000000000; Plural: pfOne; Value: '000 trilliún'), (Range: 100000000000000; Plural: pfTwo; Value: '000 trilliún'), (Range: 100000000000000; Plural: pfFew; Value: '000 trilliún'), (Range: 100000000000000; Plural: pfMany; Value: '000 trilliún'), (Range: 100000000000000; Plural: pfOther; Value: '000 trilliún') ); GA_SHORT: array[0..59] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0k'), (Range: 1000; Plural: pfTwo; Value: '0k'), (Range: 1000; Plural: pfFew; Value: '0k'), (Range: 1000; Plural: pfMany; Value: '0k'), (Range: 1000; Plural: pfOther; Value: '0k'), (Range: 10000; Plural: pfOne; Value: '00k'), (Range: 10000; Plural: pfTwo; Value: '00k'), (Range: 10000; Plural: pfFew; Value: '00k'), (Range: 10000; Plural: pfMany; Value: '00k'), (Range: 10000; Plural: pfOther; Value: '00k'), (Range: 100000; Plural: pfOne; Value: '000k'), (Range: 100000; Plural: pfTwo; Value: '000k'), (Range: 100000; Plural: pfFew; Value: '000k'), (Range: 100000; Plural: pfMany; Value: '000k'), (Range: 100000; Plural: pfOther; Value: '000k'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfTwo; Value: '0M'), (Range: 1000000; Plural: pfFew; Value: '0M'), (Range: 1000000; Plural: pfMany; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfTwo; Value: '00M'), (Range: 10000000; Plural: pfFew; Value: '00M'), (Range: 10000000; Plural: pfMany; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfTwo; Value: '000M'), (Range: 100000000; Plural: pfFew; Value: '000M'), (Range: 100000000; Plural: pfMany; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfTwo; Value: '0B'), (Range: 1000000000; Plural: pfFew; Value: '0B'), (Range: 1000000000; Plural: pfMany; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfTwo; Value: '00B'), (Range: 10000000000; Plural: pfFew; Value: '00B'), (Range: 10000000000; Plural: pfMany; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfTwo; Value: '000B'), (Range: 100000000000; Plural: pfFew; Value: '000B'), (Range: 100000000000; Plural: pfMany; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfTwo; Value: '0T'), (Range: 1000000000000; Plural: pfFew; Value: '0T'), (Range: 1000000000000; Plural: pfMany; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfTwo; Value: '00T'), (Range: 10000000000000; Plural: pfFew; Value: '00T'), (Range: 10000000000000; Plural: pfMany; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfTwo; Value: '000T'), (Range: 100000000000000; Plural: pfFew; Value: '000T'), (Range: 100000000000000; Plural: pfMany; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); GA_CURRENCY: array[0..59] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0k'), (Range: 1000; Plural: pfTwo; Value: '¤0k'), (Range: 1000; Plural: pfFew; Value: '¤0k'), (Range: 1000; Plural: pfMany; Value: '¤0k'), (Range: 1000; Plural: pfOther; Value: '¤0k'), (Range: 10000; Plural: pfOne; Value: '¤00k'), (Range: 10000; Plural: pfTwo; Value: '¤00k'), (Range: 10000; Plural: pfFew; Value: '¤00k'), (Range: 10000; Plural: pfMany; Value: '¤00k'), (Range: 10000; Plural: pfOther; Value: '¤00k'), (Range: 100000; Plural: pfOne; Value: '¤000k'), (Range: 100000; Plural: pfTwo; Value: '¤000k'), (Range: 100000; Plural: pfFew; Value: '¤000k'), (Range: 100000; Plural: pfMany; Value: '¤000k'), (Range: 100000; Plural: pfOther; Value: '¤000k'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfTwo; Value: '¤0M'), (Range: 1000000; Plural: pfFew; Value: '¤0M'), (Range: 1000000; Plural: pfMany; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfTwo; Value: '¤00M'), (Range: 10000000; Plural: pfFew; Value: '¤00M'), (Range: 10000000; Plural: pfMany; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfTwo; Value: '¤000M'), (Range: 100000000; Plural: pfFew; Value: '¤000M'), (Range: 100000000; Plural: pfMany; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfTwo; Value: '¤0B'), (Range: 1000000000; Plural: pfFew; Value: '¤0B'), (Range: 1000000000; Plural: pfMany; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfTwo; Value: '¤00B'), (Range: 10000000000; Plural: pfFew; Value: '¤00B'), (Range: 10000000000; Plural: pfMany; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfTwo; Value: '¤000B'), (Range: 100000000000; Plural: pfFew; Value: '¤000B'), (Range: 100000000000; Plural: pfMany; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfTwo; Value: '¤0T'), (Range: 1000000000000; Plural: pfFew; Value: '¤0T'), (Range: 1000000000000; Plural: pfMany; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfTwo; Value: '¤00T'), (Range: 10000000000000; Plural: pfFew; Value: '¤00T'), (Range: 10000000000000; Plural: pfMany; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfTwo; Value: '¤000T'), (Range: 100000000000000; Plural: pfFew; Value: '¤000T'), (Range: 100000000000000; Plural: pfMany; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Scottish Gaelic GD_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mhìle'), (Range: 1000; Plural: pfTwo; Value: '0 mhìle'), (Range: 1000; Plural: pfFew; Value: '0 mìle'), (Range: 1000; Plural: pfOther; Value: '0 mìle'), (Range: 10000; Plural: pfOne; Value: '00 mhìle'), (Range: 10000; Plural: pfTwo; Value: '00 mhìle'), (Range: 10000; Plural: pfFew; Value: '00 mìle'), (Range: 10000; Plural: pfOther; Value: '00 mìle'), (Range: 100000; Plural: pfOne; Value: '000 mhìle'), (Range: 100000; Plural: pfTwo; Value: '000 mhìle'), (Range: 100000; Plural: pfFew; Value: '000 mìle'), (Range: 100000; Plural: pfOther; Value: '000 mìle'), (Range: 1000000; Plural: pfOne; Value: '0 mhillean'), (Range: 1000000; Plural: pfTwo; Value: '0 mhillean'), (Range: 1000000; Plural: pfFew; Value: '0 millean'), (Range: 1000000; Plural: pfOther; Value: '0 millean'), (Range: 10000000; Plural: pfOne; Value: '00 mhillean'), (Range: 10000000; Plural: pfTwo; Value: '00 mhillean'), (Range: 10000000; Plural: pfFew; Value: '00 millean'), (Range: 10000000; Plural: pfOther; Value: '00 millean'), (Range: 100000000; Plural: pfOne; Value: '000 mhillean'), (Range: 100000000; Plural: pfTwo; Value: '000 mhillean'), (Range: 100000000; Plural: pfFew; Value: '000 millean'), (Range: 100000000; Plural: pfOther; Value: '000 millean'), (Range: 1000000000; Plural: pfOne; Value: '0 bhillean'), (Range: 1000000000; Plural: pfTwo; Value: '0 bhillean'), (Range: 1000000000; Plural: pfFew; Value: '0 billean'), (Range: 1000000000; Plural: pfOther; Value: '0 billean'), (Range: 10000000000; Plural: pfOne; Value: '00 bhillean'), (Range: 10000000000; Plural: pfTwo; Value: '00 bhillean'), (Range: 10000000000; Plural: pfFew; Value: '00 billean'), (Range: 10000000000; Plural: pfOther; Value: '00 billean'), (Range: 100000000000; Plural: pfOne; Value: '000 billean'), (Range: 100000000000; Plural: pfTwo; Value: '000 billean'), (Range: 100000000000; Plural: pfFew; Value: '000 bhillean'), (Range: 100000000000; Plural: pfOther; Value: '000 bhillean'), (Range: 1000000000000; Plural: pfOne; Value: '0 trillean'), (Range: 1000000000000; Plural: pfTwo; Value: '0 thrillean'), (Range: 1000000000000; Plural: pfFew; Value: '0 trillean'), (Range: 1000000000000; Plural: pfOther; Value: '0 trillean'), (Range: 10000000000000; Plural: pfOne; Value: '00 trillean'), (Range: 10000000000000; Plural: pfTwo; Value: '00 thrillean'), (Range: 10000000000000; Plural: pfFew; Value: '00 trillean'), (Range: 10000000000000; Plural: pfOther; Value: '00 trillean'), (Range: 100000000000000; Plural: pfOne; Value: '000 trillean'), (Range: 100000000000000; Plural: pfTwo; Value: '000 thrillean'), (Range: 100000000000000; Plural: pfFew; Value: '000 trillean'), (Range: 100000000000000; Plural: pfOther; Value: '000 trillean') ); GD_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfTwo; Value: '0K'), (Range: 1000; Plural: pfFew; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfTwo; Value: '00K'), (Range: 10000; Plural: pfFew; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfTwo; Value: '000K'), (Range: 100000; Plural: pfFew; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfTwo; Value: '0M'), (Range: 1000000; Plural: pfFew; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfTwo; Value: '00M'), (Range: 10000000; Plural: pfFew; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfTwo; Value: '000M'), (Range: 100000000; Plural: pfFew; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfTwo; Value: '0B'), (Range: 1000000000; Plural: pfFew; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfTwo; Value: '00B'), (Range: 10000000000; Plural: pfFew; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfTwo; Value: '000B'), (Range: 100000000000; Plural: pfFew; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfTwo; Value: '0T'), (Range: 1000000000000; Plural: pfFew; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfTwo; Value: '00T'), (Range: 10000000000000; Plural: pfFew; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfTwo; Value: '000T'), (Range: 100000000000000; Plural: pfFew; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); // Galician GL_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0'), (Range: 100000; Plural: pfOne; Value: '0'), (Range: 100000; Plural: pfOther; Value: '0'), (Range: 1000000; Plural: pfOne; Value: '0 millón'), (Range: 1000000; Plural: pfOther; Value: '0 millóns'), (Range: 10000000; Plural: pfOne; Value: '00 millóns'), (Range: 10000000; Plural: pfOther; Value: '00 millóns'), (Range: 100000000; Plural: pfOne; Value: '000 millóns'), (Range: 100000000; Plural: pfOther; Value: '000 millóns'), (Range: 1000000000; Plural: pfOne; Value: '0'), (Range: 1000000000; Plural: pfOther; Value: '0'), (Range: 10000000000; Plural: pfOne; Value: '0'), (Range: 10000000000; Plural: pfOther; Value: '0'), (Range: 100000000000; Plural: pfOne; Value: '0'), (Range: 100000000000; Plural: pfOther; Value: '0'), (Range: 1000000000000; Plural: pfOne; Value: '0 billón'), (Range: 1000000000000; Plural: pfOther; Value: '0 billóns'), (Range: 10000000000000; Plural: pfOne; Value: '00 billóns'), (Range: 10000000000000; Plural: pfOther; Value: '00 billóns'), (Range: 100000000000000; Plural: pfOne; Value: '000 billóns'), (Range: 100000000000000; Plural: pfOther; Value: '000 billóns') ); GL_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0'), (Range: 100000; Plural: pfOne; Value: '0'), (Range: 100000; Plural: pfOther; Value: '0'), (Range: 1000000; Plural: pfOne; Value: '0 mill.'), (Range: 1000000; Plural: pfOther; Value: '0 mill.'), (Range: 10000000; Plural: pfOne; Value: '00 mill.'), (Range: 10000000; Plural: pfOther; Value: '00 mill.'), (Range: 100000000; Plural: pfOne; Value: '000 mill'), (Range: 100000000; Plural: pfOther; Value: '000 mill'), (Range: 1000000000; Plural: pfOne; Value: '0'), (Range: 1000000000; Plural: pfOther; Value: '0'), (Range: 10000000000; Plural: pfOne; Value: '0'), (Range: 10000000000; Plural: pfOther; Value: '0'), (Range: 100000000000; Plural: pfOne; Value: '0'), (Range: 100000000000; Plural: pfOther; Value: '0'), (Range: 1000000000000; Plural: pfOne; Value: '0 bill.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bill.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bill.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bill.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bill.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bill.') ); GL_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0'), (Range: 100000; Plural: pfOne; Value: '0'), (Range: 100000; Plural: pfOther; Value: '0'), (Range: 1000000; Plural: pfOne; Value: '0 M¤'), (Range: 1000000; Plural: pfOther; Value: '0 M¤'), (Range: 10000000; Plural: pfOne; Value: '00 M¤'), (Range: 10000000; Plural: pfOther; Value: '00 M¤'), (Range: 100000000; Plural: pfOne; Value: '000 M¤'), (Range: 100000000; Plural: pfOther; Value: '000 M¤'), (Range: 1000000000; Plural: pfOne; Value: '0'), (Range: 1000000000; Plural: pfOther; Value: '0'), (Range: 10000000000; Plural: pfOne; Value: '0'), (Range: 10000000000; Plural: pfOther; Value: '0'), (Range: 100000000000; Plural: pfOne; Value: '0'), (Range: 100000000000; Plural: pfOther; Value: '0'), (Range: 1000000000000; Plural: pfOne; Value: '0'), (Range: 1000000000000; Plural: pfOther; Value: '0'), (Range: 10000000000000; Plural: pfOne; Value: '0'), (Range: 10000000000000; Plural: pfOther; Value: '0'), (Range: 100000000000000; Plural: pfOne; Value: '0'), (Range: 100000000000000; Plural: pfOther; Value: '0') ); // Swiss German GSW_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tausend'), (Range: 1000; Plural: pfOther; Value: '0 tausend'), (Range: 10000; Plural: pfOne; Value: '00 tausend'), (Range: 10000; Plural: pfOther; Value: '00 tausend'), (Range: 100000; Plural: pfOne; Value: '000 tausend'), (Range: 100000; Plural: pfOther; Value: '000 tausend'), (Range: 1000000; Plural: pfOne; Value: '0 Million'), (Range: 1000000; Plural: pfOther; Value: '0 Millionen'), (Range: 10000000; Plural: pfOne; Value: '00 Million'), (Range: 10000000; Plural: pfOther; Value: '00 Millionen'), (Range: 100000000; Plural: pfOne; Value: '000 Million'), (Range: 100000000; Plural: pfOther; Value: '000 Millionen'), (Range: 1000000000; Plural: pfOne; Value: '0 Milliarde'), (Range: 1000000000; Plural: pfOther; Value: '0 Milliarden'), (Range: 10000000000; Plural: pfOne; Value: '00 Milliarde'), (Range: 10000000000; Plural: pfOther; Value: '00 Milliarden'), (Range: 100000000000; Plural: pfOne; Value: '000 Milliarde'), (Range: 100000000000; Plural: pfOther; Value: '000 Milliarden'), (Range: 1000000000000; Plural: pfOne; Value: '0 Billion'), (Range: 1000000000000; Plural: pfOther; Value: '0 Billionen'), (Range: 10000000000000; Plural: pfOne; Value: '00 Billion'), (Range: 10000000000000; Plural: pfOther; Value: '00 Billionen'), (Range: 100000000000000; Plural: pfOne; Value: '000 Billion'), (Range: 100000000000000; Plural: pfOther; Value: '000 Billionen') ); GSW_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tsd'), (Range: 1000; Plural: pfOther; Value: '0 tsd'), (Range: 10000; Plural: pfOne; Value: '00 tsd'), (Range: 10000; Plural: pfOther; Value: '00 tsd'), (Range: 100000; Plural: pfOne; Value: '000 tsd'), (Range: 100000; Plural: pfOther; Value: '000 tsd'), (Range: 1000000; Plural: pfOne; Value: '0 Mio'), (Range: 1000000; Plural: pfOther; Value: '0 Mio'), (Range: 10000000; Plural: pfOne; Value: '00 Mio'), (Range: 10000000; Plural: pfOther; Value: '00 Mio'), (Range: 100000000; Plural: pfOne; Value: '000 Mio'), (Range: 100000000; Plural: pfOther; Value: '000 Mio'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio') ); GSW_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tsd ¤'), (Range: 1000; Plural: pfOther; Value: '0 tsd ¤'), (Range: 10000; Plural: pfOne; Value: '00 tsd ¤'), (Range: 10000; Plural: pfOther; Value: '00 tsd ¤'), (Range: 100000; Plural: pfOne; Value: '000 tsd ¤'), (Range: 100000; Plural: pfOther; Value: '000 tsd ¤'), (Range: 1000000; Plural: pfOne; Value: '0 Mio ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Mio ¤'), (Range: 10000000; Plural: pfOne; Value: '00 Mio ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Mio ¤'), (Range: 100000000; Plural: pfOne; Value: '000 Mio ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Mio ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio ¤') ); // Gujarati GU_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 હજાર'), (Range: 1000; Plural: pfOther; Value: '0 હજાર'), (Range: 10000; Plural: pfOne; Value: '00 હજાર'), (Range: 10000; Plural: pfOther; Value: '00 હજાર'), (Range: 100000; Plural: pfOne; Value: '0 લાખ'), (Range: 100000; Plural: pfOther; Value: '0 લાખ'), (Range: 1000000; Plural: pfOne; Value: '00 લાખ'), (Range: 1000000; Plural: pfOther; Value: '00 લાખ'), (Range: 10000000; Plural: pfOne; Value: '0 કરોડ'), (Range: 10000000; Plural: pfOther; Value: '0 કરોડ'), (Range: 100000000; Plural: pfOne; Value: '00 કરોડ'), (Range: 100000000; Plural: pfOther; Value: '00 કરોડ'), (Range: 1000000000; Plural: pfOne; Value: '0 અબજ'), (Range: 1000000000; Plural: pfOther; Value: '0 અબજ'), (Range: 10000000000; Plural: pfOne; Value: '00 અબજ'), (Range: 10000000000; Plural: pfOther; Value: '00 અબજ'), (Range: 100000000000; Plural: pfOne; Value: '0 નિખર્વ'), (Range: 100000000000; Plural: pfOther; Value: '0 નિખર્વ'), (Range: 1000000000000; Plural: pfOne; Value: '0 મહાપદ્મ'), (Range: 1000000000000; Plural: pfOther; Value: '0 મહાપદ્મ'), (Range: 10000000000000; Plural: pfOne; Value: '0 શંકુ'), (Range: 10000000000000; Plural: pfOther; Value: '0 શંકુ'), (Range: 100000000000000; Plural: pfOne; Value: '0 જલધિ'), (Range: 100000000000000; Plural: pfOther; Value: '0 જલધિ') ); GU_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 હજાર'), (Range: 1000; Plural: pfOther; Value: '0 હજાર'), (Range: 10000; Plural: pfOne; Value: '00 હજાર'), (Range: 10000; Plural: pfOther; Value: '00 હજાર'), (Range: 100000; Plural: pfOne; Value: '0 લાખ'), (Range: 100000; Plural: pfOther; Value: '0 લાખ'), (Range: 1000000; Plural: pfOne; Value: '00 લાખ'), (Range: 1000000; Plural: pfOther; Value: '00 લાખ'), (Range: 10000000; Plural: pfOne; Value: '0 કરોડ'), (Range: 10000000; Plural: pfOther; Value: '0 કરોડ'), (Range: 100000000; Plural: pfOne; Value: '00 કરોડ'), (Range: 100000000; Plural: pfOther; Value: '00 કરોડ'), (Range: 1000000000; Plural: pfOne; Value: '0 અબજ'), (Range: 1000000000; Plural: pfOther; Value: '0 અબજ'), (Range: 10000000000; Plural: pfOne; Value: '00 અબજ'), (Range: 10000000000; Plural: pfOther; Value: '00 અબજ'), (Range: 100000000000; Plural: pfOne; Value: '0 નિખર્વ'), (Range: 100000000000; Plural: pfOther; Value: '0 નિખર્વ'), (Range: 1000000000000; Plural: pfOne; Value: '0 મહાપદ્મ'), (Range: 1000000000000; Plural: pfOther; Value: '0 મહાપદ્મ'), (Range: 10000000000000; Plural: pfOne; Value: '0 શંકુ'), (Range: 10000000000000; Plural: pfOther; Value: '0 શંકુ'), (Range: 100000000000000; Plural: pfOne; Value: '0 જલધિ'), (Range: 100000000000000; Plural: pfOther; Value: '0 જલધિ') ); // Gusii GUZ_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Manx GV_CURRENCY: array[0..59] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfTwo; Value: '¤0K'), (Range: 1000; Plural: pfFew; Value: '¤0K'), (Range: 1000; Plural: pfMany; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfTwo; Value: '¤00K'), (Range: 10000; Plural: pfFew; Value: '¤00K'), (Range: 10000; Plural: pfMany; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfTwo; Value: '¤000K'), (Range: 100000; Plural: pfFew; Value: '¤000K'), (Range: 100000; Plural: pfMany; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfTwo; Value: '¤0M'), (Range: 1000000; Plural: pfFew; Value: '¤0M'), (Range: 1000000; Plural: pfMany; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfTwo; Value: '¤00M'), (Range: 10000000; Plural: pfFew; Value: '¤00M'), (Range: 10000000; Plural: pfMany; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfTwo; Value: '¤000M'), (Range: 100000000; Plural: pfFew; Value: '¤000M'), (Range: 100000000; Plural: pfMany; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfTwo; Value: '¤0G'), (Range: 1000000000; Plural: pfFew; Value: '¤0G'), (Range: 1000000000; Plural: pfMany; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfTwo; Value: '¤00G'), (Range: 10000000000; Plural: pfFew; Value: '¤00G'), (Range: 10000000000; Plural: pfMany; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfTwo; Value: '¤000G'), (Range: 100000000000; Plural: pfFew; Value: '¤000G'), (Range: 100000000000; Plural: pfMany; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfTwo; Value: '¤0T'), (Range: 1000000000000; Plural: pfFew; Value: '¤0T'), (Range: 1000000000000; Plural: pfMany; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfTwo; Value: '¤00T'), (Range: 10000000000000; Plural: pfFew; Value: '¤00T'), (Range: 10000000000000; Plural: pfMany; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfTwo; Value: '¤000T'), (Range: 100000000000000; Plural: pfFew; Value: '¤000T'), (Range: 100000000000000; Plural: pfMany; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Hausa HA_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: 'Dubu 0'), (Range: 1000; Plural: pfOther; Value: 'Dubu 0'), (Range: 10000; Plural: pfOne; Value: 'Dubu 00'), (Range: 10000; Plural: pfOther; Value: 'Dubu 00'), (Range: 100000; Plural: pfOne; Value: 'Dubu 000'), (Range: 100000; Plural: pfOther; Value: 'Dubu 000'), (Range: 1000000; Plural: pfOne; Value: 'Miliyan 0'), (Range: 1000000; Plural: pfOther; Value: 'Miliyan 0'), (Range: 10000000; Plural: pfOne; Value: 'Miliyan 00'), (Range: 10000000; Plural: pfOther; Value: 'Miliyan 00'), (Range: 100000000; Plural: pfOne; Value: 'Miliyan 000'), (Range: 100000000; Plural: pfOther; Value: 'Miliyan 000'), (Range: 1000000000; Plural: pfOne; Value: 'Biliyan 0'), (Range: 1000000000; Plural: pfOther; Value: 'Biliyan 0'), (Range: 10000000000; Plural: pfOne; Value: 'Biliyan 00'), (Range: 10000000000; Plural: pfOther; Value: 'Biliyan 00'), (Range: 100000000000; Plural: pfOne; Value: 'Biliyan 000'), (Range: 100000000000; Plural: pfOther; Value: 'Biliyan 000'), (Range: 1000000000000; Plural: pfOne; Value: 'Triliyan 0'), (Range: 1000000000000; Plural: pfOther; Value: 'Triliyan 0'), (Range: 10000000000000; Plural: pfOne; Value: 'Triliyan 00'), (Range: 10000000000000; Plural: pfOther; Value: 'Triliyan 00'), (Range: 100000000000000; Plural: pfOne; Value: 'Triliyan 000'), (Range: 100000000000000; Plural: pfOther; Value: 'Triliyan 000') ); HA_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0D'), (Range: 1000; Plural: pfOther; Value: '0D'), (Range: 10000; Plural: pfOne; Value: '00D'), (Range: 10000; Plural: pfOther; Value: '00D'), (Range: 100000; Plural: pfOne; Value: '000D'), (Range: 100000; Plural: pfOther; Value: '000D'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); HA_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0D'), (Range: 1000; Plural: pfOther; Value: '¤ 0D'), (Range: 10000; Plural: pfOne; Value: '¤ 00D'), (Range: 10000; Plural: pfOther; Value: '¤ 00D'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000D'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Hawaiian HAW_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Hebrew HE_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '‏0 אלף'), (Range: 1000; Plural: pfTwo; Value: '‏0 אלף'), (Range: 1000; Plural: pfMany; Value: '‏0 אלף'), (Range: 1000; Plural: pfOther; Value: '‏0 אלף'), (Range: 10000; Plural: pfOne; Value: '‏00 אלף'), (Range: 10000; Plural: pfTwo; Value: '‏00 אלף'), (Range: 10000; Plural: pfMany; Value: '‏00 אלף'), (Range: 10000; Plural: pfOther; Value: '‏00 אלף'), (Range: 100000; Plural: pfOne; Value: '‏000 אלף'), (Range: 100000; Plural: pfTwo; Value: '‏000 אלף'), (Range: 100000; Plural: pfMany; Value: '‏000 אלף'), (Range: 100000; Plural: pfOther; Value: '‏000 אלף'), (Range: 1000000; Plural: pfOne; Value: '‏0 מיליון'), (Range: 1000000; Plural: pfTwo; Value: '‏0 מיליון'), (Range: 1000000; Plural: pfMany; Value: '‏0 מיליון'), (Range: 1000000; Plural: pfOther; Value: '‏0 מיליון'), (Range: 10000000; Plural: pfOne; Value: '‏00 מיליון'), (Range: 10000000; Plural: pfTwo; Value: '‏00 מיליון'), (Range: 10000000; Plural: pfMany; Value: '‏00 מיליון'), (Range: 10000000; Plural: pfOther; Value: '‏00 מיליון'), (Range: 100000000; Plural: pfOne; Value: '‏000 מיליון'), (Range: 100000000; Plural: pfTwo; Value: '‏000 מיליון'), (Range: 100000000; Plural: pfMany; Value: '‏000 מיליון'), (Range: 100000000; Plural: pfOther; Value: '‏000 מיליון'), (Range: 1000000000; Plural: pfOne; Value: '‏0 מיליארד'), (Range: 1000000000; Plural: pfTwo; Value: '‏0 מיליארד'), (Range: 1000000000; Plural: pfMany; Value: '‏0 מיליארד'), (Range: 1000000000; Plural: pfOther; Value: '‏0 מיליארד'), (Range: 10000000000; Plural: pfOne; Value: '‏00 מיליארד'), (Range: 10000000000; Plural: pfTwo; Value: '‏00 מיליארד'), (Range: 10000000000; Plural: pfMany; Value: '‏00 מיליארד'), (Range: 10000000000; Plural: pfOther; Value: '‏00 מיליארד'), (Range: 100000000000; Plural: pfOne; Value: '‏000 מיליארד'), (Range: 100000000000; Plural: pfTwo; Value: '‏000 מיליארד'), (Range: 100000000000; Plural: pfMany; Value: '‏000 מיליארד'), (Range: 100000000000; Plural: pfOther; Value: '‏000 מיליארד'), (Range: 1000000000000; Plural: pfOne; Value: '‏0 טריליון'), (Range: 1000000000000; Plural: pfTwo; Value: '‏0 טריליון'), (Range: 1000000000000; Plural: pfMany; Value: '‏0 טריליון'), (Range: 1000000000000; Plural: pfOther; Value: '‏0 טריליון'), (Range: 10000000000000; Plural: pfOne; Value: '‏00 טריליון'), (Range: 10000000000000; Plural: pfTwo; Value: '‏00 טריליון'), (Range: 10000000000000; Plural: pfMany; Value: '‏00 טריליון'), (Range: 10000000000000; Plural: pfOther; Value: '‏00 טריליון'), (Range: 100000000000000; Plural: pfOne; Value: '‏000 טריליון'), (Range: 100000000000000; Plural: pfTwo; Value: '‏000 טריליון'), (Range: 100000000000000; Plural: pfMany; Value: '‏000 טריליון'), (Range: 100000000000000; Plural: pfOther; Value: '‏000 טריליון') ); HE_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfTwo; Value: '0K'), (Range: 1000; Plural: pfMany; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfTwo; Value: '00K'), (Range: 10000; Plural: pfMany; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfTwo; Value: '000K'), (Range: 100000; Plural: pfMany; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfTwo; Value: '0M'), (Range: 1000000; Plural: pfMany; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfTwo; Value: '00M'), (Range: 10000000; Plural: pfMany; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfTwo; Value: '000M'), (Range: 100000000; Plural: pfMany; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfTwo; Value: '0B'), (Range: 1000000000; Plural: pfMany; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfTwo; Value: '00B'), (Range: 10000000000; Plural: pfMany; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfTwo; Value: '000B'), (Range: 100000000000; Plural: pfMany; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfTwo; Value: '0T'), (Range: 1000000000000; Plural: pfMany; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfTwo; Value: '00T'), (Range: 10000000000000; Plural: pfMany; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfTwo; Value: '000T'), (Range: 100000000000000; Plural: pfMany; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); HE_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfTwo; Value: '¤ 0K'), (Range: 1000; Plural: pfMany; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfTwo; Value: '¤00K'), (Range: 10000; Plural: pfMany; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfTwo; Value: '¤000K'), (Range: 100000; Plural: pfMany; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfTwo; Value: '¤0M'), (Range: 1000000; Plural: pfMany; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfTwo; Value: '¤00M'), (Range: 10000000; Plural: pfMany; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfTwo; Value: '¤000M'), (Range: 100000000; Plural: pfMany; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfTwo; Value: '¤0B'), (Range: 1000000000; Plural: pfMany; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfTwo; Value: '¤00B'), (Range: 10000000000; Plural: pfMany; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfTwo; Value: '¤000B'), (Range: 100000000000; Plural: pfMany; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfTwo; Value: '¤0T'), (Range: 1000000000000; Plural: pfMany; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfTwo; Value: '¤00T'), (Range: 10000000000000; Plural: pfMany; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfTwo; Value: '¤000T'), (Range: 100000000000000; Plural: pfMany; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Hindi HI_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 हज़ार'), (Range: 1000; Plural: pfOther; Value: '0 हज़ार'), (Range: 10000; Plural: pfOne; Value: '00 हज़ार'), (Range: 10000; Plural: pfOther; Value: '00 हज़ार'), (Range: 100000; Plural: pfOne; Value: '0 लाख'), (Range: 100000; Plural: pfOther; Value: '0 लाख'), (Range: 1000000; Plural: pfOne; Value: '00 लाख'), (Range: 1000000; Plural: pfOther; Value: '00 लाख'), (Range: 10000000; Plural: pfOne; Value: '0 करोड़'), (Range: 10000000; Plural: pfOther; Value: '0 करोड़'), (Range: 100000000; Plural: pfOne; Value: '00 करोड़'), (Range: 100000000; Plural: pfOther; Value: '00 करोड़'), (Range: 1000000000; Plural: pfOne; Value: '0 अरब'), (Range: 1000000000; Plural: pfOther; Value: '0 अरब'), (Range: 10000000000; Plural: pfOne; Value: '00 अरब'), (Range: 10000000000; Plural: pfOther; Value: '00 अरब'), (Range: 100000000000; Plural: pfOne; Value: '0 खरब'), (Range: 100000000000; Plural: pfOther; Value: '0 खरब'), (Range: 1000000000000; Plural: pfOne; Value: '00 खरब'), (Range: 1000000000000; Plural: pfOther; Value: '00 खरब'), (Range: 10000000000000; Plural: pfOne; Value: '000 खरब'), (Range: 10000000000000; Plural: pfOther; Value: '000 खरब'), (Range: 100000000000000; Plural: pfOne; Value: '0000 खरब'), (Range: 100000000000000; Plural: pfOther; Value: '0000 खरब') ); HI_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 हज़ार'), (Range: 1000; Plural: pfOther; Value: '0 हज़ार'), (Range: 10000; Plural: pfOne; Value: '00 हज़ार'), (Range: 10000; Plural: pfOther; Value: '00 हज़ार'), (Range: 100000; Plural: pfOne; Value: '0 लाख'), (Range: 100000; Plural: pfOther; Value: '0 लाख'), (Range: 1000000; Plural: pfOne; Value: '00 लाख'), (Range: 1000000; Plural: pfOther; Value: '00 लाख'), (Range: 10000000; Plural: pfOne; Value: '0 क.'), (Range: 10000000; Plural: pfOther; Value: '0 क.'), (Range: 100000000; Plural: pfOne; Value: '00 क.'), (Range: 100000000; Plural: pfOther; Value: '00 क.'), (Range: 1000000000; Plural: pfOne; Value: '0 अ.'), (Range: 1000000000; Plural: pfOther; Value: '0 अ.'), (Range: 10000000000; Plural: pfOne; Value: '00 अ.'), (Range: 10000000000; Plural: pfOther; Value: '00 अ.'), (Range: 100000000000; Plural: pfOne; Value: '0 ख.'), (Range: 100000000000; Plural: pfOther; Value: '0 ख.'), (Range: 1000000000000; Plural: pfOne; Value: '00 ख.'), (Range: 1000000000000; Plural: pfOther; Value: '00 ख.'), (Range: 10000000000000; Plural: pfOne; Value: '0 नील'), (Range: 10000000000000; Plural: pfOther; Value: '0 नील'), (Range: 100000000000000; Plural: pfOne; Value: '00 नील'), (Range: 100000000000000; Plural: pfOther; Value: '00 नील') ); // Croatian HR_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tisuća'), (Range: 1000; Plural: pfFew; Value: '0 tisuće'), (Range: 1000; Plural: pfOther; Value: '0 tisuća'), (Range: 10000; Plural: pfOne; Value: '00 tisuća'), (Range: 10000; Plural: pfFew; Value: '00 tisuće'), (Range: 10000; Plural: pfOther; Value: '00 tisuća'), (Range: 100000; Plural: pfOne; Value: '000 tisuća'), (Range: 100000; Plural: pfFew; Value: '000 tisuće'), (Range: 100000; Plural: pfOther; Value: '000 tisuća'), (Range: 1000000; Plural: pfOne; Value: '0 milijun'), (Range: 1000000; Plural: pfFew; Value: '0 milijuna'), (Range: 1000000; Plural: pfOther; Value: '0 milijuna'), (Range: 10000000; Plural: pfOne; Value: '00 milijun'), (Range: 10000000; Plural: pfFew; Value: '00 milijuna'), (Range: 10000000; Plural: pfOther; Value: '00 milijuna'), (Range: 100000000; Plural: pfOne; Value: '000 milijun'), (Range: 100000000; Plural: pfFew; Value: '000 milijuna'), (Range: 100000000; Plural: pfOther; Value: '000 milijuna'), (Range: 1000000000; Plural: pfOne; Value: '0 milijarda'), (Range: 1000000000; Plural: pfFew; Value: '0 milijarde'), (Range: 1000000000; Plural: pfOther; Value: '0 milijardi'), (Range: 10000000000; Plural: pfOne; Value: '00 milijarda'), (Range: 10000000000; Plural: pfFew; Value: '00 milijarde'), (Range: 10000000000; Plural: pfOther; Value: '00 milijardi'), (Range: 100000000000; Plural: pfOne; Value: '000 milijarda'), (Range: 100000000000; Plural: pfFew; Value: '000 milijarde'), (Range: 100000000000; Plural: pfOther; Value: '000 milijardi'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilijun'), (Range: 1000000000000; Plural: pfFew; Value: '0 bilijuna'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilijuna'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilijun'), (Range: 10000000000000; Plural: pfFew; Value: '00 bilijuna'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilijuna'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilijun'), (Range: 100000000000000; Plural: pfFew; Value: '000 bilijuna'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilijuna') ); HR_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tis.'), (Range: 1000; Plural: pfFew; Value: '0 tis.'), (Range: 1000; Plural: pfOther; Value: '0 tis.'), (Range: 10000; Plural: pfOne; Value: '00 tis.'), (Range: 10000; Plural: pfFew; Value: '00 tis.'), (Range: 10000; Plural: pfOther; Value: '00 tis.'), (Range: 100000; Plural: pfOne; Value: '000 tis.'), (Range: 100000; Plural: pfFew; Value: '000 tis.'), (Range: 100000; Plural: pfOther; Value: '000 tis.'), (Range: 1000000; Plural: pfOne; Value: '0 mil.'), (Range: 1000000; Plural: pfFew; Value: '0 mil.'), (Range: 1000000; Plural: pfOther; Value: '0 mil.'), (Range: 10000000; Plural: pfOne; Value: '00 mil.'), (Range: 10000000; Plural: pfFew; Value: '00 mil.'), (Range: 10000000; Plural: pfOther; Value: '00 mil.'), (Range: 100000000; Plural: pfOne; Value: '000 mil.'), (Range: 100000000; Plural: pfFew; Value: '000 mil.'), (Range: 100000000; Plural: pfOther; Value: '000 mil.'), (Range: 1000000000; Plural: pfOne; Value: '0 mlr.'), (Range: 1000000000; Plural: pfFew; Value: '0 mlr.'), (Range: 1000000000; Plural: pfOther; Value: '0 mlr.'), (Range: 10000000000; Plural: pfOne; Value: '00 mlr.'), (Range: 10000000000; Plural: pfFew; Value: '00 mlr.'), (Range: 10000000000; Plural: pfOther; Value: '00 mlr.'), (Range: 100000000000; Plural: pfOne; Value: '000 mlr.'), (Range: 100000000000; Plural: pfFew; Value: '000 mlr.'), (Range: 100000000000; Plural: pfOther; Value: '000 mlr.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); HR_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0000¤'), (Range: 1000; Plural: pfFew; Value: '0000¤'), (Range: 1000; Plural: pfOther; Value: '0000¤'), (Range: 10000; Plural: pfOne; Value: '00 tis. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tis. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tis. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tis. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tis. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tis. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mil. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mil. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mil. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mlr. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mlr. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mlr. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mlr. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mlr. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mlr. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mlr. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mlr. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mlr. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Upper Sorbian HSB_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tysac'), (Range: 1000; Plural: pfTwo; Value: '0 tysac'), (Range: 1000; Plural: pfFew; Value: '0 tysac'), (Range: 1000; Plural: pfOther; Value: '0 tysac'), (Range: 10000; Plural: pfOne; Value: '00 tysac'), (Range: 10000; Plural: pfTwo; Value: '00 tysac'), (Range: 10000; Plural: pfFew; Value: '00 tysac'), (Range: 10000; Plural: pfOther; Value: '00 tysac'), (Range: 100000; Plural: pfOne; Value: '000 tysac'), (Range: 100000; Plural: pfTwo; Value: '000 tysac'), (Range: 100000; Plural: pfFew; Value: '000 tysac'), (Range: 100000; Plural: pfOther; Value: '000 tysac'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfTwo; Value: '0 milionaj'), (Range: 1000000; Plural: pfFew; Value: '0 miliony'), (Range: 1000000; Plural: pfOther; Value: '0 milionow'), (Range: 10000000; Plural: pfOne; Value: '00 milionow'), (Range: 10000000; Plural: pfTwo; Value: '00 milionow'), (Range: 10000000; Plural: pfFew; Value: '00 milionow'), (Range: 10000000; Plural: pfOther; Value: '00 milionow'), (Range: 100000000; Plural: pfOne; Value: '000 milionow'), (Range: 100000000; Plural: pfTwo; Value: '000 milionow'), (Range: 100000000; Plural: pfFew; Value: '000 milionow'), (Range: 100000000; Plural: pfOther; Value: '000 milionow'), (Range: 1000000000; Plural: pfOne; Value: '0 miliarda'), (Range: 1000000000; Plural: pfTwo; Value: '0 miliardźe'), (Range: 1000000000; Plural: pfFew; Value: '0 miliardy'), (Range: 1000000000; Plural: pfOther; Value: '0 miliardow'), (Range: 10000000000; Plural: pfOne; Value: '00 miliardow'), (Range: 10000000000; Plural: pfTwo; Value: '00 miliardow'), (Range: 10000000000; Plural: pfFew; Value: '00 miliardow'), (Range: 10000000000; Plural: pfOther; Value: '00 miliardow'), (Range: 100000000000; Plural: pfOne; Value: '000 miliardow'), (Range: 100000000000; Plural: pfTwo; Value: '000 miliardow'), (Range: 100000000000; Plural: pfFew; Value: '000 miliardow'), (Range: 100000000000; Plural: pfOther; Value: '000 miliardow'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilion'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bilionaj'), (Range: 1000000000000; Plural: pfFew; Value: '0 biliony'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilionow'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilionow'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bilionow'), (Range: 10000000000000; Plural: pfFew; Value: '00 bilionow'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilionow'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilionow'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bilionow'), (Range: 100000000000000; Plural: pfFew; Value: '000 bilionow'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilionow') ); HSB_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tys.'), (Range: 1000; Plural: pfTwo; Value: '0 tys.'), (Range: 1000; Plural: pfFew; Value: '0 tys.'), (Range: 1000; Plural: pfOther; Value: '0 tys.'), (Range: 10000; Plural: pfOne; Value: '00 tys.'), (Range: 10000; Plural: pfTwo; Value: '00 tys.'), (Range: 10000; Plural: pfFew; Value: '00 tys.'), (Range: 10000; Plural: pfOther; Value: '00 tys.'), (Range: 100000; Plural: pfOne; Value: '000 tys.'), (Range: 100000; Plural: pfTwo; Value: '000 tys.'), (Range: 100000; Plural: pfFew; Value: '000 tys.'), (Range: 100000; Plural: pfOther; Value: '000 tys.'), (Range: 1000000; Plural: pfOne; Value: '0 mio.'), (Range: 1000000; Plural: pfTwo; Value: '0 mio.'), (Range: 1000000; Plural: pfFew; Value: '0 mio.'), (Range: 1000000; Plural: pfOther; Value: '0 mio.'), (Range: 10000000; Plural: pfOne; Value: '00 mio.'), (Range: 10000000; Plural: pfTwo; Value: '00 mio.'), (Range: 10000000; Plural: pfFew; Value: '00 mio.'), (Range: 10000000; Plural: pfOther; Value: '00 mio.'), (Range: 100000000; Plural: pfOne; Value: '000 mio.'), (Range: 100000000; Plural: pfTwo; Value: '000 mio.'), (Range: 100000000; Plural: pfFew; Value: '000 mio.'), (Range: 100000000; Plural: pfOther; Value: '000 mio.'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd.'), (Range: 1000000000; Plural: pfTwo; Value: '0 mrd.'), (Range: 1000000000; Plural: pfFew; Value: '0 mrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd.'), (Range: 10000000000; Plural: pfTwo; Value: '00 mrd.'), (Range: 10000000000; Plural: pfFew; Value: '00 mrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd.'), (Range: 100000000000; Plural: pfTwo; Value: '000 mrd.'), (Range: 100000000000; Plural: pfFew; Value: '000 mrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); HSB_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tys. ¤'), (Range: 1000; Plural: pfTwo; Value: '0 tys. ¤'), (Range: 1000; Plural: pfFew; Value: '0 tys. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tys. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tys. ¤'), (Range: 10000; Plural: pfTwo; Value: '00 tys. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tys. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tys. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tys. ¤'), (Range: 100000; Plural: pfTwo; Value: '000 tys. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tys. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tys. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfTwo; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mio. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfTwo; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mio. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfTwo; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mio. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfTwo; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfTwo; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfTwo; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Hungarian HU_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ezer'), (Range: 1000; Plural: pfOther; Value: '0 ezer'), (Range: 10000; Plural: pfOne; Value: '00 ezer'), (Range: 10000; Plural: pfOther; Value: '00 ezer'), (Range: 100000; Plural: pfOne; Value: '000 ezer'), (Range: 100000; Plural: pfOther; Value: '000 ezer'), (Range: 1000000; Plural: pfOne; Value: '0 millió'), (Range: 1000000; Plural: pfOther; Value: '0 millió'), (Range: 10000000; Plural: pfOne; Value: '00 millió'), (Range: 10000000; Plural: pfOther; Value: '00 millió'), (Range: 100000000; Plural: pfOne; Value: '000 millió'), (Range: 100000000; Plural: pfOther; Value: '000 millió'), (Range: 1000000000; Plural: pfOne; Value: '0 milliárd'), (Range: 1000000000; Plural: pfOther; Value: '0 milliárd'), (Range: 10000000000; Plural: pfOne; Value: '00 milliárd'), (Range: 10000000000; Plural: pfOther; Value: '00 milliárd'), (Range: 100000000000; Plural: pfOne; Value: '000 milliárd'), (Range: 100000000000; Plural: pfOther; Value: '000 milliárd'), (Range: 1000000000000; Plural: pfOne; Value: '0 billió'), (Range: 1000000000000; Plural: pfOther; Value: '0 billió'), (Range: 10000000000000; Plural: pfOne; Value: '00 billió'), (Range: 10000000000000; Plural: pfOther; Value: '00 billió'), (Range: 100000000000000; Plural: pfOne; Value: '000 billió'), (Range: 100000000000000; Plural: pfOther; Value: '000 billió') ); HU_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 E'), (Range: 1000; Plural: pfOther; Value: '0 E'), (Range: 10000; Plural: pfOne; Value: '00 E'), (Range: 10000; Plural: pfOther; Value: '00 E'), (Range: 100000; Plural: pfOne; Value: '000 E'), (Range: 100000; Plural: pfOther; Value: '000 E'), (Range: 1000000; Plural: pfOne; Value: '0 M'), (Range: 1000000; Plural: pfOther; Value: '0 M'), (Range: 10000000; Plural: pfOne; Value: '00 M'), (Range: 10000000; Plural: pfOther; Value: '00 M'), (Range: 100000000; Plural: pfOne; Value: '000 M'), (Range: 100000000; Plural: pfOther; Value: '000 M'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd'), (Range: 1000000000000; Plural: pfOne; Value: '0 B'), (Range: 1000000000000; Plural: pfOther; Value: '0 B'), (Range: 10000000000000; Plural: pfOne; Value: '00 B'), (Range: 10000000000000; Plural: pfOther; Value: '00 B'), (Range: 100000000000000; Plural: pfOne; Value: '000 B'), (Range: 100000000000000; Plural: pfOther; Value: '000 B') ); HU_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 E ¤'), (Range: 1000; Plural: pfOther; Value: '0 E ¤'), (Range: 10000; Plural: pfOne; Value: '00 E ¤'), (Range: 10000; Plural: pfOther; Value: '00 E ¤'), (Range: 100000; Plural: pfOne; Value: '000 E ¤'), (Range: 100000; Plural: pfOther; Value: '000 E ¤'), (Range: 1000000; Plural: pfOne; Value: '0 M ¤'), (Range: 1000000; Plural: pfOther; Value: '0 M ¤'), (Range: 10000000; Plural: pfOne; Value: '00 M ¤'), (Range: 10000000; Plural: pfOther; Value: '00 M ¤'), (Range: 100000000; Plural: pfOne; Value: '000 M ¤'), (Range: 100000000; Plural: pfOther; Value: '000 M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 B ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 B ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 B ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 B ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 B ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 B ¤') ); // Armenian HY_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 հազար'), (Range: 1000; Plural: pfOther; Value: '0 հազար'), (Range: 10000; Plural: pfOne; Value: '00 հազար'), (Range: 10000; Plural: pfOther; Value: '00 հազար'), (Range: 100000; Plural: pfOne; Value: '000 հազար'), (Range: 100000; Plural: pfOther; Value: '000 հազար'), (Range: 1000000; Plural: pfOne; Value: '0 միլիոն'), (Range: 1000000; Plural: pfOther; Value: '0 միլիոն'), (Range: 10000000; Plural: pfOne; Value: '00 միլիոն'), (Range: 10000000; Plural: pfOther; Value: '00 միլիոն'), (Range: 100000000; Plural: pfOne; Value: '000 միլիոն'), (Range: 100000000; Plural: pfOther; Value: '000 միլիոն'), (Range: 1000000000; Plural: pfOne; Value: '0 միլիարդ'), (Range: 1000000000; Plural: pfOther; Value: '0 միլիարդ'), (Range: 10000000000; Plural: pfOne; Value: '00 միլիարդ'), (Range: 10000000000; Plural: pfOther; Value: '00 միլիարդ'), (Range: 100000000000; Plural: pfOne; Value: '000 միլիարդ'), (Range: 100000000000; Plural: pfOther; Value: '000 միլիարդ'), (Range: 1000000000000; Plural: pfOne; Value: '0 տրիլիոն'), (Range: 1000000000000; Plural: pfOther; Value: '0 տրիլիոն'), (Range: 10000000000000; Plural: pfOne; Value: '00 տրիլիոն'), (Range: 10000000000000; Plural: pfOther; Value: '00 տրիլիոն'), (Range: 100000000000000; Plural: pfOne; Value: '000 տրիլիոն'), (Range: 100000000000000; Plural: pfOther; Value: '000 տրիլիոն') ); HY_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 հզր'), (Range: 1000; Plural: pfOther; Value: '0 հզր'), (Range: 10000; Plural: pfOne; Value: '00 հզր'), (Range: 10000; Plural: pfOther; Value: '00 հզր'), (Range: 100000; Plural: pfOne; Value: '000 հզր'), (Range: 100000; Plural: pfOther; Value: '000 հզր'), (Range: 1000000; Plural: pfOne; Value: '0 մլն'), (Range: 1000000; Plural: pfOther; Value: '0 մլն'), (Range: 10000000; Plural: pfOne; Value: '00 մլն'), (Range: 10000000; Plural: pfOther; Value: '00 մլն'), (Range: 100000000; Plural: pfOne; Value: '000 մլն'), (Range: 100000000; Plural: pfOther; Value: '000 մլն'), (Range: 1000000000; Plural: pfOne; Value: '0 մլրդ'), (Range: 1000000000; Plural: pfOther; Value: '0 մլրդ'), (Range: 10000000000; Plural: pfOne; Value: '00 մլրդ'), (Range: 10000000000; Plural: pfOther; Value: '00 մլրդ'), (Range: 100000000000; Plural: pfOne; Value: '000 մլրդ'), (Range: 100000000000; Plural: pfOther; Value: '000 մլրդ'), (Range: 1000000000000; Plural: pfOne; Value: '0 տրլն'), (Range: 1000000000000; Plural: pfOther; Value: '0 տրլն'), (Range: 10000000000000; Plural: pfOne; Value: '00 տրլն'), (Range: 10000000000000; Plural: pfOther; Value: '00 տրլն'), (Range: 100000000000000; Plural: pfOne; Value: '000 տրլն'), (Range: 100000000000000; Plural: pfOther; Value: '000 տրլն') ); HY_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 հզր ¤'), (Range: 1000; Plural: pfOther; Value: '0 հզր ¤'), (Range: 10000; Plural: pfOne; Value: '00 հզր ¤'), (Range: 10000; Plural: pfOther; Value: '00 հզր ¤'), (Range: 100000; Plural: pfOne; Value: '000 հզր ¤'), (Range: 100000; Plural: pfOther; Value: '000 հզր ¤'), (Range: 1000000; Plural: pfOne; Value: '0 մլն ¤'), (Range: 1000000; Plural: pfOther; Value: '0 մլն ¤'), (Range: 10000000; Plural: pfOne; Value: '00 մլն ¤'), (Range: 10000000; Plural: pfOther; Value: '00 մլն ¤'), (Range: 100000000; Plural: pfOne; Value: '000 մլն ¤'), (Range: 100000000; Plural: pfOther; Value: '000 մլն ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 մլրդ ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 մլրդ ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 մլրդ ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 մլրդ ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 մլրդ ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 մլրդ ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 տրլն ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 տրլն ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 տրլն ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 տրլն ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 տրլն ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 տրլն ¤') ); // Indonesian ID_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 ribu'), (Range: 10000; Plural: pfOther; Value: '00 ribu'), (Range: 100000; Plural: pfOther; Value: '000 ribu'), (Range: 1000000; Plural: pfOther; Value: '0 juta'), (Range: 10000000; Plural: pfOther; Value: '00 juta'), (Range: 100000000; Plural: pfOther; Value: '000 juta'), (Range: 1000000000; Plural: pfOther; Value: '0 miliar'), (Range: 10000000000; Plural: pfOther; Value: '00 miliar'), (Range: 100000000000; Plural: pfOther; Value: '000 miliar'), (Range: 1000000000000; Plural: pfOther; Value: '0 triliun'), (Range: 10000000000000; Plural: pfOther; Value: '00 triliun'), (Range: 100000000000000; Plural: pfOther; Value: '000 triliun') ); ID_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 rb'), (Range: 10000; Plural: pfOther; Value: '00 rb'), (Range: 100000; Plural: pfOther; Value: '000 rb'), (Range: 1000000; Plural: pfOther; Value: '0 jt'), (Range: 10000000; Plural: pfOther; Value: '00 jt'), (Range: 100000000; Plural: pfOther; Value: '000 jt'), (Range: 1000000000; Plural: pfOther; Value: '0 M'), (Range: 10000000000; Plural: pfOther; Value: '00 M'), (Range: 100000000000; Plural: pfOther; Value: '000 M'), (Range: 1000000000000; Plural: pfOther; Value: '0 T'), (Range: 10000000000000; Plural: pfOther; Value: '00 T'), (Range: 100000000000000; Plural: pfOther; Value: '000 T') ); ID_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0 rb'), (Range: 10000; Plural: pfOther; Value: '¤00 rb'), (Range: 100000; Plural: pfOther; Value: '¤000 rb'), (Range: 1000000; Plural: pfOther; Value: '¤0 jt'), (Range: 10000000; Plural: pfOther; Value: '¤00 jt'), (Range: 100000000; Plural: pfOther; Value: '¤000 jt'), (Range: 1000000000; Plural: pfOther; Value: '¤0 M'), (Range: 10000000000; Plural: pfOther; Value: '¤00 M'), (Range: 100000000000; Plural: pfOther; Value: '¤000 M'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 T') ); // Yi II_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Icelandic IS_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 þúsund'), (Range: 1000; Plural: pfOther; Value: '0 þúsund'), (Range: 10000; Plural: pfOne; Value: '00 þúsund'), (Range: 10000; Plural: pfOther; Value: '00 þúsund'), (Range: 100000; Plural: pfOne; Value: '000 þúsund'), (Range: 100000; Plural: pfOther; Value: '000 þúsund'), (Range: 1000000; Plural: pfOne; Value: '0 milljón'), (Range: 1000000; Plural: pfOther; Value: '0 milljónir'), (Range: 10000000; Plural: pfOne; Value: '00 milljón'), (Range: 10000000; Plural: pfOther; Value: '00 milljónir'), (Range: 100000000; Plural: pfOne; Value: '000 milljón'), (Range: 100000000; Plural: pfOther; Value: '000 milljónir'), (Range: 1000000000; Plural: pfOne; Value: '0 milljarður'), (Range: 1000000000; Plural: pfOther; Value: '0 milljarðar'), (Range: 10000000000; Plural: pfOne; Value: '00 milljarður'), (Range: 10000000000; Plural: pfOther; Value: '00 milljarðar'), (Range: 100000000000; Plural: pfOne; Value: '000 milljarður'), (Range: 100000000000; Plural: pfOther; Value: '000 milljarðar'), (Range: 1000000000000; Plural: pfOne; Value: '0 billjón'), (Range: 1000000000000; Plural: pfOther; Value: '0 billjónir'), (Range: 10000000000000; Plural: pfOne; Value: '00 billjón'), (Range: 10000000000000; Plural: pfOther; Value: '00 billjónir'), (Range: 100000000000000; Plural: pfOne; Value: '000 billjón'), (Range: 100000000000000; Plural: pfOther; Value: '000 billjónir') ); IS_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 þ.'), (Range: 1000; Plural: pfOther; Value: '0 þ.'), (Range: 10000; Plural: pfOne; Value: '00 þ.'), (Range: 10000; Plural: pfOther; Value: '00 þ.'), (Range: 100000; Plural: pfOne; Value: '000 þ.'), (Range: 100000; Plural: pfOther; Value: '000 þ.'), (Range: 1000000; Plural: pfOne; Value: '0 m.'), (Range: 1000000; Plural: pfOther; Value: '0 m.'), (Range: 10000000; Plural: pfOne; Value: '00 m.'), (Range: 10000000; Plural: pfOther; Value: '00 m.'), (Range: 100000000; Plural: pfOne; Value: '000 m.'), (Range: 100000000; Plural: pfOther; Value: '000 m.'), (Range: 1000000000; Plural: pfOne; Value: '0 ma.'), (Range: 1000000000; Plural: pfOther; Value: '0 ma.'), (Range: 10000000000; Plural: pfOne; Value: '00 ma.'), (Range: 10000000000; Plural: pfOther; Value: '00 ma.'), (Range: 100000000000; Plural: pfOne; Value: '000 ma.'), (Range: 100000000000; Plural: pfOther; Value: '000 ma.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn') ); IS_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 þ. ¤'), (Range: 1000; Plural: pfOther; Value: '0 þ. ¤'), (Range: 10000; Plural: pfOne; Value: '00 þ. ¤'), (Range: 10000; Plural: pfOther; Value: '00 þ. ¤'), (Range: 100000; Plural: pfOne; Value: '000 þ. ¤'), (Range: 100000; Plural: pfOther; Value: '000 þ. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 m. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 m. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 m. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 m. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 m. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 m. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 ma. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 ma. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 ma. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 ma. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 ma. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 ma. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn ¤') ); // Italian IT_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mila'), (Range: 1000; Plural: pfOther; Value: '0 mila'), (Range: 10000; Plural: pfOne; Value: '00 mila'), (Range: 10000; Plural: pfOther; Value: '00 mila'), (Range: 100000; Plural: pfOne; Value: '000 mila'), (Range: 100000; Plural: pfOther; Value: '000 mila'), (Range: 1000000; Plural: pfOne; Value: '0 milione'), (Range: 1000000; Plural: pfOther; Value: '0 milioni'), (Range: 10000000; Plural: pfOne; Value: '00 milioni'), (Range: 10000000; Plural: pfOther; Value: '00 milioni'), (Range: 100000000; Plural: pfOne; Value: '000 milioni'), (Range: 100000000; Plural: pfOther; Value: '000 milioni'), (Range: 1000000000; Plural: pfOne; Value: '0 miliardo'), (Range: 1000000000; Plural: pfOther; Value: '0 miliardi'), (Range: 10000000000; Plural: pfOne; Value: '00 miliardi'), (Range: 10000000000; Plural: pfOther; Value: '00 miliardi'), (Range: 100000000000; Plural: pfOne; Value: '000 miliardi'), (Range: 100000000000; Plural: pfOther; Value: '000 miliardi'), (Range: 1000000000000; Plural: pfOne; Value: '0 mila miliardi'), (Range: 1000000000000; Plural: pfOther; Value: '0 mila miliardi'), (Range: 10000000000000; Plural: pfOne; Value: '00 mila miliardi'), (Range: 10000000000000; Plural: pfOther; Value: '00 mila miliardi'), (Range: 100000000000000; Plural: pfOne; Value: '000 mila miliardi'), (Range: 100000000000000; Plural: pfOther; Value: '000 mila miliardi') ); IT_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0'), (Range: 100000; Plural: pfOne; Value: '0'), (Range: 100000; Plural: pfOther; Value: '0'), (Range: 1000000; Plural: pfOne; Value: '0 Mln'), (Range: 1000000; Plural: pfOther; Value: '0 Mln'), (Range: 10000000; Plural: pfOne; Value: '00 Mln'), (Range: 10000000; Plural: pfOther; Value: '00 Mln'), (Range: 100000000; Plural: pfOne; Value: '000 Mln'), (Range: 100000000; Plural: pfOther; Value: '000 Mln'), (Range: 1000000000; Plural: pfOne; Value: '0 Mld'), (Range: 1000000000; Plural: pfOther; Value: '0 Mld'), (Range: 10000000000; Plural: pfOne; Value: '00 Mld'), (Range: 10000000000; Plural: pfOther; Value: '00 Mld'), (Range: 100000000000; Plural: pfOne; Value: '000 Mld'), (Range: 100000000000; Plural: pfOther; Value: '000 Mld'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bln'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bln'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bln'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bln'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bln'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bln') ); IT_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0'), (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOne; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0'), (Range: 100000; Plural: pfOne; Value: '0'), (Range: 100000; Plural: pfOther; Value: '0'), (Range: 1000000; Plural: pfOne; Value: '0 Mio ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Mio ¤'), (Range: 10000000; Plural: pfOne; Value: '00 Mio ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Mio ¤'), (Range: 100000000; Plural: pfOne; Value: '000 Mio ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Mio ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bln ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bln ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bln ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bln ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bln ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bln ¤') ); // Japanese JA_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0万'), (Range: 100000; Plural: pfOther; Value: '00万'), (Range: 1000000; Plural: pfOther; Value: '000万'), (Range: 10000000; Plural: pfOther; Value: '0000万'), (Range: 100000000; Plural: pfOther; Value: '0億'), (Range: 1000000000; Plural: pfOther; Value: '00億'), (Range: 10000000000; Plural: pfOther; Value: '000億'), (Range: 100000000000; Plural: pfOther; Value: '0000億'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); JA_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOther; Value: '0万'), (Range: 100000; Plural: pfOther; Value: '00万'), (Range: 1000000; Plural: pfOther; Value: '000万'), (Range: 10000000; Plural: pfOther; Value: '0000万'), (Range: 100000000; Plural: pfOther; Value: '0億'), (Range: 1000000000; Plural: pfOther; Value: '00億'), (Range: 10000000000; Plural: pfOther; Value: '000億'), (Range: 100000000000; Plural: pfOther; Value: '0000億'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); JA_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0'), (Range: 10000; Plural: pfOther; Value: '¤0万'), (Range: 100000; Plural: pfOther; Value: '¤00万'), (Range: 1000000; Plural: pfOther; Value: '¤000万'), (Range: 10000000; Plural: pfOther; Value: '¤0000万'), (Range: 100000000; Plural: pfOther; Value: '¤0億'), (Range: 1000000000; Plural: pfOther; Value: '¤00億'), (Range: 10000000000; Plural: pfOther; Value: '¤000億'), (Range: 100000000000; Plural: pfOther; Value: '¤0000億'), (Range: 1000000000000; Plural: pfOther; Value: '¤0兆'), (Range: 10000000000000; Plural: pfOther; Value: '¤00兆'), (Range: 100000000000000; Plural: pfOther; Value: '¤000兆') ); // Ngomba JGO_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Machame JMC_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Georgian KA_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ათასი'), (Range: 1000; Plural: pfOther; Value: '0 ათასი'), (Range: 10000; Plural: pfOne; Value: '00 ათასი'), (Range: 10000; Plural: pfOther; Value: '00 ათასი'), (Range: 100000; Plural: pfOne; Value: '000 ათასი'), (Range: 100000; Plural: pfOther; Value: '000 ათასი'), (Range: 1000000; Plural: pfOne; Value: '0 მილიონი'), (Range: 1000000; Plural: pfOther; Value: '0 მილიონი'), (Range: 10000000; Plural: pfOne; Value: '00 მილიონი'), (Range: 10000000; Plural: pfOther; Value: '00 მილიონი'), (Range: 100000000; Plural: pfOne; Value: '000 მილიონი'), (Range: 100000000; Plural: pfOther; Value: '000 მილიონი'), (Range: 1000000000; Plural: pfOne; Value: '0 მილიარდი'), (Range: 1000000000; Plural: pfOther; Value: '0 მილიარდი'), (Range: 10000000000; Plural: pfOne; Value: '00 მილიარდი'), (Range: 10000000000; Plural: pfOther; Value: '00 მილიარდი'), (Range: 100000000000; Plural: pfOne; Value: '000 მილიარდი'), (Range: 100000000000; Plural: pfOther; Value: '000 მილიარდი'), (Range: 1000000000000; Plural: pfOne; Value: '0 ტრილიონი'), (Range: 1000000000000; Plural: pfOther; Value: '0 ტრილიონი'), (Range: 10000000000000; Plural: pfOne; Value: '00 ტრილიონი'), (Range: 10000000000000; Plural: pfOther; Value: '00 ტრილიონი'), (Range: 100000000000000; Plural: pfOne; Value: '000 ტრილიონი'), (Range: 100000000000000; Plural: pfOther; Value: '000 ტრილიონი') ); KA_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ათ.'), (Range: 1000; Plural: pfOther; Value: '0 ათ.'), (Range: 10000; Plural: pfOne; Value: '00 ათ.'), (Range: 10000; Plural: pfOther; Value: '00 ათ.'), (Range: 100000; Plural: pfOne; Value: '000 ათ.'), (Range: 100000; Plural: pfOther; Value: '000 ათ.'), (Range: 1000000; Plural: pfOne; Value: '0 მლნ.'), (Range: 1000000; Plural: pfOther; Value: '0 მლნ.'), (Range: 10000000; Plural: pfOne; Value: '00 მლნ.'), (Range: 10000000; Plural: pfOther; Value: '00 მლნ.'), (Range: 100000000; Plural: pfOne; Value: '000 მლნ.'), (Range: 100000000; Plural: pfOther; Value: '000 მლნ.'), (Range: 1000000000; Plural: pfOne; Value: '0 მლრდ.'), (Range: 1000000000; Plural: pfOther; Value: '0 მლრდ.'), (Range: 10000000000; Plural: pfOne; Value: '00 მლრდ.'), (Range: 10000000000; Plural: pfOther; Value: '00 მლრდ.'), (Range: 100000000000; Plural: pfOne; Value: '000 მლრ.'), (Range: 100000000000; Plural: pfOther; Value: '000 მლრ.'), (Range: 1000000000000; Plural: pfOne; Value: '0 ტრლ.'), (Range: 1000000000000; Plural: pfOther; Value: '0 ტრლ.'), (Range: 10000000000000; Plural: pfOne; Value: '00 ტრლ.'), (Range: 10000000000000; Plural: pfOther; Value: '00 ტრლ.'), (Range: 100000000000000; Plural: pfOne; Value: '000 ტრლ.'), (Range: 100000000000000; Plural: pfOther; Value: '000 ტრლ.') ); KA_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ათ. ¤'), (Range: 1000; Plural: pfOther; Value: '0 ათ. ¤'), (Range: 10000; Plural: pfOne; Value: '00 ათ. ¤'), (Range: 10000; Plural: pfOther; Value: '00 ათ. ¤'), (Range: 100000; Plural: pfOne; Value: '000 ათ. ¤'), (Range: 100000; Plural: pfOther; Value: '000 ათ. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 მლნ. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 მლნ. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 მლნ. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 მლნ. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 მლნ. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 მლნ. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 მლრდ. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 მლრდ. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 მლრდ. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 მლრდ. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 მლრ. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 მლრ. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 ტრლ. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 ტრლ. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 ტრლ. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 ტრლ. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 ტრლ. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 ტრლ. ¤') ); // Kabyle KAB_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Kamba KAM_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Makonde KDE_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Kabuverdianu KEA_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 mil'), (Range: 10000; Plural: pfOther; Value: '00 mil'), (Range: 100000; Plural: pfOther; Value: '000 mil'), (Range: 1000000; Plural: pfOther; Value: '0 milhãu'), (Range: 10000000; Plural: pfOther; Value: '00 milhãu'), (Range: 100000000; Plural: pfOther; Value: '000 milhãu'), (Range: 1000000000; Plural: pfOther; Value: '0 mil milhãu'), (Range: 10000000000; Plural: pfOther; Value: '00 mil milhãu'), (Range: 100000000000; Plural: pfOther; Value: '000 mil milhãu'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilhãu'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilhãu'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilhãu') ); KEA_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 mil'), (Range: 10000; Plural: pfOther; Value: '00 mil'), (Range: 100000; Plural: pfOther; Value: '000 mil'), (Range: 1000000; Plural: pfOther; Value: '0 M'), (Range: 10000000; Plural: pfOther; Value: '00 M'), (Range: 100000000; Plural: pfOther; Value: '000 M'), (Range: 1000000000; Plural: pfOther; Value: '0 MM'), (Range: 10000000000; Plural: pfOther; Value: '00 MM'), (Range: 100000000000; Plural: pfOther; Value: '000 MM'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bi'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bi'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bi') ); KEA_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 mil ¤'), (Range: 10000; Plural: pfOther; Value: '00 mil ¤'), (Range: 100000; Plural: pfOther; Value: '000 mil ¤'), (Range: 1000000; Plural: pfOther; Value: '0 M ¤'), (Range: 10000000; Plural: pfOther; Value: '00 M ¤'), (Range: 100000000; Plural: pfOther; Value: '000 M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 MM ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 MM ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 MM ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bi ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bi ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bi ¤') ); // Koyra Chiini KHQ_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Kikuyu KI_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Kazakh KK_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 мың'), (Range: 1000; Plural: pfOther; Value: '0 мың'), (Range: 10000; Plural: pfOne; Value: '00 мың'), (Range: 10000; Plural: pfOther; Value: '00 мың'), (Range: 100000; Plural: pfOne; Value: '000 мың'), (Range: 100000; Plural: pfOther; Value: '000 мың'), (Range: 1000000; Plural: pfOne; Value: '0 миллион'), (Range: 1000000; Plural: pfOther; Value: '0 миллион'), (Range: 10000000; Plural: pfOne; Value: '00 миллион'), (Range: 10000000; Plural: pfOther; Value: '00 миллион'), (Range: 100000000; Plural: pfOne; Value: '000 миллион'), (Range: 100000000; Plural: pfOther; Value: '000 миллион'), (Range: 1000000000; Plural: pfOne; Value: '0 миллиард'), (Range: 1000000000; Plural: pfOther; Value: '0 миллиард'), (Range: 10000000000; Plural: pfOne; Value: '00 миллиард'), (Range: 10000000000; Plural: pfOther; Value: '00 миллиард'), (Range: 100000000000; Plural: pfOne; Value: '000 миллиард'), (Range: 100000000000; Plural: pfOther; Value: '000 миллиард'), (Range: 1000000000000; Plural: pfOne; Value: '0 триллион'), (Range: 1000000000000; Plural: pfOther; Value: '0 триллион'), (Range: 10000000000000; Plural: pfOne; Value: '00 триллион'), (Range: 10000000000000; Plural: pfOther; Value: '00 триллион'), (Range: 100000000000000; Plural: pfOne; Value: '000 триллион'), (Range: 100000000000000; Plural: pfOther; Value: '000 триллион') ); KK_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 мың'), (Range: 1000; Plural: pfOther; Value: '0 мың'), (Range: 10000; Plural: pfOne; Value: '00 мың'), (Range: 10000; Plural: pfOther; Value: '00 мың'), (Range: 100000; Plural: pfOne; Value: '000 м.'), (Range: 100000; Plural: pfOther; Value: '000 м.'), (Range: 1000000; Plural: pfOne; Value: '0 млн'), (Range: 1000000; Plural: pfOther; Value: '0 млн'), (Range: 10000000; Plural: pfOne; Value: '00 млн'), (Range: 10000000; Plural: pfOther; Value: '00 млн'), (Range: 100000000; Plural: pfOne; Value: '000 млн'), (Range: 100000000; Plural: pfOther; Value: '000 млн'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн') ); KK_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 мың ¤'), (Range: 1000; Plural: pfOther; Value: '0 мың ¤'), (Range: 10000; Plural: pfOne; Value: '00 мың ¤'), (Range: 10000; Plural: pfOther; Value: '00 мың ¤'), (Range: 100000; Plural: pfOne; Value: '000 мың ¤'), (Range: 100000; Plural: pfOther; Value: '000 мың ¤'), (Range: 1000000; Plural: pfOne; Value: '0 млн ¤'), (Range: 1000000; Plural: pfOther; Value: '0 млн ¤'), (Range: 10000000; Plural: pfOne; Value: '00 млн ¤'), (Range: 10000000; Plural: pfOther; Value: '00 млн ¤'), (Range: 100000000; Plural: pfOne; Value: '000 млн ¤'), (Range: 100000000; Plural: pfOther; Value: '000 млн ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн ¤') ); // Kako KKJ_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Greenlandic KL_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tusind'), (Range: 1000; Plural: pfOther; Value: '0 tusind'), (Range: 10000; Plural: pfOne; Value: '00 tusind'), (Range: 10000; Plural: pfOther; Value: '00 tusind'), (Range: 100000; Plural: pfOne; Value: '000 tusind'), (Range: 100000; Plural: pfOther; Value: '000 tusind'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 millioner'), (Range: 10000000; Plural: pfOne; Value: '00 million'), (Range: 10000000; Plural: pfOther; Value: '00 millioner'), (Range: 100000000; Plural: pfOne; Value: '000 million'), (Range: 100000000; Plural: pfOther; Value: '000 millioner'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliarder'), (Range: 10000000000; Plural: pfOne; Value: '00 milliard'), (Range: 10000000000; Plural: pfOther; Value: '00 milliarder'), (Range: 100000000000; Plural: pfOne; Value: '000 milliard'), (Range: 100000000000; Plural: pfOther; Value: '000 milliarder'), (Range: 1000000000000; Plural: pfOne; Value: '0 billion'), (Range: 1000000000000; Plural: pfOther; Value: '0 billioner'), (Range: 10000000000000; Plural: pfOne; Value: '00 billion'), (Range: 10000000000000; Plural: pfOther; Value: '00 billioner'), (Range: 100000000000000; Plural: pfOne; Value: '000 billion'), (Range: 100000000000000; Plural: pfOther; Value: '000 billioner') ); KL_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 td'), (Range: 1000; Plural: pfOther; Value: '0 td'), (Range: 10000; Plural: pfOne; Value: '00 td'), (Range: 10000; Plural: pfOther; Value: '00 td'), (Range: 100000; Plural: pfOne; Value: '000 td'), (Range: 100000; Plural: pfOther; Value: '000 td'), (Range: 1000000; Plural: pfOne; Value: '0 mn'), (Range: 1000000; Plural: pfOther; Value: '0 mn'), (Range: 10000000; Plural: pfOne; Value: '00 mn'), (Range: 10000000; Plural: pfOther; Value: '00 mn'), (Range: 100000000; Plural: pfOne; Value: '000 mn'), (Range: 100000000; Plural: pfOther; Value: '000 mn'), (Range: 1000000000; Plural: pfOne; Value: '0 md'), (Range: 1000000000; Plural: pfOther; Value: '0 md'), (Range: 10000000000; Plural: pfOne; Value: '00 md'), (Range: 10000000000; Plural: pfOther; Value: '00 md'), (Range: 100000000000; Plural: pfOne; Value: '000 md'), (Range: 100000000000; Plural: pfOther; Value: '000 md'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn') ); KL_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0 td'), (Range: 1000; Plural: pfOther; Value: '¤0 td'), (Range: 10000; Plural: pfOne; Value: '¤00 td'), (Range: 10000; Plural: pfOther; Value: '¤00 td'), (Range: 100000; Plural: pfOne; Value: '¤000 td'), (Range: 100000; Plural: pfOther; Value: '¤000 td'), (Range: 1000000; Plural: pfOne; Value: '¤0 mn'), (Range: 1000000; Plural: pfOther; Value: '¤0 mn'), (Range: 10000000; Plural: pfOne; Value: '¤00 mn'), (Range: 10000000; Plural: pfOther; Value: '¤00 mn'), (Range: 100000000; Plural: pfOne; Value: '¤000 mn'), (Range: 100000000; Plural: pfOther; Value: '¤000 mn'), (Range: 1000000000; Plural: pfOne; Value: '¤0 md'), (Range: 1000000000; Plural: pfOther; Value: '¤0 md'), (Range: 10000000000; Plural: pfOne; Value: '¤00 md'), (Range: 10000000000; Plural: pfOther; Value: '¤00 md'), (Range: 100000000000; Plural: pfOne; Value: '¤000 md'), (Range: 100000000000; Plural: pfOther; Value: '¤000 md'), (Range: 1000000000000; Plural: pfOne; Value: '¤0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '¤00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '¤000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 bn') ); // Kalenjin KLN_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Khmer KM_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0ពាន់'), (Range: 10000; Plural: pfOther; Value: '0​មឺុន'), (Range: 100000; Plural: pfOther; Value: '0សែន'), (Range: 1000000; Plural: pfOther; Value: '0លាន'), (Range: 10000000; Plural: pfOther; Value: '0​ដប់​លាន'), (Range: 100000000; Plural: pfOther; Value: '0​រយលាន'), (Range: 1000000000; Plural: pfOther; Value: '0​កោដិ'), (Range: 10000000000; Plural: pfOther; Value: '0​ដប់​កោដិ'), (Range: 100000000000; Plural: pfOther; Value: '0​រយ​កោដិ'), (Range: 1000000000000; Plural: pfOther; Value: '0​ពាន់​កោដិ'), (Range: 10000000000000; Plural: pfOther; Value: '0​មឺុន​កោដិ'), (Range: 100000000000000; Plural: pfOther; Value: '0​សែន​កោដិ') ); KM_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0ពាន់'), (Range: 10000; Plural: pfOther; Value: '0​មឺុន'), (Range: 100000; Plural: pfOther; Value: '0សែន'), (Range: 1000000; Plural: pfOther; Value: '0លាន'), (Range: 10000000; Plural: pfOther; Value: '0​ដប់​លាន'), (Range: 100000000; Plural: pfOther; Value: '0​រយលាន'), (Range: 1000000000; Plural: pfOther; Value: '0​កោដិ'), (Range: 10000000000; Plural: pfOther; Value: '0​ដប់​កោដិ'), (Range: 100000000000; Plural: pfOther; Value: '0​រយ​កោដិ'), (Range: 1000000000000; Plural: pfOther; Value: '0​ពាន់​កោដិ'), (Range: 10000000000000; Plural: pfOther; Value: '0​មឺុន​កោដិ'), (Range: 100000000000000; Plural: pfOther; Value: '0​សែន​កោដិ') ); KM_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0ពាន់'), (Range: 10000; Plural: pfOther; Value: '¤0​មឺុន'), (Range: 100000; Plural: pfOther; Value: '¤0សែន'), (Range: 1000000; Plural: pfOther; Value: '¤0លាន'), (Range: 10000000; Plural: pfOther; Value: '¤0​ដប់​លាន'), (Range: 100000000; Plural: pfOther; Value: '¤0​រយលាន'), (Range: 1000000000; Plural: pfOther; Value: '¤0​កោដិ'), (Range: 10000000000; Plural: pfOther; Value: '¤0​ដប់​កោដិ'), (Range: 100000000000; Plural: pfOther; Value: '¤0​រយ​កោដិ'), (Range: 1000000000000; Plural: pfOther; Value: '¤0​ពាន់​កោដិ'), (Range: 10000000000000; Plural: pfOther; Value: '¤0​មឺុន​កោដិ'), (Range: 100000000000000; Plural: pfOther; Value: '¤0​សែន​កោដិ') ); // Kannada KN_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ಸಾವಿರ'), (Range: 1000; Plural: pfOther; Value: '0 ಸಾವಿರ'), (Range: 10000; Plural: pfOne; Value: '00 ಸಾವಿರ'), (Range: 10000; Plural: pfOther; Value: '00 ಸಾವಿರ'), (Range: 100000; Plural: pfOne; Value: '000 ಸಾವಿರ'), (Range: 100000; Plural: pfOther; Value: '000 ಸಾವಿರ'), (Range: 1000000; Plural: pfOne; Value: '0 ಮಿಲಿಯನ್'), (Range: 1000000; Plural: pfOther; Value: '0 ಮಿಲಿಯನ್'), (Range: 10000000; Plural: pfOne; Value: '00 ಮಿಲಿಯನ್'), (Range: 10000000; Plural: pfOther; Value: '00 ಮಿಲಿಯನ್'), (Range: 100000000; Plural: pfOne; Value: '000 ಮಿಲಿಯನ್'), (Range: 100000000; Plural: pfOther; Value: '000 ಮಿಲಿಯನ್'), (Range: 1000000000; Plural: pfOne; Value: '0 ಬಿಲಿಯನ್'), (Range: 1000000000; Plural: pfOther; Value: '0 ಬಿಲಿಯನ್'), (Range: 10000000000; Plural: pfOne; Value: '00 ಬಿಲಿಯನ್'), (Range: 10000000000; Plural: pfOther; Value: '00 ಬಿಲಿಯನ್'), (Range: 100000000000; Plural: pfOne; Value: '000 ಬಿಲಿಯನ್'), (Range: 100000000000; Plural: pfOther; Value: '000 ಬಿಲಿಯನ್'), (Range: 1000000000000; Plural: pfOne; Value: '0 ಟ್ರಿಲಿಯನ್‌'), (Range: 1000000000000; Plural: pfOther; Value: '0 ಟ್ರಿಲಿಯನ್‌'), (Range: 10000000000000; Plural: pfOne; Value: '00 ಟ್ರಿಲಿಯನ್‌'), (Range: 10000000000000; Plural: pfOther; Value: '00 ಟ್ರಿಲಿಯನ್‌'), (Range: 100000000000000; Plural: pfOne; Value: '000 ಟ್ರಿಲಿಯನ್‌'), (Range: 100000000000000; Plural: pfOther; Value: '000 ಟ್ರಿಲಿಯನ್‌') ); KN_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0ಸಾ'), (Range: 1000; Plural: pfOther; Value: '0ಸಾ'), (Range: 10000; Plural: pfOne; Value: '00ಸಾ'), (Range: 10000; Plural: pfOther; Value: '00ಸಾ'), (Range: 100000; Plural: pfOne; Value: '000ಸಾ'), (Range: 100000; Plural: pfOther; Value: '000ಸಾ'), (Range: 1000000; Plural: pfOne; Value: '0ಮಿ'), (Range: 1000000; Plural: pfOther; Value: '0ಮಿ'), (Range: 10000000; Plural: pfOne; Value: '00ಮಿ'), (Range: 10000000; Plural: pfOther; Value: '00ಮಿ'), (Range: 100000000; Plural: pfOne; Value: '000ಮಿ'), (Range: 100000000; Plural: pfOther; Value: '000ಮಿ'), (Range: 1000000000; Plural: pfOne; Value: '0ಬಿ'), (Range: 1000000000; Plural: pfOther; Value: '0ಬಿ'), (Range: 10000000000; Plural: pfOne; Value: '00ಬಿ'), (Range: 10000000000; Plural: pfOther; Value: '00ಬಿ'), (Range: 100000000000; Plural: pfOne; Value: '000ಬಿ'), (Range: 100000000000; Plural: pfOther; Value: '000ಬಿ'), (Range: 1000000000000; Plural: pfOne; Value: '0ಟ್ರಿ'), (Range: 1000000000000; Plural: pfOther; Value: '0ಟ್ರಿ'), (Range: 10000000000000; Plural: pfOne; Value: '00ಟ್ರಿ'), (Range: 10000000000000; Plural: pfOther; Value: '00ಟ್ರಿ'), (Range: 100000000000000; Plural: pfOne; Value: '000ಟ್ರಿ'), (Range: 100000000000000; Plural: pfOther; Value: '000ಟ್ರಿ') ); // Korean KO_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0천'), (Range: 10000; Plural: pfOther; Value: '0만'), (Range: 100000; Plural: pfOther; Value: '00만'), (Range: 1000000; Plural: pfOther; Value: '000만'), (Range: 10000000; Plural: pfOther; Value: '0000만'), (Range: 100000000; Plural: pfOther; Value: '0억'), (Range: 1000000000; Plural: pfOther; Value: '00억'), (Range: 10000000000; Plural: pfOther; Value: '000억'), (Range: 100000000000; Plural: pfOther; Value: '0000억'), (Range: 1000000000000; Plural: pfOther; Value: '0조'), (Range: 10000000000000; Plural: pfOther; Value: '00조'), (Range: 100000000000000; Plural: pfOther; Value: '000조') ); KO_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0천'), (Range: 10000; Plural: pfOther; Value: '0만'), (Range: 100000; Plural: pfOther; Value: '00만'), (Range: 1000000; Plural: pfOther; Value: '000만'), (Range: 10000000; Plural: pfOther; Value: '0000만'), (Range: 100000000; Plural: pfOther; Value: '0억'), (Range: 1000000000; Plural: pfOther; Value: '00억'), (Range: 10000000000; Plural: pfOther; Value: '000억'), (Range: 100000000000; Plural: pfOther; Value: '0000억'), (Range: 1000000000000; Plural: pfOther; Value: '0조'), (Range: 10000000000000; Plural: pfOther; Value: '00조'), (Range: 100000000000000; Plural: pfOther; Value: '000조') ); KO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0천'), (Range: 10000; Plural: pfOther; Value: '¤0만'), (Range: 100000; Plural: pfOther; Value: '¤00만'), (Range: 1000000; Plural: pfOther; Value: '¤000만'), (Range: 10000000; Plural: pfOther; Value: '¤0000만'), (Range: 100000000; Plural: pfOther; Value: '¤0억'), (Range: 1000000000; Plural: pfOther; Value: '¤00억'), (Range: 10000000000; Plural: pfOther; Value: '¤000억'), (Range: 100000000000; Plural: pfOther; Value: '¤0000억'), (Range: 1000000000000; Plural: pfOther; Value: '¤0조'), (Range: 10000000000000; Plural: pfOther; Value: '¤00조'), (Range: 100000000000000; Plural: pfOther; Value: '¤000조') ); // Konkani KOK_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Kashmiri KS_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Shambala KSB_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Bafia KSF_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Colognian KSH_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 Dousend'), (Range: 1000; Plural: pfOne; Value: '0 Dousend'), (Range: 1000; Plural: pfOther; Value: '0 Dousend'), (Range: 10000; Plural: pfZero; Value: '00 Dousend'), (Range: 10000; Plural: pfOne; Value: '00 Dousend'), (Range: 10000; Plural: pfOther; Value: '00 Dousend'), (Range: 100000; Plural: pfZero; Value: '000 Dousend'), (Range: 100000; Plural: pfOne; Value: '000 Dousend'), (Range: 100000; Plural: pfOther; Value: '000 Dousend'), (Range: 1000000; Plural: pfZero; Value: '0 Milljuhne'), (Range: 1000000; Plural: pfOne; Value: '0 Million'), (Range: 1000000; Plural: pfOther; Value: '0 Milljuhne'), (Range: 10000000; Plural: pfZero; Value: '00 Milljuhne'), (Range: 10000000; Plural: pfOne; Value: '00 Milljuhne'), (Range: 10000000; Plural: pfOther; Value: '00 Millionen'), (Range: 100000000; Plural: pfZero; Value: '000 Milljuhne'), (Range: 100000000; Plural: pfOne; Value: '000 Milljuhne'), (Range: 100000000; Plural: pfOther; Value: '000 Millionen'), (Range: 1000000000; Plural: pfZero; Value: '0 Milljard'), (Range: 1000000000; Plural: pfOne; Value: '0 Milliarde'), (Range: 1000000000; Plural: pfOther; Value: '0 Milljarde'), (Range: 10000000000; Plural: pfZero; Value: '00 Milljarde'), (Range: 10000000000; Plural: pfOne; Value: '00 Milljarde'), (Range: 10000000000; Plural: pfOther; Value: '00 Milliarden'), (Range: 100000000000; Plural: pfZero; Value: '000 Milljarde'), (Range: 100000000000; Plural: pfOne; Value: '000 Milliarde'), (Range: 100000000000; Plural: pfOther; Value: '000 Milliarden'), (Range: 1000000000000; Plural: pfZero; Value: '0 Billjuhn'), (Range: 1000000000000; Plural: pfOne; Value: '0 Billjuhn'), (Range: 1000000000000; Plural: pfOther; Value: '0 Billjuhn'), (Range: 10000000000000; Plural: pfZero; Value: '00 Billjuhn'), (Range: 10000000000000; Plural: pfOne; Value: '00 Billion'), (Range: 10000000000000; Plural: pfOther; Value: '00 Billionen'), (Range: 100000000000000; Plural: pfZero; Value: '000 Billjuhn'), (Range: 100000000000000; Plural: pfOne; Value: '000 Billion'), (Range: 100000000000000; Plural: pfOther; Value: '000 Billionen') ); KSH_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 tsd'), (Range: 1000; Plural: pfOne; Value: '0 tsd'), (Range: 1000; Plural: pfOther; Value: '0 tsd'), (Range: 10000; Plural: pfZero; Value: '00 tsd'), (Range: 10000; Plural: pfOne; Value: '00 tsd'), (Range: 10000; Plural: pfOther; Value: '00 tsd'), (Range: 100000; Plural: pfZero; Value: '000 tsd'), (Range: 100000; Plural: pfOne; Value: '000 tsd'), (Range: 100000; Plural: pfOther; Value: '000 tsd'), (Range: 1000000; Plural: pfZero; Value: '0 Mio'), (Range: 1000000; Plural: pfOne; Value: '0 Mio'), (Range: 1000000; Plural: pfOther; Value: '0 Mio'), (Range: 10000000; Plural: pfZero; Value: '00 Mio'), (Range: 10000000; Plural: pfOne; Value: '00 Mio'), (Range: 10000000; Plural: pfOther; Value: '00 Mio'), (Range: 100000000; Plural: pfZero; Value: '000 Mio'), (Range: 100000000; Plural: pfOne; Value: '000 Mio'), (Range: 100000000; Plural: pfOther; Value: '000 Mio'), (Range: 1000000000; Plural: pfZero; Value: '0 Mrd'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd'), (Range: 10000000000; Plural: pfZero; Value: '00 Mrd'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd'), (Range: 100000000000; Plural: pfZero; Value: '000 Mrd'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd'), (Range: 1000000000000; Plural: pfZero; Value: '0 Bio'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio'), (Range: 10000000000000; Plural: pfZero; Value: '00 Bio'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio'), (Range: 100000000000000; Plural: pfZero; Value: '000 Bio'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio') ); KSH_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 tsd ¤'), (Range: 1000; Plural: pfOne; Value: '0 tsd ¤'), (Range: 1000; Plural: pfOther; Value: '0 tsd ¤'), (Range: 10000; Plural: pfZero; Value: '00 tsd ¤'), (Range: 10000; Plural: pfOne; Value: '00 tsd ¤'), (Range: 10000; Plural: pfOther; Value: '00 tsd ¤'), (Range: 100000; Plural: pfZero; Value: '000 tsd ¤'), (Range: 100000; Plural: pfOne; Value: '000 tsd ¤'), (Range: 100000; Plural: pfOther; Value: '000 tsd ¤'), (Range: 1000000; Plural: pfZero; Value: '0 Mio ¤'), (Range: 1000000; Plural: pfOne; Value: '0 Mio ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Mio ¤'), (Range: 10000000; Plural: pfZero; Value: '00 Mio ¤'), (Range: 10000000; Plural: pfOne; Value: '00 Mio ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Mio ¤'), (Range: 100000000; Plural: pfZero; Value: '000 Mio ¤'), (Range: 100000000; Plural: pfOne; Value: '000 Mio ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Mio ¤'), (Range: 1000000000; Plural: pfZero; Value: '0 Mrd ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd ¤'), (Range: 10000000000; Plural: pfZero; Value: '00 Mrd ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd ¤'), (Range: 100000000000; Plural: pfZero; Value: '000 Mrd ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd ¤'), (Range: 1000000000000; Plural: pfZero; Value: '0 Bio ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio ¤'), (Range: 10000000000000; Plural: pfZero; Value: '00 Bio ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio ¤'), (Range: 100000000000000; Plural: pfZero; Value: '000 Bio ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio ¤') ); // Cornish KW_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfTwo; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfTwo; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfTwo; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfTwo; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfTwo; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfTwo; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfTwo; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfTwo; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfTwo; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfTwo; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfTwo; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfTwo; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Kyrgyz KY_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 миӊ'), (Range: 1000; Plural: pfOther; Value: '0 миӊ'), (Range: 10000; Plural: pfOne; Value: '00 миӊ'), (Range: 10000; Plural: pfOther; Value: '00 миӊ'), (Range: 100000; Plural: pfOne; Value: '000 миӊ'), (Range: 100000; Plural: pfOther; Value: '000 миӊ'), (Range: 1000000; Plural: pfOne; Value: '0 миллион'), (Range: 1000000; Plural: pfOther; Value: '0 миллион'), (Range: 10000000; Plural: pfOne; Value: '00 миллион'), (Range: 10000000; Plural: pfOther; Value: '00 миллион'), (Range: 100000000; Plural: pfOne; Value: '000 миллион'), (Range: 100000000; Plural: pfOther; Value: '000 миллион'), (Range: 1000000000; Plural: pfOne; Value: '0 миллиард'), (Range: 1000000000; Plural: pfOther; Value: '0 миллиард'), (Range: 10000000000; Plural: pfOne; Value: '00 миллиард'), (Range: 10000000000; Plural: pfOther; Value: '00 миллиард'), (Range: 100000000000; Plural: pfOne; Value: '000 миллиард'), (Range: 100000000000; Plural: pfOther; Value: '000 миллиард'), (Range: 1000000000000; Plural: pfOne; Value: '0 триллион'), (Range: 1000000000000; Plural: pfOther; Value: '0 триллион'), (Range: 10000000000000; Plural: pfOne; Value: '00 триллион'), (Range: 10000000000000; Plural: pfOther; Value: '00 триллион'), (Range: 100000000000000; Plural: pfOne; Value: '000 триллион'), (Range: 100000000000000; Plural: pfOther; Value: '000 триллион') ); KY_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 миӊ'), (Range: 1000; Plural: pfOther; Value: '0 миӊ'), (Range: 10000; Plural: pfOne; Value: '00 миӊ'), (Range: 10000; Plural: pfOther; Value: '00 миӊ'), (Range: 100000; Plural: pfOne; Value: '000 миӊ'), (Range: 100000; Plural: pfOther; Value: '000 миӊ'), (Range: 1000000; Plural: pfOne; Value: '0 млн'), (Range: 1000000; Plural: pfOther; Value: '0 млн'), (Range: 10000000; Plural: pfOne; Value: '00 млн'), (Range: 10000000; Plural: pfOther; Value: '00 млн'), (Range: 100000000; Plural: pfOne; Value: '000 млн'), (Range: 100000000; Plural: pfOther; Value: '000 млн'), (Range: 1000000000; Plural: pfOne; Value: '0 млд'), (Range: 1000000000; Plural: pfOther; Value: '0 млд'), (Range: 10000000000; Plural: pfOne; Value: '00 млд'), (Range: 10000000000; Plural: pfOther; Value: '00 млд'), (Range: 100000000000; Plural: pfOne; Value: '000 млд'), (Range: 100000000000; Plural: pfOther; Value: '000 млд'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн') ); KY_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 миӊ ¤'), (Range: 1000; Plural: pfOther; Value: '0 миӊ ¤'), (Range: 10000; Plural: pfOne; Value: '00 миӊ ¤'), (Range: 10000; Plural: pfOther; Value: '00 миӊ ¤'), (Range: 100000; Plural: pfOne; Value: '000 миӊ ¤'), (Range: 100000; Plural: pfOther; Value: '000 миӊ ¤'), (Range: 1000000; Plural: pfOne; Value: '0 млн ¤'), (Range: 1000000; Plural: pfOther; Value: '0 млн ¤'), (Range: 10000000; Plural: pfOne; Value: '00 млн ¤'), (Range: 10000000; Plural: pfOther; Value: '00 млн ¤'), (Range: 100000000; Plural: pfOne; Value: '000 млн ¤'), (Range: 100000000; Plural: pfOther; Value: '000 млн ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млд ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млд ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млд ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млд ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн ¤') ); // Langi LAG_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '¤ 0K'), (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfZero; Value: '¤ 00K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfZero; Value: '¤ 000K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfZero; Value: '¤ 0M'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfZero; Value: '¤ 00M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfZero; Value: '¤ 000M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfZero; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfZero; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfZero; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfZero; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfZero; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfZero; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Luxembourgish LB_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 Dausend'), (Range: 1000; Plural: pfOther; Value: '0 Dausend'), (Range: 10000; Plural: pfOne; Value: '00 Dausend'), (Range: 10000; Plural: pfOther; Value: '00 Dausend'), (Range: 100000; Plural: pfOne; Value: '000 Dausend'), (Range: 100000; Plural: pfOther; Value: '000 Dausend'), (Range: 1000000; Plural: pfOne; Value: '0 Millioun'), (Range: 1000000; Plural: pfOther; Value: '0 Milliounen'), (Range: 10000000; Plural: pfOne; Value: '00 Milliounen'), (Range: 10000000; Plural: pfOther; Value: '00 Milliounen'), (Range: 100000000; Plural: pfOne; Value: '000 Milliounen'), (Range: 100000000; Plural: pfOther; Value: '000 Milliounen'), (Range: 1000000000; Plural: pfOne; Value: '0 Milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 Milliarden'), (Range: 10000000000; Plural: pfOne; Value: '00 Milliarden'), (Range: 10000000000; Plural: pfOther; Value: '00 Milliarden'), (Range: 100000000000; Plural: pfOne; Value: '000 Milliarden'), (Range: 100000000000; Plural: pfOther; Value: '000 Milliarden'), (Range: 1000000000000; Plural: pfOne; Value: '0 Billioun'), (Range: 1000000000000; Plural: pfOther; Value: '0 Billiounen'), (Range: 10000000000000; Plural: pfOne; Value: '00 Billiounen'), (Range: 10000000000000; Plural: pfOther; Value: '00 Billiounen'), (Range: 100000000000000; Plural: pfOne; Value: '000 Billiounen'), (Range: 100000000000000; Plural: pfOther; Value: '000 Billiounen') ); LB_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 Dsd.'), (Range: 1000; Plural: pfOther; Value: '0 Dsd.'), (Range: 10000; Plural: pfOne; Value: '00 Dsd.'), (Range: 10000; Plural: pfOther; Value: '00 Dsd.'), (Range: 100000; Plural: pfOne; Value: '000 Dsd.'), (Range: 100000; Plural: pfOther; Value: '000 Dsd.'), (Range: 1000000; Plural: pfOne; Value: '0 Mio.'), (Range: 1000000; Plural: pfOther; Value: '0 Mio.'), (Range: 10000000; Plural: pfOne; Value: '00 Mio.'), (Range: 10000000; Plural: pfOther; Value: '00 Mio.'), (Range: 100000000; Plural: pfOne; Value: '000 Mio.'), (Range: 100000000; Plural: pfOther; Value: '000 Mio.'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio.'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio.'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio.'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio.'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio.'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio.') ); LB_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 Dsd. ¤'), (Range: 1000; Plural: pfOther; Value: '0 Dsd. ¤'), (Range: 10000; Plural: pfOne; Value: '00 Dsd. ¤'), (Range: 10000; Plural: pfOther; Value: '00 Dsd. ¤'), (Range: 100000; Plural: pfOne; Value: '000 Dsd. ¤'), (Range: 100000; Plural: pfOther; Value: '000 Dsd. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 Mio. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Mio. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 Mio. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Mio. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 Mio. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Mio. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bio. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bio. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bio. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bio. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bio. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bio. ¤') ); // Ganda LG_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Lakota LKT_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Lingala LN_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Lao LO_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0ພັນ'), (Range: 10000; Plural: pfOther; Value: '00ພັນ'), (Range: 100000; Plural: pfOther; Value: '000ພັນ'), (Range: 1000000; Plural: pfOther; Value: '0ລ້ານ'), (Range: 10000000; Plural: pfOther; Value: '00ລ້ານ'), (Range: 100000000; Plural: pfOther; Value: '000ລ້ານ'), (Range: 1000000000; Plural: pfOther; Value: '0ພັນລ້ານ'), (Range: 10000000000; Plural: pfOther; Value: '00ພັນລ້ານ'), (Range: 100000000000; Plural: pfOther; Value: '000ພັນລ້ານ'), (Range: 1000000000000; Plural: pfOther; Value: '0000ພັນລ້ານ'), (Range: 10000000000000; Plural: pfOther; Value: '00ລ້ານລ້ານ'), (Range: 100000000000000; Plural: pfOther; Value: '000ລ້ານລ້ານ') ); LO_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0ພັນ'), (Range: 10000; Plural: pfOther; Value: '00ພັນ'), (Range: 100000; Plural: pfOther; Value: '000ພັນ'), (Range: 1000000; Plural: pfOther; Value: '0ລ້ານ'), (Range: 10000000; Plural: pfOther; Value: '00ລ້ານ'), (Range: 100000000; Plural: pfOther; Value: '000ລ້ານ'), (Range: 1000000000; Plural: pfOther; Value: '0ຕື້'), (Range: 10000000000; Plural: pfOther; Value: '00ຕື້'), (Range: 100000000000; Plural: pfOther; Value: '000ຕື້'), (Range: 1000000000000; Plural: pfOther; Value: '0000ຕື້'), (Range: 10000000000000; Plural: pfOther; Value: '00ພັນຕື້'), (Range: 100000000000000; Plural: pfOther; Value: '000ພັນຕື້') ); LO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0 ພັນ'), (Range: 10000; Plural: pfOther; Value: '¤00 ພັນ'), (Range: 100000; Plural: pfOther; Value: '¤000 ກີບ'), (Range: 1000000; Plural: pfOther; Value: '¤0 ລ້ານ'), (Range: 10000000; Plural: pfOther; Value: '¤00 ລ້ານ'), (Range: 100000000; Plural: pfOther; Value: '¤000 ລ້ານ'), (Range: 1000000000; Plural: pfOther; Value: '¤0 ຕື້'), (Range: 10000000000; Plural: pfOther; Value: '¤00 ຕື້'), (Range: 100000000000; Plural: pfOther; Value: '¤000 ຕື້'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 ລ້ານລ້ານ'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 ລ້ານລ້ານ'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 ລ້ານລ້ານ') ); // Lithuanian LT_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tūkstantis'), (Range: 1000; Plural: pfFew; Value: '0 tūkstančiai'), (Range: 1000; Plural: pfMany; Value: '0 tūkstančio'), (Range: 1000; Plural: pfOther; Value: '0 tūkstančių'), (Range: 10000; Plural: pfOne; Value: '00 tūkstantis'), (Range: 10000; Plural: pfFew; Value: '00 tūkstančiai'), (Range: 10000; Plural: pfMany; Value: '00 tūkstančio'), (Range: 10000; Plural: pfOther; Value: '00 tūkstančių'), (Range: 100000; Plural: pfOne; Value: '000 tūkstantis'), (Range: 100000; Plural: pfFew; Value: '000 tūkstančiai'), (Range: 100000; Plural: pfMany; Value: '000 tūkstančio'), (Range: 100000; Plural: pfOther; Value: '000 tūkstančių'), (Range: 1000000; Plural: pfOne; Value: '0 milijonas'), (Range: 1000000; Plural: pfFew; Value: '0 milijonai'), (Range: 1000000; Plural: pfMany; Value: '0 milijono'), (Range: 1000000; Plural: pfOther; Value: '0 milijonų'), (Range: 10000000; Plural: pfOne; Value: '00 milijonas'), (Range: 10000000; Plural: pfFew; Value: '00 milijonai'), (Range: 10000000; Plural: pfMany; Value: '00 milijono'), (Range: 10000000; Plural: pfOther; Value: '00 milijonų'), (Range: 100000000; Plural: pfOne; Value: '000 milijonas'), (Range: 100000000; Plural: pfFew; Value: '000 milijonai'), (Range: 100000000; Plural: pfMany; Value: '000 milijono'), (Range: 100000000; Plural: pfOther; Value: '000 milijonų'), (Range: 1000000000; Plural: pfOne; Value: '0 milijardas'), (Range: 1000000000; Plural: pfFew; Value: '0 milijardai'), (Range: 1000000000; Plural: pfMany; Value: '0 milijardo'), (Range: 1000000000; Plural: pfOther; Value: '0 milijardų'), (Range: 10000000000; Plural: pfOne; Value: '00 milijardas'), (Range: 10000000000; Plural: pfFew; Value: '00 milijardai'), (Range: 10000000000; Plural: pfMany; Value: '00 milijardo'), (Range: 10000000000; Plural: pfOther; Value: '00 milijardų'), (Range: 100000000000; Plural: pfOne; Value: '000 milijardas'), (Range: 100000000000; Plural: pfFew; Value: '000 milijardai'), (Range: 100000000000; Plural: pfMany; Value: '000 milijardo'), (Range: 100000000000; Plural: pfOther; Value: '000 milijardų'), (Range: 1000000000000; Plural: pfOne; Value: '0 trilijonas'), (Range: 1000000000000; Plural: pfFew; Value: '0 trilijonai'), (Range: 1000000000000; Plural: pfMany; Value: '0 trilijono'), (Range: 1000000000000; Plural: pfOther; Value: '0 trilijonų'), (Range: 10000000000000; Plural: pfOne; Value: '00 trilijonas'), (Range: 10000000000000; Plural: pfFew; Value: '00 trilijonai'), (Range: 10000000000000; Plural: pfMany; Value: '00 trilijono'), (Range: 10000000000000; Plural: pfOther; Value: '00 trilijonų'), (Range: 100000000000000; Plural: pfOne; Value: '000 trilijonas'), (Range: 100000000000000; Plural: pfFew; Value: '000 trilijonai'), (Range: 100000000000000; Plural: pfMany; Value: '000 trilijono'), (Range: 100000000000000; Plural: pfOther; Value: '000 trilijonų') ); LT_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tūkst.'), (Range: 1000; Plural: pfFew; Value: '0 tūkst.'), (Range: 1000; Plural: pfMany; Value: '0 tūkst.'), (Range: 1000; Plural: pfOther; Value: '0 tūkst.'), (Range: 10000; Plural: pfOne; Value: '00 tūkst.'), (Range: 10000; Plural: pfFew; Value: '00 tūkst.'), (Range: 10000; Plural: pfMany; Value: '00 tūkst.'), (Range: 10000; Plural: pfOther; Value: '00 tūkst.'), (Range: 100000; Plural: pfOne; Value: '000 tūkst.'), (Range: 100000; Plural: pfFew; Value: '000 tūkst.'), (Range: 100000; Plural: pfMany; Value: '000 tūkst.'), (Range: 100000; Plural: pfOther; Value: '000 tūkst.'), (Range: 1000000; Plural: pfOne; Value: '0 mln.'), (Range: 1000000; Plural: pfFew; Value: '0 mln.'), (Range: 1000000; Plural: pfMany; Value: '0 mln.'), (Range: 1000000; Plural: pfOther; Value: '0 mln.'), (Range: 10000000; Plural: pfOne; Value: '00 mln.'), (Range: 10000000; Plural: pfFew; Value: '00 mln.'), (Range: 10000000; Plural: pfMany; Value: '00 mln.'), (Range: 10000000; Plural: pfOther; Value: '00 mln.'), (Range: 100000000; Plural: pfOne; Value: '000 mln.'), (Range: 100000000; Plural: pfFew; Value: '000 mln.'), (Range: 100000000; Plural: pfMany; Value: '000 mln.'), (Range: 100000000; Plural: pfOther; Value: '000 mln.'), (Range: 1000000000; Plural: pfOne; Value: '0 mlrd.'), (Range: 1000000000; Plural: pfFew; Value: '0 mlrd.'), (Range: 1000000000; Plural: pfMany; Value: '0 mlrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 mlrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 mlrd.'), (Range: 10000000000; Plural: pfFew; Value: '00 mlrd.'), (Range: 10000000000; Plural: pfMany; Value: '00 mlrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 mlrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 mlrd.'), (Range: 100000000000; Plural: pfFew; Value: '000 mlrd.'), (Range: 100000000000; Plural: pfMany; Value: '000 mlrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 mlrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 trln.'), (Range: 1000000000000; Plural: pfFew; Value: '0 trln.'), (Range: 1000000000000; Plural: pfMany; Value: '0 trln.'), (Range: 1000000000000; Plural: pfOther; Value: '0 trln.'), (Range: 10000000000000; Plural: pfOne; Value: '00 trln.'), (Range: 10000000000000; Plural: pfFew; Value: '00 trln.'), (Range: 10000000000000; Plural: pfMany; Value: '00 trln.'), (Range: 10000000000000; Plural: pfOther; Value: '00 trln.'), (Range: 100000000000000; Plural: pfOne; Value: '000 trln.'), (Range: 100000000000000; Plural: pfFew; Value: '000 trln.'), (Range: 100000000000000; Plural: pfMany; Value: '000 trln.'), (Range: 100000000000000; Plural: pfOther; Value: '000 trln.') ); LT_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tūkst. ¤'), (Range: 1000; Plural: pfFew; Value: '0 tūkst. ¤'), (Range: 1000; Plural: pfMany; Value: '0 tūkst. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tūkst. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tūkst. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tūkst. ¤'), (Range: 10000; Plural: pfMany; Value: '00 tūkst. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tūkst. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tūkst. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tūkst. ¤'), (Range: 100000; Plural: pfMany; Value: '000 tūkst. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tūkst. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mln. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mln. ¤'), (Range: 1000000; Plural: pfMany; Value: '0 mln. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mln. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mln. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mln. ¤'), (Range: 10000000; Plural: pfMany; Value: '00 mln. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mln. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mln. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mln. ¤'), (Range: 100000000; Plural: pfMany; Value: '000 mln. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mln. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mlrd. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mlrd. ¤'), (Range: 1000000000; Plural: pfMany; Value: '0 mlrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mlrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mlrd. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mlrd. ¤'), (Range: 10000000000; Plural: pfMany; Value: '00 mlrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mlrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mlrd. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mlrd. ¤'), (Range: 100000000000; Plural: pfMany; Value: '000 mlrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mlrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 trln. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 trln. ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0 trln. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 trln. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 trln. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 trln. ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00 trln. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 trln. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 trln. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 trln. ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000 trln. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 trln. ¤') ); // Luba-Katanga LU_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Luo LUO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Luyia LUY_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Latvian LV_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 tūkstoši'), (Range: 1000; Plural: pfOne; Value: '0 tūkstotis'), (Range: 1000; Plural: pfOther; Value: '0 tūkstoši'), (Range: 10000; Plural: pfZero; Value: '00 tūkstoši'), (Range: 10000; Plural: pfOne; Value: '00 tūkstotis'), (Range: 10000; Plural: pfOther; Value: '00 tūkstoši'), (Range: 100000; Plural: pfZero; Value: '000 tūkstoši'), (Range: 100000; Plural: pfOne; Value: '000 tūkstotis'), (Range: 100000; Plural: pfOther; Value: '000 tūkstoši'), (Range: 1000000; Plural: pfZero; Value: '0 miljoni'), (Range: 1000000; Plural: pfOne; Value: '0 miljons'), (Range: 1000000; Plural: pfOther; Value: '0 miljoni'), (Range: 10000000; Plural: pfZero; Value: '00 miljoni'), (Range: 10000000; Plural: pfOne; Value: '00 miljons'), (Range: 10000000; Plural: pfOther; Value: '00 miljoni'), (Range: 100000000; Plural: pfZero; Value: '000 miljoni'), (Range: 100000000; Plural: pfOne; Value: '000 miljons'), (Range: 100000000; Plural: pfOther; Value: '000 miljoni'), (Range: 1000000000; Plural: pfZero; Value: '0 miljardi'), (Range: 1000000000; Plural: pfOne; Value: '0 miljards'), (Range: 1000000000; Plural: pfOther; Value: '0 miljardi'), (Range: 10000000000; Plural: pfZero; Value: '00 miljardi'), (Range: 10000000000; Plural: pfOne; Value: '00 miljards'), (Range: 10000000000; Plural: pfOther; Value: '00 miljardi'), (Range: 100000000000; Plural: pfZero; Value: '000 miljardi'), (Range: 100000000000; Plural: pfOne; Value: '000 miljards'), (Range: 100000000000; Plural: pfOther; Value: '000 miljardi'), (Range: 1000000000000; Plural: pfZero; Value: '0 triljoni'), (Range: 1000000000000; Plural: pfOne; Value: '0 triljons'), (Range: 1000000000000; Plural: pfOther; Value: '0 triljoni'), (Range: 10000000000000; Plural: pfZero; Value: '00 triljoni'), (Range: 10000000000000; Plural: pfOne; Value: '00 triljons'), (Range: 10000000000000; Plural: pfOther; Value: '00 triljoni'), (Range: 100000000000000; Plural: pfZero; Value: '000 triljoni'), (Range: 100000000000000; Plural: pfOne; Value: '000 triljons'), (Range: 100000000000000; Plural: pfOther; Value: '000 triljoni') ); LV_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 tūkst.'), (Range: 1000; Plural: pfOne; Value: '0 tūkst.'), (Range: 1000; Plural: pfOther; Value: '0 tūkst.'), (Range: 10000; Plural: pfZero; Value: '00 tūkst.'), (Range: 10000; Plural: pfOne; Value: '00 tūkst.'), (Range: 10000; Plural: pfOther; Value: '00 tūkst.'), (Range: 100000; Plural: pfZero; Value: '000 tūkst.'), (Range: 100000; Plural: pfOne; Value: '000 tūkst.'), (Range: 100000; Plural: pfOther; Value: '000 tūkst.'), (Range: 1000000; Plural: pfZero; Value: '0 milj.'), (Range: 1000000; Plural: pfOne; Value: '0 milj.'), (Range: 1000000; Plural: pfOther; Value: '0 milj.'), (Range: 10000000; Plural: pfZero; Value: '00 milj.'), (Range: 10000000; Plural: pfOne; Value: '00 milj.'), (Range: 10000000; Plural: pfOther; Value: '00 milj.'), (Range: 100000000; Plural: pfZero; Value: '000 milj.'), (Range: 100000000; Plural: pfOne; Value: '000 milj.'), (Range: 100000000; Plural: pfOther; Value: '000 milj.'), (Range: 1000000000; Plural: pfZero; Value: '0 mljrd.'), (Range: 1000000000; Plural: pfOne; Value: '0 mljrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 mljrd.'), (Range: 10000000000; Plural: pfZero; Value: '00 mljrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 mljrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 mljrd.'), (Range: 100000000000; Plural: pfZero; Value: '000 mljrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 mljrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 mljrd.'), (Range: 1000000000000; Plural: pfZero; Value: '0 trilj.'), (Range: 1000000000000; Plural: pfOne; Value: '0 trilj.'), (Range: 1000000000000; Plural: pfOther; Value: '0 trilj.'), (Range: 10000000000000; Plural: pfZero; Value: '00 trilj.'), (Range: 10000000000000; Plural: pfOne; Value: '00 trilj.'), (Range: 10000000000000; Plural: pfOther; Value: '00 trilj.'), (Range: 100000000000000; Plural: pfZero; Value: '000 trilj.'), (Range: 100000000000000; Plural: pfOne; Value: '000 trilj.'), (Range: 100000000000000; Plural: pfOther; Value: '000 trilj.') ); LV_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfZero; Value: '0 tūkst. ¤'), (Range: 1000; Plural: pfOne; Value: '0 tūkst. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tūkst. ¤'), (Range: 10000; Plural: pfZero; Value: '00 tūkst. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tūkst. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tūkst. ¤'), (Range: 100000; Plural: pfZero; Value: '000 tūkst. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tūkst. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tūkst. ¤'), (Range: 1000000; Plural: pfZero; Value: '0 milj. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 milj. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 milj. ¤'), (Range: 10000000; Plural: pfZero; Value: '00 milj. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 milj. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 milj. ¤'), (Range: 100000000; Plural: pfZero; Value: '000 milj. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 milj. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 milj. ¤'), (Range: 1000000000; Plural: pfZero; Value: '0 mljrd. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mljrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mljrd. ¤'), (Range: 10000000000; Plural: pfZero; Value: '¤00 mljrd.'), (Range: 10000000000; Plural: pfOne; Value: '¤00 mljrd.'), (Range: 10000000000; Plural: pfOther; Value: '¤00 mljrd.'), (Range: 100000000000; Plural: pfZero; Value: '¤000 mljrd.'), (Range: 100000000000; Plural: pfOne; Value: '¤000 mljrd.'), (Range: 100000000000; Plural: pfOther; Value: '¤000 mljrd.'), (Range: 1000000000000; Plural: pfZero; Value: '¤0 trilj.'), (Range: 1000000000000; Plural: pfOne; Value: '¤0 trilj.'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 trilj.'), (Range: 10000000000000; Plural: pfZero; Value: '¤00 trilj.'), (Range: 10000000000000; Plural: pfOne; Value: '¤00 trilj.'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 trilj.'), (Range: 100000000000000; Plural: pfZero; Value: '¤000 trilj.'), (Range: 100000000000000; Plural: pfOne; Value: '¤000 trilj.'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 trilj.') ); // Masai MAS_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Meru MER_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Morisyen MFE_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Malagasy MG_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Makhuwa-Meetto MGH_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Metaʼ MGO_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Macedonian MK_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 илјада'), (Range: 1000; Plural: pfOther; Value: '0 илјади'), (Range: 10000; Plural: pfOne; Value: '00 илјади'), (Range: 10000; Plural: pfOther; Value: '00 илјади'), (Range: 100000; Plural: pfOne; Value: '000 илјади'), (Range: 100000; Plural: pfOther; Value: '000 илјади'), (Range: 1000000; Plural: pfOne; Value: '0 милион'), (Range: 1000000; Plural: pfOther; Value: '0 милиони'), (Range: 10000000; Plural: pfOne; Value: '00 милиони'), (Range: 10000000; Plural: pfOther; Value: '00 милиони'), (Range: 100000000; Plural: pfOne; Value: '000 милиони'), (Range: 100000000; Plural: pfOther; Value: '000 милиони'), (Range: 1000000000; Plural: pfOne; Value: '0 милијарда'), (Range: 1000000000; Plural: pfOther; Value: '0 милијарди'), (Range: 10000000000; Plural: pfOne; Value: '00 милијарди'), (Range: 10000000000; Plural: pfOther; Value: '00 милијарди'), (Range: 100000000000; Plural: pfOne; Value: '000 милијарди'), (Range: 100000000000; Plural: pfOther; Value: '000 милијарди'), (Range: 1000000000000; Plural: pfOne; Value: '0 трилион'), (Range: 1000000000000; Plural: pfOther; Value: '0 трилиони'), (Range: 10000000000000; Plural: pfOne; Value: '00 трилиони'), (Range: 10000000000000; Plural: pfOther; Value: '00 трилиони'), (Range: 100000000000000; Plural: pfOne; Value: '000 трилиони'), (Range: 100000000000000; Plural: pfOther; Value: '000 трилиони') ); MK_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 илј.'), (Range: 1000; Plural: pfOther; Value: '0 илј.'), (Range: 10000; Plural: pfOne; Value: '00 илј.'), (Range: 10000; Plural: pfOther; Value: '00 илј.'), (Range: 100000; Plural: pfOne; Value: '000 илј.'), (Range: 100000; Plural: pfOther; Value: '000 илј.'), (Range: 1000000; Plural: pfOne; Value: '0 мил.'), (Range: 1000000; Plural: pfOther; Value: '0 мил.'), (Range: 10000000; Plural: pfOne; Value: '00 мил.'), (Range: 10000000; Plural: pfOther; Value: '00 мил.'), (Range: 100000000; Plural: pfOne; Value: '000 М'), (Range: 100000000; Plural: pfOther; Value: '000 М'), (Range: 1000000000; Plural: pfOne; Value: '0 милј.'), (Range: 1000000000; Plural: pfOther; Value: '0 милј.'), (Range: 10000000000; Plural: pfOne; Value: '00 милј.'), (Range: 10000000000; Plural: pfOther; Value: '00 милј.'), (Range: 100000000000; Plural: pfOne; Value: '000 мј.'), (Range: 100000000000; Plural: pfOther; Value: '000 милј.'), (Range: 1000000000000; Plural: pfOne; Value: '0 трил.'), (Range: 1000000000000; Plural: pfOther; Value: '0 трил.'), (Range: 10000000000000; Plural: pfOne; Value: '00 трил.'), (Range: 10000000000000; Plural: pfOther; Value: '00 трил.'), (Range: 100000000000000; Plural: pfOne; Value: '000 трил.'), (Range: 100000000000000; Plural: pfOther; Value: '000 трил.') ); MK_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0 илј.'), (Range: 1000; Plural: pfOther; Value: '¤ 0 илј.'), (Range: 10000; Plural: pfOne; Value: '¤ 00 илј.'), (Range: 10000; Plural: pfOther; Value: '¤ 00 илј.'), (Range: 100000; Plural: pfOne; Value: '¤ 000 илј.'), (Range: 100000; Plural: pfOther; Value: '¤ 000 илј.'), (Range: 1000000; Plural: pfOne; Value: '¤ 0 мил.'), (Range: 1000000; Plural: pfOther; Value: '¤ 0 мил.'), (Range: 10000000; Plural: pfOne; Value: '¤ 00 мил.'), (Range: 10000000; Plural: pfOther; Value: '¤ 00 мил.'), (Range: 100000000; Plural: pfOne; Value: '¤ 000 М'), (Range: 100000000; Plural: pfOther; Value: '¤ 000 М'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0 милј.'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0 милј.'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00 милј.'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00 милј.'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000 мј.'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000 милј.'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0 трил.'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0 трил.'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00 трил.'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00 трил.'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000 трил.'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000 трил.') ); // Malayalam ML_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ആയിരം'), (Range: 1000; Plural: pfOther; Value: '0 ആയിരം'), (Range: 10000; Plural: pfOne; Value: '00 ആയിരം'), (Range: 10000; Plural: pfOther; Value: '00 ആയിരം'), (Range: 100000; Plural: pfOne; Value: '000 ആയിരം'), (Range: 100000; Plural: pfOther; Value: '000 ആയിരം'), (Range: 1000000; Plural: pfOne; Value: '0 ദശലക്ഷം'), (Range: 1000000; Plural: pfOther; Value: '0 ദശലക്ഷം'), (Range: 10000000; Plural: pfOne; Value: '00 ദശലക്ഷം'), (Range: 10000000; Plural: pfOther; Value: '00 ദശലക്ഷം'), (Range: 100000000; Plural: pfOne; Value: '000 ദശലക്ഷം'), (Range: 100000000; Plural: pfOther; Value: '000 ദശലക്ഷം'), (Range: 1000000000; Plural: pfOne; Value: '0 ലക്ഷം കോടി'), (Range: 1000000000; Plural: pfOther; Value: '0 ലക്ഷം കോടി'), (Range: 10000000000; Plural: pfOne; Value: '00 ലക്ഷം കോടി'), (Range: 10000000000; Plural: pfOther; Value: '00 ലക്ഷം കോടി'), (Range: 100000000000; Plural: pfOne; Value: '000 ലക്ഷം കോടി'), (Range: 100000000000; Plural: pfOther; Value: '000 ലക്ഷം കോടി'), (Range: 1000000000000; Plural: pfOne; Value: '0 ട്രില്യൺ'), (Range: 1000000000000; Plural: pfOther; Value: '0 ട്രില്യൺ'), (Range: 10000000000000; Plural: pfOne; Value: '00 ട്രില്യൺ'), (Range: 10000000000000; Plural: pfOther; Value: '00 ട്രില്യൺ'), (Range: 100000000000000; Plural: pfOne; Value: '000 ട്രില്യൺ'), (Range: 100000000000000; Plural: pfOther; Value: '000 ട്രില്യൺ') ); ML_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); ML_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Mongolian, Cyrillic MN_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 мянга'), (Range: 1000; Plural: pfOther; Value: '0 мянга'), (Range: 10000; Plural: pfOne; Value: '00 мянга'), (Range: 10000; Plural: pfOther; Value: '00 мянга'), (Range: 100000; Plural: pfOne; Value: '000 мянга'), (Range: 100000; Plural: pfOther; Value: '000 мянга'), (Range: 1000000; Plural: pfOne; Value: '0 сая'), (Range: 1000000; Plural: pfOther; Value: '0 сая'), (Range: 10000000; Plural: pfOne; Value: '00 сая'), (Range: 10000000; Plural: pfOther; Value: '00 сая'), (Range: 100000000; Plural: pfOne; Value: '000 сая'), (Range: 100000000; Plural: pfOther; Value: '000 сая'), (Range: 1000000000; Plural: pfOne; Value: '0 тэрбум'), (Range: 1000000000; Plural: pfOther; Value: '0 тэрбум'), (Range: 10000000000; Plural: pfOne; Value: '00 тэрбум'), (Range: 10000000000; Plural: pfOther; Value: '00 тэрбум'), (Range: 100000000000; Plural: pfOne; Value: '000 тэрбум'), (Range: 100000000000; Plural: pfOther; Value: '000 тэрбум'), (Range: 1000000000000; Plural: pfOne; Value: '0 их наяд'), (Range: 1000000000000; Plural: pfOther; Value: '0 их наяд'), (Range: 10000000000000; Plural: pfOne; Value: '00 их наяд'), (Range: 10000000000000; Plural: pfOther; Value: '00 их наяд'), (Range: 100000000000000; Plural: pfOne; Value: '000 их наяд'), (Range: 100000000000000; Plural: pfOther; Value: '000 их наяд') ); MN_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0мянга'), (Range: 1000; Plural: pfOther; Value: '0мянга'), (Range: 10000; Plural: pfOne; Value: '00мянга'), (Range: 10000; Plural: pfOther; Value: '00мянга'), (Range: 100000; Plural: pfOne; Value: '000М'), (Range: 100000; Plural: pfOther; Value: '000М'), (Range: 1000000; Plural: pfOne; Value: '0сая'), (Range: 1000000; Plural: pfOther; Value: '0сая'), (Range: 10000000; Plural: pfOne; Value: '00сая'), (Range: 10000000; Plural: pfOther; Value: '00сая'), (Range: 100000000; Plural: pfOne; Value: '000сая'), (Range: 100000000; Plural: pfOther; Value: '000сая'), (Range: 1000000000; Plural: pfOne; Value: '0тэрбум'), (Range: 1000000000; Plural: pfOther; Value: '0тэрбум'), (Range: 10000000000; Plural: pfOne; Value: '00Т'), (Range: 10000000000; Plural: pfOther; Value: '00Т'), (Range: 100000000000; Plural: pfOne; Value: '000Т'), (Range: 100000000000; Plural: pfOther; Value: '000Т'), (Range: 1000000000000; Plural: pfOne; Value: '0ИН'), (Range: 1000000000000; Plural: pfOther; Value: '0ИН'), (Range: 10000000000000; Plural: pfOne; Value: '00ИН'), (Range: 10000000000000; Plural: pfOther; Value: '00ИН'), (Range: 100000000000000; Plural: pfOne; Value: '000ИН'), (Range: 100000000000000; Plural: pfOther; Value: '000ИН') ); MN_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0Мянга'), (Range: 1000; Plural: pfOther; Value: '¤ 0Мянга'), (Range: 10000; Plural: pfOne; Value: '¤ 00Мянга'), (Range: 10000; Plural: pfOther; Value: '¤ 00Мянга'), (Range: 100000; Plural: pfOne; Value: '¤ 0Мянга'), (Range: 100000; Plural: pfOther; Value: '¤ 0Мянга'), (Range: 1000000; Plural: pfOne; Value: '¤ 0Сая'), (Range: 1000000; Plural: pfOther; Value: '¤ 0Сая'), (Range: 10000000; Plural: pfOne; Value: '¤ 00Сая'), (Range: 10000000; Plural: pfOther; Value: '¤ 00Сая'), (Range: 100000000; Plural: pfOne; Value: '¤ 000Сая'), (Range: 100000000; Plural: pfOther; Value: '¤ 000Сая'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0Тэрбум'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0Тэрбум'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00Тэрбум'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00Тэрбум'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000Тэрбум'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000Тэрбум'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0ИН'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0ИН'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00ИН'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00ИН'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000ИН'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000ИН') ); // Marathi MR_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 हजार'), (Range: 1000; Plural: pfOther; Value: '0 हजार'), (Range: 10000; Plural: pfOne; Value: '00 हजार'), (Range: 10000; Plural: pfOther; Value: '00 हजार'), (Range: 100000; Plural: pfOne; Value: '0 लाख'), (Range: 100000; Plural: pfOther; Value: '0 लाख'), (Range: 1000000; Plural: pfOne; Value: '00 लाख'), (Range: 1000000; Plural: pfOther; Value: '00 लाख'), (Range: 10000000; Plural: pfOne; Value: '0 कोटी'), (Range: 10000000; Plural: pfOther; Value: '0 कोटी'), (Range: 100000000; Plural: pfOne; Value: '00 कोटी'), (Range: 100000000; Plural: pfOther; Value: '00 कोटी'), (Range: 1000000000; Plural: pfOne; Value: '0 अब्ज'), (Range: 1000000000; Plural: pfOther; Value: '0 अब्ज'), (Range: 10000000000; Plural: pfOne; Value: '00 अब्ज'), (Range: 10000000000; Plural: pfOther; Value: '00 अब्ज'), (Range: 100000000000; Plural: pfOne; Value: '0 खर्व'), (Range: 100000000000; Plural: pfOther; Value: '0 खर्व'), (Range: 1000000000000; Plural: pfOne; Value: '00 खर्व'), (Range: 1000000000000; Plural: pfOther; Value: '00 खर्व'), (Range: 10000000000000; Plural: pfOne; Value: '0 पद्म'), (Range: 10000000000000; Plural: pfOther; Value: '0 पद्म'), (Range: 100000000000000; Plural: pfOne; Value: '00 पद्म'), (Range: 100000000000000; Plural: pfOther; Value: '00 पद्म') ); MR_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ह'), (Range: 1000; Plural: pfOther; Value: '0 ह'), (Range: 10000; Plural: pfOne; Value: '00 ह'), (Range: 10000; Plural: pfOther; Value: '00 ह'), (Range: 100000; Plural: pfOne; Value: '0 लाख'), (Range: 100000; Plural: pfOther; Value: '0 लाख'), (Range: 1000000; Plural: pfOne; Value: '00 लाख'), (Range: 1000000; Plural: pfOther; Value: '00 लाख'), (Range: 10000000; Plural: pfOne; Value: '0 कोटी'), (Range: 10000000; Plural: pfOther; Value: '0 कोटी'), (Range: 100000000; Plural: pfOne; Value: '00 कोटी'), (Range: 100000000; Plural: pfOther; Value: '00 कोटी'), (Range: 1000000000; Plural: pfOne; Value: '0 अब्ज'), (Range: 1000000000; Plural: pfOther; Value: '0 अब्ज'), (Range: 10000000000; Plural: pfOne; Value: '00 अब्ज'), (Range: 10000000000; Plural: pfOther; Value: '00 अब्ज'), (Range: 100000000000; Plural: pfOne; Value: '0 खर्व'), (Range: 100000000000; Plural: pfOther; Value: '0 खर्व'), (Range: 1000000000000; Plural: pfOne; Value: '00 खर्व'), (Range: 1000000000000; Plural: pfOther; Value: '00 खर्व'), (Range: 10000000000000; Plural: pfOne; Value: '0 पद्म'), (Range: 10000000000000; Plural: pfOther; Value: '0 पद्म'), (Range: 100000000000000; Plural: pfOne; Value: '00 पद्म'), (Range: 100000000000000; Plural: pfOther; Value: '00 पद्म') ); // Malay MS_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 ribu'), (Range: 10000; Plural: pfOther; Value: '00 ribu'), (Range: 100000; Plural: pfOther; Value: '000 ribu'), (Range: 1000000; Plural: pfOther; Value: '0 juta'), (Range: 10000000; Plural: pfOther; Value: '00 juta'), (Range: 100000000; Plural: pfOther; Value: '000 juta'), (Range: 1000000000; Plural: pfOther; Value: '0 bilion'), (Range: 10000000000; Plural: pfOther; Value: '00 bilion'), (Range: 100000000000; Plural: pfOther; Value: '000 bilion'), (Range: 1000000000000; Plural: pfOther; Value: '0 trilion'), (Range: 10000000000000; Plural: pfOther; Value: '00 trilion'), (Range: 100000000000000; Plural: pfOther; Value: '000 trilion') ); MS_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOther; Value: '0J'), (Range: 10000000; Plural: pfOther; Value: '00J'), (Range: 100000000; Plural: pfOther; Value: '000J'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); MS_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0J'), (Range: 10000000; Plural: pfOther; Value: '¤00J'), (Range: 100000000; Plural: pfOther; Value: '¤000J'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Maltese MT_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfFew; Value: '¤0K'), (Range: 1000; Plural: pfMany; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfFew; Value: '¤00K'), (Range: 10000; Plural: pfMany; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfFew; Value: '¤000K'), (Range: 100000; Plural: pfMany; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfFew; Value: '¤0M'), (Range: 1000000; Plural: pfMany; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfFew; Value: '¤00M'), (Range: 10000000; Plural: pfMany; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfFew; Value: '¤000M'), (Range: 100000000; Plural: pfMany; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfFew; Value: '¤0G'), (Range: 1000000000; Plural: pfMany; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfFew; Value: '¤00G'), (Range: 10000000000; Plural: pfMany; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfFew; Value: '¤000G'), (Range: 100000000000; Plural: pfMany; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfFew; Value: '¤0T'), (Range: 1000000000000; Plural: pfMany; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfFew; Value: '¤00T'), (Range: 10000000000000; Plural: pfMany; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfFew; Value: '¤000T'), (Range: 100000000000000; Plural: pfMany; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Mundang MUA_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Burmese MY_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0ထောင်'), (Range: 10000; Plural: pfOther; Value: '0သောင်း'), (Range: 100000; Plural: pfOther; Value: '0သိန်း'), (Range: 1000000; Plural: pfOther; Value: '0သန်း'), (Range: 10000000; Plural: pfOther; Value: '0ကုဋေ'), (Range: 100000000; Plural: pfOther; Value: '00ကုဋေ'), (Range: 1000000000; Plural: pfOther; Value: 'ကုဋေ000'), (Range: 10000000000; Plural: pfOther; Value: 'ကုဋေ0000'), (Range: 100000000000; Plural: pfOther; Value: 'ကုဋေ0သောင်း'), (Range: 1000000000000; Plural: pfOther; Value: 'ကုဋေ0သိန်း'), (Range: 10000000000000; Plural: pfOther; Value: 'ကုဋေ0သန်း'), (Range: 100000000000000; Plural: pfOther; Value: '0ကောဋိ') ); MY_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0ထောင်'), (Range: 10000; Plural: pfOther; Value: '0သောင်း'), (Range: 100000; Plural: pfOther; Value: '0သိန်း'), (Range: 1000000; Plural: pfOther; Value: '0သန်း'), (Range: 10000000; Plural: pfOther; Value: '0ကုဋေ'), (Range: 100000000; Plural: pfOther; Value: '00ကုဋေ'), (Range: 1000000000; Plural: pfOther; Value: 'ကုဋေ000'), (Range: 10000000000; Plural: pfOther; Value: 'ကုဋေ0ထ'), (Range: 100000000000; Plural: pfOther; Value: 'ကုဋေ0သ'), (Range: 1000000000000; Plural: pfOther; Value: 'ဋေ0သိန်း'), (Range: 10000000000000; Plural: pfOther; Value: 'ဋေ0သန်း'), (Range: 100000000000000; Plural: pfOther; Value: '0ကောဋိ') ); MY_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0ထောင်'), (Range: 10000; Plural: pfOther; Value: '¤ 0သောင်း'), (Range: 100000; Plural: pfOther; Value: '¤ 0သိန်း'), (Range: 1000000; Plural: pfOther; Value: '¤ 0သန်း'), (Range: 10000000; Plural: pfOther; Value: '¤ 0ကုဋေ'), (Range: 100000000; Plural: pfOther; Value: '¤ 00ကုဋေ'), (Range: 1000000000; Plural: pfOther; Value: '¤ ကုဋေ000'), (Range: 10000000000; Plural: pfOther; Value: '¤ ကုဋေ0000'), (Range: 100000000000; Plural: pfOther; Value: '¤ ကုဋေ0သောင်း'), (Range: 1000000000000; Plural: pfOther; Value: '¤ ကုဋေ0သိန်း'), (Range: 10000000000000; Plural: pfOther; Value: '¤ ကုဋေ0သန်း'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 0ကောဋိ') ); // Nama NAQ_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfTwo; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfTwo; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfTwo; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfTwo; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfTwo; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfTwo; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfTwo; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfTwo; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfTwo; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfTwo; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfTwo; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfTwo; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Norwegian Bokmål NB_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tusen'), (Range: 1000; Plural: pfOther; Value: '0 tusen'), (Range: 10000; Plural: pfOne; Value: '00 tusen'), (Range: 10000; Plural: pfOther; Value: '00 tusen'), (Range: 100000; Plural: pfOne; Value: '000 tusen'), (Range: 100000; Plural: pfOther; Value: '000 tusen'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 millioner'), (Range: 10000000; Plural: pfOne; Value: '00 million'), (Range: 10000000; Plural: pfOther; Value: '00 millioner'), (Range: 100000000; Plural: pfOne; Value: '000 million'), (Range: 100000000; Plural: pfOther; Value: '000 millioner'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliarder'), (Range: 10000000000; Plural: pfOne; Value: '00 milliard'), (Range: 10000000000; Plural: pfOther; Value: '00 milliarder'), (Range: 100000000000; Plural: pfOne; Value: '000 milliard'), (Range: 100000000000; Plural: pfOther; Value: '000 milliarder'), (Range: 1000000000000; Plural: pfOne; Value: '0 billion'), (Range: 1000000000000; Plural: pfOther; Value: '0 billioner'), (Range: 10000000000000; Plural: pfOne; Value: '00 billioner'), (Range: 10000000000000; Plural: pfOther; Value: '00 billioner'), (Range: 100000000000000; Plural: pfOne; Value: '000 billioner'), (Range: 100000000000000; Plural: pfOther; Value: '000 billioner') ); NB_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0k'), (Range: 1000; Plural: pfOther; Value: '0k'), (Range: 10000; Plural: pfOne; Value: '00k'), (Range: 10000; Plural: pfOther; Value: '00k'), (Range: 100000; Plural: pfOne; Value: '000k'), (Range: 100000; Plural: pfOther; Value: '000k'), (Range: 1000000; Plural: pfOne; Value: '0 mill'), (Range: 1000000; Plural: pfOther; Value: '0 mill'), (Range: 10000000; Plural: pfOne; Value: '00 mill'), (Range: 10000000; Plural: pfOther; Value: '00 mill'), (Range: 100000000; Plural: pfOne; Value: '000 mill'), (Range: 100000000; Plural: pfOther; Value: '000 mill'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd'), (Range: 1000000000000; Plural: pfOne; Value: '0 bill'), (Range: 1000000000000; Plural: pfOther; Value: '0 bill'), (Range: 10000000000000; Plural: pfOne; Value: '00 bill'), (Range: 10000000000000; Plural: pfOther; Value: '00 bill'), (Range: 100000000000000; Plural: pfOne; Value: '000 bill'), (Range: 100000000000000; Plural: pfOther; Value: '000 bill') ); // North Ndebele ND_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Nepali NE_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 हजार'), (Range: 1000; Plural: pfOther; Value: '0 हजार'), (Range: 10000; Plural: pfOne; Value: '00 हजार'), (Range: 10000; Plural: pfOther; Value: '00 हजार'), (Range: 100000; Plural: pfOne; Value: '0 लाख'), (Range: 100000; Plural: pfOther; Value: '0 लाख'), (Range: 1000000; Plural: pfOne; Value: '0 करोड'), (Range: 1000000; Plural: pfOther; Value: '0 करोड'), (Range: 10000000; Plural: pfOne; Value: '00 करोड'), (Range: 10000000; Plural: pfOther; Value: '00 करोड'), (Range: 100000000; Plural: pfOne; Value: '000 करोड'), (Range: 100000000; Plural: pfOther; Value: '000 करोड'), (Range: 1000000000; Plural: pfOne; Value: '0 अर्ब'), (Range: 1000000000; Plural: pfOther; Value: '0 अर्ब'), (Range: 10000000000; Plural: pfOne; Value: '00 अर्ब'), (Range: 10000000000; Plural: pfOther; Value: '00 अर्ब'), (Range: 100000000000; Plural: pfOne; Value: '000 अरब'), (Range: 100000000000; Plural: pfOther; Value: '000 अरब'), (Range: 1000000000000; Plural: pfOne; Value: '0 खर्ब'), (Range: 1000000000000; Plural: pfOther; Value: '0 खर्ब'), (Range: 10000000000000; Plural: pfOne; Value: '0 शंख'), (Range: 10000000000000; Plural: pfOther; Value: '0 शंख'), (Range: 100000000000000; Plural: pfOne; Value: '00 शंख'), (Range: 100000000000000; Plural: pfOther; Value: '00 शंख') ); NE_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 हजार'), (Range: 1000; Plural: pfOther; Value: '0 हजार'), (Range: 10000; Plural: pfOne; Value: '00 हजार'), (Range: 10000; Plural: pfOther; Value: '00 हजार'), (Range: 100000; Plural: pfOne; Value: '0 लाख'), (Range: 100000; Plural: pfOther; Value: '0 लाख'), (Range: 1000000; Plural: pfOne; Value: '00 लाख'), (Range: 1000000; Plural: pfOther; Value: '00 लाख'), (Range: 10000000; Plural: pfOne; Value: '0 करोड'), (Range: 10000000; Plural: pfOther; Value: '0 करोड'), (Range: 100000000; Plural: pfOne; Value: '00 करोड'), (Range: 100000000; Plural: pfOther; Value: '00 करोड'), (Range: 1000000000; Plural: pfOne; Value: '0 अरब'), (Range: 1000000000; Plural: pfOther; Value: '0 अरब'), (Range: 10000000000; Plural: pfOne; Value: '00 अरब'), (Range: 10000000000; Plural: pfOther; Value: '00 अरब'), (Range: 100000000000; Plural: pfOne; Value: '0 खरब'), (Range: 100000000000; Plural: pfOther; Value: '0 खरब'), (Range: 1000000000000; Plural: pfOne; Value: '00 खरब'), (Range: 1000000000000; Plural: pfOther; Value: '00 खरब'), (Range: 10000000000000; Plural: pfOne; Value: '0 शंख'), (Range: 10000000000000; Plural: pfOther; Value: '0 शंख'), (Range: 100000000000000; Plural: pfOne; Value: '00 शंख'), (Range: 100000000000000; Plural: pfOther; Value: '00 शंख') ); // Dutch NL_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 duizend'), (Range: 1000; Plural: pfOther; Value: '0 duizend'), (Range: 10000; Plural: pfOne; Value: '00 duizend'), (Range: 10000; Plural: pfOther; Value: '00 duizend'), (Range: 100000; Plural: pfOne; Value: '000 duizend'), (Range: 100000; Plural: pfOther; Value: '000 duizend'), (Range: 1000000; Plural: pfOne; Value: '0 miljoen'), (Range: 1000000; Plural: pfOther; Value: '0 miljoen'), (Range: 10000000; Plural: pfOne; Value: '00 miljoen'), (Range: 10000000; Plural: pfOther; Value: '00 miljoen'), (Range: 100000000; Plural: pfOne; Value: '000 miljoen'), (Range: 100000000; Plural: pfOther; Value: '000 miljoen'), (Range: 1000000000; Plural: pfOne; Value: '0 miljard'), (Range: 1000000000; Plural: pfOther; Value: '0 miljard'), (Range: 10000000000; Plural: pfOne; Value: '00 miljard'), (Range: 10000000000; Plural: pfOther; Value: '00 miljard'), (Range: 100000000000; Plural: pfOne; Value: '000 miljard'), (Range: 100000000000; Plural: pfOther; Value: '000 miljard'), (Range: 1000000000000; Plural: pfOne; Value: '0 biljoen'), (Range: 1000000000000; Plural: pfOther; Value: '0 biljoen'), (Range: 10000000000000; Plural: pfOne; Value: '00 biljoen'), (Range: 10000000000000; Plural: pfOther; Value: '00 biljoen'), (Range: 100000000000000; Plural: pfOne; Value: '000 biljoen'), (Range: 100000000000000; Plural: pfOther; Value: '000 biljoen') ); NL_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0 mln.'), (Range: 1000000; Plural: pfOther; Value: '0 mln.'), (Range: 10000000; Plural: pfOne; Value: '00 mln.'), (Range: 10000000; Plural: pfOther; Value: '00 mln.'), (Range: 100000000; Plural: pfOne; Value: '000 mln.'), (Range: 100000000; Plural: pfOther; Value: '000 mln.'), (Range: 1000000000; Plural: pfOne; Value: '0 mld.'), (Range: 1000000000; Plural: pfOther; Value: '0 mld.'), (Range: 10000000000; Plural: pfOne; Value: '00 mld.'), (Range: 10000000000; Plural: pfOther; Value: '00 mld.'), (Range: 100000000000; Plural: pfOne; Value: '000 mld.'), (Range: 100000000000; Plural: pfOther; Value: '000 mld.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bln.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bln.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bln.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bln.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bln.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bln.') ); // Kwasio NMG_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Norwegian Nynorsk NN_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tusen'), (Range: 1000; Plural: pfOther; Value: '0 tusen'), (Range: 10000; Plural: pfOne; Value: '00 tusen'), (Range: 10000; Plural: pfOther; Value: '00 tusen'), (Range: 100000; Plural: pfOne; Value: '000 tusen'), (Range: 100000; Plural: pfOther; Value: '000 tusen'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 millioner'), (Range: 10000000; Plural: pfOne; Value: '00 million'), (Range: 10000000; Plural: pfOther; Value: '00 millioner'), (Range: 100000000; Plural: pfOne; Value: '000 million'), (Range: 100000000; Plural: pfOther; Value: '000 millioner'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliarder'), (Range: 10000000000; Plural: pfOne; Value: '00 milliard'), (Range: 10000000000; Plural: pfOther; Value: '00 milliarder'), (Range: 100000000000; Plural: pfOne; Value: '000 milliard'), (Range: 100000000000; Plural: pfOther; Value: '000 milliarder'), (Range: 1000000000000; Plural: pfOne; Value: '0 billion'), (Range: 1000000000000; Plural: pfOther; Value: '0 billioner'), (Range: 10000000000000; Plural: pfOne; Value: '00 billion'), (Range: 10000000000000; Plural: pfOther; Value: '00 billioner'), (Range: 100000000000000; Plural: pfOne; Value: '000 billion'), (Range: 100000000000000; Plural: pfOther; Value: '000 billioner') ); NN_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tn'), (Range: 1000; Plural: pfOther; Value: '0 tn'), (Range: 10000; Plural: pfOne; Value: '00 tn'), (Range: 10000; Plural: pfOther; Value: '00 tn'), (Range: 100000; Plural: pfOne; Value: '000 tn'), (Range: 100000; Plural: pfOther; Value: '000 tn'), (Range: 1000000; Plural: pfOne; Value: '0 mn'), (Range: 1000000; Plural: pfOther; Value: '0 mn'), (Range: 10000000; Plural: pfOne; Value: '00 mn'), (Range: 10000000; Plural: pfOther; Value: '00 mn'), (Range: 100000000; Plural: pfOne; Value: '000 mn'), (Range: 100000000; Plural: pfOther; Value: '000 mn'), (Range: 1000000000; Plural: pfOne; Value: '0 md'), (Range: 1000000000; Plural: pfOther; Value: '0 md'), (Range: 10000000000; Plural: pfOne; Value: '00 md'), (Range: 10000000000; Plural: pfOther; Value: '00 md'), (Range: 100000000000; Plural: pfOne; Value: '000 md'), (Range: 100000000000; Plural: pfOther; Value: '000 md'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn') ); NN_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tn ¤'), (Range: 1000; Plural: pfOther; Value: '0 tn ¤'), (Range: 10000; Plural: pfOne; Value: '00 tn ¤'), (Range: 10000; Plural: pfOther; Value: '00 tn ¤'), (Range: 100000; Plural: pfOne; Value: '000 tn ¤'), (Range: 100000; Plural: pfOther; Value: '000 tn ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mn ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mn ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mn ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mn ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mn ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mn ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 md ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 md ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 md ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 md ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 md ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 md ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn ¤') ); // Ngiemboon NNH_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Nuer NUS_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Nyankole NYN_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Oromo OM_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Odia OR_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Ossetic OS_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Punjabi PA_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ਹਜ਼ਾਰ'), (Range: 1000; Plural: pfOther; Value: '0 ਹਜ਼ਾਰ'), (Range: 10000; Plural: pfOne; Value: '00 ਹਜ਼ਾਰ'), (Range: 10000; Plural: pfOther; Value: '00 ਹਜ਼ਾਰ'), (Range: 100000; Plural: pfOne; Value: '0 ਲੱਖ'), (Range: 100000; Plural: pfOther; Value: '0 ਲੱਖ'), (Range: 1000000; Plural: pfOne; Value: '00 ਲੱਖ'), (Range: 1000000; Plural: pfOther; Value: '00 ਲੱਖ'), (Range: 10000000; Plural: pfOne; Value: '0 ਕਰੋੜ'), (Range: 10000000; Plural: pfOther; Value: '0 ਕਰੋੜ'), (Range: 100000000; Plural: pfOne; Value: '00 ਕਰੋੜ'), (Range: 100000000; Plural: pfOther; Value: '00 ਕਰੋੜ'), (Range: 1000000000; Plural: pfOne; Value: '0 ਅਰਬ'), (Range: 1000000000; Plural: pfOther; Value: '0 ਅਰਬ'), (Range: 10000000000; Plural: pfOne; Value: '00 ਅਰਬ'), (Range: 10000000000; Plural: pfOther; Value: '00 ਅਰਬ'), (Range: 100000000000; Plural: pfOne; Value: '0 ਖਰਬ'), (Range: 100000000000; Plural: pfOther; Value: '0 ਖਰਬ'), (Range: 1000000000000; Plural: pfOne; Value: '00 ਖਰਬ'), (Range: 1000000000000; Plural: pfOther; Value: '00 ਖਰਬ'), (Range: 10000000000000; Plural: pfOne; Value: '0 ਨੀਲ'), (Range: 10000000000000; Plural: pfOther; Value: '0 ਨੀਲ'), (Range: 100000000000000; Plural: pfOne; Value: '00 ਨੀਲ'), (Range: 100000000000000; Plural: pfOther; Value: '00 ਨੀਲ') ); PA_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ਹਜ਼ਾਰ'), (Range: 1000; Plural: pfOther; Value: '0 ਹਜ਼ਾਰ'), (Range: 10000; Plural: pfOne; Value: '00 ਹਜ਼ਾਰ'), (Range: 10000; Plural: pfOther; Value: '00 ਹਜ਼ਾਰ'), (Range: 100000; Plural: pfOne; Value: '0 ਲੱਖ'), (Range: 100000; Plural: pfOther; Value: '0 ਲੱਖ'), (Range: 1000000; Plural: pfOne; Value: '00 ਲੱਖ'), (Range: 1000000; Plural: pfOther; Value: '00 ਲੱਖ'), (Range: 10000000; Plural: pfOne; Value: '0 ਕਰੋੜ'), (Range: 10000000; Plural: pfOther; Value: '0 ਕਰੋੜ'), (Range: 100000000; Plural: pfOne; Value: '00 ਕਰੋੜ'), (Range: 100000000; Plural: pfOther; Value: '00 ਕਰੋੜ'), (Range: 1000000000; Plural: pfOne; Value: '0 ਅਰਬ'), (Range: 1000000000; Plural: pfOther; Value: '0 ਅਰਬ'), (Range: 10000000000; Plural: pfOne; Value: '00 ਅਰਬ'), (Range: 10000000000; Plural: pfOther; Value: '00 ਅਰਬ'), (Range: 100000000000; Plural: pfOne; Value: '0 ਖਰਬ'), (Range: 100000000000; Plural: pfOther; Value: '0 ਖਰਬ'), (Range: 1000000000000; Plural: pfOne; Value: '00 ਖਰਬ'), (Range: 1000000000000; Plural: pfOther; Value: '00 ਖਰਬ'), (Range: 10000000000000; Plural: pfOne; Value: '0 ਨੀਲ'), (Range: 10000000000000; Plural: pfOther; Value: '0 ਨੀਲ'), (Range: 100000000000000; Plural: pfOne; Value: '00 ਨੀਲ'), (Range: 100000000000000; Plural: pfOther; Value: '00 ਨੀਲ') ); // Punjabi PA_ARAB_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Polish PL_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tysiąc'), (Range: 1000; Plural: pfFew; Value: '0 tysiące'), (Range: 1000; Plural: pfMany; Value: '0 tysięcy'), (Range: 1000; Plural: pfOther; Value: '0 tysiąca'), (Range: 10000; Plural: pfOne; Value: '00 tysiąc'), (Range: 10000; Plural: pfFew; Value: '00 tysiące'), (Range: 10000; Plural: pfMany; Value: '00 tysięcy'), (Range: 10000; Plural: pfOther; Value: '00 tysiąca'), (Range: 100000; Plural: pfOne; Value: '000 tysiąc'), (Range: 100000; Plural: pfFew; Value: '000 tysiące'), (Range: 100000; Plural: pfMany; Value: '000 tysięcy'), (Range: 100000; Plural: pfOther; Value: '000 tysiąca'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfFew; Value: '0 miliony'), (Range: 1000000; Plural: pfMany; Value: '0 milionów'), (Range: 1000000; Plural: pfOther; Value: '0 miliona'), (Range: 10000000; Plural: pfOne; Value: '00 milion'), (Range: 10000000; Plural: pfFew; Value: '00 miliony'), (Range: 10000000; Plural: pfMany; Value: '00 milionów'), (Range: 10000000; Plural: pfOther; Value: '00 miliona'), (Range: 100000000; Plural: pfOne; Value: '000 milion'), (Range: 100000000; Plural: pfFew; Value: '000 miliony'), (Range: 100000000; Plural: pfMany; Value: '000 milionów'), (Range: 100000000; Plural: pfOther; Value: '000 miliona'), (Range: 1000000000; Plural: pfOne; Value: '0 miliard'), (Range: 1000000000; Plural: pfFew; Value: '0 miliardy'), (Range: 1000000000; Plural: pfMany; Value: '0 miliardów'), (Range: 1000000000; Plural: pfOther; Value: '0 miliarda'), (Range: 10000000000; Plural: pfOne; Value: '00 miliard'), (Range: 10000000000; Plural: pfFew; Value: '00 miliardy'), (Range: 10000000000; Plural: pfMany; Value: '00 miliardów'), (Range: 10000000000; Plural: pfOther; Value: '00 miliarda'), (Range: 100000000000; Plural: pfOne; Value: '000 miliard'), (Range: 100000000000; Plural: pfFew; Value: '000 miliardy'), (Range: 100000000000; Plural: pfMany; Value: '000 miliardów'), (Range: 100000000000; Plural: pfOther; Value: '000 miliarda'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilion'), (Range: 1000000000000; Plural: pfFew; Value: '0 biliony'), (Range: 1000000000000; Plural: pfMany; Value: '0 bilionów'), (Range: 1000000000000; Plural: pfOther; Value: '0 biliona'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilion'), (Range: 10000000000000; Plural: pfFew; Value: '00 biliony'), (Range: 10000000000000; Plural: pfMany; Value: '00 bilionów'), (Range: 10000000000000; Plural: pfOther; Value: '00 biliona'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilion'), (Range: 100000000000000; Plural: pfFew; Value: '000 biliony'), (Range: 100000000000000; Plural: pfMany; Value: '000 bilionów'), (Range: 100000000000000; Plural: pfOther; Value: '000 biliona') ); PL_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tys.'), (Range: 1000; Plural: pfFew; Value: '0 tys.'), (Range: 1000; Plural: pfMany; Value: '0 tys.'), (Range: 1000; Plural: pfOther; Value: '0 tys.'), (Range: 10000; Plural: pfOne; Value: '00 tys.'), (Range: 10000; Plural: pfFew; Value: '00 tys.'), (Range: 10000; Plural: pfMany; Value: '00 tys.'), (Range: 10000; Plural: pfOther; Value: '00 tys.'), (Range: 100000; Plural: pfOne; Value: '000 tys.'), (Range: 100000; Plural: pfFew; Value: '000 tys.'), (Range: 100000; Plural: pfMany; Value: '000 tys.'), (Range: 100000; Plural: pfOther; Value: '000 tys.'), (Range: 1000000; Plural: pfOne; Value: '0 mln'), (Range: 1000000; Plural: pfFew; Value: '0 mln'), (Range: 1000000; Plural: pfMany; Value: '0 mln'), (Range: 1000000; Plural: pfOther; Value: '0 mln'), (Range: 10000000; Plural: pfOne; Value: '00 mln'), (Range: 10000000; Plural: pfFew; Value: '00 mln'), (Range: 10000000; Plural: pfMany; Value: '00 mln'), (Range: 10000000; Plural: pfOther; Value: '00 mln'), (Range: 100000000; Plural: pfOne; Value: '000 mln'), (Range: 100000000; Plural: pfFew; Value: '000 mln'), (Range: 100000000; Plural: pfMany; Value: '000 mln'), (Range: 100000000; Plural: pfOther; Value: '000 mln'), (Range: 1000000000; Plural: pfOne; Value: '0 mld'), (Range: 1000000000; Plural: pfFew; Value: '0 mld'), (Range: 1000000000; Plural: pfMany; Value: '0 mld'), (Range: 1000000000; Plural: pfOther; Value: '0 mld'), (Range: 10000000000; Plural: pfOne; Value: '00 mld'), (Range: 10000000000; Plural: pfFew; Value: '00 mld'), (Range: 10000000000; Plural: pfMany; Value: '00 mld'), (Range: 10000000000; Plural: pfOther; Value: '00 mld'), (Range: 100000000000; Plural: pfOne; Value: '000 mld'), (Range: 100000000000; Plural: pfFew; Value: '000 mld'), (Range: 100000000000; Plural: pfMany; Value: '000 mld'), (Range: 100000000000; Plural: pfOther; Value: '000 mld'), (Range: 1000000000000; Plural: pfOne; Value: '0 bln'), (Range: 1000000000000; Plural: pfFew; Value: '0 bln'), (Range: 1000000000000; Plural: pfMany; Value: '0 bln'), (Range: 1000000000000; Plural: pfOther; Value: '0 bln'), (Range: 10000000000000; Plural: pfOne; Value: '00 bln'), (Range: 10000000000000; Plural: pfFew; Value: '00 bln'), (Range: 10000000000000; Plural: pfMany; Value: '00 bln'), (Range: 10000000000000; Plural: pfOther; Value: '00 bln'), (Range: 100000000000000; Plural: pfOne; Value: '000 bln'), (Range: 100000000000000; Plural: pfFew; Value: '000 bln'), (Range: 100000000000000; Plural: pfMany; Value: '000 bln'), (Range: 100000000000000; Plural: pfOther; Value: '000 bln') ); PL_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tys. ¤'), (Range: 1000; Plural: pfFew; Value: '0 tys. ¤'), (Range: 1000; Plural: pfMany; Value: '0 tys. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tys. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tys. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tys. ¤'), (Range: 10000; Plural: pfMany; Value: '00 tys. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tys. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tys. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tys. ¤'), (Range: 100000; Plural: pfMany; Value: '000 tys. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tys. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mln ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mln ¤'), (Range: 1000000; Plural: pfMany; Value: '0 mln ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mln ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mln ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mln ¤'), (Range: 10000000; Plural: pfMany; Value: '00 mln ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mln ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mln ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mln ¤'), (Range: 100000000; Plural: pfMany; Value: '000 mln ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mln ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mld ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mld ¤'), (Range: 1000000000; Plural: pfMany; Value: '0 mld ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mld ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mld ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mld ¤'), (Range: 10000000000; Plural: pfMany; Value: '00 mld ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mld ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mld ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mld ¤'), (Range: 100000000000; Plural: pfMany; Value: '000 mld ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mld ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bln ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bln ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0 bln ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bln ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bln ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bln ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00 bln ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bln ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bln ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bln ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000 bln ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bln ¤') ); // Portuguese PT_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mil'), (Range: 1000; Plural: pfOther; Value: '0 mil'), (Range: 10000; Plural: pfOne; Value: '00 mil'), (Range: 10000; Plural: pfOther; Value: '00 mil'), (Range: 100000; Plural: pfOne; Value: '000 mil'), (Range: 100000; Plural: pfOther; Value: '000 mil'), (Range: 1000000; Plural: pfOne; Value: '0 milhão'), (Range: 1000000; Plural: pfOther; Value: '0 milhões'), (Range: 10000000; Plural: pfOne; Value: '00 milhão'), (Range: 10000000; Plural: pfOther; Value: '00 milhões'), (Range: 100000000; Plural: pfOne; Value: '000 milhão'), (Range: 100000000; Plural: pfOther; Value: '000 milhões'), (Range: 1000000000; Plural: pfOne; Value: '0 bilhão'), (Range: 1000000000; Plural: pfOther; Value: '0 bilhões'), (Range: 10000000000; Plural: pfOne; Value: '00 bilhão'), (Range: 10000000000; Plural: pfOther; Value: '00 bilhões'), (Range: 100000000000; Plural: pfOne; Value: '000 bilhão'), (Range: 100000000000; Plural: pfOther; Value: '000 bilhões'), (Range: 1000000000000; Plural: pfOne; Value: '0 trilhão'), (Range: 1000000000000; Plural: pfOther; Value: '0 trilhões'), (Range: 10000000000000; Plural: pfOne; Value: '00 trilhão'), (Range: 10000000000000; Plural: pfOther; Value: '00 trilhões'), (Range: 100000000000000; Plural: pfOne; Value: '000 trilhão'), (Range: 100000000000000; Plural: pfOther; Value: '000 trilhões') ); PT_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mil'), (Range: 1000; Plural: pfOther; Value: '0 mil'), (Range: 10000; Plural: pfOne; Value: '00 mil'), (Range: 10000; Plural: pfOther; Value: '00 mil'), (Range: 100000; Plural: pfOne; Value: '000 mil'), (Range: 100000; Plural: pfOther; Value: '000 mil'), (Range: 1000000; Plural: pfOne; Value: '0 mi'), (Range: 1000000; Plural: pfOther; Value: '0 mi'), (Range: 10000000; Plural: pfOne; Value: '00 mi'), (Range: 10000000; Plural: pfOther; Value: '00 mi'), (Range: 100000000; Plural: pfOne; Value: '000 mi'), (Range: 100000000; Plural: pfOther; Value: '000 mi'), (Range: 1000000000; Plural: pfOne; Value: '0 bi'), (Range: 1000000000; Plural: pfOther; Value: '0 bi'), (Range: 10000000000; Plural: pfOne; Value: '00 bi'), (Range: 10000000000; Plural: pfOther; Value: '00 bi'), (Range: 100000000000; Plural: pfOne; Value: '000 bi'), (Range: 100000000000; Plural: pfOther; Value: '000 bi'), (Range: 1000000000000; Plural: pfOne; Value: '0 tri'), (Range: 1000000000000; Plural: pfOther; Value: '0 tri'), (Range: 10000000000000; Plural: pfOne; Value: '00 tri'), (Range: 10000000000000; Plural: pfOther; Value: '00 tri'), (Range: 100000000000000; Plural: pfOne; Value: '000 tri'), (Range: 100000000000000; Plural: pfOther; Value: '000 tri') ); PT_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0 mil'), (Range: 1000; Plural: pfOther; Value: '¤0 mil'), (Range: 10000; Plural: pfOne; Value: '¤00 mil'), (Range: 10000; Plural: pfOther; Value: '¤00 mil'), (Range: 100000; Plural: pfOne; Value: '¤000 mil'), (Range: 100000; Plural: pfOther; Value: '¤000 mil'), (Range: 1000000; Plural: pfOne; Value: '¤0 mi'), (Range: 1000000; Plural: pfOther; Value: '¤0 mi'), (Range: 10000000; Plural: pfOne; Value: '¤00 mi'), (Range: 10000000; Plural: pfOther; Value: '¤00 mi'), (Range: 100000000; Plural: pfOne; Value: '¤000 mi'), (Range: 100000000; Plural: pfOther; Value: '¤000 mi'), (Range: 1000000000; Plural: pfOne; Value: '¤0 bi'), (Range: 1000000000; Plural: pfOther; Value: '¤0 bi'), (Range: 10000000000; Plural: pfOne; Value: '¤00 bi'), (Range: 10000000000; Plural: pfOther; Value: '¤00 bi'), (Range: 100000000000; Plural: pfOne; Value: '¤000 bi'), (Range: 100000000000; Plural: pfOther; Value: '¤000 bi'), (Range: 1000000000000; Plural: pfOne; Value: '¤0 tri'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 tri'), (Range: 10000000000000; Plural: pfOne; Value: '¤00 tri'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 tri'), (Range: 100000000000000; Plural: pfOne; Value: '¤000 tri'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 tri') ); // QU_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Romansh RM_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Rundi RN_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Romanian RO_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mie'), (Range: 1000; Plural: pfFew; Value: '0 mii'), (Range: 1000; Plural: pfOther; Value: '0 de mii'), (Range: 10000; Plural: pfOne; Value: '00 mie'), (Range: 10000; Plural: pfFew; Value: '00 mii'), (Range: 10000; Plural: pfOther; Value: '00 de mii'), (Range: 100000; Plural: pfOne; Value: '000 mie'), (Range: 100000; Plural: pfFew; Value: '000 mii'), (Range: 100000; Plural: pfOther; Value: '000 de mii'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfFew; Value: '0 milioane'), (Range: 1000000; Plural: pfOther; Value: '0 de milioane'), (Range: 10000000; Plural: pfOne; Value: '00 milion'), (Range: 10000000; Plural: pfFew; Value: '00 milioane'), (Range: 10000000; Plural: pfOther; Value: '00 de milioane'), (Range: 100000000; Plural: pfOne; Value: '000 milion'), (Range: 100000000; Plural: pfFew; Value: '000 milioane'), (Range: 100000000; Plural: pfOther; Value: '000 de milioane'), (Range: 1000000000; Plural: pfOne; Value: '0 miliard'), (Range: 1000000000; Plural: pfFew; Value: '0 miliarde'), (Range: 1000000000; Plural: pfOther; Value: '0 de miliarde'), (Range: 10000000000; Plural: pfOne; Value: '00 miliard'), (Range: 10000000000; Plural: pfFew; Value: '00 miliarde'), (Range: 10000000000; Plural: pfOther; Value: '00 de miliarde'), (Range: 100000000000; Plural: pfOne; Value: '000 miliard'), (Range: 100000000000; Plural: pfFew; Value: '000 miliarde'), (Range: 100000000000; Plural: pfOther; Value: '000 de miliarde'), (Range: 1000000000000; Plural: pfOne; Value: '0 trilion'), (Range: 1000000000000; Plural: pfFew; Value: '0 trilioane'), (Range: 1000000000000; Plural: pfOther; Value: '0 de trilioane'), (Range: 10000000000000; Plural: pfOne; Value: '00 trilion'), (Range: 10000000000000; Plural: pfFew; Value: '00 trilioane'), (Range: 10000000000000; Plural: pfOther; Value: '00 de trilioane'), (Range: 100000000000000; Plural: pfOne; Value: '000 trilion'), (Range: 100000000000000; Plural: pfFew; Value: '000 trilioane'), (Range: 100000000000000; Plural: pfOther; Value: '000 de trilioane') ); RO_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 K'), (Range: 1000; Plural: pfFew; Value: '0 K'), (Range: 1000; Plural: pfOther; Value: '0 K'), (Range: 10000; Plural: pfOne; Value: '00 K'), (Range: 10000; Plural: pfFew; Value: '00 K'), (Range: 10000; Plural: pfOther; Value: '00 K'), (Range: 100000; Plural: pfOne; Value: '000 K'), (Range: 100000; Plural: pfFew; Value: '000 K'), (Range: 100000; Plural: pfOther; Value: '000 K'), (Range: 1000000; Plural: pfOne; Value: '0 mil.'), (Range: 1000000; Plural: pfFew; Value: '0 mil.'), (Range: 1000000; Plural: pfOther; Value: '0 mil.'), (Range: 10000000; Plural: pfOne; Value: '00 mil.'), (Range: 10000000; Plural: pfFew; Value: '00 mil.'), (Range: 10000000; Plural: pfOther; Value: '00 mil.'), (Range: 100000000; Plural: pfOne; Value: '000 mil.'), (Range: 100000000; Plural: pfFew; Value: '000 mil.'), (Range: 100000000; Plural: pfOther; Value: '000 mil.'), (Range: 1000000000; Plural: pfOne; Value: '0 mld.'), (Range: 1000000000; Plural: pfFew; Value: '0 mld.'), (Range: 1000000000; Plural: pfOther; Value: '0 mld.'), (Range: 10000000000; Plural: pfOne; Value: '00 mld.'), (Range: 10000000000; Plural: pfFew; Value: '00 mld.'), (Range: 10000000000; Plural: pfOther; Value: '00 mld.'), (Range: 100000000000; Plural: pfOne; Value: '000 mld.'), (Range: 100000000000; Plural: pfFew; Value: '000 mld.'), (Range: 100000000000; Plural: pfOther; Value: '000 mld.'), (Range: 1000000000000; Plural: pfOne; Value: '0 tril.'), (Range: 1000000000000; Plural: pfFew; Value: '0 tril.'), (Range: 1000000000000; Plural: pfOther; Value: '0 tril.'), (Range: 10000000000000; Plural: pfOne; Value: '00 tril.'), (Range: 10000000000000; Plural: pfFew; Value: '00 tril.'), (Range: 10000000000000; Plural: pfOther; Value: '00 tril.'), (Range: 100000000000000; Plural: pfOne; Value: '000 tril.'), (Range: 100000000000000; Plural: pfFew; Value: '000 tril.'), (Range: 100000000000000; Plural: pfOther; Value: '000 tril.') ); RO_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mie ¤'), (Range: 1000; Plural: pfFew; Value: '0 mii ¤'), (Range: 1000; Plural: pfOther; Value: '0 mii ¤'), (Range: 10000; Plural: pfOne; Value: '00 mii ¤'), (Range: 10000; Plural: pfFew; Value: '00 mii ¤'), (Range: 10000; Plural: pfOther; Value: '00 mii ¤'), (Range: 100000; Plural: pfOne; Value: '000 mii ¤'), (Range: 100000; Plural: pfFew; Value: '000 mii ¤'), (Range: 100000; Plural: pfOther; Value: '000 mii ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mil. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mil. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mil. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mld. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mld. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mld. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 tril. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 tril. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 tril. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 tril. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 tril. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 tril. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 tril. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 tril. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 tril. ¤') ); // Rombo ROF_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // ROOT_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOther; Value: '0G'), (Range: 10000000000; Plural: pfOther; Value: '00G'), (Range: 100000000000; Plural: pfOther; Value: '000G'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); // Russian RU_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тысяча'), (Range: 1000; Plural: pfFew; Value: '0 тысячи'), (Range: 1000; Plural: pfMany; Value: '0 тысяч'), (Range: 1000; Plural: pfOther; Value: '0 тысячи'), (Range: 10000; Plural: pfOne; Value: '00 тысяча'), (Range: 10000; Plural: pfFew; Value: '00 тысячи'), (Range: 10000; Plural: pfMany; Value: '00 тысяч'), (Range: 10000; Plural: pfOther; Value: '00 тысячи'), (Range: 100000; Plural: pfOne; Value: '000 тысяча'), (Range: 100000; Plural: pfFew; Value: '000 тысячи'), (Range: 100000; Plural: pfMany; Value: '000 тысяч'), (Range: 100000; Plural: pfOther; Value: '000 тысячи'), (Range: 1000000; Plural: pfOne; Value: '0 миллион'), (Range: 1000000; Plural: pfFew; Value: '0 миллиона'), (Range: 1000000; Plural: pfMany; Value: '0 миллионов'), (Range: 1000000; Plural: pfOther; Value: '0 миллиона'), (Range: 10000000; Plural: pfOne; Value: '00 миллион'), (Range: 10000000; Plural: pfFew; Value: '00 миллиона'), (Range: 10000000; Plural: pfMany; Value: '00 миллионов'), (Range: 10000000; Plural: pfOther; Value: '00 миллиона'), (Range: 100000000; Plural: pfOne; Value: '000 миллион'), (Range: 100000000; Plural: pfFew; Value: '000 миллиона'), (Range: 100000000; Plural: pfMany; Value: '000 миллионов'), (Range: 100000000; Plural: pfOther; Value: '000 миллиона'), (Range: 1000000000; Plural: pfOne; Value: '0 миллиард'), (Range: 1000000000; Plural: pfFew; Value: '0 миллиарда'), (Range: 1000000000; Plural: pfMany; Value: '0 миллиардов'), (Range: 1000000000; Plural: pfOther; Value: '0 миллиарда'), (Range: 10000000000; Plural: pfOne; Value: '00 миллиард'), (Range: 10000000000; Plural: pfFew; Value: '00 миллиарда'), (Range: 10000000000; Plural: pfMany; Value: '00 миллиардов'), (Range: 10000000000; Plural: pfOther; Value: '00 миллиарда'), (Range: 100000000000; Plural: pfOne; Value: '000 миллиард'), (Range: 100000000000; Plural: pfFew; Value: '000 миллиарда'), (Range: 100000000000; Plural: pfMany; Value: '000 миллиардов'), (Range: 100000000000; Plural: pfOther; Value: '000 миллиарда'), (Range: 1000000000000; Plural: pfOne; Value: '0 триллион'), (Range: 1000000000000; Plural: pfFew; Value: '0 триллиона'), (Range: 1000000000000; Plural: pfMany; Value: '0 триллионов'), (Range: 1000000000000; Plural: pfOther; Value: '0 триллиона'), (Range: 10000000000000; Plural: pfOne; Value: '00 триллион'), (Range: 10000000000000; Plural: pfFew; Value: '00 триллиона'), (Range: 10000000000000; Plural: pfMany; Value: '00 триллионов'), (Range: 10000000000000; Plural: pfOther; Value: '00 триллиона'), (Range: 100000000000000; Plural: pfOne; Value: '000 триллион'), (Range: 100000000000000; Plural: pfFew; Value: '000 триллиона'), (Range: 100000000000000; Plural: pfMany; Value: '000 триллионов'), (Range: 100000000000000; Plural: pfOther; Value: '000 триллиона') ); RU_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тыс.'), (Range: 1000; Plural: pfFew; Value: '0 тыс.'), (Range: 1000; Plural: pfMany; Value: '0 тыс.'), (Range: 1000; Plural: pfOther; Value: '0 тыс.'), (Range: 10000; Plural: pfOne; Value: '00 тыс.'), (Range: 10000; Plural: pfFew; Value: '00 тыс.'), (Range: 10000; Plural: pfMany; Value: '00 тыс.'), (Range: 10000; Plural: pfOther; Value: '00 тыс.'), (Range: 100000; Plural: pfOne; Value: '000 тыс.'), (Range: 100000; Plural: pfFew; Value: '000 тыс.'), (Range: 100000; Plural: pfMany; Value: '000 тыс.'), (Range: 100000; Plural: pfOther; Value: '000 тыс.'), (Range: 1000000; Plural: pfOne; Value: '0 млн'), (Range: 1000000; Plural: pfFew; Value: '0 млн'), (Range: 1000000; Plural: pfMany; Value: '0 млн'), (Range: 1000000; Plural: pfOther; Value: '0 млн'), (Range: 10000000; Plural: pfOne; Value: '00 млн'), (Range: 10000000; Plural: pfFew; Value: '00 млн'), (Range: 10000000; Plural: pfMany; Value: '00 млн'), (Range: 10000000; Plural: pfOther; Value: '00 млн'), (Range: 100000000; Plural: pfOne; Value: '000 млн'), (Range: 100000000; Plural: pfFew; Value: '000 млн'), (Range: 100000000; Plural: pfMany; Value: '000 млн'), (Range: 100000000; Plural: pfOther; Value: '000 млн'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд'), (Range: 1000000000; Plural: pfMany; Value: '0 млрд'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд'), (Range: 10000000000; Plural: pfMany; Value: '00 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд'), (Range: 100000000000; Plural: pfMany; Value: '000 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн'), (Range: 1000000000000; Plural: pfFew; Value: '0 трлн'), (Range: 1000000000000; Plural: pfMany; Value: '0 трлн'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн'), (Range: 10000000000000; Plural: pfFew; Value: '00 трлн'), (Range: 10000000000000; Plural: pfMany; Value: '00 трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн'), (Range: 100000000000000; Plural: pfFew; Value: '000 трлн'), (Range: 100000000000000; Plural: pfMany; Value: '000 трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн') ); RU_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тыс. ¤'), (Range: 1000; Plural: pfFew; Value: '0 тыс. ¤'), (Range: 1000; Plural: pfMany; Value: '0 тыс. ¤'), (Range: 1000; Plural: pfOther; Value: '0 тыс. ¤'), (Range: 10000; Plural: pfOne; Value: '00 тыс. ¤'), (Range: 10000; Plural: pfFew; Value: '00 тыс. ¤'), (Range: 10000; Plural: pfMany; Value: '00 тыс. ¤'), (Range: 10000; Plural: pfOther; Value: '00 тыс. ¤'), (Range: 100000; Plural: pfOne; Value: '000 тыс. ¤'), (Range: 100000; Plural: pfFew; Value: '000 тыс. ¤'), (Range: 100000; Plural: pfMany; Value: '000 тыс. ¤'), (Range: 100000; Plural: pfOther; Value: '000 тыс. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 млн ¤'), (Range: 1000000; Plural: pfFew; Value: '0 млн ¤'), (Range: 1000000; Plural: pfMany; Value: '0 млн ¤'), (Range: 1000000; Plural: pfOther; Value: '0 млн ¤'), (Range: 10000000; Plural: pfOne; Value: '00 млн ¤'), (Range: 10000000; Plural: pfFew; Value: '00 млн ¤'), (Range: 10000000; Plural: pfMany; Value: '00 млн ¤'), (Range: 10000000; Plural: pfOther; Value: '00 млн ¤'), (Range: 100000000; Plural: pfOne; Value: '000 млн ¤'), (Range: 100000000; Plural: pfFew; Value: '000 млн ¤'), (Range: 100000000; Plural: pfMany; Value: '000 млн ¤'), (Range: 100000000; Plural: pfOther; Value: '000 млн ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfMany; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfMany; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfMany; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн ¤') ); // Kinyarwanda RW_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Rwa RWK_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Sakha SAH_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 тыһыынча'), (Range: 10000; Plural: pfOther; Value: '00 тыһыынча'), (Range: 100000; Plural: pfOther; Value: '000 тыһыынча'), (Range: 1000000; Plural: pfOther; Value: '0 мөлүйүөн'), (Range: 10000000; Plural: pfOther; Value: '00 мөлүйүөн'), (Range: 100000000; Plural: pfOther; Value: '000 мөлүйүөн'), (Range: 1000000000; Plural: pfOther; Value: '0 миллиард'), (Range: 10000000000; Plural: pfOther; Value: '00 миллиард'), (Range: 100000000000; Plural: pfOther; Value: '000 миллиард'), (Range: 1000000000000; Plural: pfOther; Value: '0 триллион'), (Range: 10000000000000; Plural: pfOther; Value: '00 триллион'), (Range: 100000000000000; Plural: pfOther; Value: '000 триллион') ); SAH_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 тыһ.'), (Range: 10000; Plural: pfOther; Value: '00 тыһ.'), (Range: 100000; Plural: pfOther; Value: '000 тыһ.'), (Range: 1000000; Plural: pfOther; Value: '0 мөл'), (Range: 10000000; Plural: pfOther; Value: '00 мөл'), (Range: 100000000; Plural: pfOther; Value: '000 мөл'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн') ); SAH_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 тыһ. ¤'), (Range: 10000; Plural: pfOther; Value: '00 тыһ. ¤'), (Range: 100000; Plural: pfOther; Value: '000 тыһ. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 мөл ¤'), (Range: 10000000; Plural: pfOther; Value: '00 мөл ¤'), (Range: 100000000; Plural: pfOther; Value: '000 мөл ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн ¤') ); // Samburu SAQ_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Sangu SBP_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Northern Sami SE_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 duhát'), (Range: 1000; Plural: pfTwo; Value: '0 duháhat'), (Range: 1000; Plural: pfOther; Value: '0 duháhat'), (Range: 10000; Plural: pfOne; Value: '00 duhát'), (Range: 10000; Plural: pfTwo; Value: '00 duháhat'), (Range: 10000; Plural: pfOther; Value: '00 duháhat'), (Range: 100000; Plural: pfOne; Value: '000 duhát'), (Range: 100000; Plural: pfTwo; Value: '000 duháhat'), (Range: 100000; Plural: pfOther; Value: '000 duháhat'), (Range: 1000000; Plural: pfOne; Value: '0 miljona'), (Range: 1000000; Plural: pfTwo; Value: '0 miljonat'), (Range: 1000000; Plural: pfOther; Value: '0 miljonat'), (Range: 10000000; Plural: pfOne; Value: '00 miljona'), (Range: 10000000; Plural: pfTwo; Value: '00 miljonat'), (Range: 10000000; Plural: pfOther; Value: '00 miljonat'), (Range: 100000000; Plural: pfOne; Value: '000 miljona'), (Range: 100000000; Plural: pfTwo; Value: '000 miljonat'), (Range: 100000000; Plural: pfOther; Value: '000 miljonat'), (Range: 1000000000; Plural: pfOne; Value: '0 miljardi'), (Range: 1000000000; Plural: pfTwo; Value: '0 miljardit'), (Range: 1000000000; Plural: pfOther; Value: '0 miljardit'), (Range: 10000000000; Plural: pfOne; Value: '00 miljardi'), (Range: 10000000000; Plural: pfTwo; Value: '00 miljardit'), (Range: 10000000000; Plural: pfOther; Value: '00 miljardit'), (Range: 100000000000; Plural: pfOne; Value: '000 miljardi'), (Range: 100000000000; Plural: pfTwo; Value: '000 miljardit'), (Range: 100000000000; Plural: pfOther; Value: '000 miljardit'), (Range: 1000000000000; Plural: pfOne; Value: '0 biljona'), (Range: 1000000000000; Plural: pfTwo; Value: '0 biljonat'), (Range: 1000000000000; Plural: pfOther; Value: '0 biljonat'), (Range: 10000000000000; Plural: pfOne; Value: '00 biljona'), (Range: 10000000000000; Plural: pfTwo; Value: '00 biljonat'), (Range: 10000000000000; Plural: pfOther; Value: '00 biljonat'), (Range: 100000000000000; Plural: pfOne; Value: '000 biljona'), (Range: 100000000000000; Plural: pfTwo; Value: '000 biljonat'), (Range: 100000000000000; Plural: pfOther; Value: '000 biljonat') ); SE_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 dt'), (Range: 1000; Plural: pfTwo; Value: '0 dt'), (Range: 1000; Plural: pfOther; Value: '0 dt'), (Range: 10000; Plural: pfOne; Value: '00 dt'), (Range: 10000; Plural: pfTwo; Value: '00 dt'), (Range: 10000; Plural: pfOther; Value: '00 dt'), (Range: 100000; Plural: pfOne; Value: '000 dt'), (Range: 100000; Plural: pfTwo; Value: '000 dt'), (Range: 100000; Plural: pfOther; Value: '000 dt'), (Range: 1000000; Plural: pfOne; Value: '0 mn'), (Range: 1000000; Plural: pfTwo; Value: '0 mn'), (Range: 1000000; Plural: pfOther; Value: '0 mn'), (Range: 10000000; Plural: pfOne; Value: '00 mn'), (Range: 10000000; Plural: pfTwo; Value: '00 mn'), (Range: 10000000; Plural: pfOther; Value: '00 mn'), (Range: 100000000; Plural: pfOne; Value: '000 mn'), (Range: 100000000; Plural: pfTwo; Value: '000 mn'), (Range: 100000000; Plural: pfOther; Value: '000 mn'), (Range: 1000000000; Plural: pfOne; Value: '0 md'), (Range: 1000000000; Plural: pfTwo; Value: '0 md'), (Range: 1000000000; Plural: pfOther; Value: '0 md'), (Range: 10000000000; Plural: pfOne; Value: '00 md'), (Range: 10000000000; Plural: pfTwo; Value: '00 md'), (Range: 10000000000; Plural: pfOther; Value: '00 md'), (Range: 100000000000; Plural: pfOne; Value: '000 md'), (Range: 100000000000; Plural: pfTwo; Value: '000 md'), (Range: 100000000000; Plural: pfOther; Value: '000 md'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn') ); SE_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 dt ¤'), (Range: 1000; Plural: pfTwo; Value: '0 dt ¤'), (Range: 1000; Plural: pfOther; Value: '0 dt ¤'), (Range: 10000; Plural: pfOne; Value: '00 dt ¤'), (Range: 10000; Plural: pfTwo; Value: '00 dt ¤'), (Range: 10000; Plural: pfOther; Value: '00 dt ¤'), (Range: 100000; Plural: pfOne; Value: '000 dt ¤'), (Range: 100000; Plural: pfTwo; Value: '000 dt ¤'), (Range: 100000; Plural: pfOther; Value: '000 dt ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mn ¤'), (Range: 1000000; Plural: pfTwo; Value: '0 mn ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mn ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mn ¤'), (Range: 10000000; Plural: pfTwo; Value: '00 mn ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mn ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mn ¤'), (Range: 100000000; Plural: pfTwo; Value: '000 mn ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mn ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 md ¤'), (Range: 1000000000; Plural: pfTwo; Value: '0 md ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 md ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 md ¤'), (Range: 10000000000; Plural: pfTwo; Value: '00 md ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 md ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 md ¤'), (Range: 100000000000; Plural: pfTwo; Value: '000 md ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 md ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn ¤'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bn ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn ¤'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bn ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn ¤'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bn ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn ¤') ); // Sena SEH_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Koyraboro Senni SES_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Sango SG_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Tachelhit SHI_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfFew; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfFew; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfFew; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfFew; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfFew; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfFew; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfFew; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfFew; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfFew; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfFew; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfFew; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfFew; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Tachelhit, Latin SHI_LATN_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K¤'), (Range: 1000; Plural: pfFew; Value: '0K¤'), (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOne; Value: '00K¤'), (Range: 10000; Plural: pfFew; Value: '00K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOne; Value: '000K¤'), (Range: 100000; Plural: pfFew; Value: '000K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOne; Value: '0M¤'), (Range: 1000000; Plural: pfFew; Value: '0M¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOne; Value: '00M¤'), (Range: 10000000; Plural: pfFew; Value: '00M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOne; Value: '000M¤'), (Range: 100000000; Plural: pfFew; Value: '000M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOne; Value: '0G¤'), (Range: 1000000000; Plural: pfFew; Value: '0G¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOne; Value: '00G¤'), (Range: 10000000000; Plural: pfFew; Value: '00G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOne; Value: '000G¤'), (Range: 100000000000; Plural: pfFew; Value: '000G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T¤'), (Range: 1000000000000; Plural: pfFew; Value: '0T¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T¤'), (Range: 10000000000000; Plural: pfFew; Value: '00T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T¤'), (Range: 100000000000000; Plural: pfFew; Value: '000T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Sinhala SI_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: 'දහස 0'), (Range: 1000; Plural: pfOther; Value: 'දහස 0'), (Range: 10000; Plural: pfOne; Value: 'දහස 00'), (Range: 10000; Plural: pfOther; Value: 'දහස 00'), (Range: 100000; Plural: pfOne; Value: 'දහස 000'), (Range: 100000; Plural: pfOther; Value: 'දහස 000'), (Range: 1000000; Plural: pfOne; Value: 'මිලියන 0'), (Range: 1000000; Plural: pfOther; Value: 'මිලියන 0'), (Range: 10000000; Plural: pfOne; Value: 'මිලියන 00'), (Range: 10000000; Plural: pfOther; Value: 'මිලියන 00'), (Range: 100000000; Plural: pfOne; Value: 'මිලියන 000'), (Range: 100000000; Plural: pfOther; Value: 'මිලියන 000'), (Range: 1000000000; Plural: pfOne; Value: 'බිලියන 0'), (Range: 1000000000; Plural: pfOther; Value: 'බිලියන 0'), (Range: 10000000000; Plural: pfOne; Value: 'බිලියන 00'), (Range: 10000000000; Plural: pfOther; Value: 'බිලියන 00'), (Range: 100000000000; Plural: pfOne; Value: 'බිලියන 000'), (Range: 100000000000; Plural: pfOther; Value: 'බිලියන 000'), (Range: 1000000000000; Plural: pfOne; Value: 'ට්‍රිලියන 0'), (Range: 1000000000000; Plural: pfOther; Value: 'ට්‍රිලියන 0'), (Range: 10000000000000; Plural: pfOne; Value: 'ට්‍රිලියන 00'), (Range: 10000000000000; Plural: pfOther; Value: 'ට්‍රිලියන 00'), (Range: 100000000000000; Plural: pfOne; Value: 'ට්‍රිලියන 000'), (Range: 100000000000000; Plural: pfOther; Value: 'ට්‍රිලියන 000') ); SI_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: 'ද0'), (Range: 1000; Plural: pfOther; Value: 'ද0'), (Range: 10000; Plural: pfOne; Value: 'ද00'), (Range: 10000; Plural: pfOther; Value: 'ද00'), (Range: 100000; Plural: pfOne; Value: 'ද000'), (Range: 100000; Plural: pfOther; Value: 'ද000'), (Range: 1000000; Plural: pfOne; Value: 'මි0'), (Range: 1000000; Plural: pfOther; Value: 'මි0'), (Range: 10000000; Plural: pfOne; Value: 'මි00'), (Range: 10000000; Plural: pfOther; Value: 'මි00'), (Range: 100000000; Plural: pfOne; Value: 'මි000'), (Range: 100000000; Plural: pfOther; Value: 'මි000'), (Range: 1000000000; Plural: pfOne; Value: 'බි0'), (Range: 1000000000; Plural: pfOther; Value: 'බි0'), (Range: 10000000000; Plural: pfOne; Value: 'බි00'), (Range: 10000000000; Plural: pfOther; Value: 'බි00'), (Range: 100000000000; Plural: pfOne; Value: 'බි000'), (Range: 100000000000; Plural: pfOther; Value: 'බි000'), (Range: 1000000000000; Plural: pfOne; Value: 'ට්‍රි0'), (Range: 1000000000000; Plural: pfOther; Value: 'ට්‍රි0'), (Range: 10000000000000; Plural: pfOne; Value: 'ට්‍රි00'), (Range: 10000000000000; Plural: pfOther; Value: 'ට්‍රි00'), (Range: 100000000000000; Plural: pfOne; Value: 'ට්‍රි000'), (Range: 100000000000000; Plural: pfOther; Value: 'ට්‍රි000') ); SI_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ද0'), (Range: 1000; Plural: pfOther; Value: '¤ද0'), (Range: 10000; Plural: pfOne; Value: '¤ද00'), (Range: 10000; Plural: pfOther; Value: '¤ද00'), (Range: 100000; Plural: pfOne; Value: '¤ද000'), (Range: 100000; Plural: pfOther; Value: '¤ද000'), (Range: 1000000; Plural: pfOne; Value: '¤මි0'), (Range: 1000000; Plural: pfOther; Value: '¤මි0'), (Range: 10000000; Plural: pfOne; Value: '¤මි00'), (Range: 10000000; Plural: pfOther; Value: '¤මි00'), (Range: 100000000; Plural: pfOne; Value: '¤මි000'), (Range: 100000000; Plural: pfOther; Value: '¤මි000'), (Range: 1000000000; Plural: pfOne; Value: '¤බි0'), (Range: 1000000000; Plural: pfOther; Value: '¤බි0'), (Range: 10000000000; Plural: pfOne; Value: '¤බි00'), (Range: 10000000000; Plural: pfOther; Value: '¤බි00'), (Range: 100000000000; Plural: pfOne; Value: '¤බි000'), (Range: 100000000000; Plural: pfOther; Value: '¤බි000'), (Range: 1000000000000; Plural: pfOne; Value: '¤ට්‍රි0'), (Range: 1000000000000; Plural: pfOther; Value: '¤ට්‍රි0'), (Range: 10000000000000; Plural: pfOne; Value: '¤ට්‍රි00'), (Range: 10000000000000; Plural: pfOther; Value: '¤ට්‍රි00'), (Range: 100000000000000; Plural: pfOne; Value: '¤ට්‍රි000'), (Range: 100000000000000; Plural: pfOther; Value: '¤ට්‍රි000') ); // Slovak SK_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tisíc'), (Range: 1000; Plural: pfFew; Value: '0 tisíce'), (Range: 1000; Plural: pfMany; Value: '0 tisíca'), (Range: 1000; Plural: pfOther; Value: '0 tisíc'), (Range: 10000; Plural: pfOne; Value: '00 tisíc'), (Range: 10000; Plural: pfFew; Value: '00 tisíc'), (Range: 10000; Plural: pfMany; Value: '00 tisíca'), (Range: 10000; Plural: pfOther; Value: '00 tisíc'), (Range: 100000; Plural: pfOne; Value: '000 tisíc'), (Range: 100000; Plural: pfFew; Value: '000 tisíc'), (Range: 100000; Plural: pfMany; Value: '000 tisíca'), (Range: 100000; Plural: pfOther; Value: '000 tisíc'), (Range: 1000000; Plural: pfOne; Value: '0 milión'), (Range: 1000000; Plural: pfFew; Value: '0 milióny'), (Range: 1000000; Plural: pfMany; Value: '0 milióna'), (Range: 1000000; Plural: pfOther; Value: '0 miliónov'), (Range: 10000000; Plural: pfOne; Value: '00 miliónov'), (Range: 10000000; Plural: pfFew; Value: '00 miliónov'), (Range: 10000000; Plural: pfMany; Value: '00 milióna'), (Range: 10000000; Plural: pfOther; Value: '00 miliónov'), (Range: 100000000; Plural: pfOne; Value: '000 miliónov'), (Range: 100000000; Plural: pfFew; Value: '000 miliónov'), (Range: 100000000; Plural: pfMany; Value: '000 milióna'), (Range: 100000000; Plural: pfOther; Value: '000 miliónov'), (Range: 1000000000; Plural: pfOne; Value: '0 miliarda'), (Range: 1000000000; Plural: pfFew; Value: '0 miliardy'), (Range: 1000000000; Plural: pfMany; Value: '0 miliardy'), (Range: 1000000000; Plural: pfOther; Value: '0 miliárd'), (Range: 10000000000; Plural: pfOne; Value: '00 miliárd'), (Range: 10000000000; Plural: pfFew; Value: '00 miliárd'), (Range: 10000000000; Plural: pfMany; Value: '00 miliardy'), (Range: 10000000000; Plural: pfOther; Value: '00 miliárd'), (Range: 100000000000; Plural: pfOne; Value: '000 miliárd'), (Range: 100000000000; Plural: pfFew; Value: '000 miliárd'), (Range: 100000000000; Plural: pfMany; Value: '000 miliardy'), (Range: 100000000000; Plural: pfOther; Value: '000 miliárd'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilión'), (Range: 1000000000000; Plural: pfFew; Value: '0 bilióny'), (Range: 1000000000000; Plural: pfMany; Value: '0 bilióna'), (Range: 1000000000000; Plural: pfOther; Value: '0 biliónov'), (Range: 10000000000000; Plural: pfOne; Value: '00 biliónov'), (Range: 10000000000000; Plural: pfFew; Value: '00 biliónov'), (Range: 10000000000000; Plural: pfMany; Value: '00 bilióna'), (Range: 10000000000000; Plural: pfOther; Value: '00 biliónov'), (Range: 100000000000000; Plural: pfOne; Value: '000 biliónov'), (Range: 100000000000000; Plural: pfFew; Value: '000 biliónov'), (Range: 100000000000000; Plural: pfMany; Value: '000 bilióna'), (Range: 100000000000000; Plural: pfOther; Value: '000 biliónov') ); SK_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tis.'), (Range: 1000; Plural: pfFew; Value: '0 tis.'), (Range: 1000; Plural: pfMany; Value: '0 tis.'), (Range: 1000; Plural: pfOther; Value: '0 tis.'), (Range: 10000; Plural: pfOne; Value: '00 tis.'), (Range: 10000; Plural: pfFew; Value: '00 tis.'), (Range: 10000; Plural: pfMany; Value: '00 tis.'), (Range: 10000; Plural: pfOther; Value: '00 tis.'), (Range: 100000; Plural: pfOne; Value: '000 tis.'), (Range: 100000; Plural: pfFew; Value: '000 tis.'), (Range: 100000; Plural: pfMany; Value: '000 tis.'), (Range: 100000; Plural: pfOther; Value: '000 tis.'), (Range: 1000000; Plural: pfOne; Value: '0 mil.'), (Range: 1000000; Plural: pfFew; Value: '0 mil.'), (Range: 1000000; Plural: pfMany; Value: '0 mil.'), (Range: 1000000; Plural: pfOther; Value: '0 mil.'), (Range: 10000000; Plural: pfOne; Value: '00 mil.'), (Range: 10000000; Plural: pfFew; Value: '00 mil.'), (Range: 10000000; Plural: pfMany; Value: '00 mil.'), (Range: 10000000; Plural: pfOther; Value: '00 mil.'), (Range: 100000000; Plural: pfOne; Value: '000 mil.'), (Range: 100000000; Plural: pfFew; Value: '000 mil.'), (Range: 100000000; Plural: pfMany; Value: '000 mil.'), (Range: 100000000; Plural: pfOther; Value: '000 mil.'), (Range: 1000000000; Plural: pfOne; Value: '0 mld.'), (Range: 1000000000; Plural: pfFew; Value: '0 mld.'), (Range: 1000000000; Plural: pfMany; Value: '0 mld.'), (Range: 1000000000; Plural: pfOther; Value: '0 mld.'), (Range: 10000000000; Plural: pfOne; Value: '00 mld.'), (Range: 10000000000; Plural: pfFew; Value: '00 mld.'), (Range: 10000000000; Plural: pfMany; Value: '00 mld.'), (Range: 10000000000; Plural: pfOther; Value: '00 mld.'), (Range: 100000000000; Plural: pfOne; Value: '000 mld.'), (Range: 100000000000; Plural: pfFew; Value: '000 mld.'), (Range: 100000000000; Plural: pfMany; Value: '000 mld.'), (Range: 100000000000; Plural: pfOther; Value: '000 mld.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfMany; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfMany; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfMany; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); SK_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tis. ¤'), (Range: 1000; Plural: pfFew; Value: '0 tis. ¤'), (Range: 1000; Plural: pfMany; Value: '0 tis. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tis. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tis. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tis. ¤'), (Range: 10000; Plural: pfMany; Value: '00 tis. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tis. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tis. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tis. ¤'), (Range: 100000; Plural: pfMany; Value: '000 tis. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tis. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfMany; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mil. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfMany; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mil. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfMany; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mil. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfMany; Value: '0 mld. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mld. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfMany; Value: '00 mld. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mld. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfMany; Value: '000 mld. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mld. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Slovenian SL_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tisoč'), (Range: 1000; Plural: pfTwo; Value: '0 tisoč'), (Range: 1000; Plural: pfFew; Value: '0 tisoč'), (Range: 1000; Plural: pfOther; Value: '0 tisoč'), (Range: 10000; Plural: pfOne; Value: '00 tisoč'), (Range: 10000; Plural: pfTwo; Value: '00 tisoč'), (Range: 10000; Plural: pfFew; Value: '00 tisoč'), (Range: 10000; Plural: pfOther; Value: '00 tisoč'), (Range: 100000; Plural: pfOne; Value: '000 tisoč'), (Range: 100000; Plural: pfTwo; Value: '000 tisoč'), (Range: 100000; Plural: pfFew; Value: '000 tisoč'), (Range: 100000; Plural: pfOther; Value: '000 tisoč'), (Range: 1000000; Plural: pfOne; Value: '0 milijon'), (Range: 1000000; Plural: pfTwo; Value: '0 milijona'), (Range: 1000000; Plural: pfFew; Value: '0 milijone'), (Range: 1000000; Plural: pfOther; Value: '0 milijonov'), (Range: 10000000; Plural: pfOne; Value: '00 milijon'), (Range: 10000000; Plural: pfTwo; Value: '00 milijona'), (Range: 10000000; Plural: pfFew; Value: '00 milijoni'), (Range: 10000000; Plural: pfOther; Value: '00 milijonov'), (Range: 100000000; Plural: pfOne; Value: '000 milijon'), (Range: 100000000; Plural: pfTwo; Value: '000 milijona'), (Range: 100000000; Plural: pfFew; Value: '000 milijoni'), (Range: 100000000; Plural: pfOther; Value: '000 milijonov'), (Range: 1000000000; Plural: pfOne; Value: '0 milijarda'), (Range: 1000000000; Plural: pfTwo; Value: '0 milijardi'), (Range: 1000000000; Plural: pfFew; Value: '0 milijarde'), (Range: 1000000000; Plural: pfOther; Value: '0 milijard'), (Range: 10000000000; Plural: pfOne; Value: '00 milijarda'), (Range: 10000000000; Plural: pfTwo; Value: '00 milijardi'), (Range: 10000000000; Plural: pfFew; Value: '00 milijarde'), (Range: 10000000000; Plural: pfOther; Value: '00 milijard'), (Range: 100000000000; Plural: pfOne; Value: '000 milijarda'), (Range: 100000000000; Plural: pfTwo; Value: '000 milijardi'), (Range: 100000000000; Plural: pfFew; Value: '000 milijarde'), (Range: 100000000000; Plural: pfOther; Value: '000 milijard'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilijon'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bilijona'), (Range: 1000000000000; Plural: pfFew; Value: '0 bilijoni'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilijonov'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilijon'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bilijona'), (Range: 10000000000000; Plural: pfFew; Value: '00 bilijoni'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilijonov'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilijon'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bilijona'), (Range: 100000000000000; Plural: pfFew; Value: '000 bilijoni'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilijonov') ); SL_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tis.'), (Range: 1000; Plural: pfTwo; Value: '0 tis.'), (Range: 1000; Plural: pfFew; Value: '0 tis.'), (Range: 1000; Plural: pfOther; Value: '0 tis.'), (Range: 10000; Plural: pfOne; Value: '00 tis.'), (Range: 10000; Plural: pfTwo; Value: '00 tis.'), (Range: 10000; Plural: pfFew; Value: '00 tis.'), (Range: 10000; Plural: pfOther; Value: '00 tis.'), (Range: 100000; Plural: pfOne; Value: '000 tis.'), (Range: 100000; Plural: pfTwo; Value: '000 tis.'), (Range: 100000; Plural: pfFew; Value: '000 tis.'), (Range: 100000; Plural: pfOther; Value: '000 tis.'), (Range: 1000000; Plural: pfOne; Value: '0 mio.'), (Range: 1000000; Plural: pfTwo; Value: '0 mio.'), (Range: 1000000; Plural: pfFew; Value: '0 mio.'), (Range: 1000000; Plural: pfOther; Value: '0 mio.'), (Range: 10000000; Plural: pfOne; Value: '00 mio.'), (Range: 10000000; Plural: pfTwo; Value: '00 mio.'), (Range: 10000000; Plural: pfFew; Value: '00 mio.'), (Range: 10000000; Plural: pfOther; Value: '00 mio.'), (Range: 100000000; Plural: pfOne; Value: '000 mio.'), (Range: 100000000; Plural: pfTwo; Value: '000 mio.'), (Range: 100000000; Plural: pfFew; Value: '000 mio.'), (Range: 100000000; Plural: pfOther; Value: '000 mio.'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd.'), (Range: 1000000000; Plural: pfTwo; Value: '0 mrd.'), (Range: 1000000000; Plural: pfFew; Value: '0 mrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd.'), (Range: 10000000000; Plural: pfTwo; Value: '00 mrd.'), (Range: 10000000000; Plural: pfFew; Value: '00 mrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd.'), (Range: 100000000000; Plural: pfTwo; Value: '000 mrd.'), (Range: 100000000000; Plural: pfFew; Value: '000 mrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); SL_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tis. ¤'), (Range: 1000; Plural: pfTwo; Value: '0 tis. ¤'), (Range: 1000; Plural: pfFew; Value: '0 tis. ¤'), (Range: 1000; Plural: pfOther; Value: '0 tis. ¤'), (Range: 10000; Plural: pfOne; Value: '00 tis. ¤'), (Range: 10000; Plural: pfTwo; Value: '00 tis. ¤'), (Range: 10000; Plural: pfFew; Value: '00 tis. ¤'), (Range: 10000; Plural: pfOther; Value: '00 tis. ¤'), (Range: 100000; Plural: pfOne; Value: '000 tis. ¤'), (Range: 100000; Plural: pfTwo; Value: '000 tis. ¤'), (Range: 100000; Plural: pfFew; Value: '000 tis. ¤'), (Range: 100000; Plural: pfOther; Value: '000 tis. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfTwo; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mio. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mio. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfTwo; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mio. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mio. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfTwo; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mio. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mio. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfTwo; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfTwo; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfTwo; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfTwo; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfTwo; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfTwo; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Sami, Inari SMN_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tuhháát'), (Range: 1000; Plural: pfTwo; Value: '0 tuhháát'), (Range: 1000; Plural: pfOther; Value: '0 tuhháát'), (Range: 10000; Plural: pfOne; Value: '00 tuhháát'), (Range: 10000; Plural: pfTwo; Value: '00 tuhháát'), (Range: 10000; Plural: pfOther; Value: '00 tuhháát'), (Range: 100000; Plural: pfOne; Value: '000 tuhháát'), (Range: 100000; Plural: pfTwo; Value: '000 tuhháát'), (Range: 100000; Plural: pfOther; Value: '000 tuhháát'), (Range: 1000000; Plural: pfOne; Value: '0 miljovn'), (Range: 1000000; Plural: pfTwo; Value: '0 miljovn'), (Range: 1000000; Plural: pfOther; Value: '0 miljovn'), (Range: 10000000; Plural: pfOne; Value: '00 miljovn'), (Range: 10000000; Plural: pfTwo; Value: '00 miljovn'), (Range: 10000000; Plural: pfOther; Value: '00 miljovn'), (Range: 100000000; Plural: pfOne; Value: '000 miljovn'), (Range: 100000000; Plural: pfTwo; Value: '000 miljovn'), (Range: 100000000; Plural: pfOther; Value: '000 miljovn'), (Range: 1000000000; Plural: pfOne; Value: '0 miljard'), (Range: 1000000000; Plural: pfTwo; Value: '0 miljard'), (Range: 1000000000; Plural: pfOther; Value: '0 miljard'), (Range: 10000000000; Plural: pfOne; Value: '00 miljard'), (Range: 10000000000; Plural: pfTwo; Value: '00 miljard'), (Range: 10000000000; Plural: pfOther; Value: '00 miljard'), (Range: 100000000000; Plural: pfOne; Value: '000 miljard'), (Range: 100000000000; Plural: pfTwo; Value: '000 miljard'), (Range: 100000000000; Plural: pfOther; Value: '000 miljard'), (Range: 1000000000000; Plural: pfOne; Value: '0 biljovn'), (Range: 1000000000000; Plural: pfTwo; Value: '0 biljovn'), (Range: 1000000000000; Plural: pfOther; Value: '0 biljovn'), (Range: 10000000000000; Plural: pfOne; Value: '00 biljovn'), (Range: 10000000000000; Plural: pfTwo; Value: '00 biljovn'), (Range: 10000000000000; Plural: pfOther; Value: '00 biljovn'), (Range: 100000000000000; Plural: pfOne; Value: '000 biljovn'), (Range: 100000000000000; Plural: pfTwo; Value: '000 biljovn'), (Range: 100000000000000; Plural: pfOther; Value: '000 biljovn') ); SMN_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfTwo; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfTwo; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfTwo; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfTwo; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfTwo; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfTwo; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfTwo; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfTwo; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfTwo; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfTwo; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfTwo; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfTwo; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Shona SN_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Somali SO_LONG: array[0..5] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: 'Kun'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K') ); SO_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Albanian SQ_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mijë'), (Range: 1000; Plural: pfOther; Value: '0 mijë'), (Range: 10000; Plural: pfOne; Value: '00 mijë'), (Range: 10000; Plural: pfOther; Value: '00 mijë'), (Range: 100000; Plural: pfOne; Value: '000 mijë'), (Range: 100000; Plural: pfOther; Value: '000 mijë'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfOther; Value: '0 milion'), (Range: 10000000; Plural: pfOne; Value: '00 milion'), (Range: 10000000; Plural: pfOther; Value: '00 milion'), (Range: 100000000; Plural: pfOne; Value: '000 milion'), (Range: 100000000; Plural: pfOther; Value: '000 milion'), (Range: 1000000000; Plural: pfOne; Value: '0 miliard'), (Range: 1000000000; Plural: pfOther; Value: '0 miliard'), (Range: 10000000000; Plural: pfOne; Value: '00 miliard'), (Range: 10000000000; Plural: pfOther; Value: '00 miliard'), (Range: 100000000000; Plural: pfOne; Value: '000 miliard'), (Range: 100000000000; Plural: pfOther; Value: '000 miliard'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilion'), (Range: 1000000000000; Plural: pfOther; Value: '0 bilion'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilion'), (Range: 10000000000000; Plural: pfOther; Value: '00 bilion'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilion'), (Range: 100000000000000; Plural: pfOther; Value: '000 bilion') ); SQ_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mijë'), (Range: 1000; Plural: pfOther; Value: '0 mijë'), (Range: 10000; Plural: pfOne; Value: '00 mijë'), (Range: 10000; Plural: pfOther; Value: '00 mijë'), (Range: 100000; Plural: pfOne; Value: '000 mijë'), (Range: 100000; Plural: pfOther; Value: '000 mijë'), (Range: 1000000; Plural: pfOne; Value: '0 Mln'), (Range: 1000000; Plural: pfOther; Value: '0 Mln'), (Range: 10000000; Plural: pfOne; Value: '00 Mln'), (Range: 10000000; Plural: pfOther; Value: '00 Mln'), (Range: 100000000; Plural: pfOne; Value: '000 Mln'), (Range: 100000000; Plural: pfOther; Value: '000 Mln'), (Range: 1000000000; Plural: pfOne; Value: '0 Mld'), (Range: 1000000000; Plural: pfOther; Value: '0 Mld'), (Range: 10000000000; Plural: pfOne; Value: '00 Mld'), (Range: 10000000000; Plural: pfOther; Value: '00 Mld'), (Range: 100000000000; Plural: pfOne; Value: '000 Mld'), (Range: 100000000000; Plural: pfOther; Value: '000 Mld'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bln'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bln'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bln'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bln'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bln'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bln') ); SQ_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 mijë ¤'), (Range: 1000; Plural: pfOther; Value: '0 mijë ¤'), (Range: 10000; Plural: pfOne; Value: '00 mijë ¤'), (Range: 10000; Plural: pfOther; Value: '00 mijë ¤'), (Range: 100000; Plural: pfOne; Value: '000 mijë ¤'), (Range: 100000; Plural: pfOther; Value: '000 mijë ¤'), (Range: 1000000; Plural: pfOne; Value: '0 Mln ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Mln ¤'), (Range: 10000000; Plural: pfOne; Value: '00 Mln ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Mln ¤'), (Range: 100000000; Plural: pfOne; Value: '000 Mln ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Mln ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mld ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mld ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mld ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mld ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mld ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mld ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Bln ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Bln ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Bln ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Bln ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Bln ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Bln ¤') ); // Serbian, Cyrillic SR_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 хиљада'), (Range: 1000; Plural: pfFew; Value: '0 хиљаде'), (Range: 1000; Plural: pfOther; Value: '0 хиљада'), (Range: 10000; Plural: pfOne; Value: '00 хиљада'), (Range: 10000; Plural: pfFew; Value: '00 хиљаде'), (Range: 10000; Plural: pfOther; Value: '00 хиљада'), (Range: 100000; Plural: pfOne; Value: '000 хиљада'), (Range: 100000; Plural: pfFew; Value: '000 хиљаде'), (Range: 100000; Plural: pfOther; Value: '000 хиљада'), (Range: 1000000; Plural: pfOne; Value: '0 милион'), (Range: 1000000; Plural: pfFew; Value: '0 милиона'), (Range: 1000000; Plural: pfOther; Value: '0 милиона'), (Range: 10000000; Plural: pfOne; Value: '00 милион'), (Range: 10000000; Plural: pfFew; Value: '00 милиона'), (Range: 10000000; Plural: pfOther; Value: '00 милиона'), (Range: 100000000; Plural: pfOne; Value: '000 милион'), (Range: 100000000; Plural: pfFew; Value: '000 милиона'), (Range: 100000000; Plural: pfOther; Value: '000 милиона'), (Range: 1000000000; Plural: pfOne; Value: '0 милијарда'), (Range: 1000000000; Plural: pfFew; Value: '0 милијарде'), (Range: 1000000000; Plural: pfOther; Value: '0 милијарди'), (Range: 10000000000; Plural: pfOne; Value: '00 милијарда'), (Range: 10000000000; Plural: pfFew; Value: '00 милијарде'), (Range: 10000000000; Plural: pfOther; Value: '00 милијарди'), (Range: 100000000000; Plural: pfOne; Value: '000 милијарда'), (Range: 100000000000; Plural: pfFew; Value: '000 милијарде'), (Range: 100000000000; Plural: pfOther; Value: '000 милијарди'), (Range: 1000000000000; Plural: pfOne; Value: '0 билион'), (Range: 1000000000000; Plural: pfFew; Value: '0 билиона'), (Range: 1000000000000; Plural: pfOther; Value: '0 билиона'), (Range: 10000000000000; Plural: pfOne; Value: '00 билион'), (Range: 10000000000000; Plural: pfFew; Value: '00 билиона'), (Range: 10000000000000; Plural: pfOther; Value: '00 билиона'), (Range: 100000000000000; Plural: pfOne; Value: '000 билион'), (Range: 100000000000000; Plural: pfFew; Value: '000 билиона'), (Range: 100000000000000; Plural: pfOther; Value: '000 билиона') ); SR_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 хиљ.'), (Range: 1000; Plural: pfFew; Value: '0 хиљ.'), (Range: 1000; Plural: pfOther; Value: '0 хиљ.'), (Range: 10000; Plural: pfOne; Value: '00 хиљ.'), (Range: 10000; Plural: pfFew; Value: '00 хиљ.'), (Range: 10000; Plural: pfOther; Value: '00 хиљ.'), (Range: 100000; Plural: pfOne; Value: '000 хиљ.'), (Range: 100000; Plural: pfFew; Value: '000 хиљ.'), (Range: 100000; Plural: pfOther; Value: '000 хиљ.'), (Range: 1000000; Plural: pfOne; Value: '0 мил.'), (Range: 1000000; Plural: pfFew; Value: '0 мил.'), (Range: 1000000; Plural: pfOther; Value: '0 мил.'), (Range: 10000000; Plural: pfOne; Value: '00 мил.'), (Range: 10000000; Plural: pfFew; Value: '00 мил.'), (Range: 10000000; Plural: pfOther; Value: '00 мил.'), (Range: 100000000; Plural: pfOne; Value: '000 мил.'), (Range: 100000000; Plural: pfFew; Value: '000 мил.'), (Range: 100000000; Plural: pfOther; Value: '000 мил.'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд.'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд.'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд.'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд.'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд.'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд.'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд.'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд.'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд.'), (Range: 1000000000000; Plural: pfOne; Value: '0 бил.'), (Range: 1000000000000; Plural: pfFew; Value: '0 бил.'), (Range: 1000000000000; Plural: pfOther; Value: '0 бил.'), (Range: 10000000000000; Plural: pfOne; Value: '00 бил.'), (Range: 10000000000000; Plural: pfFew; Value: '00 бил.'), (Range: 10000000000000; Plural: pfOther; Value: '00 бил.'), (Range: 100000000000000; Plural: pfOne; Value: '000 бил.'), (Range: 100000000000000; Plural: pfFew; Value: '000 бил.'), (Range: 100000000000000; Plural: pfOther; Value: '000 бил.') ); SR_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 хиљ. ¤'), (Range: 1000; Plural: pfFew; Value: '0 хиљ. ¤'), (Range: 1000; Plural: pfOther; Value: '0 хиљ. ¤'), (Range: 10000; Plural: pfOne; Value: '00 хиљ. ¤'), (Range: 10000; Plural: pfFew; Value: '00 хиљ. ¤'), (Range: 10000; Plural: pfOther; Value: '00 хиљ. ¤'), (Range: 100000; Plural: pfOne; Value: '000 хиљ. ¤'), (Range: 100000; Plural: pfFew; Value: '000 хиљ. ¤'), (Range: 100000; Plural: pfOther; Value: '000 хиљ. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 мил. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 мил. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 мил. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 мил. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 мил. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 мил. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 мил. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 мил. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 мил. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 бил. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 бил. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 бил. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 бил. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 бил. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 бил. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 бил. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 бил. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 бил. ¤') ); // Serbian, Latin SR_LATN_LONG: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 hiljada'), (Range: 1000; Plural: pfFew; Value: '0 hiljade'), (Range: 1000; Plural: pfOther; Value: '0 hiljada'), (Range: 10000; Plural: pfOne; Value: '00 hiljada'), (Range: 10000; Plural: pfFew; Value: '00 hiljade'), (Range: 10000; Plural: pfOther; Value: '00 hiljada'), (Range: 100000; Plural: pfOne; Value: '000 hiljada'), (Range: 100000; Plural: pfFew; Value: '000 hiljade'), (Range: 100000; Plural: pfOther; Value: '000 hiljada'), (Range: 1000000; Plural: pfOne; Value: '0 milion'), (Range: 1000000; Plural: pfFew; Value: '0 miliona'), (Range: 1000000; Plural: pfOther; Value: '0 miliona'), (Range: 10000000; Plural: pfOne; Value: '00 milion'), (Range: 10000000; Plural: pfFew; Value: '00 miliona'), (Range: 10000000; Plural: pfOther; Value: '00 miliona'), (Range: 100000000; Plural: pfOne; Value: '000 milion'), (Range: 100000000; Plural: pfFew; Value: '000 miliona'), (Range: 100000000; Plural: pfOther; Value: '000 miliona'), (Range: 1000000000; Plural: pfOne; Value: '0 milijarda'), (Range: 1000000000; Plural: pfFew; Value: '0 milijarde'), (Range: 1000000000; Plural: pfOther; Value: '0 milijardi'), (Range: 10000000000; Plural: pfOne; Value: '00 milijarda'), (Range: 10000000000; Plural: pfFew; Value: '00 milijarde'), (Range: 10000000000; Plural: pfOther; Value: '00 milijardi'), (Range: 100000000000; Plural: pfOne; Value: '000 milijarda'), (Range: 100000000000; Plural: pfFew; Value: '000 milijarde'), (Range: 100000000000; Plural: pfOther; Value: '000 milijardi'), (Range: 1000000000000; Plural: pfOne; Value: '0 bilion'), (Range: 1000000000000; Plural: pfFew; Value: '0 biliona'), (Range: 1000000000000; Plural: pfOther; Value: '0 biliona'), (Range: 10000000000000; Plural: pfOne; Value: '00 bilion'), (Range: 10000000000000; Plural: pfFew; Value: '00 biliona'), (Range: 10000000000000; Plural: pfOther; Value: '00 biliona'), (Range: 100000000000000; Plural: pfOne; Value: '000 bilion'), (Range: 100000000000000; Plural: pfFew; Value: '000 biliona'), (Range: 100000000000000; Plural: pfOther; Value: '000 biliona') ); SR_LATN_SHORT: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 hilj.'), (Range: 1000; Plural: pfFew; Value: '0 hilj.'), (Range: 1000; Plural: pfOther; Value: '0 hilj.'), (Range: 10000; Plural: pfOne; Value: '00 hilj.'), (Range: 10000; Plural: pfFew; Value: '00 hilj.'), (Range: 10000; Plural: pfOther; Value: '00 hilj.'), (Range: 100000; Plural: pfOne; Value: '000 hilj.'), (Range: 100000; Plural: pfFew; Value: '000 hilj.'), (Range: 100000; Plural: pfOther; Value: '000 hilj.'), (Range: 1000000; Plural: pfOne; Value: '0 mil.'), (Range: 1000000; Plural: pfFew; Value: '0 mil.'), (Range: 1000000; Plural: pfOther; Value: '0 mil.'), (Range: 10000000; Plural: pfOne; Value: '00 mil.'), (Range: 10000000; Plural: pfFew; Value: '00 mil.'), (Range: 10000000; Plural: pfOther; Value: '00 mil.'), (Range: 100000000; Plural: pfOne; Value: '000 mil.'), (Range: 100000000; Plural: pfFew; Value: '000 mil.'), (Range: 100000000; Plural: pfOther; Value: '000 mil.'), (Range: 1000000000; Plural: pfOne; Value: '0 mlrd.'), (Range: 1000000000; Plural: pfFew; Value: '0 mlrd.'), (Range: 1000000000; Plural: pfOther; Value: '0 mlrd.'), (Range: 10000000000; Plural: pfOne; Value: '00 mlrd.'), (Range: 10000000000; Plural: pfFew; Value: '00 mlrd.'), (Range: 10000000000; Plural: pfOther; Value: '00 mlrd.'), (Range: 100000000000; Plural: pfOne; Value: '000 mlrd.'), (Range: 100000000000; Plural: pfFew; Value: '000 mlrd.'), (Range: 100000000000; Plural: pfOther; Value: '000 mlrd.'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil.'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil.'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil.'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil.'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil.'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil.'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil.'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil.'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil.') ); SR_LATN_CURRENCY: array[0..35] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 hilj. ¤'), (Range: 1000; Plural: pfFew; Value: '0 hilj. ¤'), (Range: 1000; Plural: pfOther; Value: '0 hilj. ¤'), (Range: 10000; Plural: pfOne; Value: '00 hilj. ¤'), (Range: 10000; Plural: pfFew; Value: '00 hilj. ¤'), (Range: 10000; Plural: pfOther; Value: '00 hilj. ¤'), (Range: 100000; Plural: pfOne; Value: '000 hilj. ¤'), (Range: 100000; Plural: pfFew; Value: '000 hilj. ¤'), (Range: 100000; Plural: pfOther; Value: '000 hilj. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfFew; Value: '0 mil. ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mil. ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfFew; Value: '00 mil. ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mil. ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfFew; Value: '000 mil. ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mil. ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mlrd. ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 mlrd. ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mlrd. ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mlrd. ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 mlrd. ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mlrd. ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mlrd. ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 mlrd. ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mlrd. ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 bil. ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bil. ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 bil. ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bil. ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 bil. ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bil. ¤') ); // Swedish SV_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tusen'), (Range: 1000; Plural: pfOther; Value: '0 tusen'), (Range: 10000; Plural: pfOne; Value: '00 tusen'), (Range: 10000; Plural: pfOther; Value: '00 tusen'), (Range: 100000; Plural: pfOne; Value: '000 tusen'), (Range: 100000; Plural: pfOther; Value: '000 tusen'), (Range: 1000000; Plural: pfOne; Value: '0 miljon'), (Range: 1000000; Plural: pfOther; Value: '0 miljoner'), (Range: 10000000; Plural: pfOne; Value: '00 miljon'), (Range: 10000000; Plural: pfOther; Value: '00 miljoner'), (Range: 100000000; Plural: pfOne; Value: '000 miljoner'), (Range: 100000000; Plural: pfOther; Value: '000 miljoner'), (Range: 1000000000; Plural: pfOne; Value: '0 miljard'), (Range: 1000000000; Plural: pfOther; Value: '0 miljarder'), (Range: 10000000000; Plural: pfOne; Value: '00 miljarder'), (Range: 10000000000; Plural: pfOther; Value: '00 miljarder'), (Range: 100000000000; Plural: pfOne; Value: '000 miljarder'), (Range: 100000000000; Plural: pfOther; Value: '000 miljarder'), (Range: 1000000000000; Plural: pfOne; Value: '0 biljon'), (Range: 1000000000000; Plural: pfOther; Value: '0 biljoner'), (Range: 10000000000000; Plural: pfOne; Value: '00 biljoner'), (Range: 10000000000000; Plural: pfOther; Value: '00 biljoner'), (Range: 100000000000000; Plural: pfOne; Value: '000 biljoner'), (Range: 100000000000000; Plural: pfOther; Value: '000 biljoner') ); SV_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tn'), (Range: 1000; Plural: pfOther; Value: '0 tn'), (Range: 10000; Plural: pfOne; Value: '00 tn'), (Range: 10000; Plural: pfOther; Value: '00 tn'), (Range: 100000; Plural: pfOne; Value: '000 tn'), (Range: 100000; Plural: pfOther; Value: '000 tn'), (Range: 1000000; Plural: pfOne; Value: '0 mn'), (Range: 1000000; Plural: pfOther; Value: '0 mn'), (Range: 10000000; Plural: pfOne; Value: '00 mn'), (Range: 10000000; Plural: pfOther; Value: '00 mn'), (Range: 100000000; Plural: pfOne; Value: '000 mn'), (Range: 100000000; Plural: pfOther; Value: '000 mn'), (Range: 1000000000; Plural: pfOne; Value: '0 md'), (Range: 1000000000; Plural: pfOther; Value: '0 md'), (Range: 10000000000; Plural: pfOne; Value: '00 md'), (Range: 10000000000; Plural: pfOther; Value: '00 md'), (Range: 100000000000; Plural: pfOne; Value: '000 md'), (Range: 100000000000; Plural: pfOther; Value: '000 md'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn') ); SV_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 tn ¤'), (Range: 1000; Plural: pfOther; Value: '0 tn ¤'), (Range: 10000; Plural: pfOne; Value: '00 tn ¤'), (Range: 10000; Plural: pfOther; Value: '00 tn ¤'), (Range: 100000; Plural: pfOne; Value: '000 tn ¤'), (Range: 100000; Plural: pfOther; Value: '000 tn ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mn ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mn ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mn ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mn ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mn ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mn ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 md ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 md ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 md ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 md ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 md ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 md ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 bn ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 bn ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 bn ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 bn ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 bn ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 bn ¤') ); // Kiswahili SW_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: 'Elfu 0'), (Range: 1000; Plural: pfOther; Value: 'Elfu 0'), (Range: 10000; Plural: pfOne; Value: 'Elfu 00'), (Range: 10000; Plural: pfOther; Value: 'Elfu 00'), (Range: 100000; Plural: pfOne; Value: 'Elfu 000'), (Range: 100000; Plural: pfOther; Value: 'Elfu 000'), (Range: 1000000; Plural: pfOne; Value: 'Milioni 0'), (Range: 1000000; Plural: pfOther; Value: 'Milioni 0'), (Range: 10000000; Plural: pfOne; Value: 'Milioni 00'), (Range: 10000000; Plural: pfOther; Value: 'Milioni 00'), (Range: 100000000; Plural: pfOne; Value: 'Milioni 000'), (Range: 100000000; Plural: pfOther; Value: 'Milioni 000'), (Range: 1000000000; Plural: pfOne; Value: 'Bilioni 0'), (Range: 1000000000; Plural: pfOther; Value: 'Bilioni 0'), (Range: 10000000000; Plural: pfOne; Value: 'Bilioni 00'), (Range: 10000000000; Plural: pfOther; Value: 'Bilioni 00'), (Range: 100000000000; Plural: pfOne; Value: 'Bilioni 000'), (Range: 100000000000; Plural: pfOther; Value: 'Bilioni 000'), (Range: 1000000000000; Plural: pfOne; Value: 'Trilioni 0'), (Range: 1000000000000; Plural: pfOther; Value: 'Trilioni 0'), (Range: 10000000000000; Plural: pfOne; Value: 'Trilioni 00'), (Range: 10000000000000; Plural: pfOther; Value: 'Trilioni 00'), (Range: 100000000000000; Plural: pfOne; Value: 'Trilioni 000'), (Range: 100000000000000; Plural: pfOther; Value: 'Trilioni 000') ); SW_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: 'elfu 0'), (Range: 1000; Plural: pfOther; Value: 'elfu 0'), (Range: 10000; Plural: pfOne; Value: 'elfu 00'), (Range: 10000; Plural: pfOther; Value: 'elfu 00'), (Range: 100000; Plural: pfOne; Value: 'elfu 000'), (Range: 100000; Plural: pfOther; Value: 'elfu 000'), (Range: 1000000; Plural: pfOne; Value: 'M0'), (Range: 1000000; Plural: pfOther; Value: 'M0'), (Range: 10000000; Plural: pfOne; Value: 'M00'), (Range: 10000000; Plural: pfOther; Value: 'M00'), (Range: 100000000; Plural: pfOne; Value: 'M000'), (Range: 100000000; Plural: pfOther; Value: 'M000'), (Range: 1000000000; Plural: pfOne; Value: 'B0'), (Range: 1000000000; Plural: pfOther; Value: 'B0'), (Range: 10000000000; Plural: pfOne; Value: 'B00'), (Range: 10000000000; Plural: pfOther; Value: 'B00'), (Range: 100000000000; Plural: pfOne; Value: 'B000'), (Range: 100000000000; Plural: pfOther; Value: 'B000'), (Range: 1000000000000; Plural: pfOne; Value: 'T0'), (Range: 1000000000000; Plural: pfOther; Value: 'T0'), (Range: 10000000000000; Plural: pfOne; Value: 'T00'), (Range: 10000000000000; Plural: pfOther; Value: 'T00'), (Range: 100000000000000; Plural: pfOne; Value: 'T000'), (Range: 100000000000000; Plural: pfOther; Value: 'T000') ); SW_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤elfu 0'), (Range: 1000; Plural: pfOther; Value: '¤elfu 0'), (Range: 10000; Plural: pfOne; Value: '¤elfu 00'), (Range: 10000; Plural: pfOther; Value: '¤elfu 00'), (Range: 100000; Plural: pfOne; Value: '¤laki 000'), (Range: 100000; Plural: pfOther; Value: '¤laki 000'), (Range: 1000000; Plural: pfOne; Value: '¤M0'), (Range: 1000000; Plural: pfOther; Value: '¤M0'), (Range: 10000000; Plural: pfOne; Value: '¤M00'), (Range: 10000000; Plural: pfOther; Value: '¤M00'), (Range: 100000000; Plural: pfOne; Value: '¤M000'), (Range: 100000000; Plural: pfOther; Value: '¤M000'), (Range: 1000000000; Plural: pfOne; Value: '¤B0'), (Range: 1000000000; Plural: pfOther; Value: '¤B0'), (Range: 10000000000; Plural: pfOne; Value: '¤B00'), (Range: 10000000000; Plural: pfOther; Value: '¤B00'), (Range: 100000000000; Plural: pfOne; Value: '¤B000'), (Range: 100000000000; Plural: pfOther; Value: '¤B000'), (Range: 1000000000000; Plural: pfOne; Value: '¤T0'), (Range: 1000000000000; Plural: pfOther; Value: '¤T0'), (Range: 10000000000000; Plural: pfOne; Value: '¤T00'), (Range: 10000000000000; Plural: pfOther; Value: '¤T00'), (Range: 100000000000000; Plural: pfOne; Value: '¤T000'), (Range: 100000000000000; Plural: pfOther; Value: '¤T000') ); // Tamil TA_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ஆயிரம்'), (Range: 1000; Plural: pfOther; Value: '0 ஆயிரம்'), (Range: 10000; Plural: pfOne; Value: '00 ஆயிரம்'), (Range: 10000; Plural: pfOther; Value: '00 ஆயிரம்'), (Range: 100000; Plural: pfOne; Value: '000 ஆயிரம்'), (Range: 100000; Plural: pfOther; Value: '000 ஆயிரம்'), (Range: 1000000; Plural: pfOne; Value: '0 மில்லியன்'), (Range: 1000000; Plural: pfOther; Value: '0 மில்லியன்'), (Range: 10000000; Plural: pfOne; Value: '00 மில்லியன்'), (Range: 10000000; Plural: pfOther; Value: '00 மில்லியன்'), (Range: 100000000; Plural: pfOne; Value: '000 மில்லியன்'), (Range: 100000000; Plural: pfOther; Value: '000 மில்லியன்'), (Range: 1000000000; Plural: pfOne; Value: '0 பில்லியன்'), (Range: 1000000000; Plural: pfOther; Value: '0 பில்லியன்'), (Range: 10000000000; Plural: pfOne; Value: '00 பில்லியன்'), (Range: 10000000000; Plural: pfOther; Value: '00 பில்லியன்'), (Range: 100000000000; Plural: pfOne; Value: '000 பில்லியன்'), (Range: 100000000000; Plural: pfOther; Value: '000 பில்லியன்'), (Range: 1000000000000; Plural: pfOne; Value: '0 டிரில்லியன்'), (Range: 1000000000000; Plural: pfOther; Value: '0 டிரில்லியன்'), (Range: 10000000000000; Plural: pfOne; Value: '00 டிரில்லியன்'), (Range: 10000000000000; Plural: pfOther; Value: '00 டிரில்லியன்'), (Range: 100000000000000; Plural: pfOne; Value: '000 டிரில்லியன்'), (Range: 100000000000000; Plural: pfOther; Value: '000 டிரில்லியன்') ); TA_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0ஆ'), (Range: 1000; Plural: pfOther; Value: '0ஆ'), (Range: 10000; Plural: pfOne; Value: '00ஆ'), (Range: 10000; Plural: pfOther; Value: '00ஆ'), (Range: 100000; Plural: pfOne; Value: '000ஆ'), (Range: 100000; Plural: pfOther; Value: '000ஆ'), (Range: 1000000; Plural: pfOne; Value: '0மி'), (Range: 1000000; Plural: pfOther; Value: '0மி'), (Range: 10000000; Plural: pfOne; Value: '00மி'), (Range: 10000000; Plural: pfOther; Value: '00மி'), (Range: 100000000; Plural: pfOne; Value: '000மி'), (Range: 100000000; Plural: pfOther; Value: '000மி'), (Range: 1000000000; Plural: pfOne; Value: '0பி'), (Range: 1000000000; Plural: pfOther; Value: '0பி'), (Range: 10000000000; Plural: pfOne; Value: '00பி'), (Range: 10000000000; Plural: pfOther; Value: '00பி'), (Range: 100000000000; Plural: pfOne; Value: '000பி'), (Range: 100000000000; Plural: pfOther; Value: '000பி'), (Range: 1000000000000; Plural: pfOne; Value: '0டி'), (Range: 1000000000000; Plural: pfOther; Value: '0டி'), (Range: 10000000000000; Plural: pfOne; Value: '00டி'), (Range: 10000000000000; Plural: pfOther; Value: '00டி'), (Range: 100000000000000; Plural: pfOne; Value: '000டி'), (Range: 100000000000000; Plural: pfOther; Value: '000டி') ); TA_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0ஆ'), (Range: 1000; Plural: pfOther; Value: '¤ 0ஆ'), (Range: 10000; Plural: pfOne; Value: '¤ 00ஆ'), (Range: 10000; Plural: pfOther; Value: '¤ 00ஆ'), (Range: 100000; Plural: pfOne; Value: '¤ 000ஆ'), (Range: 100000; Plural: pfOther; Value: '¤ 000ஆ'), (Range: 1000000; Plural: pfOne; Value: '¤ 0மி'), (Range: 1000000; Plural: pfOther; Value: '¤ 0மி'), (Range: 10000000; Plural: pfOne; Value: '¤ 00மி'), (Range: 10000000; Plural: pfOther; Value: '¤ 00மி'), (Range: 100000000; Plural: pfOne; Value: '¤ 000மி'), (Range: 100000000; Plural: pfOther; Value: '¤ 000மி'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0பி'), (Range: 1000000000; Plural: pfOther; Value: '¤0பி'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00பி'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00பி'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000பி'), (Range: 100000000000; Plural: pfOther; Value: '¤000பி'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0டி'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0டி'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00டி'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00டி'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000டி'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000டி') ); // Telugu TE_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 వేయి'), (Range: 1000; Plural: pfOther; Value: '0 వేలు'), (Range: 10000; Plural: pfOne; Value: '00 వేలు'), (Range: 10000; Plural: pfOther; Value: '00 వేలు'), (Range: 100000; Plural: pfOne; Value: '000 వేలు'), (Range: 100000; Plural: pfOther; Value: '000 వేలు'), (Range: 1000000; Plural: pfOne; Value: '0 మిలియన్'), (Range: 1000000; Plural: pfOther; Value: '0 మిలియన్లు'), (Range: 10000000; Plural: pfOne; Value: '00 మిలియన్లు'), (Range: 10000000; Plural: pfOther; Value: '00 మిలియన్లు'), (Range: 100000000; Plural: pfOne; Value: '000 మిలియన్లు'), (Range: 100000000; Plural: pfOther; Value: '000 మిలియన్లు'), (Range: 1000000000; Plural: pfOne; Value: '0 బిలియన్'), (Range: 1000000000; Plural: pfOther; Value: '0 బిలియన్లు'), (Range: 10000000000; Plural: pfOne; Value: '00 బిలియన్లు'), (Range: 10000000000; Plural: pfOther; Value: '00 బిలియన్లు'), (Range: 100000000000; Plural: pfOne; Value: '000 బిలియన్లు'), (Range: 100000000000; Plural: pfOther; Value: '000 బిలియన్లు'), (Range: 1000000000000; Plural: pfOne; Value: '0 ట్రిలియన్'), (Range: 1000000000000; Plural: pfOther; Value: '0 ట్రిలియన్లు'), (Range: 10000000000000; Plural: pfOne; Value: '00 ట్రిలియన్లు'), (Range: 10000000000000; Plural: pfOther; Value: '00 ట్రిలియన్లు'), (Range: 100000000000000; Plural: pfOne; Value: '000 ట్రిలియన్లు'), (Range: 100000000000000; Plural: pfOther; Value: '000 ట్రిలియన్లు') ); TE_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0వే'), (Range: 1000; Plural: pfOther; Value: '0వే'), (Range: 10000; Plural: pfOne; Value: '00వే'), (Range: 10000; Plural: pfOther; Value: '00వే'), (Range: 100000; Plural: pfOne; Value: '000వే'), (Range: 100000; Plural: pfOther; Value: '000వే'), (Range: 1000000; Plural: pfOne; Value: '0మి'), (Range: 1000000; Plural: pfOther; Value: '0మి'), (Range: 10000000; Plural: pfOne; Value: '00మి'), (Range: 10000000; Plural: pfOther; Value: '00మి'), (Range: 100000000; Plural: pfOne; Value: '000మి'), (Range: 100000000; Plural: pfOther; Value: '000మి'), (Range: 1000000000; Plural: pfOne; Value: '0బి'), (Range: 1000000000; Plural: pfOther; Value: '0బి'), (Range: 10000000000; Plural: pfOne; Value: '00బి'), (Range: 10000000000; Plural: pfOther; Value: '00బి'), (Range: 100000000000; Plural: pfOne; Value: '000బి'), (Range: 100000000000; Plural: pfOther; Value: '000బి'), (Range: 1000000000000; Plural: pfOne; Value: '0ట్రి'), (Range: 1000000000000; Plural: pfOther; Value: '0ట్రి'), (Range: 10000000000000; Plural: pfOne; Value: '00ట్రి'), (Range: 10000000000000; Plural: pfOther; Value: '00ట్రి'), (Range: 100000000000000; Plural: pfOne; Value: '000ట్రి'), (Range: 100000000000000; Plural: pfOther; Value: '000ట్రి') ); TE_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0వే'), (Range: 1000; Plural: pfOther; Value: '¤0వే'), (Range: 10000; Plural: pfOne; Value: '¤00వే'), (Range: 10000; Plural: pfOther; Value: '¤00వే'), (Range: 100000; Plural: pfOne; Value: '¤000వే'), (Range: 100000; Plural: pfOther; Value: '¤000వే'), (Range: 1000000; Plural: pfOne; Value: '¤0మి'), (Range: 1000000; Plural: pfOther; Value: '¤0మి'), (Range: 10000000; Plural: pfOne; Value: '¤00మి'), (Range: 10000000; Plural: pfOther; Value: '¤00మి'), (Range: 100000000; Plural: pfOne; Value: '¤000మి'), (Range: 100000000; Plural: pfOther; Value: '¤000మి'), (Range: 1000000000; Plural: pfOne; Value: '¤0బి'), (Range: 1000000000; Plural: pfOther; Value: '¤0బి'), (Range: 10000000000; Plural: pfOne; Value: '¤00బి'), (Range: 10000000000; Plural: pfOther; Value: '¤00బి'), (Range: 100000000000; Plural: pfOne; Value: '¤000బి'), (Range: 100000000000; Plural: pfOther; Value: '¤000బి'), (Range: 1000000000000; Plural: pfOne; Value: '¤0ట్రి'), (Range: 1000000000000; Plural: pfOther; Value: '¤0ట్రి'), (Range: 10000000000000; Plural: pfOne; Value: '¤00ట్రి'), (Range: 10000000000000; Plural: pfOther; Value: '¤00ట్రి'), (Range: 100000000000000; Plural: pfOne; Value: '¤000ట్రి'), (Range: 100000000000000; Plural: pfOther; Value: '¤000ట్రి') ); // Teso TEO_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Thai TH_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 พัน'), (Range: 10000; Plural: pfOther; Value: '0 หมื่น'), (Range: 100000; Plural: pfOther; Value: '0 แสน'), (Range: 1000000; Plural: pfOther; Value: '0 ล้าน'), (Range: 10000000; Plural: pfOther; Value: '00 ล้าน'), (Range: 100000000; Plural: pfOther; Value: '000 ล้าน'), (Range: 1000000000; Plural: pfOther; Value: '0 พันล้าน'), (Range: 10000000000; Plural: pfOther; Value: '0 หมื่นล้าน'), (Range: 100000000000; Plural: pfOther; Value: '0 แสนล้าน'), (Range: 1000000000000; Plural: pfOther; Value: '0 ล้านล้าน'), (Range: 10000000000000; Plural: pfOther; Value: '00 ล้านล้าน'), (Range: 100000000000000; Plural: pfOther; Value: '000 ล้านล้าน') ); TH_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 พ.'), (Range: 10000; Plural: pfOther; Value: '0 ม.'), (Range: 100000; Plural: pfOther; Value: '0 ส.'), (Range: 1000000; Plural: pfOther; Value: '0 ล.'), (Range: 10000000; Plural: pfOther; Value: '00 ล.'), (Range: 100000000; Plural: pfOther; Value: '000 ล.'), (Range: 1000000000; Plural: pfOther; Value: '0 พ.ล.'), (Range: 10000000000; Plural: pfOther; Value: '0 ม.ล.'), (Range: 100000000000; Plural: pfOther; Value: '0 ส.ล.'), (Range: 1000000000000; Plural: pfOther; Value: '0 ล.ล.'), (Range: 10000000000000; Plural: pfOther; Value: '00 ล.ล.'), (Range: 100000000000000; Plural: pfOther; Value: '000 ล.ล.') ); TH_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0 พ.'), (Range: 10000; Plural: pfOther; Value: '¤0 ม.'), (Range: 100000; Plural: pfOther; Value: '¤0 ส.'), (Range: 1000000; Plural: pfOther; Value: '¤0 ล.'), (Range: 10000000; Plural: pfOther; Value: '¤00 ล.'), (Range: 100000000; Plural: pfOther; Value: '¤000 ล.'), (Range: 1000000000; Plural: pfOther; Value: '¤0 พ.ล.'), (Range: 10000000000; Plural: pfOther; Value: '¤0 ม.ล.'), (Range: 100000000000; Plural: pfOther; Value: '¤0 ส.ล.'), (Range: 1000000000000; Plural: pfOther; Value: '¤0 ล.ล.'), (Range: 10000000000000; Plural: pfOther; Value: '¤00 ล.ล.'), (Range: 100000000000000; Plural: pfOther; Value: '¤000 ล.ล.') ); // Tigrinya TI_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Turkmen TK_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 müň'), (Range: 1000; Plural: pfOther; Value: '0 müň'), (Range: 10000; Plural: pfOne; Value: '00 müň'), (Range: 10000; Plural: pfOther; Value: '00 müň'), (Range: 100000; Plural: pfOne; Value: '000 müň'), (Range: 100000; Plural: pfOther; Value: '000 müň'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 million'), (Range: 10000000; Plural: pfOne; Value: '00 million'), (Range: 10000000; Plural: pfOther; Value: '00 million'), (Range: 100000000; Plural: pfOne; Value: '000 million'), (Range: 100000000; Plural: pfOther; Value: '000 million'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliard'), (Range: 10000000000; Plural: pfOne; Value: '00 milliard'), (Range: 10000000000; Plural: pfOther; Value: '00 milliard'), (Range: 100000000000; Plural: pfOne; Value: '000 milliard'), (Range: 100000000000; Plural: pfOther; Value: '000 milliard'), (Range: 1000000000000; Plural: pfOne; Value: '0 trillion'), (Range: 1000000000000; Plural: pfOther; Value: '0 trillion'), (Range: 10000000000000; Plural: pfOne; Value: '00 trillion'), (Range: 10000000000000; Plural: pfOther; Value: '00 trillion'), (Range: 100000000000000; Plural: pfOne; Value: '000 trillion'), (Range: 100000000000000; Plural: pfOther; Value: '000 trillion') ); TK_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 müň'), (Range: 1000; Plural: pfOther; Value: '0 müň'), (Range: 10000; Plural: pfOne; Value: '00 müň'), (Range: 10000; Plural: pfOther; Value: '00 müň'), (Range: 100000; Plural: pfOne; Value: '000 müň'), (Range: 100000; Plural: pfOther; Value: '000 müň'), (Range: 1000000; Plural: pfOne; Value: '0 mln'), (Range: 1000000; Plural: pfOther; Value: '0 mln'), (Range: 10000000; Plural: pfOne; Value: '00 mln'), (Range: 10000000; Plural: pfOther; Value: '00 mln'), (Range: 100000000; Plural: pfOne; Value: '000 mln'), (Range: 100000000; Plural: pfOther; Value: '000 mln'), (Range: 1000000000; Plural: pfOne; Value: '0 mlrd'), (Range: 1000000000; Plural: pfOther; Value: '0 mlrd'), (Range: 10000000000; Plural: pfOne; Value: '00 mlrd'), (Range: 10000000000; Plural: pfOther; Value: '00 mlrd'), (Range: 100000000000; Plural: pfOne; Value: '000 mlrd'), (Range: 100000000000; Plural: pfOther; Value: '000 mlrd'), (Range: 1000000000000; Plural: pfOne; Value: '0 trln'), (Range: 1000000000000; Plural: pfOther; Value: '0 trln'), (Range: 10000000000000; Plural: pfOne; Value: '00 trln'), (Range: 10000000000000; Plural: pfOther; Value: '00 trln'), (Range: 100000000000000; Plural: pfOne; Value: '000 trln'), (Range: 100000000000000; Plural: pfOther; Value: '000 trln') ); TK_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 müň ¤'), (Range: 1000; Plural: pfOther; Value: '0 müň ¤'), (Range: 10000; Plural: pfOne; Value: '00 müň ¤'), (Range: 10000; Plural: pfOther; Value: '00 müň ¤'), (Range: 100000; Plural: pfOne; Value: '000 müň ¤'), (Range: 100000; Plural: pfOther; Value: '000 müň ¤'), (Range: 1000000; Plural: pfOne; Value: '0 mln ¤'), (Range: 1000000; Plural: pfOther; Value: '0 mln ¤'), (Range: 10000000; Plural: pfOne; Value: '00 mln ¤'), (Range: 10000000; Plural: pfOther; Value: '00 mln ¤'), (Range: 100000000; Plural: pfOne; Value: '000 mln ¤'), (Range: 100000000; Plural: pfOther; Value: '000 mln ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 mlrd ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 mlrd ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 mlrd ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 mlrd ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 mlrd ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 mlrd ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 trln ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 trln ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 trln ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 trln ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 trln ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 trln ¤') ); // Tongan TO_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 afe'), (Range: 10000; Plural: pfOther; Value: '0 mano'), (Range: 100000; Plural: pfOther; Value: '0 kilu'), (Range: 1000000; Plural: pfOther; Value: '0 miliona'), (Range: 10000000; Plural: pfOther; Value: '00 miliona'), (Range: 100000000; Plural: pfOther; Value: '000 miliona'), (Range: 1000000000; Plural: pfOther; Value: '0 piliona'), (Range: 10000000000; Plural: pfOther; Value: '00 piliona'), (Range: 100000000000; Plural: pfOther; Value: '000 piliona'), (Range: 1000000000000; Plural: pfOther; Value: '0 tiliona'), (Range: 10000000000000; Plural: pfOther; Value: '00 tiliona'), (Range: 100000000000000; Plural: pfOther; Value: '000 tiliona') ); TO_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0k'), (Range: 10000; Plural: pfOther; Value: '00k'), (Range: 100000; Plural: pfOther; Value: '000k'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOther; Value: '0Ki'), (Range: 10000000000; Plural: pfOther; Value: '00Ki'), (Range: 100000000000; Plural: pfOther; Value: '000Ki'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); TO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤ 0k'), (Range: 10000; Plural: pfOther; Value: '¤ 00k'), (Range: 100000; Plural: pfOther; Value: '¤ 000k'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0Ki'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00Ki'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000Ki'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Turkish TR_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 bin'), (Range: 1000; Plural: pfOther; Value: '0 bin'), (Range: 10000; Plural: pfOne; Value: '00 bin'), (Range: 10000; Plural: pfOther; Value: '00 bin'), (Range: 100000; Plural: pfOne; Value: '000 bin'), (Range: 100000; Plural: pfOther; Value: '000 bin'), (Range: 1000000; Plural: pfOne; Value: '0 milyon'), (Range: 1000000; Plural: pfOther; Value: '0 milyon'), (Range: 10000000; Plural: pfOne; Value: '00 milyon'), (Range: 10000000; Plural: pfOther; Value: '00 milyon'), (Range: 100000000; Plural: pfOne; Value: '000 milyon'), (Range: 100000000; Plural: pfOther; Value: '000 milyon'), (Range: 1000000000; Plural: pfOne; Value: '0 milyar'), (Range: 1000000000; Plural: pfOther; Value: '0 milyar'), (Range: 10000000000; Plural: pfOne; Value: '00 milyar'), (Range: 10000000000; Plural: pfOther; Value: '00 milyar'), (Range: 100000000000; Plural: pfOne; Value: '000 milyar'), (Range: 100000000000; Plural: pfOther; Value: '000 milyar'), (Range: 1000000000000; Plural: pfOne; Value: '0 trilyon'), (Range: 1000000000000; Plural: pfOther; Value: '0 trilyon'), (Range: 10000000000000; Plural: pfOne; Value: '00 trilyon'), (Range: 10000000000000; Plural: pfOther; Value: '00 trilyon'), (Range: 100000000000000; Plural: pfOne; Value: '000 trilyon'), (Range: 100000000000000; Plural: pfOther; Value: '000 trilyon') ); TR_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 B'), (Range: 1000; Plural: pfOther; Value: '0 B'), (Range: 10000; Plural: pfOne; Value: '00 B'), (Range: 10000; Plural: pfOther; Value: '00 B'), (Range: 100000; Plural: pfOne; Value: '000 B'), (Range: 100000; Plural: pfOther; Value: '000 B'), (Range: 1000000; Plural: pfOne; Value: '0 Mn'), (Range: 1000000; Plural: pfOther; Value: '0 Mn'), (Range: 10000000; Plural: pfOne; Value: '00 Mn'), (Range: 10000000; Plural: pfOther; Value: '00 Mn'), (Range: 100000000; Plural: pfOne; Value: '000 Mn'), (Range: 100000000; Plural: pfOther; Value: '000 Mn'), (Range: 1000000000; Plural: pfOne; Value: '0 Mr'), (Range: 1000000000; Plural: pfOther; Value: '0 Mr'), (Range: 10000000000; Plural: pfOne; Value: '00 Mr'), (Range: 10000000000; Plural: pfOther; Value: '00 Mr'), (Range: 100000000000; Plural: pfOne; Value: '000 Mr'), (Range: 100000000000; Plural: pfOther; Value: '000 Mr'), (Range: 1000000000000; Plural: pfOne; Value: '0 Tn'), (Range: 1000000000000; Plural: pfOther; Value: '0 Tn'), (Range: 10000000000000; Plural: pfOne; Value: '00 Tn'), (Range: 10000000000000; Plural: pfOther; Value: '00 Tn'), (Range: 100000000000000; Plural: pfOne; Value: '000 Tn'), (Range: 100000000000000; Plural: pfOther; Value: '000 Tn') ); TR_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 B ¤'), (Range: 1000; Plural: pfOther; Value: '0 B ¤'), (Range: 10000; Plural: pfOne; Value: '00 B ¤'), (Range: 10000; Plural: pfOther; Value: '00 B ¤'), (Range: 100000; Plural: pfOne; Value: '000 B ¤'), (Range: 100000; Plural: pfOther; Value: '000 B ¤'), (Range: 1000000; Plural: pfOne; Value: '0 Mn ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Mn ¤'), (Range: 10000000; Plural: pfOne; Value: '00 Mn ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Mn ¤'), (Range: 100000000; Plural: pfOne; Value: '000 Mn ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Mn ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 Mr ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 Mr ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 Mr ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 Mr ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 Mr ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 Mr ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 Tn ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 Tn ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 Tn ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 Tn ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 Tn ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 Tn ¤') ); // Tasawaq TWQ_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Central Atlas Tamazight TZM_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Uyghur UG_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 مىڭ'), (Range: 1000; Plural: pfOther; Value: '0 مىڭ'), (Range: 10000; Plural: pfOne; Value: '00 مىڭ'), (Range: 10000; Plural: pfOther; Value: '00 مىڭ'), (Range: 100000; Plural: pfOne; Value: '000 مىڭ'), (Range: 100000; Plural: pfOther; Value: '000 مىڭ'), (Range: 1000000; Plural: pfOne; Value: '0 مىليون'), (Range: 1000000; Plural: pfOther; Value: '0 مىليون'), (Range: 10000000; Plural: pfOne; Value: '00 مىليون'), (Range: 10000000; Plural: pfOther; Value: '00 مىليون'), (Range: 100000000; Plural: pfOne; Value: '000 مىليون'), (Range: 100000000; Plural: pfOther; Value: '000 مىليون'), (Range: 1000000000; Plural: pfOne; Value: '0 مىليارد'), (Range: 1000000000; Plural: pfOther; Value: '0 مىليارد'), (Range: 10000000000; Plural: pfOne; Value: '00 مىليارد'), (Range: 10000000000; Plural: pfOther; Value: '00 مىليارد'), (Range: 100000000000; Plural: pfOne; Value: '000 مىليارد'), (Range: 100000000000; Plural: pfOther; Value: '000 مىليارد'), (Range: 1000000000000; Plural: pfOne; Value: '0 تىرىليون'), (Range: 1000000000000; Plural: pfOther; Value: '0 تىرىليون'), (Range: 10000000000000; Plural: pfOne; Value: '00 تىرىليون'), (Range: 10000000000000; Plural: pfOther; Value: '00 تىرىليون'), (Range: 100000000000000; Plural: pfOne; Value: '000 تىرىليون'), (Range: 100000000000000; Plural: pfOther; Value: '000 تىرىليون') ); UG_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0مىڭ'), (Range: 1000; Plural: pfOther; Value: '0مىڭ'), (Range: 10000; Plural: pfOne; Value: '00مىڭ'), (Range: 10000; Plural: pfOther; Value: '00مىڭ'), (Range: 100000; Plural: pfOne; Value: '000مىڭ'), (Range: 100000; Plural: pfOther; Value: '000مىڭ'), (Range: 1000000; Plural: pfOne; Value: '0مىليون'), (Range: 1000000; Plural: pfOther; Value: '0مىليون'), (Range: 10000000; Plural: pfOne; Value: '00مىليون'), (Range: 10000000; Plural: pfOther; Value: '00مىليون'), (Range: 100000000; Plural: pfOne; Value: '000مىليون'), (Range: 100000000; Plural: pfOther; Value: '000مىليون'), (Range: 1000000000; Plural: pfOne; Value: '0مىليارد'), (Range: 1000000000; Plural: pfOther; Value: '0مىليارد'), (Range: 10000000000; Plural: pfOne; Value: '00مىليارد'), (Range: 10000000000; Plural: pfOther; Value: '00مىليارد'), (Range: 100000000000; Plural: pfOne; Value: '000مىليارد'), (Range: 100000000000; Plural: pfOther; Value: '000مىليارد'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); UG_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0مىڭ'), (Range: 1000; Plural: pfOther; Value: '¤0مىڭ'), (Range: 10000; Plural: pfOne; Value: '¤00مىڭ'), (Range: 10000; Plural: pfOther; Value: '¤00مىڭ'), (Range: 100000; Plural: pfOne; Value: '¤000مىڭ'), (Range: 100000; Plural: pfOther; Value: '¤000مىڭ'), (Range: 1000000; Plural: pfOne; Value: '¤0مىليون'), (Range: 1000000; Plural: pfOther; Value: '¤0مىليون'), (Range: 10000000; Plural: pfOne; Value: '¤00مىليون'), (Range: 10000000; Plural: pfOther; Value: '¤00مىليون'), (Range: 100000000; Plural: pfOne; Value: '¤000مىليون'), (Range: 100000000; Plural: pfOther; Value: '¤000مىليون'), (Range: 1000000000; Plural: pfOne; Value: '¤0مىليارد'), (Range: 1000000000; Plural: pfOther; Value: '¤0مىليارد'), (Range: 10000000000; Plural: pfOne; Value: '¤00مىليارد'), (Range: 10000000000; Plural: pfOther; Value: '¤00مىليارد'), (Range: 100000000000; Plural: pfOne; Value: '¤000مىليارد'), (Range: 100000000000; Plural: pfOther; Value: '¤000مىليارد'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Ukrainian UK_LONG: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тисяча'), (Range: 1000; Plural: pfFew; Value: '0 тисячі'), (Range: 1000; Plural: pfMany; Value: '0 тисяч'), (Range: 1000; Plural: pfOther; Value: '0 тисячі'), (Range: 10000; Plural: pfOne; Value: '00 тисяча'), (Range: 10000; Plural: pfFew; Value: '00 тисячі'), (Range: 10000; Plural: pfMany; Value: '00 тисяч'), (Range: 10000; Plural: pfOther; Value: '00 тисячі'), (Range: 100000; Plural: pfOne; Value: '000 тисяча'), (Range: 100000; Plural: pfFew; Value: '000 тисячі'), (Range: 100000; Plural: pfMany; Value: '000 тисяч'), (Range: 100000; Plural: pfOther; Value: '000 тисячі'), (Range: 1000000; Plural: pfOne; Value: '0 мільйон'), (Range: 1000000; Plural: pfFew; Value: '0 мільйони'), (Range: 1000000; Plural: pfMany; Value: '0 мільйонів'), (Range: 1000000; Plural: pfOther; Value: '0 мільйона'), (Range: 10000000; Plural: pfOne; Value: '00 мільйон'), (Range: 10000000; Plural: pfFew; Value: '00 мільйони'), (Range: 10000000; Plural: pfMany; Value: '00 мільйонів'), (Range: 10000000; Plural: pfOther; Value: '00 мільйона'), (Range: 100000000; Plural: pfOne; Value: '000 мільйон'), (Range: 100000000; Plural: pfFew; Value: '000 мільйони'), (Range: 100000000; Plural: pfMany; Value: '000 мільйонів'), (Range: 100000000; Plural: pfOther; Value: '000 мільйона'), (Range: 1000000000; Plural: pfOne; Value: '0 мільярд'), (Range: 1000000000; Plural: pfFew; Value: '0 мільярди'), (Range: 1000000000; Plural: pfMany; Value: '0 мільярдів'), (Range: 1000000000; Plural: pfOther; Value: '0 мільярда'), (Range: 10000000000; Plural: pfOne; Value: '00 мільярд'), (Range: 10000000000; Plural: pfFew; Value: '00 мільярди'), (Range: 10000000000; Plural: pfMany; Value: '00 мільярдів'), (Range: 10000000000; Plural: pfOther; Value: '00 мільярда'), (Range: 100000000000; Plural: pfOne; Value: '000 мільярд'), (Range: 100000000000; Plural: pfFew; Value: '000 мільярди'), (Range: 100000000000; Plural: pfMany; Value: '000 мільярдів'), (Range: 100000000000; Plural: pfOther; Value: '000 мільярда'), (Range: 1000000000000; Plural: pfOne; Value: '0 трильйон'), (Range: 1000000000000; Plural: pfFew; Value: '0 трильйони'), (Range: 1000000000000; Plural: pfMany; Value: '0 трильйонів'), (Range: 1000000000000; Plural: pfOther; Value: '0 трильйона'), (Range: 10000000000000; Plural: pfOne; Value: '00 трильйон'), (Range: 10000000000000; Plural: pfFew; Value: '00 трильйони'), (Range: 10000000000000; Plural: pfMany; Value: '00 трильйонів'), (Range: 10000000000000; Plural: pfOther; Value: '00 трильйона'), (Range: 100000000000000; Plural: pfOne; Value: '000 трильйон'), (Range: 100000000000000; Plural: pfFew; Value: '000 трильйони'), (Range: 100000000000000; Plural: pfMany; Value: '000 трильйонів'), (Range: 100000000000000; Plural: pfOther; Value: '000 трильйона') ); UK_SHORT: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тис.'), (Range: 1000; Plural: pfFew; Value: '0 тис.'), (Range: 1000; Plural: pfMany; Value: '0 тис.'), (Range: 1000; Plural: pfOther; Value: '0 тис.'), (Range: 10000; Plural: pfOne; Value: '00 тис.'), (Range: 10000; Plural: pfFew; Value: '00 тис.'), (Range: 10000; Plural: pfMany; Value: '00 тис.'), (Range: 10000; Plural: pfOther; Value: '00 тис.'), (Range: 100000; Plural: pfOne; Value: '000 тис.'), (Range: 100000; Plural: pfFew; Value: '000 тис.'), (Range: 100000; Plural: pfMany; Value: '000 тис.'), (Range: 100000; Plural: pfOther; Value: '000 тис.'), (Range: 1000000; Plural: pfOne; Value: '0 млн'), (Range: 1000000; Plural: pfFew; Value: '0 млн'), (Range: 1000000; Plural: pfMany; Value: '0 млн'), (Range: 1000000; Plural: pfOther; Value: '0 млн'), (Range: 10000000; Plural: pfOne; Value: '00 млн'), (Range: 10000000; Plural: pfFew; Value: '00 млн'), (Range: 10000000; Plural: pfMany; Value: '00 млн'), (Range: 10000000; Plural: pfOther; Value: '00 млн'), (Range: 100000000; Plural: pfOne; Value: '000 млн'), (Range: 100000000; Plural: pfFew; Value: '000 млн'), (Range: 100000000; Plural: pfMany; Value: '000 млн'), (Range: 100000000; Plural: pfOther; Value: '000 млн'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд'), (Range: 1000000000; Plural: pfMany; Value: '0 млрд'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд'), (Range: 10000000000; Plural: pfMany; Value: '00 млрд'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд'), (Range: 100000000000; Plural: pfMany; Value: '000 млрд'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн'), (Range: 1000000000000; Plural: pfFew; Value: '0 трлн'), (Range: 1000000000000; Plural: pfMany; Value: '0 трлн'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн'), (Range: 10000000000000; Plural: pfFew; Value: '00 трлн'), (Range: 10000000000000; Plural: pfMany; Value: '00 трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн'), (Range: 100000000000000; Plural: pfFew; Value: '000 трлн'), (Range: 100000000000000; Plural: pfMany; Value: '000 трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн') ); UK_CURRENCY: array[0..47] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 тис. ¤'), (Range: 1000; Plural: pfFew; Value: '0 тис. ¤'), (Range: 1000; Plural: pfMany; Value: '0 тис. ¤'), (Range: 1000; Plural: pfOther; Value: '0 тис. ¤'), (Range: 10000; Plural: pfOne; Value: '00 тис. ¤'), (Range: 10000; Plural: pfFew; Value: '00 тис. ¤'), (Range: 10000; Plural: pfMany; Value: '00 тис. ¤'), (Range: 10000; Plural: pfOther; Value: '00 тис. ¤'), (Range: 100000; Plural: pfOne; Value: '000 тис. ¤'), (Range: 100000; Plural: pfFew; Value: '000 тис. ¤'), (Range: 100000; Plural: pfMany; Value: '000 тис. ¤'), (Range: 100000; Plural: pfOther; Value: '000 тис. ¤'), (Range: 1000000; Plural: pfOne; Value: '0 млн ¤'), (Range: 1000000; Plural: pfFew; Value: '0 млн ¤'), (Range: 1000000; Plural: pfMany; Value: '0 млн ¤'), (Range: 1000000; Plural: pfOther; Value: '0 млн ¤'), (Range: 10000000; Plural: pfOne; Value: '00 млн ¤'), (Range: 10000000; Plural: pfFew; Value: '00 млн ¤'), (Range: 10000000; Plural: pfMany; Value: '00 млн ¤'), (Range: 10000000; Plural: pfOther; Value: '00 млн ¤'), (Range: 100000000; Plural: pfOne; Value: '000 млн ¤'), (Range: 100000000; Plural: pfFew; Value: '000 млн ¤'), (Range: 100000000; Plural: pfMany; Value: '000 млн ¤'), (Range: 100000000; Plural: pfOther; Value: '000 млн ¤'), (Range: 1000000000; Plural: pfOne; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfFew; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfMany; Value: '0 млрд ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 млрд ¤'), (Range: 10000000000; Plural: pfOne; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfFew; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfMany; Value: '00 млрд ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 млрд ¤'), (Range: 100000000000; Plural: pfOne; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfFew; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfMany; Value: '000 млрд ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 млрд ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfFew; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfMany; Value: '0 трлн ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 трлн ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfFew; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfMany; Value: '00 трлн ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 трлн ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfFew; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfMany; Value: '000 трлн ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 трлн ¤') ); // Urdu UR_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ہزار'), (Range: 1000; Plural: pfOther; Value: '0 ہزار'), (Range: 10000; Plural: pfOne; Value: '00 ہزار'), (Range: 10000; Plural: pfOther; Value: '00 ہزار'), (Range: 100000; Plural: pfOne; Value: '0 لاکھ'), (Range: 100000; Plural: pfOther; Value: '0 لاکھ'), (Range: 1000000; Plural: pfOne; Value: '00 لاکھ'), (Range: 1000000; Plural: pfOther; Value: '00 لاکھ'), (Range: 10000000; Plural: pfOne; Value: '0 کروڑ'), (Range: 10000000; Plural: pfOther; Value: '0 کروڑ'), (Range: 100000000; Plural: pfOne; Value: '00 کروڑ'), (Range: 100000000; Plural: pfOther; Value: '00 کروڑ'), (Range: 1000000000; Plural: pfOne; Value: '0 ارب'), (Range: 1000000000; Plural: pfOther; Value: '0 ارب'), (Range: 10000000000; Plural: pfOne; Value: '00 ارب'), (Range: 10000000000; Plural: pfOther; Value: '00 ارب'), (Range: 100000000000; Plural: pfOne; Value: '0 کھرب'), (Range: 100000000000; Plural: pfOther; Value: '0 کھرب'), (Range: 1000000000000; Plural: pfOne; Value: '00 کھرب'), (Range: 1000000000000; Plural: pfOther; Value: '00 کھرب'), (Range: 10000000000000; Plural: pfOne; Value: '00 ٹریلین'), (Range: 10000000000000; Plural: pfOther; Value: '00 ٹریلین'), (Range: 100000000000000; Plural: pfOne; Value: '000 ٹریلین'), (Range: 100000000000000; Plural: pfOther; Value: '000 ٹریلین') ); UR_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ہزار'), (Range: 1000; Plural: pfOther; Value: '0 ہزار'), (Range: 10000; Plural: pfOne; Value: '00 ہزار'), (Range: 10000; Plural: pfOther; Value: '00 ہزار'), (Range: 100000; Plural: pfOne; Value: '0 لاکھ'), (Range: 100000; Plural: pfOther; Value: '0 لاکھ'), (Range: 1000000; Plural: pfOne; Value: '00 لاکھ'), (Range: 1000000; Plural: pfOther; Value: '00 لاکھ'), (Range: 10000000; Plural: pfOne; Value: '0 کروڑ'), (Range: 10000000; Plural: pfOther; Value: '0 کروڑ'), (Range: 100000000; Plural: pfOne; Value: '00 کروڑ'), (Range: 100000000; Plural: pfOther; Value: '00 کروڑ'), (Range: 1000000000; Plural: pfOne; Value: '0 ارب'), (Range: 1000000000; Plural: pfOther; Value: '0 ارب'), (Range: 10000000000; Plural: pfOne; Value: '00 ارب'), (Range: 10000000000; Plural: pfOther; Value: '00 ارب'), (Range: 100000000000; Plural: pfOne; Value: '0 کھرب'), (Range: 100000000000; Plural: pfOther; Value: '0 کھرب'), (Range: 1000000000000; Plural: pfOne; Value: '00 کھرب'), (Range: 1000000000000; Plural: pfOther; Value: '00 کھرب'), (Range: 10000000000000; Plural: pfOne; Value: '00 ٹریلین'), (Range: 10000000000000; Plural: pfOther; Value: '00 ٹریلین'), (Range: 100000000000000; Plural: pfOne; Value: '000 ٹریلین'), (Range: 100000000000000; Plural: pfOther; Value: '000 ٹریلین') ); // Uzbek, Latin UZ_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ming'), (Range: 1000; Plural: pfOther; Value: '0 ming'), (Range: 10000; Plural: pfOne; Value: '00 ming'), (Range: 10000; Plural: pfOther; Value: '00 ming'), (Range: 100000; Plural: pfOne; Value: '000 ming'), (Range: 100000; Plural: pfOther; Value: '000 ming'), (Range: 1000000; Plural: pfOne; Value: '0 million'), (Range: 1000000; Plural: pfOther; Value: '0 million'), (Range: 10000000; Plural: pfOne; Value: '00 million'), (Range: 10000000; Plural: pfOther; Value: '00 million'), (Range: 100000000; Plural: pfOne; Value: '000 million'), (Range: 100000000; Plural: pfOther; Value: '000 million'), (Range: 1000000000; Plural: pfOne; Value: '0 milliard'), (Range: 1000000000; Plural: pfOther; Value: '0 milliard'), (Range: 10000000000; Plural: pfOne; Value: '00 milliard'), (Range: 10000000000; Plural: pfOther; Value: '00 milliard'), (Range: 100000000000; Plural: pfOne; Value: '000 milliard'), (Range: 100000000000; Plural: pfOther; Value: '000 milliard'), (Range: 1000000000000; Plural: pfOne; Value: '0 trillion'), (Range: 1000000000000; Plural: pfOther; Value: '0 trillion'), (Range: 10000000000000; Plural: pfOne; Value: '00 trillion'), (Range: 10000000000000; Plural: pfOther; Value: '00 trillion'), (Range: 100000000000000; Plural: pfOne; Value: '000 trillion'), (Range: 100000000000000; Plural: pfOther; Value: '000 trillion') ); UZ_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 ming'), (Range: 1000; Plural: pfOther; Value: '0 ming'), (Range: 10000; Plural: pfOne; Value: '00 ming'), (Range: 10000; Plural: pfOther; Value: '00 ming'), (Range: 100000; Plural: pfOne; Value: '000 ming'), (Range: 100000; Plural: pfOther; Value: '000 ming'), (Range: 1000000; Plural: pfOne; Value: '0 mln'), (Range: 1000000; Plural: pfOther; Value: '0 mln'), (Range: 10000000; Plural: pfOne; Value: '00 mln'), (Range: 10000000; Plural: pfOther; Value: '00 mln'), (Range: 100000000; Plural: pfOne; Value: '000 mln'), (Range: 100000000; Plural: pfOther; Value: '000 mln'), (Range: 1000000000; Plural: pfOne; Value: '0 mlrd'), (Range: 1000000000; Plural: pfOther; Value: '0 mlrd'), (Range: 10000000000; Plural: pfOne; Value: '00 mlrd'), (Range: 10000000000; Plural: pfOther; Value: '00 mlrd'), (Range: 100000000000; Plural: pfOne; Value: '000 mlrd'), (Range: 100000000000; Plural: pfOther; Value: '000 mlrd'), (Range: 1000000000000; Plural: pfOne; Value: '0 trln'), (Range: 1000000000000; Plural: pfOther; Value: '0 trln'), (Range: 10000000000000; Plural: pfOne; Value: '00 trln'), (Range: 10000000000000; Plural: pfOther; Value: '00 trln'), (Range: 100000000000000; Plural: pfOne; Value: '000 trln'), (Range: 100000000000000; Plural: pfOther; Value: '000 trln') ); // Uzbek, Perso-Arabic UZ_ARAB_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Uzbek, Cyrillic UZ_CYRL_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 минг'), (Range: 1000; Plural: pfOther; Value: '0 минг'), (Range: 10000; Plural: pfOne; Value: '00 минг'), (Range: 10000; Plural: pfOther; Value: '00 минг'), (Range: 100000; Plural: pfOne; Value: '000 минг'), (Range: 100000; Plural: pfOther; Value: '000 минг'), (Range: 1000000; Plural: pfOne; Value: '0 миллион'), (Range: 1000000; Plural: pfOther; Value: '0 миллион'), (Range: 10000000; Plural: pfOne; Value: '00 миллион'), (Range: 10000000; Plural: pfOther; Value: '00 миллион'), (Range: 100000000; Plural: pfOne; Value: '000 миллион'), (Range: 100000000; Plural: pfOther; Value: '000 миллион'), (Range: 1000000000; Plural: pfOne; Value: '0 миллиард'), (Range: 1000000000; Plural: pfOther; Value: '0 миллиард'), (Range: 10000000000; Plural: pfOne; Value: '00 миллиард'), (Range: 10000000000; Plural: pfOther; Value: '00 миллиард'), (Range: 100000000000; Plural: pfOne; Value: '000 миллиард'), (Range: 100000000000; Plural: pfOther; Value: '000 миллиард'), (Range: 1000000000000; Plural: pfOne; Value: '0 трилион'), (Range: 1000000000000; Plural: pfOther; Value: '0 трилион'), (Range: 10000000000000; Plural: pfOne; Value: '00 трилион'), (Range: 10000000000000; Plural: pfOther; Value: '00 трилион'), (Range: 100000000000000; Plural: pfOne; Value: '000 трилион'), (Range: 100000000000000; Plural: pfOther; Value: '000 трилион') ); UZ_CYRL_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0минг'), (Range: 1000; Plural: pfOther; Value: '0минг'), (Range: 10000; Plural: pfOne; Value: '00минг'), (Range: 10000; Plural: pfOther; Value: '00минг'), (Range: 100000; Plural: pfOne; Value: '000минг'), (Range: 100000; Plural: pfOther; Value: '000минг'), (Range: 1000000; Plural: pfOne; Value: '0млн'), (Range: 1000000; Plural: pfOther; Value: '0млн'), (Range: 10000000; Plural: pfOne; Value: '00млн'), (Range: 10000000; Plural: pfOther; Value: '00млн'), (Range: 100000000; Plural: pfOne; Value: '000млн'), (Range: 100000000; Plural: pfOther; Value: '000млн'), (Range: 1000000000; Plural: pfOne; Value: '0млрд'), (Range: 1000000000; Plural: pfOther; Value: '0млрд'), (Range: 10000000000; Plural: pfOne; Value: '00млрд'), (Range: 10000000000; Plural: pfOther; Value: '00млрд'), (Range: 100000000000; Plural: pfOne; Value: '000млрд'), (Range: 100000000000; Plural: pfOther; Value: '000млрд'), (Range: 1000000000000; Plural: pfOne; Value: '0трлн'), (Range: 1000000000000; Plural: pfOther; Value: '0трлн'), (Range: 10000000000000; Plural: pfOne; Value: '00трлн'), (Range: 10000000000000; Plural: pfOther; Value: '00трлн'), (Range: 100000000000000; Plural: pfOne; Value: '000трлн'), (Range: 100000000000000; Plural: pfOther; Value: '000трлн') ); // Vai VAI_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Vai, Latin VAI_LATN_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Vietnamese VI_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 nghìn'), (Range: 10000; Plural: pfOther; Value: '00 nghìn'), (Range: 100000; Plural: pfOther; Value: '000 nghìn'), (Range: 1000000; Plural: pfOther; Value: '0 triệu'), (Range: 10000000; Plural: pfOther; Value: '00 triệu'), (Range: 100000000; Plural: pfOther; Value: '000 triệu'), (Range: 1000000000; Plural: pfOther; Value: '0 tỷ'), (Range: 10000000000; Plural: pfOther; Value: '00 tỷ'), (Range: 100000000000; Plural: pfOther; Value: '000 tỷ'), (Range: 1000000000000; Plural: pfOther; Value: '0 nghìn tỷ'), (Range: 10000000000000; Plural: pfOther; Value: '00 nghìn tỷ'), (Range: 100000000000000; Plural: pfOther; Value: '000 nghìn tỷ') ); VI_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 N'), (Range: 10000; Plural: pfOther; Value: '00 N'), (Range: 100000; Plural: pfOther; Value: '000 N'), (Range: 1000000; Plural: pfOther; Value: '0 Tr'), (Range: 10000000; Plural: pfOther; Value: '00 Tr'), (Range: 100000000; Plural: pfOther; Value: '000 Tr'), (Range: 1000000000; Plural: pfOther; Value: '0 T'), (Range: 10000000000; Plural: pfOther; Value: '00 T'), (Range: 100000000000; Plural: pfOther; Value: '000 T'), (Range: 1000000000000; Plural: pfOther; Value: '0 NT'), (Range: 10000000000000; Plural: pfOther; Value: '00 NT'), (Range: 100000000000000; Plural: pfOther; Value: '000 NT') ); VI_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0 N ¤'), (Range: 10000; Plural: pfOther; Value: '00 N ¤'), (Range: 100000; Plural: pfOther; Value: '000 N ¤'), (Range: 1000000; Plural: pfOther; Value: '0 Tr ¤'), (Range: 10000000; Plural: pfOther; Value: '00 Tr ¤'), (Range: 100000000; Plural: pfOther; Value: '000 Tr ¤'), (Range: 1000000000; Plural: pfOther; Value: '0 T ¤'), (Range: 10000000000; Plural: pfOther; Value: '00 T ¤'), (Range: 100000000000; Plural: pfOther; Value: '000 T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0 NT ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00 NT ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000 NT ¤') ); // Vunjo VUN_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0G'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOne; Value: '¤00G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOne; Value: '¤000G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // Walser WAE_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Soga XOG_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K ¤'), (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOne; Value: '00K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOne; Value: '000K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOne; Value: '0M ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOne; Value: '00M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOne; Value: '000M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOne; Value: '0G ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOne; Value: '00G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOne; Value: '000G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOne; Value: '0T ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOne; Value: '00T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOne; Value: '000T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Yangben YAV_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K ¤'), (Range: 10000; Plural: pfOther; Value: '00K ¤'), (Range: 100000; Plural: pfOther; Value: '000K ¤'), (Range: 1000000; Plural: pfOther; Value: '0M ¤'), (Range: 10000000; Plural: pfOther; Value: '00M ¤'), (Range: 100000000; Plural: pfOther; Value: '000M ¤'), (Range: 1000000000; Plural: pfOther; Value: '0G ¤'), (Range: 10000000000; Plural: pfOther; Value: '00G ¤'), (Range: 100000000000; Plural: pfOther; Value: '000G ¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T ¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T ¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T ¤') ); // Yiddish YI_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤ 0K'), (Range: 1000; Plural: pfOther; Value: '¤ 0K'), (Range: 10000; Plural: pfOne; Value: '¤ 00K'), (Range: 10000; Plural: pfOther; Value: '¤ 00K'), (Range: 100000; Plural: pfOne; Value: '¤ 000K'), (Range: 100000; Plural: pfOther; Value: '¤ 000K'), (Range: 1000000; Plural: pfOne; Value: '¤ 0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤ 00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤ 000M'), (Range: 100000000; Plural: pfOther; Value: '¤ 000M'), (Range: 1000000000; Plural: pfOne; Value: '¤ 0G'), (Range: 1000000000; Plural: pfOther; Value: '¤ 0G'), (Range: 10000000000; Plural: pfOne; Value: '¤ 00G'), (Range: 10000000000; Plural: pfOther; Value: '¤ 00G'), (Range: 100000000000; Plural: pfOne; Value: '¤ 000G'), (Range: 100000000000; Plural: pfOther; Value: '¤ 000G'), (Range: 1000000000000; Plural: pfOne; Value: '¤ 0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤ 0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤ 00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤ 00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤ 000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤ 000T') ); // Yoruba YO_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOther; Value: '¤0M'), (Range: 10000000; Plural: pfOther; Value: '¤00M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOther; Value: '¤0G'), (Range: 10000000000; Plural: pfOther; Value: '¤00G'), (Range: 100000000000; Plural: pfOther; Value: '¤000G'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); // YUE_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0千'), (Range: 10000; Plural: pfOther; Value: '0萬'), (Range: 100000; Plural: pfOther; Value: '00萬'), (Range: 1000000; Plural: pfOther; Value: '000萬'), (Range: 10000000; Plural: pfOther; Value: '0000萬'), (Range: 100000000; Plural: pfOther; Value: '0億'), (Range: 1000000000; Plural: pfOther; Value: '00億'), (Range: 10000000000; Plural: pfOther; Value: '000億'), (Range: 100000000000; Plural: pfOther; Value: '0000億'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); YUE_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0千'), (Range: 10000; Plural: pfOther; Value: '0萬'), (Range: 100000; Plural: pfOther; Value: '00萬'), (Range: 1000000; Plural: pfOther; Value: '000萬'), (Range: 10000000; Plural: pfOther; Value: '0000萬'), (Range: 100000000; Plural: pfOther; Value: '0億'), (Range: 1000000000; Plural: pfOther; Value: '00億'), (Range: 10000000000; Plural: pfOther; Value: '000億'), (Range: 100000000000; Plural: pfOther; Value: '0000億'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); // Standard Moroccan Tamazight ZGH_CURRENCY: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0K¤'), (Range: 10000; Plural: pfOther; Value: '00K¤'), (Range: 100000; Plural: pfOther; Value: '000K¤'), (Range: 1000000; Plural: pfOther; Value: '0M¤'), (Range: 10000000; Plural: pfOther; Value: '00M¤'), (Range: 100000000; Plural: pfOther; Value: '000M¤'), (Range: 1000000000; Plural: pfOther; Value: '0G¤'), (Range: 10000000000; Plural: pfOther; Value: '00G¤'), (Range: 100000000000; Plural: pfOther; Value: '000G¤'), (Range: 1000000000000; Plural: pfOther; Value: '0T¤'), (Range: 10000000000000; Plural: pfOther; Value: '00T¤'), (Range: 100000000000000; Plural: pfOther; Value: '000T¤') ); // Chinese, Simplified ZH_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0千'), (Range: 10000; Plural: pfOther; Value: '0万'), (Range: 100000; Plural: pfOther; Value: '00万'), (Range: 1000000; Plural: pfOther; Value: '000万'), (Range: 10000000; Plural: pfOther; Value: '0000万'), (Range: 100000000; Plural: pfOther; Value: '0亿'), (Range: 1000000000; Plural: pfOther; Value: '00亿'), (Range: 10000000000; Plural: pfOther; Value: '000亿'), (Range: 100000000000; Plural: pfOther; Value: '0000亿'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); ZH_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0千'), (Range: 10000; Plural: pfOther; Value: '0万'), (Range: 100000; Plural: pfOther; Value: '00万'), (Range: 1000000; Plural: pfOther; Value: '000万'), (Range: 10000000; Plural: pfOther; Value: '0000万'), (Range: 100000000; Plural: pfOther; Value: '0亿'), (Range: 1000000000; Plural: pfOther; Value: '00亿'), (Range: 10000000000; Plural: pfOther; Value: '000亿'), (Range: 100000000000; Plural: pfOther; Value: '0000亿'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); // Chinese, Traditional ZH_HANT_LONG: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0千'), (Range: 10000; Plural: pfOther; Value: '0萬'), (Range: 100000; Plural: pfOther; Value: '00萬'), (Range: 1000000; Plural: pfOther; Value: '000萬'), (Range: 10000000; Plural: pfOther; Value: '0000萬'), (Range: 100000000; Plural: pfOther; Value: '0億'), (Range: 1000000000; Plural: pfOther; Value: '00億'), (Range: 10000000000; Plural: pfOther; Value: '000億'), (Range: 100000000000; Plural: pfOther; Value: '0000億'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); ZH_HANT_SHORT: array[0..11] of TAbbreviationRule = ( (Range: 1000; Plural: pfOther; Value: '0千'), (Range: 10000; Plural: pfOther; Value: '0萬'), (Range: 100000; Plural: pfOther; Value: '00萬'), (Range: 1000000; Plural: pfOther; Value: '000萬'), (Range: 10000000; Plural: pfOther; Value: '0000萬'), (Range: 100000000; Plural: pfOther; Value: '0億'), (Range: 1000000000; Plural: pfOther; Value: '00億'), (Range: 10000000000; Plural: pfOther; Value: '000億'), (Range: 100000000000; Plural: pfOther; Value: '0000億'), (Range: 1000000000000; Plural: pfOther; Value: '0兆'), (Range: 10000000000000; Plural: pfOther; Value: '00兆'), (Range: 100000000000000; Plural: pfOther; Value: '000兆') ); // isiZulu ZU_LONG: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0 inkulungwane'), (Range: 1000; Plural: pfOther; Value: '0 inkulungwane'), (Range: 10000; Plural: pfOne; Value: '00 inkulungwane'), (Range: 10000; Plural: pfOther; Value: '00 inkulungwane'), (Range: 100000; Plural: pfOne; Value: '000 inkulungwane'), (Range: 100000; Plural: pfOther; Value: '000 inkulungwane'), (Range: 1000000; Plural: pfOne; Value: '0 isigidi'), (Range: 1000000; Plural: pfOther; Value: '0 isigidi'), (Range: 10000000; Plural: pfOne; Value: '00 isigidi'), (Range: 10000000; Plural: pfOther; Value: '00 isigidi'), (Range: 100000000; Plural: pfOne; Value: '000 isigidi'), (Range: 100000000; Plural: pfOther; Value: '000 isigidi'), (Range: 1000000000; Plural: pfOne; Value: '0 isigidi sezigidi'), (Range: 1000000000; Plural: pfOther; Value: '0 isigidi sezigidi'), (Range: 10000000000; Plural: pfOne; Value: '00 isigidi sezigidi'), (Range: 10000000000; Plural: pfOther; Value: '00 isigidi sezigidi'), (Range: 100000000000; Plural: pfOne; Value: '000 isigidi sezigidi'), (Range: 100000000000; Plural: pfOther; Value: '000 isigidi sezigidi'), (Range: 1000000000000; Plural: pfOne; Value: '0 isigidintathu'), (Range: 1000000000000; Plural: pfOther; Value: '0 isigidintathu'), (Range: 10000000000000; Plural: pfOne; Value: '00 isigidintathu'), (Range: 10000000000000; Plural: pfOther; Value: '00 isigidintathu'), (Range: 100000000000000; Plural: pfOne; Value: '000 isigidintathu'), (Range: 100000000000000; Plural: pfOther; Value: '000 isigidintathu') ); ZU_SHORT: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '0K'), (Range: 1000; Plural: pfOther; Value: '0K'), (Range: 10000; Plural: pfOne; Value: '00K'), (Range: 10000; Plural: pfOther; Value: '00K'), (Range: 100000; Plural: pfOne; Value: '000K'), (Range: 100000; Plural: pfOther; Value: '000K'), (Range: 1000000; Plural: pfOne; Value: '0M'), (Range: 1000000; Plural: pfOther; Value: '0M'), (Range: 10000000; Plural: pfOne; Value: '00M'), (Range: 10000000; Plural: pfOther; Value: '00M'), (Range: 100000000; Plural: pfOne; Value: '000M'), (Range: 100000000; Plural: pfOther; Value: '000M'), (Range: 1000000000; Plural: pfOne; Value: '0B'), (Range: 1000000000; Plural: pfOther; Value: '0B'), (Range: 10000000000; Plural: pfOne; Value: '00B'), (Range: 10000000000; Plural: pfOther; Value: '00B'), (Range: 100000000000; Plural: pfOne; Value: '000B'), (Range: 100000000000; Plural: pfOther; Value: '000B'), (Range: 1000000000000; Plural: pfOne; Value: '0T'), (Range: 1000000000000; Plural: pfOther; Value: '0T'), (Range: 10000000000000; Plural: pfOne; Value: '00T'), (Range: 10000000000000; Plural: pfOther; Value: '00T'), (Range: 100000000000000; Plural: pfOne; Value: '000T'), (Range: 100000000000000; Plural: pfOther; Value: '000T') ); ZU_CURRENCY: array[0..23] of TAbbreviationRule = ( (Range: 1000; Plural: pfOne; Value: '¤0K'), (Range: 1000; Plural: pfOther; Value: '¤0K'), (Range: 10000; Plural: pfOne; Value: '¤00K'), (Range: 10000; Plural: pfOther; Value: '¤00K'), (Range: 100000; Plural: pfOne; Value: '¤000K'), (Range: 100000; Plural: pfOther; Value: '¤000K'), (Range: 1000000; Plural: pfOne; Value: '¤0M'), (Range: 1000000; Plural: pfOther; Value: '¤ 0M'), (Range: 10000000; Plural: pfOne; Value: '¤00M'), (Range: 10000000; Plural: pfOther; Value: '¤ 00M'), (Range: 100000000; Plural: pfOne; Value: '¤000M'), (Range: 100000000; Plural: pfOther; Value: '¤000M'), (Range: 1000000000; Plural: pfOne; Value: '¤0B'), (Range: 1000000000; Plural: pfOther; Value: '¤0B'), (Range: 10000000000; Plural: pfOne; Value: '¤00B'), (Range: 10000000000; Plural: pfOther; Value: '¤00B'), (Range: 100000000000; Plural: pfOne; Value: '¤000B'), (Range: 100000000000; Plural: pfOther; Value: '¤000B'), (Range: 1000000000000; Plural: pfOne; Value: '¤0T'), (Range: 1000000000000; Plural: pfOther; Value: '¤0T'), (Range: 10000000000000; Plural: pfOne; Value: '¤00T'), (Range: 10000000000000; Plural: pfOther; Value: '¤00T'), (Range: 100000000000000; Plural: pfOne; Value: '¤000T'), (Range: 100000000000000; Plural: pfOther; Value: '¤000T') ); implementation const EMPTY: array[0..0] of TAbbreviationRule = ( (Range: 0; Plural: pfOne; Value: '') ); initialization TAbbreviatedNumber.Register('af', AF_LONG, AF_SHORT, AF_CURRENCY); TAbbreviatedNumber.Register('agq', EMPTY, EMPTY, AGQ_CURRENCY); TAbbreviatedNumber.Register('ak', EMPTY, EMPTY, AK_CURRENCY); TAbbreviatedNumber.Register('am', AM_LONG, AM_SHORT, AM_CURRENCY); TAbbreviatedNumber.Register('ar', AR_LONG, AR_SHORT, EMPTY); TAbbreviatedNumber.Register('as', EMPTY, EMPTY, AS_CURRENCY); TAbbreviatedNumber.Register('asa', EMPTY, EMPTY, ASA_CURRENCY); TAbbreviatedNumber.Register('ast', AST_LONG, AST_SHORT, EMPTY); TAbbreviatedNumber.Register('az', AZ_LONG, AZ_SHORT, AZ_CURRENCY); TAbbreviatedNumber.Register('az-Cyrl', EMPTY, EMPTY, AZ_CYRL_CURRENCY); TAbbreviatedNumber.Register('bas', EMPTY, EMPTY, BAS_CURRENCY); TAbbreviatedNumber.Register('be', BE_LONG, BE_SHORT, BE_CURRENCY); TAbbreviatedNumber.Register('bem', EMPTY, EMPTY, BEM_CURRENCY); TAbbreviatedNumber.Register('bez', EMPTY, EMPTY, BEZ_CURRENCY); TAbbreviatedNumber.Register('bg', BG_LONG, BG_SHORT, BG_CURRENCY); TAbbreviatedNumber.Register('bm', EMPTY, EMPTY, BM_CURRENCY); TAbbreviatedNumber.Register('bn', BN_LONG, BN_SHORT, EMPTY); TAbbreviatedNumber.Register('bo', EMPTY, EMPTY, BO_CURRENCY); TAbbreviatedNumber.Register('br', EMPTY, EMPTY, BR_CURRENCY); TAbbreviatedNumber.Register('brx', EMPTY, EMPTY, BRX_CURRENCY); TAbbreviatedNumber.Register('bs', BS_LONG, BS_SHORT, BS_CURRENCY); TAbbreviatedNumber.Register('bs-Cyrl', BS_CYRL_LONG, BS_CYRL_SHORT, BS_CYRL_CURRENCY); TAbbreviatedNumber.Register('ca', CA_LONG, CA_SHORT, CA_CURRENCY); TAbbreviatedNumber.Register('ce', CE_LONG, CE_SHORT, CE_CURRENCY); TAbbreviatedNumber.Register('cgg', EMPTY, EMPTY, CGG_CURRENCY); TAbbreviatedNumber.Register('chr', CHR_LONG, CHR_SHORT, CHR_CURRENCY); TAbbreviatedNumber.Register('cs', CS_LONG, CS_SHORT, CS_CURRENCY); TAbbreviatedNumber.Register('cy', CY_LONG, CY_SHORT, CY_CURRENCY); TAbbreviatedNumber.Register('da', DA_LONG, DA_SHORT, DA_CURRENCY); TAbbreviatedNumber.Register('dav', EMPTY, EMPTY, DAV_CURRENCY); TAbbreviatedNumber.Register('de', DE_LONG, DE_SHORT, DE_CURRENCY); TAbbreviatedNumber.Register('dje', EMPTY, EMPTY, DJE_CURRENCY); TAbbreviatedNumber.Register('dsb', DSB_LONG, DSB_SHORT, DSB_CURRENCY); TAbbreviatedNumber.Register('dua', EMPTY, EMPTY, DUA_CURRENCY); TAbbreviatedNumber.Register('dyo', EMPTY, EMPTY, DYO_CURRENCY); TAbbreviatedNumber.Register('dz', DZ_LONG, EMPTY, DZ_CURRENCY); TAbbreviatedNumber.Register('ebu', EMPTY, EMPTY, EBU_CURRENCY); TAbbreviatedNumber.Register('ee', EE_LONG, EE_SHORT, EE_CURRENCY); TAbbreviatedNumber.Register('el', EL_LONG, EL_SHORT, EL_CURRENCY); TAbbreviatedNumber.Register('en', EN_LONG, EN_SHORT, EN_CURRENCY); TAbbreviatedNumber.Register('eo', EMPTY, EMPTY, EO_CURRENCY); TAbbreviatedNumber.Register('es', ES_LONG, ES_SHORT, ES_CURRENCY); TAbbreviatedNumber.Register('et', ET_LONG, ET_SHORT, ET_CURRENCY); TAbbreviatedNumber.Register('eu', EU_LONG, EU_SHORT, EU_CURRENCY); TAbbreviatedNumber.Register('ewo', EMPTY, EMPTY, EWO_CURRENCY); TAbbreviatedNumber.Register('fa', FA_LONG, FA_SHORT, EMPTY); TAbbreviatedNumber.Register('ff', EMPTY, EMPTY, FF_CURRENCY); TAbbreviatedNumber.Register('fi', FI_LONG, FI_SHORT, FI_CURRENCY); TAbbreviatedNumber.Register('fil', FIL_LONG, FIL_SHORT, FIL_CURRENCY); TAbbreviatedNumber.Register('fo', FO_LONG, FO_SHORT, FO_CURRENCY); TAbbreviatedNumber.Register('fr', FR_LONG, FR_SHORT, FR_CURRENCY); TAbbreviatedNumber.Register('fur', EMPTY, EMPTY, FUR_CURRENCY); TAbbreviatedNumber.Register('fy', FY_LONG, FY_SHORT, FY_CURRENCY); TAbbreviatedNumber.Register('ga', GA_LONG, GA_SHORT, GA_CURRENCY); TAbbreviatedNumber.Register('gd', GD_LONG, GD_SHORT, EMPTY); TAbbreviatedNumber.Register('gl', GL_LONG, GL_SHORT, GL_CURRENCY); TAbbreviatedNumber.Register('gsw', GSW_LONG, GSW_SHORT, GSW_CURRENCY); TAbbreviatedNumber.Register('gu', GU_LONG, GU_SHORT, EMPTY); TAbbreviatedNumber.Register('guz', EMPTY, EMPTY, GUZ_CURRENCY); TAbbreviatedNumber.Register('gv', EMPTY, EMPTY, GV_CURRENCY); TAbbreviatedNumber.Register('ha', HA_LONG, HA_SHORT, HA_CURRENCY); TAbbreviatedNumber.Register('haw', EMPTY, EMPTY, HAW_CURRENCY); TAbbreviatedNumber.Register('he', HE_LONG, HE_SHORT, HE_CURRENCY); TAbbreviatedNumber.Register('hi', HI_LONG, HI_SHORT, EMPTY); TAbbreviatedNumber.Register('hr', HR_LONG, HR_SHORT, HR_CURRENCY); TAbbreviatedNumber.Register('hsb', HSB_LONG, HSB_SHORT, HSB_CURRENCY); TAbbreviatedNumber.Register('hu', HU_LONG, HU_SHORT, HU_CURRENCY); TAbbreviatedNumber.Register('hy', HY_LONG, HY_SHORT, HY_CURRENCY); TAbbreviatedNumber.Register('id', ID_LONG, ID_SHORT, ID_CURRENCY); TAbbreviatedNumber.Register('ii', EMPTY, EMPTY, II_CURRENCY); TAbbreviatedNumber.Register('is', IS_LONG, IS_SHORT, IS_CURRENCY); TAbbreviatedNumber.Register('it', IT_LONG, IT_SHORT, IT_CURRENCY); TAbbreviatedNumber.Register('ja', JA_LONG, JA_SHORT, JA_CURRENCY); TAbbreviatedNumber.Register('jgo', EMPTY, EMPTY, JGO_CURRENCY); TAbbreviatedNumber.Register('jmc', EMPTY, EMPTY, JMC_CURRENCY); TAbbreviatedNumber.Register('ka', KA_LONG, KA_SHORT, KA_CURRENCY); TAbbreviatedNumber.Register('kab', EMPTY, EMPTY, KAB_CURRENCY); TAbbreviatedNumber.Register('kam', EMPTY, EMPTY, KAM_CURRENCY); TAbbreviatedNumber.Register('kde', EMPTY, EMPTY, KDE_CURRENCY); TAbbreviatedNumber.Register('kea', KEA_LONG, KEA_SHORT, KEA_CURRENCY); TAbbreviatedNumber.Register('khq', EMPTY, EMPTY, KHQ_CURRENCY); TAbbreviatedNumber.Register('ki', EMPTY, EMPTY, KI_CURRENCY); TAbbreviatedNumber.Register('kk', KK_LONG, KK_SHORT, KK_CURRENCY); TAbbreviatedNumber.Register('kkj', EMPTY, EMPTY, KKJ_CURRENCY); TAbbreviatedNumber.Register('kl', KL_LONG, KL_SHORT, KL_CURRENCY); TAbbreviatedNumber.Register('kln', EMPTY, EMPTY, KLN_CURRENCY); TAbbreviatedNumber.Register('km', KM_LONG, KM_SHORT, KM_CURRENCY); TAbbreviatedNumber.Register('kn', KN_LONG, KN_SHORT, EMPTY); TAbbreviatedNumber.Register('ko', KO_LONG, KO_SHORT, KO_CURRENCY); TAbbreviatedNumber.Register('kok', EMPTY, EMPTY, KOK_CURRENCY); TAbbreviatedNumber.Register('ks', EMPTY, EMPTY, KS_CURRENCY); TAbbreviatedNumber.Register('ksb', EMPTY, EMPTY, KSB_CURRENCY); TAbbreviatedNumber.Register('ksf', EMPTY, EMPTY, KSF_CURRENCY); TAbbreviatedNumber.Register('ksh', KSH_LONG, KSH_SHORT, KSH_CURRENCY); TAbbreviatedNumber.Register('kw', EMPTY, EMPTY, KW_CURRENCY); TAbbreviatedNumber.Register('ky', KY_LONG, KY_SHORT, KY_CURRENCY); TAbbreviatedNumber.Register('lag', EMPTY, EMPTY, LAG_CURRENCY); TAbbreviatedNumber.Register('lb', LB_LONG, LB_SHORT, LB_CURRENCY); TAbbreviatedNumber.Register('lg', EMPTY, EMPTY, LG_CURRENCY); TAbbreviatedNumber.Register('lkt', EMPTY, EMPTY, LKT_CURRENCY); TAbbreviatedNumber.Register('ln', EMPTY, EMPTY, LN_CURRENCY); TAbbreviatedNumber.Register('lo', LO_LONG, LO_SHORT, LO_CURRENCY); TAbbreviatedNumber.Register('lt', LT_LONG, LT_SHORT, LT_CURRENCY); TAbbreviatedNumber.Register('lu', EMPTY, EMPTY, LU_CURRENCY); TAbbreviatedNumber.Register('luo', EMPTY, EMPTY, LUO_CURRENCY); TAbbreviatedNumber.Register('luy', EMPTY, EMPTY, LUY_CURRENCY); TAbbreviatedNumber.Register('lv', LV_LONG, LV_SHORT, LV_CURRENCY); TAbbreviatedNumber.Register('mas', EMPTY, EMPTY, MAS_CURRENCY); TAbbreviatedNumber.Register('mer', EMPTY, EMPTY, MER_CURRENCY); TAbbreviatedNumber.Register('mfe', EMPTY, EMPTY, MFE_CURRENCY); TAbbreviatedNumber.Register('mg', EMPTY, EMPTY, MG_CURRENCY); TAbbreviatedNumber.Register('mgh', EMPTY, EMPTY, MGH_CURRENCY); TAbbreviatedNumber.Register('mgo', EMPTY, EMPTY, MGO_CURRENCY); TAbbreviatedNumber.Register('mk', MK_LONG, MK_SHORT, MK_CURRENCY); TAbbreviatedNumber.Register('ml', ML_LONG, ML_SHORT, ML_CURRENCY); TAbbreviatedNumber.Register('mn', MN_LONG, MN_SHORT, MN_CURRENCY); TAbbreviatedNumber.Register('mr', MR_LONG, MR_SHORT, EMPTY); TAbbreviatedNumber.Register('ms', MS_LONG, MS_SHORT, MS_CURRENCY); TAbbreviatedNumber.Register('mt', EMPTY, EMPTY, MT_CURRENCY); TAbbreviatedNumber.Register('mua', EMPTY, EMPTY, MUA_CURRENCY); TAbbreviatedNumber.Register('my', MY_LONG, MY_SHORT, MY_CURRENCY); TAbbreviatedNumber.Register('naq', EMPTY, EMPTY, NAQ_CURRENCY); TAbbreviatedNumber.Register('nb', NB_LONG, NB_SHORT, EMPTY); TAbbreviatedNumber.Register('nd', EMPTY, EMPTY, ND_CURRENCY); TAbbreviatedNumber.Register('ne', NE_LONG, NE_SHORT, EMPTY); TAbbreviatedNumber.Register('nl', NL_LONG, NL_SHORT, EMPTY); TAbbreviatedNumber.Register('nmg', EMPTY, EMPTY, NMG_CURRENCY); TAbbreviatedNumber.Register('nn', NN_LONG, NN_SHORT, NN_CURRENCY); TAbbreviatedNumber.Register('nnh', EMPTY, EMPTY, NNH_CURRENCY); TAbbreviatedNumber.Register('nus', EMPTY, EMPTY, NUS_CURRENCY); TAbbreviatedNumber.Register('nyn', EMPTY, EMPTY, NYN_CURRENCY); TAbbreviatedNumber.Register('om', EMPTY, EMPTY, OM_CURRENCY); TAbbreviatedNumber.Register('or', EMPTY, EMPTY, OR_CURRENCY); TAbbreviatedNumber.Register('os', EMPTY, EMPTY, OS_CURRENCY); TAbbreviatedNumber.Register('pa', PA_LONG, PA_SHORT, EMPTY); TAbbreviatedNumber.Register('pa-Arab', EMPTY, EMPTY, PA_ARAB_CURRENCY); TAbbreviatedNumber.Register('pl', PL_LONG, PL_SHORT, PL_CURRENCY); TAbbreviatedNumber.Register('pt', PT_LONG, PT_SHORT, PT_CURRENCY); TAbbreviatedNumber.Register('qu', EMPTY, EMPTY, QU_CURRENCY); TAbbreviatedNumber.Register('rm', EMPTY, EMPTY, RM_CURRENCY); TAbbreviatedNumber.Register('rn', EMPTY, EMPTY, RN_CURRENCY); TAbbreviatedNumber.Register('ro', RO_LONG, RO_SHORT, RO_CURRENCY); TAbbreviatedNumber.Register('rof', EMPTY, EMPTY, ROF_CURRENCY); TAbbreviatedNumber.Register('root', EMPTY, ROOT_SHORT, EMPTY); TAbbreviatedNumber.Register('ru', RU_LONG, RU_SHORT, RU_CURRENCY); TAbbreviatedNumber.Register('rw', EMPTY, EMPTY, RW_CURRENCY); TAbbreviatedNumber.Register('rwk', EMPTY, EMPTY, RWK_CURRENCY); TAbbreviatedNumber.Register('sah', SAH_LONG, SAH_SHORT, SAH_CURRENCY); TAbbreviatedNumber.Register('saq', EMPTY, EMPTY, SAQ_CURRENCY); TAbbreviatedNumber.Register('sbp', EMPTY, EMPTY, SBP_CURRENCY); TAbbreviatedNumber.Register('se', SE_LONG, SE_SHORT, SE_CURRENCY); TAbbreviatedNumber.Register('seh', EMPTY, EMPTY, SEH_CURRENCY); TAbbreviatedNumber.Register('ses', EMPTY, EMPTY, SES_CURRENCY); TAbbreviatedNumber.Register('sg', EMPTY, EMPTY, SG_CURRENCY); TAbbreviatedNumber.Register('shi', EMPTY, EMPTY, SHI_CURRENCY); TAbbreviatedNumber.Register('shi-Latn', EMPTY, EMPTY, SHI_LATN_CURRENCY); TAbbreviatedNumber.Register('si', SI_LONG, SI_SHORT, SI_CURRENCY); TAbbreviatedNumber.Register('sk', SK_LONG, SK_SHORT, SK_CURRENCY); TAbbreviatedNumber.Register('sl', SL_LONG, SL_SHORT, SL_CURRENCY); TAbbreviatedNumber.Register('smn', SMN_LONG, EMPTY, SMN_CURRENCY); TAbbreviatedNumber.Register('sn', EMPTY, EMPTY, SN_CURRENCY); TAbbreviatedNumber.Register('so', SO_LONG, EMPTY, SO_CURRENCY); TAbbreviatedNumber.Register('sq', SQ_LONG, SQ_SHORT, SQ_CURRENCY); TAbbreviatedNumber.Register('sr', SR_LONG, SR_SHORT, SR_CURRENCY); TAbbreviatedNumber.Register('sr-Latn', SR_LATN_LONG, SR_LATN_SHORT, SR_LATN_CURRENCY); TAbbreviatedNumber.Register('sv', SV_LONG, SV_SHORT, SV_CURRENCY); TAbbreviatedNumber.Register('sw', SW_LONG, SW_SHORT, SW_CURRENCY); TAbbreviatedNumber.Register('ta', TA_LONG, TA_SHORT, TA_CURRENCY); TAbbreviatedNumber.Register('te', TE_LONG, TE_SHORT, TE_CURRENCY); TAbbreviatedNumber.Register('teo', EMPTY, EMPTY, TEO_CURRENCY); TAbbreviatedNumber.Register('th', TH_LONG, TH_SHORT, TH_CURRENCY); TAbbreviatedNumber.Register('ti', EMPTY, EMPTY, TI_CURRENCY); TAbbreviatedNumber.Register('tk', TK_LONG, TK_SHORT, TK_CURRENCY); TAbbreviatedNumber.Register('to', TO_LONG, TO_SHORT, TO_CURRENCY); TAbbreviatedNumber.Register('tr', TR_LONG, TR_SHORT, TR_CURRENCY); TAbbreviatedNumber.Register('twq', EMPTY, EMPTY, TWQ_CURRENCY); TAbbreviatedNumber.Register('tzm', EMPTY, EMPTY, TZM_CURRENCY); TAbbreviatedNumber.Register('ug', UG_LONG, UG_SHORT, UG_CURRENCY); TAbbreviatedNumber.Register('uk', UK_LONG, UK_SHORT, UK_CURRENCY); TAbbreviatedNumber.Register('ur', UR_LONG, UR_SHORT, EMPTY); TAbbreviatedNumber.Register('uz', UZ_LONG, UZ_SHORT, EMPTY); TAbbreviatedNumber.Register('uz-Arab', EMPTY, EMPTY, UZ_ARAB_CURRENCY); TAbbreviatedNumber.Register('uz-Cyrl', UZ_CYRL_LONG, UZ_CYRL_SHORT, EMPTY); TAbbreviatedNumber.Register('vai', EMPTY, EMPTY, VAI_CURRENCY); TAbbreviatedNumber.Register('vai-Latn', EMPTY, EMPTY, VAI_LATN_CURRENCY); TAbbreviatedNumber.Register('vi', VI_LONG, VI_SHORT, VI_CURRENCY); TAbbreviatedNumber.Register('vun', EMPTY, EMPTY, VUN_CURRENCY); TAbbreviatedNumber.Register('wae', EMPTY, EMPTY, WAE_CURRENCY); TAbbreviatedNumber.Register('xog', EMPTY, EMPTY, XOG_CURRENCY); TAbbreviatedNumber.Register('yav', EMPTY, EMPTY, YAV_CURRENCY); TAbbreviatedNumber.Register('yi', EMPTY, EMPTY, YI_CURRENCY); TAbbreviatedNumber.Register('yo', EMPTY, EMPTY, YO_CURRENCY); TAbbreviatedNumber.Register('yue', YUE_LONG, YUE_SHORT, EMPTY); TAbbreviatedNumber.Register('zgh', EMPTY, EMPTY, ZGH_CURRENCY); TAbbreviatedNumber.Register('zh', ZH_LONG, ZH_SHORT, EMPTY); TAbbreviatedNumber.Register('zh-Hant', ZH_HANT_LONG, ZH_HANT_SHORT, EMPTY); TAbbreviatedNumber.Register('zu', ZU_LONG, ZU_SHORT, ZU_CURRENCY); end.
unit uEndereco; interface Type TEndereco = class private Fcep: String; Flogradouro: string; Fbairro: String; Fnumero: String; Fcomplemento: String; Fcidade: String; FPais: String; FEstado: String; procedure Setcep(const Value: String); procedure Setbairro(const Value: String); procedure Setcidade(const Value: String); procedure Setcomplemento(const Value: String); procedure SetEstado(const Value: String); procedure Setlogradouro(const Value: string); procedure Setnumero(const Value: string); procedure SetPais(const Value: String); public property cep: String read Fcep write Setcep; property bairro:String read Fbairro write Setbairro; property logradouro:string read Flogradouro write Setlogradouro; property cidade:String read Fcidade write Setcidade; property Estado:String read FEstado write SetEstado; property Pais:String read FPais write SetPais; property numero:string read Fnumero write Setnumero; property complemento:String read Fcomplemento write Setcomplemento; end; implementation { TEndereco } procedure TEndereco.Setbairro(const Value: String); begin Fbairro := Value; end; procedure TEndereco.Setcep(const Value: String); begin Fcep := Value; end; procedure TEndereco.Setcidade(const Value: String); begin Fcidade := Value; end; procedure TEndereco.Setcomplemento(const Value: String); begin Fcomplemento := Value; end; procedure TEndereco.SetEstado(const Value: String); begin FEstado := Value; end; procedure TEndereco.Setlogradouro(const Value: string); begin Flogradouro := Value; end; procedure TEndereco.Setnumero(const Value: String); begin Fnumero := Value; end; procedure TEndereco.SetPais(const Value: String); begin FPais := Value; end; end.
unit FGKX_LoadType; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, RzPanel, Grids, AdvObj, BaseGrid, AdvGrid, ExtCtrls,FormEx_View, RzButton,cxSSTypes, cxControls, cxSSheet,Class_TYPE_IN_GKZF,Uni,UniConnct, RzSplit,Class_CORD_IN_GKZF; type TCellData=class(TObject) public Code:string; Name:string; Memo:string; end; TFGKXLoadType = class(TFormExView) rzstsbr1: TRzStatusBar; Grid_Dept: TAdvStringGrid; Tool_1: TRzToolbar; Btnx_Mrok: TRzBitBtn; Btnx_Quit: TRzBitBtn; Btnx_Expt: TRzBitBtn; Btnx_Help: TRzBitBtn; Btnx_Impt: TRzBitBtn; CxExcel_1: TcxSpreadSheetBook; RzSplitter1: TRzSplitter; procedure Btnx_ExptClick(Sender: TObject); procedure Btnx_QuitClick(Sender: TObject); procedure Btnx_MrokClick(Sender: TObject); procedure Grid_DeptGetAlignment(Sender: TObject; ARow, ACol: Integer; var HAlign: TAlignment; var VAlign: TVAlignment); procedure Btnx_HelpClick(Sender: TObject); procedure Btnx_ImptClick(Sender: TObject); private FUnitLink:string; FRealCord:TCORD; //& FListType:TStringList;//*list of *ttype FListCach:TStringList;//*list of *ttype IsReadied:Boolean; protected procedure SetInitialize;override; procedure SetCommParams;override; procedure SetGridParams;override; procedure SetComboItems;override; procedure TryFreeAndNil;override; public procedure InitData; procedure ImptFile; procedure ReadData; procedure ImptData; function DealLink(CodeRule:string;CodeLink:string;var ADeptLink:string;var ADeptCode:string;var ADeptPrev:string;var ADeptLevl:Integer):Boolean; end; var FGKXLoadType: TFGKXLoadType; function ViewLoadType(AUnitLink:string;ACord:TCORD):Integer; implementation uses Class_KzUtils,Class_KzExcel,Class_AppUtil,Class_KzDebug; {$R *.dfm} function ViewLoadType(AUnitLink:string;ACord:TCORD):Integer; begin try FGKXLoadType:=TFGKXLoadType.Create(nil); FGKXLoadType.FUnitLink:=AUnitLink; FGKXLoadType.FRealCord:=ACord; Result:=FGKXLoadType.ShowModal; finally FreeAndNil(FGKXLoadType); end; end; { TForm1 } procedure TFGKXLoadType.SetComboItems; begin inherited; end; procedure TFGKXLoadType.SetCommParams; begin inherited; Caption:='字典导入'; if FRealCord<>nil then begin Caption:=Format('字典导入:编码规则:%S',[FRealCord.CODERULE]); end; Btnx_Quit.SetFocus; RzSplitter1.LowerRight.Visible:=False; if DebugHook=1 then begin RzSplitter1.Percent:=50; RzSplitter1.LowerRight.Visible:=True; end; end; procedure TFGKXLoadType.SetGridParams; begin inherited; with Grid_Dept do begin RowCount:=2; ColCount:=20; DefaultColWidth:=100; ColWidths[0]:=40; ShowHint:=True; HintShowCells:=True; HintShowSizing:=True; Options:=Options+[goColSizing]; Font.Size:=10; Font.Name:='宋体'; FixedFont.Size:=10; FixedFont.Name:='宋体'; with ColumnHeaders do begin Clear; Delimiter:=','; DelimitedText:='序号,字典编码,字典名称,字典备注'; end; ColCount:=ColumnHeaders.Count; end; end; procedure TFGKXLoadType.SetInitialize; begin FListType:=nil; IsReadied:=False; inherited; InitData; end; procedure TFGKXLoadType.TryFreeAndNil; begin inherited; if FListType<>nil then TKzUtils.TryFreeAndNil(FListType); if FListCach<>nil then TKzUtils.TryFreeAndNil(FListCach); end; procedure TFGKXLoadType.Btnx_ExptClick(Sender: TObject); begin KzExcel:=TKzExcel.Create; KzExcel.Initialize; KzExcel.SetValidArea(1,-1,-1,-1); KzExcel.ActvGrid:=Grid_Dept; KzExcel.FileName:='元素字典.xls'; KzExcel.ShetName:=''; KzExcel.ColTotal:=-1; KzExcel.IncludeHideCols:=False; KzExcel.ShowCellsBorder:=False; KzExcel.DefaultCellStyl.IsfsBold:=False; KzExcel.DefaultCellStyl.DataType:=cxdtDoub; KzExcel.DefaultCellStyl.FontName:='宋体'; KzExcel.DefaultCellStyl.FontSize:=10; KzExcel.DefaultCellStyl.HorAlign:=cxSSTypes.haLEFT; //KzExcel.OnKzExcelGetCellStyl:=OnKzExcelGetCellStyl; //KzExcel.OnKzExcelBeforeSaved:=OnKzExcelBeforeSaved; KzExcel.Execute; FreeAndNil(KzExcel); end; procedure TFGKXLoadType.Btnx_QuitClick(Sender: TObject); begin ModalResult:=mrCancel; end; procedure TFGKXLoadType.Btnx_MrokClick(Sender: TObject); begin if not IsReadied then Exit; ImptData; ModalResult:=mrOk; end; procedure TFGKXLoadType.Grid_DeptGetAlignment(Sender: TObject; ARow, ACol: Integer; var HAlign: TAlignment; var VAlign: TVAlignment); begin if (ARow=0) or (ACol in [0]) then begin HAlign:=taCenter; end; end; procedure TFGKXLoadType.Btnx_HelpClick(Sender: TObject); var TempA:string; begin TempA:='导入外部Excel时,只取文件的第一列(部门编码)与第二列(部门名称)' +#13+'文件数据,从第二行开始读取.若其中任何一行数据为空,则忽略导入.'; ShowMessage(TempA); end; procedure TFGKXLoadType.Btnx_ImptClick(Sender: TObject); begin ImptFile; end; procedure TFGKXLoadType.ImptFile; var OD:TOpenDialog; begin try OD:=TOpenDialog.Create(nil); if OD.Execute then begin CxExcel_1.ClearAll; CxExcel_1.LoadFromFile(OD.FileName); ReadData; end; finally FreeAndNil(OD); end; end; procedure TFGKXLoadType.ReadData; var I,M:Integer; ListA:TStringList; CellD:TCellData; CellA:TcxSSCellObject; CellB:TcxSSCellObject; CellC:TcxSSCellObject; begin ListA:=TStringList.Create; TAppUtil.ClearGrid(Grid_Dept,0); with CxExcel_1 do begin for I:=1 to ActiveSheet.ContentRowCount-1 do begin CellA:=ActiveSheet.GetCellObject(0,I); CellB:=ActiveSheet.GetCellObject(1,I); CellC:=ActiveSheet.GetCellObject(2,I); if (CellA.Text<>'') and (CellB.Text<>'') then begin CellD:=TCellData.Create; CellD.Code:=CellA.Text; CellD.Name:=CellB.Text; CellD.Memo:=CellC.Text; ListA.AddObject(CellD.Code,CellD); end; CellA.Free; CellB.Free; CellC.Free; end; end; ListA.Sort; with Grid_Dept do begin BeginUpdate; for I:=0 to ListA.Count-1 do begin CellD:=TCellData(ListA.Objects[I]); if CellD=nil then Continue; if Cells[1,RowCount-1]<>'' then begin AddRow; end; Cells[1,RowCount-1]:=CellD.Code; Cells[2,RowCount-1]:=CellD.Name; Cells[3,RowCount-1]:=CellD.Memo; end; EndUpdate; end; IsReadied:=True; TKzUtils.TryFreeAndNil(ListA); end; procedure TFGKXLoadType.ImptData; var I:Integer; RuleA:string; IdexA:Integer; TextA:string; TypeA:TTYPE; TypeX:TTYPE; DeptPrev:string; DeptCode:string; DeptLink:string; DeptLevl:Integer; IsCached:Boolean; UniConnct:TUniConnection; function GetNameLink(AType:TType):string; var X:Integer; IdexX:Integer; TypeB:TTYPE; begin Result:=''; if (FListType.Count>0) then begin IdexX:=FListType.IndexOf(Format('%S-%S',[AType.UnitLink,AType.TYPEPREV])); if IdexX<>-1 then begin TypeB:=TTYPE(FListType.Objects[IdexX]); Result:=TypeB.NameLink; end; end; end; begin if FListType=nil then begin FListType:=TStringList.Create; end; TKzUtils.JustCleanList(FListType); IsCached:=(FListCach<>nil) and (FListCach.Count>0); with Grid_Dept do begin try UniConnct:=UniConnctEx.GetConnection(CONST_MARK_GKZF); try UniConnct.StartTransaction; //-< for I:=1 to RowCount-1 do begin TypeA:=TTYPE.Create; TypeA.UnitLink:=FUnitLink; RuleA:=FRealCord.CODERULE; DeptLink:=''; DeptCode:=''; DeptPrev:=''; DeptLevl:=1; if not DealLink(RuleA,Trim(Cells[1,I]),DeptLink,DeptCode,DeptPrev,DeptLevl) then Continue; TypeA.TYPELINK:=DeptLink; TypeA.TYPECODE:=DeptCode; TypeA.TYPEPREV:=DeptPrev; TypeA.TYPELEVL:=DeptLevl; TypeA.TYPENAME:=Trim(Cells[2,I]); TypeA.TYPEMEMO:=Trim(Cells[3,I]); TypeA.TYPEORDR:=I; TypeA.CORDIDEX:=FRealCord.CORDIDEX; if TypeA.TYPELEVL=1 then begin TypeA.NameLink:=TypeA.TYPENAME; end else begin TypeA.NameLink:=GetNameLink(TypeA)+'\'+TypeA.TYPENAME; end; with TypeA do begin if IsCached then begin TextA:=Format('%S-%D-%S',[UNITLINK,CORDIDEX,TYPELINK]); IdexA:=FListCach.IndexOf(TextA); if IdexA<>-1 then begin TypeX:=TTYPE(FListCach.Objects[IdexA]); TypeA.TYPEIDEX:=TypeX.TYPEIDEX; TypeA.UpdateDB(UniConnct); end else begin TypeA.TYPEIDEX:=TypeA.GetNextIdex(UniConnct); TypeA.InsertDB(UniConnct); end; end else begin if not TypeA.CheckExist('GKX_TYPE',['UNIT_LINK',UNITLINK,'CORD_IDEX',CORDIDEX,'TYPE_LINK',TYPELINK],UniConnct) then begin TypeA.TYPEIDEX:=TypeA.GetNextIdex(UniConnct); TypeA.InsertDB(UniConnct); end end; end; FListType.AddObject(Format('%S-%S',[TypeA.UNITLINK,TypeA.TYPELINK]),TypeA); end; //-> UniConnct.Commit; except on E:Exception do begin UniConnct.Rollback; raise Exception.Create(E.Message+TypeA.TYPENAME+'|'+TypeA.TYPELINK); end; end; finally FreeAndNil(UniConnct); end; end; end; function TFGKXLoadType.DealLink(CodeRule, CodeLink: string; var ADeptLink, ADeptCode,ADeptPrev: string;var ADeptLevl:Integer):Boolean; var I:Integer; LengA:Integer; LengB:Integer; LevlA:string; LevlB:string; ListA:TStringList; begin Result:=False; try LengB:=0; ListA:=TStringList.Create; if Pos('-',CodeLink) >0 then begin CodeLink:=StringReplace(CodeLink,'-','',[rfReplaceAll]); end; if Pos('.',CodeLink) >0 then begin CodeLink:=StringReplace(CodeLink,'.','',[rfReplaceAll]); end; if Pos('\',CodeLink) >0 then begin CodeLink:=StringReplace(CodeLink,'\','',[rfReplaceAll]); end; if Pos('/',CodeLink) >0 then begin CodeLink:=StringReplace(CodeLink,'/','',[rfReplaceAll]); end; for I:=1 to Length(CodeRule) do begin if I=1 then begin LengA:=StrToInt(CodeRule[I]); LevlA:=Copy(CodeLink,1,LengA); end else begin LengA:=StrToInt(CodeRule[I]); LengB:=LengB+StrToInt(CodeRule[I-1]); LevlA:=Copy(CodeLink,LengB+1,LengA); end; if LevlA='' then Continue; ListA.Add(LevlA); end; if ListA.Count=1 then begin ADeptLink:=CodeLink; ADeptCode:=CodeLink; ADeptPrev:=''; ADeptLevl:=1; end else begin if FRealCord.WITHDASH=1 then begin for I:=0 to ListA.Count-1 do begin ADeptLink:=ADeptLink+'-'+ListA.Strings[I]; end; Delete(ADeptLink,1,1); for I:=0 to ListA.Count-2 do begin ADeptPrev:=ADeptPrev+'-'+ListA.Strings[I]; end; Delete(ADeptPrev,1,1); end else begin for I:=0 to ListA.Count-1 do begin ADeptLink:=ADeptLink+ListA.Strings[I]; end; for I:=0 to ListA.Count-2 do begin ADeptPrev:=ADeptPrev+ListA.Strings[I]; end; end; ADeptCode:=ListA.Strings[ListA.Count-1]; ADeptLevl:=ListA.Count; end; finally FreeAndNil(ListA); end; Result:=True; end; procedure TFGKXLoadType.InitData; var SQLA:string; UniConnct:TUniConnection; begin if FRealCord=nil then Exit; try UniConnct:=UniConnctEx.GetConnection(CONST_MARK_GKZF); //-< SQLA:='SELECT * FROM GKX_TYPE WHERE UNIT_LINK=%S AND CORD_IDEX=%D ORDER BY TYPE_LINK'; SQLA:=Format(SQLA,[QuotedStr('-1'),FRealCord.CORDIDEX]); if FListCach=nil then begin FListCach:=TStringList.Create; end; TKzUtils.JustCleanList(FListCach); TTYPE.ListDB(SQLA,['UNIT_LINK','CORD_IDEX','TYPE_LINK'],UniConnct,FListCach); //-> finally FreeAndNil(UniConnct); end; KzDebug.FileLog(FListCach.Text); end; end.
unit ui2ximg_mcm; interface uses Windows, Classes, uStrUtil, Graphics, SysUtils, GR32, GR32_Image, uI2XImg, mcmRegion, mcmImage, mcmImageFilter, mcmImageTransform, mcmImageTypeDef, mcmImageColor, mcmImageResStr, MapStream, uDWImage, uI2XConstants, Typinfo; const UNIT_NAME = 'ui2ximg_mcm'; type TImageInstructionsMCM = ( iDESKEW = 0, iDESPECKLE, iCOLOR_REDUCE, iAVERAGE, iAVERAGEHEAVY, iBLUR, iBLUR_HEAVY, iGBLUR, iSMOOTH, iSMOOTH_CIRCLE, iSMOOTH_CONE, iSMOOTH_PYRAMIDAL, iSHARPEN, iSHARPENHEAVY, iUNSHARPMASK, iEDGE, iEDGEPREWITT, iHIGHPASS, iGREYEDGE, iDILATE, iSHARP_DRV, iNOISE_REMOVE, iDEGRAIN, iDEGRAIN_BRIGHT, iDEGRAIN_DARK, iERODE ); //The class adds the ability to obtain the image from a memory map TDWMCMImage = class(TMCMImage) private FMemoryMap : TMapStream; public //function SaveToMemoryMap( const sMapName : string ) : boolean; //function LoadFromMemoryMap( const sMapName: string; const InitSize : Cardinal = IMAGE_MEMMAP_INIT_SIZE ): boolean; function CopyFrom( sourceImage : TMCMImage ): boolean; constructor Create(); destructor Destroy; override; end; TI2XImgMCM = class(TI2XImg) private FImg : TDWMCMImage; FImgFilter : TmcmImageFilter; function DeskewableImage(img: TmcmImage): boolean; public function Deskew(): boolean; Function Despeckle( const level_ABC: string; const iterations : byte ): boolean; overload; Function Despeckle( const Parm: string ) : boolean; overload; function ReduceColors( const colors: smallint = 8 ) : boolean; overload; function ReduceColors( const Parm : string ) : boolean; overload; function Average(): boolean; function AverageHeavy(): boolean; function Blur(): boolean; function BlurHeavy(): boolean; function GaussianBlur(): boolean; function Smooth(): boolean; function SmoothCircle(): boolean; function SmoothCone(): boolean; function SmoothPyramidal(): boolean; function Sharpen(): boolean; function SharpenHeavy(): boolean; function UnsharpenMask(): boolean; function Edge(): boolean; function EdgePewitt(): boolean; function HighPass(): boolean; function GreyEdge(): boolean; function Dilate(): boolean; function SharpenDerived(): boolean; function NoiseRemoval(): boolean; function Degrain(): boolean; function DegrainBright(): boolean; function DegrainDark(): boolean; function Erode(): boolean; function ExecuteInstruction( const InstructionString : string ) : boolean; override; constructor Create( const GUID, ParmFileName : string ); override; destructor Destroy; override; function ProcessImage( const MemoryMapName : string; InstructionList : TStrings ) : boolean; override; end; implementation { TI2XImgMCM } function TI2XImgMCM.Average: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_AVERAGE ); result := true; end; end; function TI2XImgMCM.AverageHeavy: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_AVERAGEHEAVY ); result := true; end; end; function TI2XImgMCM.Blur: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_BLUR ); result := true; end; end; function TI2XImgMCM.BlurHeavy: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_BLURHEAVY ); result := true; end; end; constructor TI2XImgMCM.Create(const GUID, ParmFileName: string); begin inherited Create( GUID, ParmFileName ); FImg := TDWMCMImage.Create; FImgFilter := TMCMImageFilter.Create( nil ); end; function TI2XImgMCM.Degrain: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_DEGRAIN ); result := true; end; end; function TI2XImgMCM.DegrainBright: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_MEDIANMAXMIN ); result := true; end; end; function TI2XImgMCM.DegrainDark: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_MEDIANMINMAX ); result := true; end; end; function TI2XImgMCM.DeskewableImage( img : TmcmImage ): boolean; Begin {* Result := ( img.ImageFormat = IF_BW ) or ( img.ImageFormat = IF_GREY4 ) or ( img.ImageFormat = IF_PAL4 ) or ( img.ImageFormat = IF_GREY8 ) or ( img.ImageFormat = IF_BW ) ; *} Result := img.BitCount <= 8; End; function TI2XImgMCM.Deskew: boolean; var ImageTransform : TmcmImageTransform; FImgResult : TmcmImage; skewAngle : Extended; imgColor1: TmcmImageColor; begin try Result := false; ImageTransform := TmcmImageTransform.Create(nil); // Assign source image. if ( not DeskewableImage( FImg ) ) then begin try imgColor1 := TmcmImageColor.Create( nil ); imgColor1.SourceImage[0] := FImg; imgColor1.ConvertTo( IF_BW, false ); ImageTransform.SourceImage[0] := imgColor1.ResultImage; //FImg.Assign( imgColor1.ResultImage ); finally FreeAndNil(imgColor1); end; end; //ImageTransform.SourceImage[0] := self.FImg; // Search for deskew angle within +30/-30 degree. ImageTransform.DeskewRange := 60; // Use 0.5 degree accuracy. //ImageTransform.DeskewStep := 0.5; ImageTransform.DeskewStep := 0.1; // Max character intensity(Luminance) to 63. ImageTransform.DeskewMaxInt := 1; ImageTransform.Deskew; if (ImageTransform.Error = EC_OK) then begin // If the angle is greater then |0.5| we'll rotate the image. if (abs(ImageTransform.Degree) >= 0.5) then begin // Fill background White. ImageTransform.BKColor := $FFFFFF; ImageTransform.SourceImage[0] := FImg; if (ImageTransform.SourceImage[0].ImageFormat = IF_BW) then ImageTransform.Interpolate := ST_NEAREST else ImageTransform.Interpolate := ST_BILINEAR; try FImgResult := ImageTransform.Rotate( False, ImageTransform.Degree); if (ImageTransform.Error <> EC_OK) then raise Exception.Create('Error rotating image: ' + CErrorStrings[word(ImageTransform.Error)]); FImg.CopyFrom( FImgResult ); finally if ( FImgResult <> nil ) then FreeAndNil( FImgResult ); end; end; end else begin if (ImageTransform.Error <> EC_OK) then raise Exception.Create('Error finding deskew angle: ' + CErrorStrings[word(ImageTransform.Error)]); end; result := true; finally if ( ImageTransform <> nil ) then FreeAndNil( ImageTransform ); end; End; function TI2XImgMCM.Despeckle(const Parm: string): boolean; begin Result := false; self.ParseParmString( Parm ); if ( (ParmMustExist('iterations')) and (ParmMustExist('level'))) then Result := Despeckle( Parms.Items['level'], StrToInt( Parms.Items['iterations'] ) ); end; function TI2XImgMCM.Despeckle( const level_ABC: string; const iterations : byte ): boolean; begin Result := false; with FImgFilter do begin MaxIterations := iterations; SourceImage[0] := FImg; ResultImage := FImg; if ( level_ABC = 'A' ) then Filter( FLT_DESPECKLE_A ) else if ( level_ABC = 'A' ) then Filter( FLT_DESPECKLE_B ) else Filter( FLT_DESPECKLE_C ); result := true; end; End; destructor TI2XImgMCM.Destroy; begin FreeAndNil( FImg ); FreeAndNil( FImgFilter ); inherited; end; function TI2XImgMCM.Dilate: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_MAXIMUM ); result := true; end; end; function TI2XImgMCM.Edge: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_EDGE ); result := true; end; end; function TI2XImgMCM.EdgePewitt: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_EDGEPREWITT ); result := true; end; end; function TI2XImgMCM.Erode: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_MINIMUM ); result := true; end; end; function TI2XImgMCM.ExecuteInstruction( const InstructionString: string): boolean; var sInst, sParmString, key, val : string; ParmCount : byte; i : integer; bRes : boolean; Begin try bRes := false; sInst := Split( InstructionString, IMGPROC_PARM_SEP, 0 ); //get the instruction sInst := Split( sInst, IMGPROC_PLUGIN_SEP, 1 ); //strip the PlugIn Numonic ParmCount := StringCount(InstructionString, IMGPROC_VALUE_SEP ); if ( Length( InstructionString ) > 0 ) then begin if ( Integer( self.DebugLevel ) > 0 ) then FImg.FileSave( self.DebugPath + 'MCM-' + sInst + '_IN.bmp' ); case TImageInstructionsMCM(GetEnumValue(TypeInfo(TImageInstructionsMCM),'i' + sInst)) of iDESKEW: begin bRes := self.Deskew(); end; iDESPECKLE: begin if ( ParmCount <> 2 ) then raise Exception.Create('Instruction "' + sInst + '" was passed an incorrect amount of parameters. Parm string=' + InstructionString); bRes := self.Despeckle( InstructionString ); end; iCOLOR_REDUCE: begin if ( ParmCount <> 1 ) then raise Exception.Create('Instruction "' + sInst + '" was passed an incorrect amount of parameters. Parm string=' + InstructionString); bRes := self.ReduceColors( InstructionString ); end; iAVERAGE: begin bRes := self.Average(); end; iAVERAGEHEAVY: begin bRes := self.AverageHeavy(); end; iBLUR: begin bRes := self.Blur(); end; iBLUR_HEAVY: begin bRes := self.BlurHeavy(); end; iGBLUR: begin bRes := self.GaussianBlur(); end; iSMOOTH: begin bRes := self.Smooth(); end; iSMOOTH_CIRCLE: begin bRes := self.SmoothCircle(); end; iSMOOTH_CONE: begin bRes := self.SmoothCone(); end; iSMOOTH_PYRAMIDAL: begin bRes := self.SmoothPyramidal(); end; iSHARPEN: begin bRes := self.Sharpen(); end; iSHARPENHEAVY: begin bRes := self.SharpenHeavy(); end; iUNSHARPMASK: begin bRes := self.UnsharpenMask(); end; iEDGE: begin bRes := self.Edge(); end; iEDGEPREWITT: begin bRes := self.EdgePewitt(); end; iHIGHPASS: begin bRes := self.HighPass(); end; iGREYEDGE: begin bRes := self.GreyEdge(); end; iDILATE: begin bRes := self.Dilate(); end; iSHARP_DRV: begin bRes := self.SharpenDerived(); end; iNOISE_REMOVE: begin bRes := self.NoiseRemoval(); end; iDEGRAIN: begin bRes := self.Degrain(); end; iDEGRAIN_BRIGHT: begin bRes := self.DegrainBright(); end; iDEGRAIN_DARK: begin bRes := self.DegrainDark(); end; iERODE: begin bRes := self.Erode(); end; end; if (( bRes ) and ( Integer( self.DebugLevel ) > 0 )) then FImg.FileSave( self.DebugPath + 'MCM-' + sInst + '_OUT.bmp' ); Result := bRes; end; finally end; End; function TI2XImgMCM.GaussianBlur: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_GAUSSBLUR ); result := true; end; end; function TI2XImgMCM.GreyEdge: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_MARRHILDRETH ); result := true; end; end; function TI2XImgMCM.HighPass: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_HIGHPASS ); result := true; end; end; function TI2XImgMCM.NoiseRemoval: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_MEDIAN ); result := true; end; End; function TI2XImgMCM.ProcessImage(const MemoryMapName: string; InstructionList: TStrings): boolean; var i : integer; bmp : TBitmap; sMemoryMapName : string; Begin try Result := false; sMemoryMapName := MemoryMapName; try FMemoryMapManager.Flush(); bmp := TBitmap.Create(); FMemoryMapManager.DebugMessageText := 'TI2XImgMCM.ProcessImage - Image Read from UI - InstructionList=' + InstructionList.Text; self.FMemoryMapManager.Read( sMemoryMapName, bmp ); self.FImg.DibHandle := bmp.ReleaseHandle; finally bmp.Free; end; //self.FImg.LoadFromMemoryMap( MemoryMapName ); try for i := 0 to InstructionList.Count - 1 do begin if ( not ExecuteInstruction( InstructionList[i] ) ) then Exit; end; //self.FImg.SaveToMemoryMap( MemoryMapName ); try bmp := TBitmap.Create; bmp.Handle := FImg.ReleaseHandle; FMemoryMapManager.DebugMessageText := 'TI2XImgMCM.ProcessImage - Image Save for UI - InstructionList=' + InstructionList.Text; FMemoryMapManager.Write( sMemoryMapName, bmp ); finally FreeAndNil( bmp ); end; Result := true; except on E : Exception do begin self.ErrorUpdate( E.Message, ERROR_IMAGE_PROC_FAILED ); end; end; finally end; End; function TI2XImgMCM.ReduceColors(const Parm: string): boolean; begin Result := false; self.ParseParmString( Parm ); if ( self.ParmMustExist( 'color_bit_count' )) then Result := ReduceColors( FStrUtil.ExtractInt( Parms.Items['color_bit_count'] ) ); end; function TI2XImgMCM.ReduceColors(const colors: smallint) : boolean; var imgColor1: TmcmImageColor; Begin Result := false; try imgColor1 := TmcmImageColor.Create( nil ); imgColor1.SourceImage[0] := FImg; //imgColor1.ResultImage := FImg; if ( colors <= 2 ) then imgColor1.ConvertTo( IF_BW, false ) else if ( colors = 4 ) then imgColor1.ConvertTo( IF_PAL4, false ) else if ( colors = 8 ) then imgColor1.ConvertTo( IF_PAL8, false ) else if ( colors = 15) then imgColor1.ConvertTo( IF_RGB15, false ) else if ( colors = 16) then imgColor1.ConvertTo( IF_RGB16, false ) else if ( colors = 24) then imgColor1.ConvertTo( IF_RGB24, false ); FImg.Assign( imgColor1.ResultImage ); Result := true; finally FreeAndNil(imgColor1); end; End; function TI2XImgMCM.Sharpen: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_SHARPEN ); result := true; end; end; function TI2XImgMCM.SharpenDerived: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_MAXMIN ); result := true; end; end; function TI2XImgMCM.SharpenHeavy: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_SHARPENHEAVY ); result := true; end; end; function TI2XImgMCM.Smooth: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_SMOOTH ); result := true; end; end; function TI2XImgMCM.SmoothCircle: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_SMOOTHCIRCLE ); result := true; end; end; function TI2XImgMCM.SmoothCone: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_SMOOTHCONE ); result := true; end; end; function TI2XImgMCM.SmoothPyramidal: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_SMOOTHPYRAMIDAL ); result := true; end; end; function TI2XImgMCM.UnsharpenMask: boolean; begin Result := false; with FImgFilter do begin SourceImage[0] := FImg; ResultImage := FImg; Filter( FLT_UNSHARPMASK ); result := true; end; end; { TDWMCMImage } function TDWMCMImage.CopyFrom(sourceImage: TMCMImage): boolean; var MemoryStream: TMemoryStream; Begin Result := false; try MemoryStream := TMemoryStream.Create; sourceImage.SaveToStream( MemoryStream ); MemoryStream.Position := 0; self.Clear; self.LoadFromStream( MemoryStream ); finally FreeAndNil( MemoryStream ); end; End; constructor TDWMCMImage.Create; begin inherited Create(); end; destructor TDWMCMImage.Destroy; begin if ( FMemoryMap = nil ) then FreeAndNil( FMemoryMap ); inherited; end; //This will read the bitmap from the memory stream. since it is of TBitmap, // it will then get converted into the FreeBitmap {* function TDWMCMImage.LoadFromMemoryMap(const sMapName: string; const InitSize: Cardinal): boolean; var msBMP : TMemoryStream; bmp : TBitmap; begin Result := false; try if ( FMemoryMap = nil ) then FMemoryMap := ActiveMemoryMaps.Stream( sMapName, InitSize ); //FMemoryMap := TMapStream.Create( sMapName, InitSize ); msBMP := TMemoryStream.Create; bmp := TBitmap.Create; FMemoryMap.Position := 0; if ( not FMemoryMap.Read( msBMP ) ) then raise Exception.Create('Error while copying BITMAP from Memory Map'); bmp.LoadFromStream( msBMP ); self.DibHandle := bmp.ReleaseHandle; Result := true; finally FreeAndNil( msBMP ); FreeAndNil( bmp ); end; end; function TDWMCMImage.SaveToMemoryMap(const sMapName: string): boolean; var msBMP : TMemoryStream; bmp : TBitmap; begin Result := false; try if ( FMemoryMap = nil ) then //FMemoryMap := TMapStream.Create( sMapName, IMAGE_MEMMAP_INIT_SIZE ); FMemoryMap := ActiveMemoryMaps.Stream( sMapName, IMAGE_MEMMAP_INIT_SIZE ); msBMP := TMemoryStream.Create; bmp := TBitmap.Create; bmp.Handle := self.ReleaseHandle; bmp.SaveToStream( msBMP ); FMemoryMap.Position := 0; if ( not FMemoryMap.Write( msBMP ) ) then raise Exception.Create('Error while copying BITMAP from Memory Map'); Result := true; finally FreeAndNil( msBMP ); FreeAndNil( bmp ); end; end; *} END.