text
stringlengths
14
6.51M
unit RandomForm; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls, ScTypes; type TfmRandom = class(TForm) ProgressBar: TProgressBar; lbInform: TLabel; btClose: TButton; procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure FormCreate(Sender: TObject); private FData: TBytes; FCount: Integer; public property Data: TBytes read FData; end; var fmRandom: TfmRandom; implementation {$IFNDEF FPC} {$IFDEF CLR} {$R *.nfm} {$ELSE} {$R *.dfm} {$ENDIF} {$ENDIF} {$IFDEF XPMAN} {$R WindowsXP.res} {$ENDIF} const DATASIZE = 512; function PerfCounter: Int64; begin if not QueryPerformanceCounter(Result) then Result := GetTickCount; end; procedure TfmRandom.FormCreate(Sender: TObject); begin SetLength(FData, DATASIZE); ProgressBar.Max := DATASIZE; end; procedure TfmRandom.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var data: Int64; begin if FCount >= DATASIZE then Exit; data := X xor Y xor PerfCounter; FData[FCount] := byte(data); Inc(FCount); data := data shr 8; FData[FCount] := byte(data); Inc(FCount); ProgressBar.StepIt; if FCount >= DATASIZE then begin lbInform.Caption := 'The data for the random generator has been generated!'; btClose.ModalResult := mrOk; btClose.Caption := '&OK'; end; end; end.
{ Jessica's Directory } program JDIR; const { Configuration } OUTPUT_BY_COLUMN = True; { True output by column, False by row. } PAGE_SIZE = 22; { Number of rows per-page. } { Set to 0 for no pagination. } PARAM_LENGTH = 32; { Maximum length of the parameter string. } { This is an arbitrary value. } { Bdos Functions. } BDOS_SET_DRIVE = $0E; { DRV_SET - Set the current drive. } BDOS_SEARCH_FIRST = $11; { F_SFIRST - search for first file. } BDOS_SEARCH_NEXT = $12; { F_SNEXT - search for next file. } BDOS_CURRENT_DRIVE = $19; { DRV_GET - Get current drive. } BDOS_GET_SET_USER = $20; { Get or set the current user. } BDOS_SET_DMA = $1A; { F_DMAOFF - Set DMA Address function number. } BDOS_DISK_PARM = $1F; { DRV_DPB - Get the Disk Parameter Address. } { Bdos return codes. } BDOS_SEARCH_LAST = $FF; { No more files found on Bdos search. } type ParamString = String[PARAM_LENGTH]; FileRecord_Ptr = ^FileRecord; FileRecord = record FileName : String[12]; UserNumber : Byte; FileSize : Integer; Records : Integer; NextFile : FileRecord_Ptr; System : Boolean; ReadOnly : Boolean; end; FCBDIR = { This is the format used for FCB and Directory Records. } record Number : Byte; FileName : array[1..11] of Byte; Extent : Byte; S1 : Byte; S2 : Byte; Records : Byte; Allocation : array[0..15] of byte; end; DiskParmBlock = record SecorsPerTrack : Integer; { spt - Number of 128-byte records per track } BlockShift : Byte; { bsh - Block shift. } BlockMask : Byte; { blm - Block mask. } ExtentMask : Byte; { exm - Extent mask, see later } BlocksOnDisk : Integer; { dsm - (no. of blocks on the disc)-1 } DirOnDisk : Integer; { drm - (no. of directory entries)-1 } Allocation0 : Byte; { al0 - Directory allocation bitmap, first } Allocation1 : Byte; { al1 - Directory allocation bitmap, second } ChecksumSize : Integer; { cks - Checksum vector size } { ;No. directory entries/4, rounded up. } ReservedTracks : Integer; { off - Offset, number of reserved tracks } end; var { BDos and file settings. } DMA : array [0..3] of FCBDIR; FCB : FCBDIR absolute $005C; FileList : FileRecord_Ptr; BlockSize : Byte; { For pagination and showing the total file count. } NumberFiles : Integer; { Command line paramter settings. } ByColumn : Boolean; GetAllFiles : Boolean; OneColumn : Boolean; ShowSystem : Boolean; PageSize : Integer; { Initialize Bdos DMA access. } Procedure InitDMA; var BdosReturn : Byte; begin BdosReturn := Bdos(BDOS_SET_DMA, Addr(DMA)); end; { Procedure InitDMA } { Initialize the FCB used to search for all files. } Procedure InitFCB; begin { Set the disk to Default. } FCB.Number := 0; { Set the file name and type to all '?'. } FillChar(FCB.FileName, 11, ord('?')); { Set Extent, S1 and S2 to '?' as well. } FCB.Extent := ord('?'); FCB.S1 := ord('?'); FCB.S2 := ord('?'); { Set everything else to 0. } FCB.Records := 0; FillChar(FCB.Allocation, 16, 0); end; { Procedure InitFCB } { Padd a string to Padlength with PaddChar. } { If the string is longer than PaddLength it is truncated. } Function PaddStr( InputStr : ParamString; PaddChar : Char; PaddLength : Byte ) : ParamString; var OutputStr : ParamString; Index : Byte; begin OutputStr := InputStr; if (Length(InputStr) < PaddLength) then begin for Index := (Length(InputStr) + 1) to PaddLength do Insert(PaddChar, OutputStr, Index); end; OutputStr[0] := Chr(PaddLength); PaddStr := OutputStr; end; { Set the current user. } Procedure SetUser(User: Integer); begin Bdos(BDOS_GET_SET_USER, User); end; { Update the FCB with a pattern from the command line. } { Destructively modifies Parameter. } Procedure UpdateFCB(var Parameter : ParamString); var Disk : Char; User : Integer; FileName : String[8]; FileType : String[3]; Index : Byte; begin FileName := ''; FileType := ''; Disk := ' '; { Check for a Disk and/or User. } Index := Pos(':', Parameter); if (Index <> 0) then begin { Check for the Disk letter. } Disk := Upcase(Copy(Parameter, 1, 1)); if (Disk in ['A'..'P']) then begin FCB.Number := Ord(Disk) - $40; { Delete the Disk letter. } Delete(Parameter, 1, 1); Index := Index - 1; end; { Anything left will the the User number. } { I can't use Val since it messes with FCB. } if (Index > 1) then begin User := Ord(Copy(Parameter, 1, 1)) - $30; if (Index > 2) then User := (User * 10) + Ord(Copy(Parameter, 2, 1)) - $30; if (User < 16) then SetUser(User); end; Delete(Parameter, 1, Index); end; { if (Index <> 0) } { Extract a file pattern from the parameter. } { The FCB is already setup to fetch all files so skip '*' and '*.*'. } if ((Parameter <> '*') and (Parameter <> '*.*') and (Parameter <> '' )) then begin Index := Pos('.', Parameter); { If there is a '.' then get the file type. } if (Index > 0) then begin FileName := Copy(Parameter, 1, (Index - 1)); FileType := Copy(Parameter, (Index + 1), Length(Parameter)); end else FileName := Parameter; { Cleanup the FileName. } Index := Pos('*', FileName); if (Index <> 0) then FileName := PaddStr(Copy(FileName, 1, (Index - 1)), '?', 8) else FileName := PaddStr(FileName, ' ', 8); { Cleanup the FileType. } Index := Pos('*', FileType); if (Index <> 0) then FileType := PaddStr(Copy(FileType, 1, (Index - 1)), '?', 3) else if (length(FileType) > 0) then FileType := PaddStr(FileType, ' ', 3); { Copy the FileName and FileType to the FCB. } for Index := 1 to Length(FileName) do FCB.FileName[Index] := Ord(Upcase(FileName[Index])); for Index := 1 to Length(Filetype) do FCB.FileName[Index + 8] := Ord(Upcase(FileType[Index])); end; { if ((Parameter <> '*') and (Parameter <> '*.*')) } end; { Get the block size for the currently logged disk. } Function GetBlockSize : Byte; var DiskParmBlock_Ptr : ^DiskParmBlock; begin DiskParmBlock_Ptr := Ptr(BdosHL(BDOS_DISK_PARM)); GetBlockSize := Succ(DiskParmBlock_Ptr^.BlockMask) shr 3; end; { Function GetBlockSize } { Add a file to the existing list of files. } { The files are sorte by name. } { NOTE: This is using a simple insertion sort. } Procedure AddFile(var NewFile : FileRecord_Ptr); var FilePtr : FileRecord_Ptr; PrevPtr : FileRecord_Ptr; begin if (FileList = Nil) then begin { This is the first file. } FileList := NewFile; NumberFiles := 1; end else begin PrevPtr := Nil; FilePtr := FileList; { Find where this file belongs. } while ((FilePtr <> Nil) and (FilePtr^.FileName < NewFile^.FileName)) do begin PrevPtr := FilePtr; FilePtr := FilePtr^.NextFile; end; if (FilePtr^.FileName <> NewFile^.FileName) then begin { Add the file to the list. } NewFile^.NextFile := FilePtr; NumberFiles := Succ(NumberFiles); if (PrevPtr = Nil) then FileList := NewFile else PrevPtr^.NextFile := NewFile; end else if (FilePtr^.FileSize < NewFile^.FileSize) then { This is not a new file, it's another directory entry. } FilePtr^.FileSize := NewFile^.FileSize; end; { if (FileList = Nil) } end; { Procedure AddFile } { Get a file entry from Bdos. } Function GetFile(BdosFunction : Byte) : byte; var FirstByte : Byte; BdosReturn : Byte; NewFile : FileRecord_Ptr; Blocks : Integer; BlockDivisor : Integer; FileSize : Integer; FileRecords : Integer; begin BdosReturn := Bdos(BdosFunction, Addr(FCB)); if (BdosReturn <> BDOS_SEARCH_LAST) then begin { First byte of the file name in memory. } FirstByte := BdosReturn * 32; { Create the next file entry. } New(NewFile); with DMA[BdosReturn] do begin NewFile^.UserNumber := Number; { See if this is a system file. } if ((ord(FileName[10]) and $80) > 0) then begin NewFile^.System := True; FileName[10] := (FileName[10] and $7F) + $20; end else NewFile^.System := False; { See if this is Read Only. } if ((ord(FileName[9]) and $80) > 0) then begin NewFile^.ReadOnly := True; FileName[9] := (FileName[9] and $7F) + $20; end else NewFile^.ReadOnly := False; Number := 11; { Used for the file name length. } move(Number, NewFile^.FileName, 12); insert('.', NewFile^.FileName, 9); NewFile^.NextFile := Nil; { Calculate the file size. } { NOTE: This is messy, there has to be a better way. } FileRecords := Records + ((Extent + (S2 shl 5)) shl 7); BlockDivisor := BlockSize shl 3; Blocks := FileRecords div BlockDivisor; FileSize := Blocks * BlockSize; if ((FileRecords mod BlockDivisor) <> 0) then FileSize := FileSize + BlockSize; NewFile^.Records := FileRecords; NewFile^.FileSize := FileSize; end; { with DMA[BdosReturn] } { Add this file to the list. } { Only add if the file is not system or ShowSystem is set. } if (NOT NewFile^.System or ShowSystem) then AddFile(NewFile); end; { if (Get_File <> BDOS_SEARCH_LAST) } GetFile := BdosReturn; end; { Function GetFile } Procedure GetFileList; var BdosFunction : Byte; BdosReturn : Byte; begin { Get files as long as there are more to retrive. } BdosFunction := BDOS_SEARCH_FIRST; Repeat BdosReturn := GetFile(BdosFunction); BdosFunction := BDOS_SEARCH_NEXT; Until BdosReturn = BDOS_SEARCH_LAST; end; { Procedure GetFileList } { Prompts the user to press any key. } Procedure PromptAnyKey; var Character : Char; begin Write('Pres any key to continue...'); Read(Kbd, Character); WriteLn; end; { Print out the files in one column. } Procedure PrintFiles; var FilePtr : FileRecord_Ptr; TotalKBytes : Integer; Row : Integer; begin FilePtr := FileList; TotalKBytes := 0; Row := 1; While (FilePtr <> Nil) do begin with FilePtr^ do begin WriteLn(FileName, '', FileSize:4, 'k '); TotalKBytes := TotalKBytes + FileSize; FilePtr := NextFile; if (PageSize > 0) then if ((Row mod PageSize) = 0) then PromptAnyKey; Row := Succ(Row); end; { with FilePtr^ } end; { While (FilePtr <> Nil) } Writeln('Files: ', NumberFiles, ' ', TotalKBytes, 'k'); end; { Procedure PrintFilesColumn } { Print out the files in columns sorted by row. } Procedure PrintFilesRow; var FilePtr : FileRecord_Ptr; TotalKBytes : Integer; Column : Integer; Row : Integer; begin FilePtr := FileList; Column := 0; Row := 1; TotalKBytes := 0; While (FilePtr <> Nil) do begin with FilePtr^ do begin Write(FileName, '', FileSize:4, 'k '); TotalKBytes := TotalKBytes + FileSize; FilePtr := NextFile; { Check the column currently on. } Column := Succ(Column); if (Column = 4) then begin WriteLn; Column := 0; if (PageSize > 0) then if ((Row mod PageSize) = 0) then PromptAnyKey; Row := Succ(Row); end else Write('| '); end; { with FilePtr^ } end; { While (FilePtr <> Nil) } if ((Column mod 4) <> 0) then WriteLn; Writeln('Files: ', NumberFiles, ' ', TotalKBytes, 'k'); end; { Procedure PrintFiles } { Print out the files in columns sorted by column. } Procedure PrintFilesColumn; var FilePtr : FileRecord_Ptr; TotalKBytes : Integer; Columns : array[0..3] of FileRecord_Ptr; Column : Byte; Rows : Integer; Row : Integer; begin FilePtr := FileList; TotalKBytes := 0; { Calculate the number of rows. } Rows := NumberFiles div 4; if ((NumberFiles mod 4) <> 0) then Rows := Succ(Rows); { Set the pointer for each column. } Columns[0] := FilePtr; for Column := 1 to 3 do begin for Row := 1 to Rows do FilePtr := FilePtr^.NextFile; Columns[Column] := FilePtr; end; { Write out the rows. } for Row := 1 to Rows do begin for Column := 0 to 3 do begin if (Columns[Column] <> Nil) then with Columns[Column]^ do begin Write(FileName, '', FileSize:4, 'k '); TotalKBytes := TotalKBytes + FileSize; Columns[Column] := NextFile; end; if (Column < 3) then Write('| '); end; { for Column := 0 to 3 } WriteLn; if (PageSize > 0) then if ((Row mod PageSize) = 0) then PromptAnyKey; end; { for Row := 1 to Rows } Writeln('Files: ', NumberFiles, ' ', TotalKBytes, 'k'); end; { Procedure PrintFilesColumn } { Print the command line options. } Procedure PrintUsage; begin WriteLn('Usage: THIS_PROGRAM [Paramters] [File Patterns]'); WriteLn('Lists files like DIR, but more like Unix ls.'); WriteLn('Lists all files by default.'); WriteLn('File patters work more line Unix wild cards.'); WriteLn; WriteLn('Parameters:'); WriteLn(' -- Start processing file patterns.'); WriteLn(' -1 Display files in one column. ByColumn'); WriteLn(' -a Include system files in the file list.'); WriteLn(' -l Synonymous with -1.'); WriteLn(' -n Do not paginate output. PageSize'); WriteLn(' -x Display the file columns across rather than down. ByColumn'); Halt; end; { Process command line parameters. } Procedure ProcessParameters; var ParamNum : Integer; Parameter : ParamString; Option : Char; Stop : Boolean; begin ParamNum := 1; Stop := False; { Stop processing Parameters. } { Fetch any command line parameters. } Repeat Parameter := ParamStr(ParamNum); if (Copy(Parameter, 1, 1) = '-') then begin Option := Upcase(Copy(Parameter, 2, 1)); Case Option of '-': Stop := True; { End of parameters, start of file patterns. } '1': OneColumn := True; 'A': ShowSystem := True; 'H': PrintUsage; 'L': OneColumn := True; 'N': PageSize := 0; 'X': ByColumn := False; end; ParamNum := Succ(ParamNum); end else Stop := True; Until (Stop or (ParamNum > ParamCount)); { Process any file patterns. } While (ParamNum <= ParamCount) do begin Parameter := ParamStr(ParamNum); GetAllFiles := False; InitFCB; UpdateFCB(Parameter); GetFileList; ParamNum := Succ(ParamNum); end; end; begin { Initialize global variables. } BlockSize := GetBlockSize; { CPM for OS X does not set the block size. } if (BlockSize = 0) then BlockSize := 1; ByColumn := OUTPUT_BY_COLUMN; FileList := Nil; GetAllFiles := True; NumberFiles := 0; OneColumn := False; PageSize := PAGE_SIZE; ShowSystem := False; { Prepare for the BDos calls. } InitDMA; { Check if there are command line parameters. } if (ParamCount >= 1) then ProcessParameters; { If there were no file patterns get all of the files. } if GetAllFiles then begin InitFCB; GetFileList; end; if (NumberFiles = 0) then WriteLn('No files found.') else if OneColumn then PrintFiles else if (ByColumn and (NumberFiles > 4)) then PrintFilesColumn else PrintFilesRow; end. { Program JDIR }
unit uCtrlObject; interface uses Classes, SysUtils, mconnect,Variants,DB, uDbCustomObject, DbClient, uDbObject, Windows, Vcl.Dialogs, FireDAC.Comp.DataSet; type TOperacaoBd = (dbInsert, dbUpdate, dbDelete); type TFiltro = class(TObject) public procedure getIndexes(campo: TStringList; valores: String); end; type TCdsArray = Array Of TClientDataSet; TOleVariantArray = array of OleVariant; TControlObjectClass = Class of TControlObject; TControlObject = class(TCustomDbObject) private _CdsEx: TClientDataSet; _lCds: TClientDataSet; _Id: Integer; FOpenTransaction: Boolean; procedure SetOpenTransaction(const Value: Boolean); procedure GravaLogErro(sMensagem, Sql: String); function validaGravar(ACds: TClientDataSet; AOperacao: TOperacaoBd): Boolean; protected _DbObject : TDbObject; _KeyFieldParent : array of TDbField; _KeyField : array of TDbField; _lDataSet, _lStoreProc: TDataSet; _Cds: TClientDataSet; {Confirma a atualização do DbObject quando este deve ser persistido a partir de um recordset com mais de um registro. Ideal para cadastros do tipo Grid ou Mestre-Detalhe. Os parâmetros KeyFieldParent e KeyField são utilizados em cadastros Mestre-Detalhe quando a nescessidade de atualização de campos do detalha em função do mestre. Esta atualização é sempre executada na inserção e pode ser executada no update de acordo como o ChangeKeyIfUpdate} function ApplyCds(aCds: TClientDataSet; aDbObject: TDbObject; KeyFieldParent: Array of TDbField; KeyField: Array of TDbField; ChangeKeyIfUpdate: Boolean = False): Boolean; {ApplyCDS "Turbinado" -> Tranfere o Olevariant para um ClientDataSet interno, faz as deleções em caso de Mestre Detalhe e gera a exceção em caso de erro} procedure ApplyCdsEx(const ovData: OleVariant; DbObject: TDbObject; KeyFieldParent, KeyField: array of TDbField; bChangeKeyIfUpdate: Boolean = False; bDeleteRecords: Boolean = False); {Move os campos do ClientDataSet da aplicação cliente para o objeto de persistência} procedure CdsToDbObject(Cds: TClientDataSet; DbObject: TDbObject); procedure SetFieldValue(afield: TDbField; rValue: Double); Overload; procedure SetFieldValue(afield: TDbField; sValue: String); Overload; procedure SetFieldValue(afield: TDbField; iValue: Integer); Overload; procedure SetFieldValue(afield: TDbField; dValue: TDateTime); Overload; function validaCamposObrigatorios(ADbObject: TDbObject): Boolean; public {Contrutor da Classe} Constructor Create; Override; procedure criaDb; virtual; procedure destroiDb; virtual; {Abre o SQL passado como parâmetro e retorna o DataPacket para ser utilizado por um ClientDataSet} function GetDataPacket(Sql: String): OleVariant; OverLoad; procedure GetDataPacket(aCds: TClientDataset; Sql: String); OverLoad; function GetDataPacketFD(Sql: String): IFDDataSetReference; Destructor Destroy; Override; {Verifica se o Database está em transação e incia caso não esteja A transacao do control object é controlada pela propriedade OpenTransaction uma vez que podemos ter vários ControlObjects agregados ao um ControlObjects, nessa casso o ControlObject agregador será responsável pela transação.} procedure StartTransaction; {Verifica se o Database está em transação e da um "commit" o processo A transacao do control object é controlada pela propriedade OpenTransaction uma vez que podemos ter vários ControlObjects agregados ao um ControlObjects, nessa casso o ControlObject agregador será responsável pela transação.} procedure Commit; {Verifica se o Database está em transação e da um "rollback" o processo A transacao do control object é controlada pela propriedade OpenTransaction uma vez que podemos ter vários ControlObjects agregados ao um ControlObjects, nessa casso o ControlObject agregador será responsável pela transação.} procedure Rollback; {Indica se o controle de transação é aplicado pela classe} property OpenTransaction :Boolean read FOpenTransaction write SetOpenTransaction; {Executa a instrução SQL passada como parâmetro e retorna o erro caso ocorra no MESSAGEINFO. A função ferifica se a instrução alterou alguma registro e trata o retorno de acordo com o parâmetro ErrorIfNoRowsAffected tembém no MESSAGEINFO} function ExecSQL(Sql: String; ErrorIfNoRowsAffected: Boolean = false; bDoLog: Boolean = True): Boolean; overload; procedure SelecionarEx(Id: Double; aCds: TCdsArray); Virtual; function selecionar(Id: Variant): OleVariant; virtual; function selecionarMestreDet(Id: Variant; ADbChilds: array of TDbObject; AKeyFieldParent: array of TDbField; AKeyFields: array of TDbField): TOleVariantArray; virtual; procedure selecionarMestreDetalhe(Id: Variant; AcdsArray: TCdsArray); virtual; function GravarEx(const aOvCds: Array of OleVariant; Operacao: TOperacaoBd): Boolean; Virtual; function listaGrid(Filtro: TFiltro = nil): OleVariant; virtual; function gravar(ACds: TClientDataSet; AOperacao: TOperacaoBd): Boolean; virtual; function validaPreenchimentoCamposObrigatorios(ACds: TClientDataSet): Boolean; virtual; function validaIncluir(ACds: TClientDataSet): Boolean; virtual; function validaExcluir(ACds: TClientDataSet): Boolean; virtual; function validaAlterar(ACds: TClientDataSet): Boolean; virtual; function gravarMestreDetalhe(ACds, ACdsDetalhe: TClientDataSet; AOperacao: TOperacaoBd): Boolean; virtual; end; implementation { TControlObject } function TControlObject.ApplyCds(aCds: TClientDataSet; aDbObject: TDbObject; KeyFieldParent, KeyField: array of TDbField; ChangeKeyIfUpdate: Boolean): Boolean; Var Y, iNumKeyFields: Integer; AcceptApply: Boolean; CdsState: TUpdateStatus; bFiltered: Boolean; i : Integer; begin Result := True; bFiltered := aCds.Filtered; Try {** Vamos varrer o cds pelo tipo do Kind do update e passar a operação correta para a classe de persistencia se não fosse feito assim não conseguiriamos deletar os os grupos excluidos **} iNumKeyFields := High(KeyFieldParent); {** Processa a exclusão usando STATUSFILTER. É utilizado um ClientDataSet Auxiliar pois quanto o Cds é filtrado o status filter deixa de funcionar mas o conteúdo do Data Packet fica inalterado **} If _lCds.Active Then _lCds.Close; If aCds.State In [DsEdit, DsInsert] Then aCds.Post; _lCds.Data := aCds.Data; _lCds.StatusFilter := [usDeleted]; _lCds.First; While Not _lCds.Eof Do Begin CdsState := usDeleted; AcceptApply := True; If AcceptApply Then Begin CdsToDbObject( _lCds, aDbObject); Result := aDbObject.Delete; If Not Result Then Raise Exception.Create(aDbObject.MessageInfo); End; _lCds.Next; End; _lCds.StatusFilter := []; If (_lCds.ChangeCount > 0) Then _lCds.CancelUpdates; _lCds.Close; {Fim do processamento da exclusão} //If aCds.State In [DsEdit, DsInsert] Then aCds.Post; aCds.DisableControls; aCds.Filtered := False; aCds.First; While Not aCds.Eof Do Begin {** No Caso de Insert, verifica se existem campos passados como chave a serem associados num relacionamento mestre-detalhe. No caso de update, a atribuição dos campos chaves vai depender do parâmetro ChangeKeyIfUpdate **} CdsState := aCds.UpdateStatus; If CdsState In [usInserted, usModified] Then Begin AcceptApply := True; If AcceptApply Then Begin CdsToDbObject( aCds, aDbObject); If (iNumKeyFields > -1) And ((CdsState = usInserted) Or (ChangeKeyIfUpdate And (CdsState = usModified))) Then For Y := 0 To iNumKeyFields Do Begin Case KeyFieldParent[y].DataType Of ftString: KeyField[y].AsString := KeyFieldParent[y].AsString; ftSmallint, ftInteger, ftWord: KeyField[y].AsInteger := KeyFieldParent[y].AsInteger; ftFloat, ftCurrency, ftBCD: KeyField[y].AsFloat := KeyFieldParent[y].AsFloat; ftDate, ftDateTime: KeyField[y].AsDateTime := KeyFieldParent[y].AsDateTime; Else KeyField[y].Value := KeyFieldParent[y].Value; End; End; Case CdsState of usInserted: Result := aDbObject.Insert; usModified: Result := aDbObject.Update; End; If Not Result Then Raise Exception.Create(aDbObject.MessageInfo); End; End Else CdsToDbObject( aCds, aDbObject); aCds.Next; End; aCds.First; aCds.Filtered := bFiltered; aCds.EnableControls; except If _lCds.Active Then _lCds.StatusFilter := []; aCds.Filtered := bFiltered; If aCds.Active Then aCds.StatusFilter := []; aCds.EnableControls; Raise; End; end; procedure TControlObject.ApplyCdsEx(const ovData: OleVariant; DbObject: TDbObject; KeyFieldParent, KeyField: array of TDbField; bChangeKeyIfUpdate, bDeleteRecords: Boolean); begin _CdsEx.Data := ovData; if bDeleteRecords then begin _CdsEx.First; while not _CdsEx.Eof do _CdsEx.Delete; end; if not ApplyCds(_CdsEx, DbObject, KeyFieldParent, KeyField, bChangeKeyIfUpdate) then raise Exception.Create(DbObject.MessageInfo); end; procedure TControlObject.CdsToDbObject(Cds: TClientDataSet; DbObject: TDbObject); begin DbObject.LoadFromCds(Cds); end; procedure TControlObject.Commit; begin If FOpenTransaction Then FConexaoPadrao.Commit; end; constructor TControlObject.Create; begin inherited; _Cds := TClientDataSet.Create(nil); _CdsEx := TClientDataSet.Create(nil); _lCds := TClientDataSet.Create(nil); MessageInfo := ''; FOpenTransaction := True; end; procedure TControlObject.criaDb; begin _DbObject := TDbObject.Create(Self); end; procedure TControlObject.destroiDb; begin end; destructor TControlObject.Destroy; begin if _lDataSet <> nil then begin if _lDataSet.Active then _lDataSet.Close; _lDataSet.Free; end; If _lCds.Active Then _lCds.CLose; _lCds.Free; If _Cds.Active Then _Cds.CLose; _Cds.Free; If _CdsEx.Active Then _CdsEx.CLose; _CdsEx.Free; inherited Destroy; end; function TControlObject.ExecSQL(Sql: String; ErrorIfNoRowsAffected, bDoLog: Boolean): Boolean; begin Try result := FConexaoPadrao.ExecSQL(Sql); Except On E:Exception Do Begin Result := False; if bDoLog then GravaLogErro(E.Message, Sql) else GravaLogErro(E.Message, ''); MessageInfo := E.Message; End; End; end; function TControlObject.GetDataPacket(Sql: String): OleVariant; begin Try Result := FConexaoPadrao.GetDataPacket(Sql); Except On E:Exception Do Begin GravaLogErro(E.Message, Sql); MessageInfo := E.Message; raise Exception.Create(e.Message); End; End; end; procedure TControlObject.GetDataPacket(aCds: TClientDataset; Sql: String); begin Try aCds.Data := GetDataPacket(Sql) Except On E:Exception Do Begin GravaLogErro(E.Message, Sql); MessageInfo := E.Message; End; End; end; function TControlObject.GetDataPacketFD(Sql: String): IFDDataSetReference; begin Try Result := FConexaoPadrao.GetDataPacketFD(Sql); Except On E:Exception Do Begin GravaLogErro(E.Message, Sql); MessageInfo := E.Message; End; End; end; procedure TControlObject.GravaLogErro(sMensagem, Sql: String); Var wAno, wMes, wDia: Word; sNomeArquivo, sAno, sMes, sDia: String; begin Try DecodeDate(Date, wAno, wMes, wDia); SDia := IntToStr(wDia); SMes := IntToStr(wMes); SAno := IntToStr(wAno); If Length(SDia) = 1 Then SDia := '0' + SDia; If Length(SMes) = 1 Then SMes := '0' + SMes; If Length(SAno) > 2 Then SAno := Copy(Sano,Length(Sano)-1,2); sNomeArquivo := 'C:\SQLError' + Sdia+Smes+Sano + '.log'; Except End; end; function TControlObject.gravar(ACds: TClientDataSet; AOperacao: TOperacaoBd): Boolean; begin result := validaGravar(ACds, AOperacao); if result then begin try StartTransaction; Result := ApplyCds(ACds, _DbObject, [], []); Commit; except on e : Exception do begin result := False; MessageInfo := 'Erro ao gravar. ' + e.Message; Rollback; end; end; end; end; function TControlObject.GravarEx(const aOvCds: array of OleVariant; Operacao: TOperacaoBd): Boolean; begin Raise Exception.Create('O Método Gravar deve ser implementado!'); end; function TControlObject.gravarMestreDetalhe(ACds, ACdsDetalhe: TClientDataSet; AOperacao: TOperacaoBd): Boolean; begin result := validaGravar(ACds, AOperacao); if result then begin try StartTransaction; Result := ApplyCds(ACds, _DbObject, [], []); Commit; except on e : Exception do begin result := False; MessageInfo := 'Erro ao gravar. ' + e.Message; Rollback; end; end; end; end; function TControlObject.listaGrid(Filtro: TFiltro): OleVariant; var sql: string; begin _DbObject.clear; sql := _DbObject.SSqlSelect; //if filtro <> nil then // sql := sql + Chr(13) + Filtro.Text; Result := GetDataPacket(sql); //raise Exception.Create('Implemente o método Lista Grid...'); end; procedure TControlObject.Rollback; begin If FOpenTransaction Then FConexaoPadrao.RollBack; end; function TControlObject.selecionarMestreDet(Id: Variant; ADbChilds: array of TDbObject; AKeyFieldParent, AKeyFields: array of TDbField): TOleVariantArray; var i : Integer; begin for i := 0 to _DbObject.FieldCount - 1 do if _DbObject.Fields[i].Key then _DbObject.Fields[i].Value := Id; // result := GetDataPacket(_DbObject.SSqlSelect); end; procedure TControlObject.selecionarMestreDetalhe(Id: Variant; AcdsArray: TCdsArray); begin // end; function TControlObject.selecionar(Id: Variant): OleVariant; var i : Integer; begin for i := 0 to _DbObject.FieldCount - 1 do if _DbObject.Fields[i].Key then _DbObject.Fields[i].Value := Id; result := GetDataPacket(_DbObject.SSqlSelect); end; procedure TControlObject.SelecionarEx(Id: Double; aCds: TCdsArray); begin Raise Exception.Create('O Método Selecionar deve ser implementado!'); end; procedure TControlObject.SetFieldValue(afield: TDbField; rValue: Double); begin If rValue <= 0 Then afield.Clear Else afield.AsFloat := rValue; end; procedure TControlObject.SetFieldValue(afield: TDbField; dValue: TDateTime); begin If dValue <= 0 Then afield.Clear Else afield.AsDateTime := dValue; end; procedure TControlObject.SetFieldValue(afield: TDbField; iValue: Integer); begin If iValue <= 0 Then afield.Clear Else afield.AsInteger := iValue; end; procedure TControlObject.SetFieldValue(afield: TDbField; sValue: String); begin If Trim(sValue) = '' Then afield.Clear Else afield.AsString := Trim(sValue); end; procedure TControlObject.SetOpenTransaction(const Value: Boolean); begin FOpenTransaction := Value; end; procedure TControlObject.StartTransaction; begin If FOpenTransaction Then FConexaoPadrao.StartTransaction; end; function TControlObject.validaAlterar(ACds: TClientDataSet): Boolean; begin _DbObject.LoadFromCds(ACds); result := validaCamposObrigatorios(_DbObject); end; function TControlObject.validaCamposObrigatorios(ADbObject: TDbObject): Boolean; var i : Integer; field : TDbField; caption: string; begin result := True; for i := 0 to _DbObject.FieldCount - 1 do begin if (_DbObject.Fields[i].IsNull) and (_DbObject.Fields[i].Required) and (not _DbObject.Fields[i].Key) then begin result := False; MessageInfo := 'O campo ' + _DbObject.Fields[i].DisplayName + ' é de preenchimento obrigatório.'; raise Exception.Create(MessageInfo); exit; end; end; end; function TControlObject.validaExcluir(ACds: TClientDataSet): Boolean; begin result := True; end; function TControlObject.validaGravar(ACds: TClientDataSet; AOperacao: TOperacaoBd): Boolean; begin try case AOperacao of dbInsert : Result := validaIncluir(ACds); dbUpdate : Result := validaAlterar(ACds); dbDelete : Result := validaExcluir(ACds); end; except on e : Exception do begin result := False; MessageInfo := e.Message; end; end; end; function TControlObject.validaIncluir(ACds: TClientDataSet): Boolean; begin _DbObject.LoadFromCds(ACds); result := validaCamposObrigatorios(_DbObject); end; function TControlObject.validaPreenchimentoCamposObrigatorios(ACds: TClientDataSet): Boolean; begin _DbObject.LoadFromCds(Acds); result := validaCamposObrigatorios(_DbObject); end; { TFiltro } procedure TFiltro.getIndexes(campo: TStringList; valores: String); begin if campo = nil then campo := TStringList.Create; valores := StringReplace(valores, ';', '', [rfReplaceAll]); campo.Delimiter := ','; campo.StrictDelimiter := True; campo.DelimitedText := valores; end; end.
{*******************************************************} { } { Delphi REST Client Framework } { } { Copyright(c) 2013-2018 Embarcadero Technologies, Inc. } { All rights reserved } { } {*******************************************************} unit REST.BindSource; interface uses System.SysUtils, System.Classes, System.TypInfo, System.Generics.Collections, Data.Bind.Components, Data.Bind.ObjectScope; type TRESTComponentBindSource = class; /// <summary> /// Base notify class for REST components. Support for multicast notifications /// </summary> TRESTComponentNotify = class public procedure PropertyValueChanged(Sender: TObject); virtual; end; /// <summary> /// Base notify class for REST components that have a JSON result. Support for multicast notifications /// </summary> TRESTJSONComponentNotify = class(TRESTComponentNotify) public procedure JSONValueChanged(Sender: TObject); virtual; end; /// <summary> /// LiveBindings adapter for REST components. Create bindable members /// </summary> TRESTComponentAdapter = class(TBindSourceAdapter) public type TNotify = class(TRESTComponentNotify) private FAdapter: TRESTComponentAdapter; public constructor Create(const AAdapter: TRESTComponentAdapter); procedure PropertyValueChanged(Sender: TObject); override; end; TReadWriteField<T> = class(TBindSourceAdapterReadWriteField<T>) private FPersistent: TPersistent; public // Reference object associated with field, such a TCollectionItem property Persistent: TPersistent read FPersistent; end; TReadField<T> = class(TBindSourceAdapterReadField<T>) private FPersistent: TPersistent; public // Reference object associated with field, such a TCollectionItem property Persistent: TPersistent read FPersistent; end; private FDeferActivate: Boolean; FPosting: Boolean; function HasComponent: Boolean; function ComponentLoading: Boolean; protected procedure DoChangePosting; virtual; procedure DoAfterPostFields(AFields: TArray<TBindSourceAdapterField>); override; procedure DoBeforePostFields(AFields: TArray<TBindSourceAdapterField>); override; function GetSource: TBaseLinkingBindSource; virtual; procedure Loaded; override; procedure SetActive(AValue: Boolean); override; function GetCanActivate: Boolean; override; function GetCanModify: Boolean; override; function SupportsNestedFields: Boolean; override; function GetCount: Integer; override; procedure DoBeforeOpen; override; procedure DoAfterClose; override; procedure AddFields; virtual; procedure CheckInactive; procedure CreateReadOnlyField<T>(const AFieldName: string; const AGetMemberObject: IGetMemberObject; AMemberType: TScopeMemberType; const AGetterFunc: TFunc<T>; const APersistent: TPersistent = nil); procedure CreateReadWriteField<T>(const AFieldName: string; const AGetMemberObject: IGetMemberObject; AMemberType: TScopeMemberType; const AGetterFunc: TFunc<T>; const ASetterProc: TProc<T>; const APersistent: TPersistent = nil); procedure RefreshFields; property Posting: Boolean read FPosting; end; /// <summary> /// LiveBindings bindsource for REST components. /// </summary> TRESTComponentBindSource = class(TBaseObjectBindSource) strict private FAdapter: TRESTComponentAdapter; private function GetAutoEdit: Boolean; function GetAutoPost: Boolean; procedure SetAutoEdit(const AValue: Boolean); procedure SetAutoPost(const AValue: Boolean); protected function GetInternalAdapter: TBindSourceAdapter; override; function CreateAdapter: TRESTComponentAdapter; virtual; abstract; public constructor Create(AOwner: TComponent); override; property AutoEdit: Boolean read GetAutoEdit write SetAutoEdit default True; property AutoPost: Boolean read GetAutoPost write SetAutoPost default True; property AutoActivate default True; property Adapter: TRESTComponentAdapter read FAdapter; end; /// <summary> /// List of notify objects for REST components. Support for multicast notifications /// </summary> TRESTComponentNotifyList<T: TRESTComponentNotify> = class(TObject) private FNotifyList: TList<T>; public constructor Create; destructor Destroy; override; procedure AddNotify(const ANotify: T); procedure RemoveNotify(const ANotify: T); procedure Notify(const AProc: TProc<T>); end; implementation uses REST.Consts, REST.Types; { TRESTComponentNotify } procedure TRESTComponentNotify.PropertyValueChanged(Sender: TObject); begin // end; { TRESTComponentAdapter } procedure TRESTComponentAdapter.DoAfterClose; begin inherited; ClearFields; end; procedure TRESTComponentAdapter.DoBeforeOpen; begin inherited; AddFields; FPosting := False; DoChangePosting; end; procedure TRESTComponentAdapter.DoBeforePostFields( AFields: TArray<TBindSourceAdapterField>); begin FPosting := True; DoChangePosting; inherited; end; procedure TRESTComponentAdapter.DoChangePosting; begin // end; procedure TRESTComponentAdapter.DoAfterPostFields( AFields: TArray<TBindSourceAdapterField>); begin FPosting := False; DoChangePosting; inherited; end; procedure TRESTComponentAdapter.AddFields; begin end; function TRESTComponentAdapter.GetCanActivate: Boolean; begin Result := HasComponent; end; function TRESTComponentAdapter.GetCanModify: Boolean; begin Result := True; end; function TRESTComponentAdapter.GetCount: Integer; begin Result := 1; end; function TRESTComponentAdapter.GetSource: TBaseLinkingBindSource; begin Result := nil; end; function TRESTComponentAdapter.HasComponent: Boolean; begin Result := GetSource <> nil; end; procedure TRESTComponentAdapter.Loaded; begin inherited; if FDeferActivate then try Active := True; except // Ignore exception during load end; end; procedure TRESTComponentAdapter.RefreshFields; begin if HasComponent and (NOT ComponentLoading) then begin if Active then begin if NOT(State IN seEditModes) then begin // Update all fields when the value of a parameter or property is changed Refresh; end; end; end; end; procedure TRESTComponentAdapter.SetActive(AValue: Boolean); begin if (csLoading in ComponentState) then begin if AValue then begin FDeferActivate := True; Exit; end; end; if (AValue = False) or CanActivate then inherited; end; function TRESTComponentAdapter.SupportsNestedFields: Boolean; begin Result := False; // No special handling for '.' end; procedure TRESTComponentAdapter.CheckInactive; begin if Active then raise ERESTException.CreateFmt(sOperationNotAllowedOnActiveComponent, [self.ClassName]); end; function TRESTComponentAdapter.ComponentLoading: Boolean; var LSource: TComponent; begin LSource := GetSource; Result := (LSource <> nil) and (csLoading in LSource.ComponentState); end; procedure TRESTComponentAdapter.CreateReadOnlyField<T>(const AFieldName: string; const AGetMemberObject: IGetMemberObject; AMemberType: TScopeMemberType; const AGetterFunc: TFunc<T>; const APersistent: TPersistent); var LField: TReadField<T>; LParamReader: TValueReader<T>; LTypeInfo: PTypeInfo; begin LParamReader := TValueReaderFunc<T>.Create(AFieldName, function(AName: string): T begin if HasComponent then Result := AGetterFunc; end); LTypeInfo := System.TypeInfo(T); LField := TReadField<T>.Create(self, AFieldName, TBindSourceAdapterFieldType.Create(LTypeInfo.NameFld.ToString, LTypeInfo.Kind), AGetMemberObject, LParamReader, AMemberType); LField.FPersistent := APersistent; Fields.Add(LField); end; procedure TRESTComponentAdapter.CreateReadWriteField<T>(const AFieldName: string; const AGetMemberObject: IGetMemberObject; AMemberType: TScopeMemberType; const AGetterFunc: TFunc<T>; const ASetterProc: TProc<T>; const APersistent: TPersistent); var LField: TReadWriteField<T>; LParamReader: TValueReader<T>; LParamWriter: TValueWriter<T>; LTypeInfo: PTypeInfo; begin LParamReader := TValueReaderFunc<T>.Create(AFieldName, function(AName: string): T begin if HasComponent then Result := AGetterFunc; end); LParamWriter := TValueWriterProc<T>.Create(AFieldName, procedure(AName: string; AValue: T) begin if HasComponent then ASetterProc(AValue); end); LTypeInfo := System.TypeInfo(T); LField := TReadWriteField<T>.Create(self, AFieldName, TBindSourceAdapterFieldType.Create(LTypeInfo.NameFld.ToString, LTypeInfo.Kind), AGetMemberObject, LParamReader, LParamWriter, AMemberType); LField.FPersistent := APersistent; Fields.Add(LField); end; { TRESTComponentAdapter.TNotify } constructor TRESTComponentAdapter.TNotify.Create(const AAdapter: TRESTComponentAdapter); begin FAdapter := AAdapter; end; procedure TRESTComponentAdapter.TNotify.PropertyValueChanged(Sender: TObject); begin FAdapter.RefreshFields; end; { TRESTComponentBindSource } constructor TRESTComponentBindSource.Create(AOwner: TComponent); begin inherited; FAdapter := CreateAdapter; Assert(FAdapter <> nil); FAdapter.AutoPost := True; // Default end; function TRESTComponentBindSource.GetAutoEdit: Boolean; begin Result := FAdapter.AutoEdit; end; function TRESTComponentBindSource.GetAutoPost: Boolean; begin Result := FAdapter.AutoPost; end; function TRESTComponentBindSource.GetInternalAdapter: TBindSourceAdapter; begin Result := FAdapter; if (Result <> NIL) then ConnectAdapter(Result); end; procedure TRESTComponentBindSource.SetAutoEdit(const AValue: Boolean); begin if (AValue <> FAdapter.AutoEdit) then begin FAdapter.AutoEdit := AValue; end; end; procedure TRESTComponentBindSource.SetAutoPost(const AValue: Boolean); begin if (AValue <> FAdapter.AutoPost) then begin FAdapter.AutoPost := AValue; end; end; { TRESTComponenttNotifyList<T> } procedure TRESTComponentNotifyList<T>.AddNotify(const ANotify: T); begin Assert(not FNotifyList.Contains(ANotify)); FNotifyList.Add(ANotify); end; constructor TRESTComponentNotifyList<T>.Create; begin inherited; FNotifyList := TList<T>.Create; end; destructor TRESTComponentNotifyList<T>.Destroy; begin FNotifyList.Free; inherited; end; procedure TRESTComponentNotifyList<T>.Notify(const AProc: TProc<T>); var LNotify: T; begin for LNotify in FNotifyList do AProc(LNotify); end; procedure TRESTComponentNotifyList<T>.RemoveNotify(const ANotify: T); begin Assert(FNotifyList.Contains(ANotify)); FNotifyList.Remove(ANotify); end; { TRESTJSONComponentNotify } procedure TRESTJSONComponentNotify.JSONValueChanged(Sender: TObject); begin // end; end.
unit ListSupport; (* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * This code was inspired to expidite the creation of unit tests * for use the Dunit test frame work. * * The Initial Developer of XPGen is Michael A. Johnson. * Portions created The Initial Developer is Copyright (C) 2000. * Portions created by The DUnit Group are Copyright (C) 2000. * All rights reserved. * * Contributor(s): * Michael A. Johnson <majohnson@golden.net> * Juanco Aņez <juanco@users.sourceforge.net> * Chris Morris <chrismo@users.sourceforge.net> * Jeff Moore <JeffMoore@users.sourceforge.net> * The DUnit group at SourceForge <http://dunit.sourceforge.net> * *) { provides common list support functions that are commonly used throughout the system. ListFreeObjectItems - clears and releases tobject descended items in a list ListFreePointerItems - clears and releases items allocated via new/dispose Programmer: Michael A. Johnson Date: 9-Mar-2000 } interface uses classes; procedure ListFreeObjectItems(List: TList); procedure ListFreePointerItems(List: TList); implementation procedure ListFreeObjectItems(List: TList); { ListFreeObjectItems - clears and releases tobject items in a list. Assumptions: Assumes list is composed of items are are derived from tobject and that the destructor is overriden from the base through all descendants. Programmer: Michael A. Johnson Date: 9-Mar-2000 } var Item: Tobject; Iter: integer; begin { make sure we have a real list } if List <> nil then begin try { visit each node in the list and release memory occupied by the items } for Iter := 0 to List.count - 1 do begin Item := List[Iter]; Item.free; end; finally { make sure we empty the list so that references to stale pointers are avoided } List.Clear; end; end; end; procedure ListFreePointerItems(List: TList); { ListFreePointerItems - clears and releases items allocated via new/dispose Assumptions: Assumes that all items in list were allocated via operator new and can be released by calling dispose on a generic pointer. You should be aware that items allocated by GetMem/AllocMem etc may not be able to be released via this means. If you used GetMen/AllocMem to create the items you should call the corresponding release procedure for those memory allocators. Programmer: Michael A. Johnson Date: 9-Mar-2000 } var Item: pointer; Iter: integer; begin { make sure we have a real list } if List <> nil then begin try { visit each node in the list and release memory occupied by the items } for Iter := 0 to List.count - 1 do begin Item := List[Iter]; Dispose(Item); end; finally { make sure we empty the list so that references to stale pointers are avoided } List.Clear; end; end; end; end.
unit FileName; interface uses SysUtils, PropEdits, Controls, Classes; Type TFileNameProperty = class(TStringProperty) public function GetAttributes: TPropertyAttributes; override; procedure Edit; override; end; //procedure Register; implementation uses Dialogs , Forms; function TFileNameProperty.GetAttributes: TPropertyAttributes; begin Result := [paDialog] end {GetAttributes}; procedure TFileNameProperty.Edit; begin with TOpenDialog.Create(Application) do try Title := GetName; { name of property as OpenDialog caption } Filename := GetValue; Filter := 'All Files (*.*)|*.*'; HelpContext := 0; Options := Options + [ofShowHelp, ofPathMustExist, ofFileMustExist]; if Execute then SetValue(Filename); finally Free end end {Edit}; //procedure Register; //begin // RegisterPropertyEditor(TypeInfo(TFileName),TxPLAction_Execute, 'FileName', TFileNameProperty); //end; end.
unit uwlxprototypes; {$mode objfpc}{$H+} interface uses Classes, SysUtils, WlxPlugin, LCLType; {$IFDEF MSWINDOWS}{$CALLING STDCALL}{$ELSE}{$CALLING CDECL}{$ENDIF} type { Mandatory } TListLoad = function (ParentWin: HWND; FileToLoad: PAnsiChar; ShowFlags: Integer): HWND; { Optional } TListLoadNext = function (ParentWin, PluginWin: HWND; FileToLoad: PAnsiChar; ShowFlags: Integer): Integer; TListCloseWindow = procedure (ListWin: HWND); TListGetDetectString = procedure (DetectString: PAnsiChar; MaxLen: Integer); TListSearchText = function (ListWin: HWND; SearchString: PAnsiChar; SearchParameter: Integer): Integer; TListSearchDialog = function (ListWin: HWND; FindNext: Integer): Integer; TListSendCommand = function (ListWin: HWND; Command, Parameter: Integer): Integer; TListPrint = function (ListWin: HWND; FileToPrint, DefPrinter: PAnsiChar; PrintFlags: Integer; var Margins: TRect): Integer; TListNotificationReceived = function (ListWin: HWND; Message, wParam, lParam: Integer): Integer; TListSetDefaultParams = procedure (dps: PListDefaultParamStruct); TListGetPreviewBitmap = function (FileToLoad: PAnsiChar; Width, Height: Integer; ContentBuf: PByte; ContentBufLen: Integer): HBITMAP; { Unicode } TListLoadW = function (ParentWin: HWND; FileToLoad: PWideChar; ShowFlags: Integer): HWND; TListLoadNextW = function (ParentWin, PluginWin: HWND; FileToLoad: PWideChar; ShowFlags: Integer): Integer; TListSearchTextW = function (ListWin: HWND; SearchString: PWideChar; SearchParameter: Integer): Integer; TListPrintW = function (ListWin: HWND; FileToPrint, DefPrinter: PWideChar; PrintFlags: Integer; var Margins: TRect): Integer; TListGetPreviewBitmapW = function (FileToLoad: PWideChar; Width, Height: Integer; ContentBuf: PByte; ContentBufLen: Integer): HBITMAP; {$CALLING DEFAULT} implementation end.
program SubstringChecker; {$mode objfpc}{$H+} uses {$IFDEF UNIX} {$IFDEF UseCThreads} cthreads, {$ENDIF} {$ENDIF} Classes, SysUtils, CustApp, SubstringChecking; type { SubstringChecker } TSubstringChecker = class(TCustomApplication) protected procedure DoRun; override; public constructor Create(TheOwner: TComponent); override; destructor Destroy; override; procedure WriteHelp; virtual; end; { SubstringChecker } procedure TSubstringChecker.DoRun; var ErrorMsg, Haystack, Needle: string; begin // quick check parameters ErrorMsg := CheckOptions('hsn', 'help haystack needle'); if ErrorMsg <> '' then begin ShowException(Exception.Create(ErrorMsg)); Terminate; Exit; end; // parse parameters if HasOption('h', 'help') then begin WriteHelp; Terminate; Exit; end; if HasOption('s', 'haystack') then begin Haystack := GetOptionValue('s', 'haystack'); end else begin WriteHelp; Terminate; Exit; end; if HasOption('n', 'needle') then begin Needle := GetOptionValue('n', 'needle'); end else begin WriteHelp; Terminate; Exit; end; // Program logic if Search(Haystack, Needle) then begin WriteLn('Found!'); end else begin WriteLn('Not found!'); end; // stop program loop Terminate; end; constructor TSubstringChecker.Create(TheOwner: TComponent); begin inherited Create(TheOwner); StopOnException := True; end; destructor TSubstringChecker.Destroy; begin inherited Destroy; end; procedure TSubstringChecker.WriteHelp; begin { add your help code here } writeln('Usage: ', ExeName, ' -h'); writeln('Usage: ', ExeName, ' -s "Hay Stack" -n " st"'); end; var Application: TSubstringChecker; begin Application := TSubstringChecker.Create(nil); Application.Title := 'Substring Checker'; Application.Run; Application.Free; end.
unit MemFile; interface uses SysUtils; type TSeek = (_BEGIN, _END, _CURRENT); EGrowFile = Exception; TMemFile = class (TObject) private protected m_Buffer: PChar; m_BufferSize: Cardinal; m_Position: Cardinal; m_FileSize: Cardinal; m_GrowBytes: Cardinal; procedure GrowFile(nNewLen: Cardinal);virtual; function Alloc(nBytes: Cardinal): PChar;virtual; procedure Realloc(lpMem: PChar; nBytes: Cardinal);virtual; procedure MemFree(lpMem: Pointer); virtual; procedure Memcpy(lpMemTarget, lpMemSource: Pointer; nBytes: Cardinal); virtual; public constructor Create(nGrowBytes: Cardinal=1024); destructor Destroy; override; procedure Close;virtual; function GetFileSize: Cardinal; function GetBufferPtr: PChar; function GetPosition: Cardinal; function Read(lpBuffer: Pointer; nCount: Cardinal): Cardinal;virtual; function Seek(lOffset: Longint; nFrom: TSeek): Longint; procedure SetLength(nNewLen: Cardinal);virtual; procedure Write(lpBuffer: Pointer; nCount: Cardinal);virtual; end; implementation uses PrnCmd; { TMemFile } function TMemFile.Alloc(nBytes: Cardinal): PChar; begin Result := AllocMem(nBytes); end; procedure TMemFile.Close; begin m_GrowBytes := 0; m_Position := 0; m_BufferSize := 0; m_FileSize := 0; if m_Buffer <> nil then MemFree(m_Buffer); m_Buffer := nil; end; constructor TMemFile.Create(nGrowBytes: Cardinal=1024); begin m_Buffer := nil; m_BufferSize := 0; m_Position := 0; m_FileSize := 0; m_GrowBytes := nGrowBytes; end; procedure TMemFile.MemFree(lpMem: Pointer); begin FreeMem(lpMem); end; function TMemFile.GetBufferPtr: PChar; begin Result := m_Buffer; end; function TMemFile.GetFileSize: Cardinal; begin Result := m_FileSize; end; function TMemFile.GetPosition: Cardinal; begin Result := m_Position; end; procedure TMemFile.GrowFile(nNewLen: Cardinal); var nNewBufferSize: Cardinal; begin if nNewLen > m_BufferSize then begin nNewBufferSize := m_BufferSize; if m_GrowBytes = 0 then raise EGrowFile.Create( IntToStr(m_GrowBytes) ); while nNewBufferSize < nNewLen do Inc(nNewBufferSize, m_GrowBytes); if m_Buffer = nil then m_Buffer := Alloc(nNewBufferSize) else Realloc(m_Buffer, nNewBufferSize); if m_Buffer=nil then raise EOutOfMemory.Create(''); m_BufferSize := nNewBufferSize; end; end; procedure TMemFile.Memcpy(lpMemTarget, lpMemSource: Pointer; nBytes: Cardinal); begin Move( lpMemSource^, lpMemTarget^, nBytes ); end; function TMemFile.Read(lpBuffer: Pointer; nCount: Cardinal): Cardinal; begin Result := 0; if nCount = 0 then Exit; if m_Position > m_FileSize then Exit; if (m_Position + nCount) > m_FileSize then Result := m_FileSize - m_Position else Result := nCount; Memcpy(PChar(lpBuffer), m_Buffer + m_Position, nCount); Inc(m_Position, Result); end; procedure TMemFile.Realloc(lpMem: PChar; nBytes: Cardinal); begin ReallocMem(lpMem, nBytes); end; function TMemFile.Seek(lOffset: LongInt; nFrom: TSeek): Longint; var lNewPos: LongInt; begin lNewPos := m_Position; { if nFrom=_BEGIN then lNewPos := lOffset else if nFrom = _CURRENT then Inc(lNewPos, lOffset) else if nFrom = _END then lNewPos := m_FileSize + lOffset else begin Result := -1; Exit; end; } case nFrom of _BEGIN: lNewPos := lOffset; _CURRENT: Inc(lNewPos, lOffset); _END: lNewPos := m_FileSize + lOffset; else begin Result := -1; Exit; end; end; if lNewPos < 0 then raise Exception.Create('Bad Seek.'); m_Position := lNewPos; Result := m_Position; end; procedure TMemFile.SetLength(nNewLen: Cardinal); begin if nNewLen > m_BufferSize then GrowFile(nNewLen); if nNewLen < m_Position then m_Position := nNewLen; m_FileSize := nNewLen; end; procedure TMemFile.Write(lpBuffer: Pointer; nCount: Cardinal); begin if nCount = 0 then Exit; if (m_Position + nCount) > m_BufferSize then GrowFile(m_Position + nCount); Memcpy((m_Buffer+m_Position), PChar(lpBuffer), nCount); Inc(m_Position, nCount); if m_Position > m_FileSize then m_FileSize := m_Position; end; destructor TMemFile.Destroy; begin Close; Inherited; end; end.
unit SubParametersQuery2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, Vcl.StdCtrls, SubParametersExcelDataModule, System.StrUtils, OrderQuery, SubParametersInterface, DSWrap; type TSubParametersW = class(TOrderW) private FChecked: TFieldWrap; FID: TFieldWrap; FIdParameter: TParamWrap; FIsDefault: TFieldWrap; FName: TFieldWrap; FProductCategoryId: TParamWrap; FTranslation: TFieldWrap; public constructor Create(AOwner: TComponent); override; property Checked: TFieldWrap read FChecked; property ID: TFieldWrap read FID; property IdParameter: TParamWrap read FIdParameter; property IsDefault: TFieldWrap read FIsDefault; property Name: TFieldWrap read FName; property ProductCategoryId: TParamWrap read FProductCategoryId; property Translation: TFieldWrap read FTranslation; end; TQuerySubParameters2 = class(TQueryOrder, ISubParameters) strict private function GetSubParameterID(const AName: string): Integer; stdcall; private FW: TSubParametersW; procedure DoAfterInsert(Sender: TObject); procedure DoBeforeCheckedOpen(Sender: TObject); function GetCheckedMode: Boolean; { Private declarations } protected function CreateDSWrap: TDSWrap; override; procedure DoAfterCheckedOpen(Sender: TObject); public constructor Create(AOwner: TComponent); override; function GetCheckedValues(const AFieldName: String): string; procedure LoadDataFromExcelTable(AExcelTable: TSubParametersExcelTable); procedure OpenWithChecked(AIDParameter, AProductCategoryId: Integer); function Search(const AName: String): Integer; overload; function SearchByID(AID: Integer; TestResult: Boolean = False) : Integer; overload; property CheckedMode: Boolean read GetCheckedMode; property W: TSubParametersW read FW; { Public declarations } end; implementation uses NotifyEvents, StrHelper, BaseQuery, System.Math; {$R *.dfm} constructor TQuerySubParameters2.Create(AOwner: TComponent); begin inherited; FW := FDSWrap as TSubParametersW; AutoTransaction := False; TNotifyEventWrap.Create(W.AfterInsert, DoAfterInsert, W.EventList); end; function TQuerySubParameters2.CreateDSWrap: TDSWrap; begin Result := TSubParametersW.Create(FDQuery); end; procedure TQuerySubParameters2.DoAfterInsert(Sender: TObject); begin W.IsDefault.F.AsInteger := W.IsDefault.DefaultValue; end; procedure TQuerySubParameters2.DoAfterCheckedOpen(Sender: TObject); begin W.Checked.F.ReadOnly := False; end; procedure TQuerySubParameters2.DoBeforeCheckedOpen(Sender: TObject); begin if FDQuery.FieldCount > 0 then Exit; // Обновляем описания полей и создаём поля по умолчанию W.CreateDefaultFields(True); W.Checked.F.FieldKind := fkInternalCalc; end; function TQuerySubParameters2.GetCheckedMode: Boolean; begin Result := FDQuery.FindField(W.Checked.FieldName) <> nil; end; function TQuerySubParameters2.GetCheckedValues(const AFieldName : String): string; var AClone: TFDMemTable; begin Assert(not AFieldName.IsEmpty); Result := ''; AClone := W.AddClone(Format('%s = %d', [W.Checked.FieldName, 1])); try while not AClone.Eof do begin Result := Result + IfThen(Result.IsEmpty, '', ',') + AClone.FieldByName(AFieldName).AsString; AClone.Next; end; finally W.DropClone(AClone); end; end; function TQuerySubParameters2.GetSubParameterID(const AName: string): Integer; var V: Variant; begin Result := 0; V := FDQuery.LookupEx(W.Name.FullName, AName, W.PKFieldName, [lxoCaseInsensitive]); if not VarIsNull(V) then Result := V; end; procedure TQuerySubParameters2.LoadDataFromExcelTable (AExcelTable: TSubParametersExcelTable); var AField: TField; I: Integer; begin AExcelTable.DisableControls; try AExcelTable.First; AExcelTable.CallOnProcessEvent; while not AExcelTable.Eof do begin W.TryAppend; try for I := 0 to AExcelTable.FieldCount - 1 do begin AField := FDQuery.FindField(AExcelTable.Fields[I].FieldName); if AField <> nil then begin AField.Value := AExcelTable.Fields[I].Value; end; end; W.TryPost; except W.TryCancel; raise; end; AExcelTable.Next; AExcelTable.CallOnProcessEvent; end; finally AExcelTable.EnableControls; end; end; procedure TQuerySubParameters2.OpenWithChecked(AIDParameter, AProductCategoryId : Integer); begin Assert(AIDParameter > 0); Assert(AProductCategoryId > 0); // Делаем замену в исходном запросе FDQuery.SQL.Text := SQL.Replace('/* IFCHECKED', '/* IFCHECKED */'); SetParamType(W.IdParameter.FieldName); SetParamType(W.ProductCategoryId.FieldName); TNotifyEventWrap.Create(W.BeforeOpen, DoBeforeCheckedOpen, W.EventList); TNotifyEventWrap.Create(W.AfterOpen, DoAfterCheckedOpen, W.EventList); // Переходим в режим кэширования записей FDQuery.CachedUpdates := True; AutoTransaction := True; Load([W.IdParameter.FieldName, W.ProductCategoryId.FieldName], [AIDParameter, AProductCategoryId]); end; function TQuerySubParameters2.Search(const AName: String): Integer; begin Assert(not AName.IsEmpty); Result := SearchEx([TParamRec.Create(W.Name.FullName, AName, ftWideString, True)]); end; function TQuerySubParameters2.SearchByID(AID: Integer; TestResult: Boolean = False): Integer; begin Result := SearchEx([TParamRec.Create(W.ID.FullName, AID)], IfThen(TestResult, 1, -1)); end; constructor TSubParametersW.Create(AOwner: TComponent); begin inherited; FID := TFieldWrap.Create(Self, 'sp.ID', '', True); FOrd := TFieldWrap.Create(Self, 'Ord'); FChecked := TFieldWrap.Create(Self, 'Checked'); FIsDefault := TFieldWrap.Create(Self, 'IsDefault'); FName := TFieldWrap.Create(Self, 'Name'); FTranslation := TFieldWrap.Create(Self, 'Translation'); FIsDefault.DefaultValue := 0; // Параметры SQL запроса FIdParameter := TParamWrap.Create(Self, 'psp.IdParameter'); FProductCategoryId := TParamWrap.Create(Self, 'cp.ProductCategoryId'); end; end.
{*******************************************************} { } { FMX UI EditView 编辑框 } { } { 版权所有 (C) 2016 YangYxd } { } {*******************************************************} unit UI.Edit; interface uses UI.Base, UI.Standard, {$IFDEF MSWINDOWS}UI.Debug, {$ENDIF} FMX.KeyMapping, FMX.VirtualKeyboard, {$IFDEF ANDROID} FMX.VirtualKeyboard.Android, {$ENDIF} {$IFDEF IOS} Macapi.Helpers, FMX.Platform.iOS, FMX.VirtualKeyboard.iOS, {$ENDIF} FMX.BehaviorManager, FMX.Forms, System.Messaging, FMX.Menus, FMX.Presentation.Messages, FMX.Controls.Presentation, FMX.Text, FMX.Edit, FMX.Edit.Style, FMX.Controls.Model, FMX.MagnifierGlass, FMX.SpellChecker, FMX.ActnList, FMX.Objects, System.Math, System.Actions, System.Rtti, FMX.Consts, System.TypInfo, System.SysUtils, System.Character, System.RTLConsts, FMX.Graphics, System.Generics.Collections, FMX.TextLayout, System.Classes, System.Types, System.UITypes, System.Math.Vectors, System.Analytics, FMX.Types, FMX.StdCtrls, FMX.Platform, FMX.Controls; type TEditDrawableBorder = class(TDrawableBorder); type TEditViewBase = class(TView, ICaption) private FText: UI.Base.TTextSettings; FTextHint: string; FDrawable: TDrawableIcon; FIsChanging: Boolean; FOnTextChange: TNotifyEvent; FOnDrawViewBackgroud: TOnDrawViewBackgroud; function GetDrawable: TDrawableIcon; procedure SetDrawable(const Value: TDrawableIcon); procedure SetTextSettings(const Value: UI.Base.TTextSettings); procedure SetTextHint(const Value: string); protected procedure Loaded; override; procedure ImagesChanged; override; procedure PaintBackground; override; procedure DoPaintBackground(var R: TRectF); virtual; procedure DoPaintText(var R: TRectF); virtual; procedure SetGravity(const Value: TLayoutGravity); override; procedure DoLayoutChanged(Sender: TObject); override; function CreateBackground: TDrawable; override; function CanRePaintBk(const View: IView; State: TViewState): Boolean; override; function GetDefaultSize: TSizeF; override; function GetData: TValue; override; procedure SetData(const Value: TValue); override; procedure SetName(const Value: TComponentName); override; protected function GetText: string; virtual; procedure SetText(const Value: string); virtual; function TextStored: Boolean; procedure DoChanged(Sender: TObject); virtual; procedure DoDrawableChanged(Sender: TObject); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; function ToString: string; override; procedure AfterConstruction; override; procedure Change; property Text: string read GetText write SetText stored TextStored; property TextHint: string read FTextHint write SetTextHint; property TextSettings: UI.Base.TTextSettings read FText write SetTextSettings; property Drawable: TDrawableIcon read GetDrawable write SetDrawable; property OnTextChange: TNotifyEvent read FOnTextChange write FOnTextChange; property OnDrawBackgroud: TOnDrawViewBackgroud read FOnDrawViewBackgroud write FOnDrawViewBackgroud; end; type TEditDataModel = class(TDataModel) public const DefaultSelectionColor = $802A8ADF; DefaultInputSupport = True; private FChanged: Boolean; FSelStart: Integer; FSelLength: Integer; FReadOnly: Boolean; FMaxLength: Integer; FPassword: Boolean; FKeyboardType : TVirtualkeyboardType; FReturnKeyType: TReturnKeyType; FImeMode: TImeMode; FKillFocusByReturn: Boolean; FCheckSpelling: Boolean; FCaretPosition: Integer; FCaret: TCaret; FTyping: Boolean; FFilterChar: string; FInputSupport: Boolean; FTextSettingsInfo: UI.Base.TTextSettings; FOnChange: TNotifyEvent; FOnChangeTracking: TNotifyEvent; FOnTyping: TNotifyEvent; FOnValidating: TValidateTextEvent; FOnValidate: TValidateTextEvent; FValidating: Boolean; procedure SetSelStart(const Value: Integer); procedure SetSelLength(const Value: Integer); procedure SetMaxLength(const Value: Integer); procedure SetReadOnly(const Value: Boolean); procedure SetPassword(const Value: Boolean); procedure SetImeMode(const Value: TImeMode); procedure SetKeyboardType(const Value: TVirtualKeyboardType); procedure SetReturnKeyType(const Value: TReturnKeyType); procedure SetKillFocusByReturn(const Value: Boolean); procedure SetCheckSpelling(const Value: Boolean); procedure SetCaretPosition(const Value: Integer); procedure SetCaret(const Value: TCaret); procedure SetTyping(const Value: Boolean); procedure SetText(const Value: string); procedure SetFilterChar(const Value: string); function GetText: string; protected ///<summary>Initial text filtering before calling <c>DoTruncating</c></summary> function DoFiltering(const Value: string): string; virtual; ///<summary>Maximum available text length filtering before calling <c>DoValidating</c></summary> function DoTruncating(const Value: string): string; virtual; ///<summary>Validate inputing text. Calling before OnChangeTracking</summary> function DoValidating(const Value: string): string; virtual; function DoValidate(const Value: string): string; virtual; procedure DoChangeTracking; virtual; procedure DoChange; virtual; procedure ResultTextSettingsChanged; virtual; /// <summary> /// This property indicates that the control is in validate value mode. See DoValidate, Change /// </summary> property Validating: Boolean read FValidating; public constructor Create; override; destructor Destroy; override; function HasSelection: Boolean; function SelectedText: string; procedure Change; ///<summary>Set text in model without text validation and sending notification to presenter</summary> procedure SetTextWithoutValidation(const Value: string); public property CaretPosition: Integer read FCaretPosition write SetCaretPosition; property Caret: TCaret read FCaret write SetCaret; property CheckSpelling: Boolean read FCheckSpelling write SetCheckSpelling; property FilterChar: string read FFilterChar write SetFilterChar; ///<summary>Text control is in read-only mode</summary> property ReadOnly: Boolean read FReadOnly write SetReadOnly; property ImeMode: TImeMode read FImeMode write SetImeMode; property InputSupport: Boolean read FInputSupport write FInputSupport; property KeyboardType : TVirtualkeyboardType read FKeyboardType write SetKeyboardType; property KillFocusByReturn: Boolean read FKillFocusByReturn write SetKillFocusByReturn; property MaxLength: Integer read FMaxLength write SetMaxLength; property Password: Boolean read FPassword write SetPassword; property ReturnKeyType: TReturnKeyType read FReturnKeyType write SetReturnKeyType; property SelStart: Integer read FSelStart write SetSelStart; property SelLength: Integer read FSelLength write SetSelLength; property Text: string read GetText write SetText; property TextSettingsInfo: UI.Base.TTextSettings read FTextSettingsInfo; property Typing: Boolean read FTyping write SetTyping; property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnChangeTracking: TNotifyEvent read FOnChangeTracking write FOnChangeTracking; property OnTyping: TNotifyEvent read FOnTyping write FOnTyping; property OnValidating: TValidateTextEvent read FOnValidating write FOnValidating; property OnValidate: TValidateTextEvent read FOnValidate write FOnValidate; end; type TCustomEditView = class(TEditViewBase, ITextInput, ICaret, ITextActions, IVirtualKeyboardControl {$IF CompilerVersion > 30.0}, IReadOnly{$ENDIF}) private FCursorFill: TBrush; FSelectionFill: TBrush; FModel: TEditDataModel; FTextHeight: Single; FLineHeight: Single; FLineTop: Single; {$IF (not Defined(ANDROID)) or (CompilerVersion < 33)} FCharsBuffer: string; {$ENDIF} FTextLayout: TTextLayout; FTextService: TTextService; FFirstVisibleChar: Integer; FInvisibleTextWidth: Single; FContentRect: TRectF; {$IFDEF ANDROID} FVKState: PByte; {$ENDIF} { Selection } FLeftSelPt: TSelectionPoint; FRightSelPt: TSelectionPoint; { Loupe } FLoupeService: ILoupeService; { Spelling } FSpellService: IFMXSpellCheckerService; FUpdateSpelling: Boolean; FSpellingRegions: TRegion; FSpellMenuItems: TList<TMenuItem>; FSpellHightlightRect: TRectF; FSpellFill: TBrush; FSpellUnderlineBrush: TStrokeBrush; FEditPopupMenu: TPopupMenu; FSelectionMode: TSelectionMode; FOnModelChange: TNotifyEvent; function GetCaretPosition: Integer; overload; function GetCaretPosition(const Value: Single): Integer; overload; function GetOriginCaretPosition: Integer; procedure SetCaretPosition(const Value: Integer); procedure SetSelectionMode(const Value: TSelectionMode); procedure UpdateSpelling; procedure InsertText(const AText: string); procedure DoTextChange(Sender: TObject); { Selections } procedure BeginSelection; procedure EndSelection; function HaveSelectionPickers: Boolean; procedure UpdateSelectionPointPositions; procedure DoSelPtMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure DoLeftSelPtChangePosition(Sender: TObject; var X, Y: Single); procedure DoLeftSelPtMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure DoRightSelPtChangePosition(Sender: TObject; var X, Y: Single); procedure DoRightSelPtMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); { Loupe } procedure HideLoupe; procedure ShowLoupe; procedure SetLoupePosition(const ASelectionPointType: TSelectionPointType); overload; procedure SetLoupePosition(const X, Y: Single); overload; procedure UpdateTextHeight; { ITextInput } function GetTextService: TTextService; procedure IMEStateUpdated; function GetTargetClausePointF: TPointF; procedure StartIMEInput; procedure EndIMEInput; function ITextInput.GetSelection = GetSelText; function ITextInput.GetSelectionRect = GetSelRect; function GetSelectionBounds: TRect; {$IF CompilerVersion >= 33} function GetSelectionPointSize: TSizeF; {$ENDIF} function HasText: Boolean; {$IFDEF ANDROID} procedure UpdateAndroidKeyboardServiceState; {$ENDIF} function GetMaxLength: Integer; function GetPassword: Boolean; function GetReadOnly: Boolean; procedure SetMaxLength(const Value: Integer); procedure SetPassword(const Value: Boolean); procedure SetReadOnly(const Value: Boolean); procedure SetImeMode(const Value: TImeMode); procedure SetKillFocusByReturn(const Value: Boolean); function GetFilterChar: string; function GetImeMode: TImeMode; function GetKillFocusByReturn: Boolean; procedure SetFilterChar(const Value: string); function GetInputSupport: Boolean; procedure SetInputSupport(const Value: Boolean); function GetSelLength: Integer; function GetSelStart: Integer; procedure SetSelLength(const Value: Integer); procedure SetSelStart(const Value: Integer); procedure SetCaret(const Value: TCaret); function GetCheckSpelling: Boolean; procedure SetCheckSpelling(const Value: Boolean); function GetOnChange: TNotifyEvent; function GetOnChangeTracking: TNotifyEvent; function GetOnTyping: TNotifyEvent; function GetOnValidate: TValidateTextEvent; function GetOnValidating: TValidateTextEvent; procedure SetOnChange(const Value: TNotifyEvent); procedure SetOnChangeTracking(const Value: TNotifyEvent); procedure SetOnTyping(const Value: TNotifyEvent); procedure SetOnValidate(const Value: TValidateTextEvent); procedure SetOnValidating(const Value: TValidateTextEvent); function GetSelfCaret: TCaret; procedure SetSelectionFill(const Value: TBrush); function GetLength: Integer; protected function GetText: string; override; procedure SetText(const Value: string); override; function ParentFrame: TFrame; { Messages From Model} procedure MMSelLengthChanged(var AMessage: TDispatchMessageWithValue<Integer>); message MM_EDIT_SELLENGTH_CHANGED; procedure MMSelStartChanged(var AMessage: TDispatchMessageWithValue<Integer>); message MM_EDIT_SELSTART_CHANGED; procedure MMCheckSpellingChanged(var AMessage: TDispatchMessageWithValue<Boolean>); message MM_EDIT_CHECKSPELLING_CHANGED; procedure MMPasswordChanged(var AMessage: TDispatchMessage); message MM_EDIT_ISPASSWORD_CHANGED; procedure MMImeModeChanged(var AMessage: TDispatchMessage); message MM_EDIT_IMEMODE_CHANGED; procedure MMTextSettingsChanged(var AMessage: TDispatchMessage); message MM_EDIT_TEXT_SETTINGS_CHANGED; procedure MMTextChanged(var AMessage: TDispatchMessageWithValue<string>); message MM_EDIT_TEXT_CHANGED; procedure MMTextChanging(var AMessage: TDispatchMessageWithValue<string>); message MM_EDIT_TEXT_CHANGING; procedure MMEditButtonsChanged(var Message: TDispatchMessage); message MM_EDIT_EDITBUTTONS_CHANGED; /// <summary>Notification about changing of <c>MaxLength</c> property value</summary> procedure MMMaxLengthChanged(var Message: TDispatchMessage); message MM_EDIT_MAXLENGTH_CHANGED; /// <summary>Notification about changing a <c>TextPrompt</c> property</summary> procedure MMPromptTextChanged(var Message: TDispatchMessage); message MM_EDIT_PROMPTTEXT_CHANGED; /// <summary>Notification about changing of <c>CaretPosition</c> property value</summary> procedure MMCaretPositionChanged(var Message: TDispatchMessageWithValue<Integer>); message MM_EDIT_CARETPOSITION_CHANGED; {$IF CompilerVersion >= 32} /// <summary>Notification about changing of <c>FilterChar</c> property value</summary> procedure MMFilterCharChanged(var Message: TDispatchMessage); message MM_EDIT_FILTERCHAR_CHANGED; {$ENDIF} {$IF CompilerVersion >= 34} procedure MMGetCaretPositionByPoint(var Message: TDispatchMessageWithValue<TCustomEditModel.TGetCaretPositionInfo>); message MM_EDIT_GET_CARET_POSITION_BY_POINT; {$ENDIF} { Messages from PresentationProxy } {$IF CompilerVersion >= 34} /// <summary>Notification about lost focus. It's sent directly before the loss of focus.</summary> procedure PMDoBeforeExit(var AMessage: TDispatchMessage); message PM_DO_BEFORE_EXIT; {$ENDIF} procedure PMInit(var Message: TDispatchMessage); message PM_INIT; procedure PMGetTextContentRect(var Message: TDispatchMessageWithValue<TRectF>); message PM_EDIT_GET_TEXT_CONTENT_RECT; { Base Mouse, Touches and Keyboard Events } procedure KeyDown(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState); override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; procedure MouseMove(Shift: TShiftState; X, Y: Single); override; procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override; procedure CMGesture(var EventInfo: TGestureEventInfo); override; procedure LongTap(const X, Y: Single); procedure DblTap; { ICaret } function ICaret.GetObject = GetCaret; procedure ShowCaret; procedure HideCaret; function GetCaret: TCustomCaret; {$IF CompilerVersion = 30} function ITextInput.ReadOnly = GetReadOnly; {$ENDIF} { Context menu } function CreatePopupMenu: TPopupMenu; virtual; function FindContextMenuItem(const AItemName: string): TMenuItem; function ShowContextMenu(const ScreenPosition: TPointF): Boolean; override; procedure UpdatePopupMenuItems; virtual; function GetEditPopupMenu: TPopupMenu; property EditPopupMenu: TPopupMenu read GetEditPopupMenu; { Standart Text Actions: Cut, Copy, Paste, Delete, Select All } procedure DoCopy(Sender: TObject); procedure DoCut(Sender: TObject); procedure DoDelete(Sender: TObject); procedure DoPaste(Sender: TObject); procedure DoSelectAll(Sender: TObject); { Spelling } procedure UpdateSpellPopupMenu(const APoint: TPointF); procedure SpellFixContextMenuHandler(Sender: TObject); procedure UpdateTextLayout; { IVirtualKeyboardControl } procedure SetKeyboardType(Value: TVirtualKeyboardType); function GetKeyboardType: TVirtualKeyboardType; procedure SetReturnKeyType(Value: TReturnKeyType); function GetReturnKeyType: TReturnKeyType; function IVirtualKeyboardControl.IsPassword = GetPassword; property InputSupport: Boolean read GetInputSupport write SetInputSupport; protected FLastKey: Word; FLastChar: System.WideChar; FClipboardSvc: IFMXClipboardService; procedure RepaintEdit; procedure SetTextInternal(const Value: string); virtual; function GetPasswordCharWidth: Single; function TextWidth(const AStart, ALength: Integer): Single; procedure UpdateFirstVisibleChar; procedure UpdateCaretPosition; function GetSelText: string; function GetSelRect: TRectF; function CheckGravity(const SrcX, EditRectWidth, WholeTextWidth: Single): Single; { Content alignment } procedure RealignContent; virtual; procedure UpdateLayoutSize; protected procedure Loaded; override; procedure Resize; override; procedure DoPaintText(var ARect: TRectF); override; procedure DoChangeTracking; virtual; procedure DoRealign; override; procedure DoTyping; virtual; procedure DoEnter; override; procedure DoExit; override; procedure DoInitStyle; virtual; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; function GetCharX(a: Integer): Single; procedure PlayClickEffect(); override; { ITextActions } procedure DeleteSelection; procedure CopyToClipboard; procedure CutToClipboard; procedure PasteFromClipboard; procedure SelectAll; procedure SelectWord; procedure ResetSelection; procedure GoToTextEnd; procedure GoToTextBegin; procedure Replace(const AStartPos: Integer; const ALength: Integer; const AStr: string); function HasSelection: Boolean; procedure HideInputMethod(); property Caret: TCaret read GetSelfCaret write SetCaret; property CaretPosition: Integer read GetCaretPosition write SetCaretPosition; property CheckSpelling: Boolean read GetCheckSpelling write SetCheckSpelling default False; property ContentRect: TRectF read FContentRect; property SelText: string read GetSelText; property SelStart: Integer read GetSelStart write SetSelStart; property SelLength: Integer read GetSelLength write SetSelLength; property SelectionFill: TBrush read FSelectionFill write SetSelectionFill; property TextHeight: Single read FTextHeight; property LineHeight: Single read FLineHeight; property LineTop: Single read FLineTop; property Length: Integer read GetLength; property SelectionMode: TSelectionMode read FSelectionMode write SetSelectionMode; property Model: TEditDataModel read FModel; property MaxLength: Integer read GetMaxLength write SetMaxLength default 0; property Password: Boolean read GetPassword write SetPassword default False; property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; property FilterChar: string read GetFilterChar write SetFilterChar; property ImeMode: TImeMode read GetImeMode write SetImeMode default TImeMode.imDontCare; property KeyboardType: TVirtualKeyboardType read GetKeyboardType write SetKeyboardType default TVirtualKeyboardType.Default; property KillFocusByReturn: Boolean read GetKillFocusByReturn write SetKillFocusByReturn default False; property ReturnKeyType: TReturnKeyType read GetReturnKeyType write SetReturnKeyType default TReturnKeyType.Default; property OnChange: TNotifyEvent read GetOnChange write SetOnChange; property OnChangeTracking: TNotifyEvent read GetOnChangeTracking write SetOnChangeTracking; property OnTyping: TNotifyEvent read GetOnTyping write SetOnTyping; property OnValidating: TValidateTextEvent read GetOnValidating write SetOnValidating; property OnValidate: TValidateTextEvent read GetOnValidate write SetOnValidate; published property Align; property Anchors; property TabOrder; property TabStop; end; type [ComponentPlatformsAttribute(AllCurrentPlatforms)] TEditView = class(TCustomEditView) private public constructor Create(AOwner: TComponent); override; destructor Destroy; override; property Action; published property Cursor default crIBeam; property CanFocus default True; property CanParentFocus; property DragMode default TDragMode.dmManual; property HitTest default True; property Clickable default True; property Text; property TextHint; property TextSettings; property Drawable; property OnTextChange; property OnDrawBackgroud; property Gravity default TLayoutGravity.CenterVertical; { inherited } property DisableFocusEffect; property KeyboardType; property ReturnKeyType; property Password; property ReadOnly; property MaxLength; property FilterChar; property ImeMode; property Position; property Width; property Height; property ClipChildren default False; property ClipParent default False; property EnableDragHighlight default True; property Enabled default True; property Locked default False; property Padding; property Opacity; property Margins; property PopupMenu; property RotationAngle; property RotationCenter; property Scale; property Size; property TouchTargetExpansion; property Visible default True; property Caret; property KillFocusByReturn; property CheckSpelling; property ParentShowHint; property ShowHint; property SelectionFill; { events } property OnChange; property OnChangeTracking; property OnTyping; property OnApplyStyleLookup; property OnValidating; property OnValidate; property OnDragEnter; property OnDragLeave; property OnDragOver; property OnDragDrop; property OnDragEnd; property OnKeyDown; property OnKeyUp; property OnCanFocus; property OnClick; property OnDblClick; property OnEnter; property OnExit; property OnMouseDown; property OnMouseMove; property OnMouseUp; property OnMouseWheel; property OnMouseEnter; property OnMouseLeave; property OnPainting; property OnPaint; property OnResize; end; implementation const LOUPE_OFFSET = 10; IMEWindowGap = 2; // 2 is small space between conrol and IME window CutStyleName = 'cut'; //Do not localize CopyStyleName = 'copy'; //Do not localize PasteStyleName = 'paste'; //Do not localize DeleteStyleName = 'delete'; //Do not localize SelectAllStyleName = 'selectall'; //Do not localize CaretColorStyleResouceName = 'caretcolor'; LeftSelectionPointStyleResourceName = 'leftselectionpoint'; RightSelectionPointStyleResourceName = 'rightselectionpoint'; function LinkObserversValueModified(const AObservers: TObservers): Boolean; begin Result := True; if AObservers.IsObserving(TObserverMapping.EditLinkID) then begin Result := TLinkObservers.EditLinkEdit(AObservers); if Result then TLinkObservers.EditLinkModified(AObservers); end; if Result and AObservers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueModified(AObservers); end; {$IF Defined(ANDROID) and (CompilerVersion <= 32)} function PackText(const AText: string): string; begin if not AText.IsEmpty then Result := Format('[%d]%s', [AText.Length, AText]) else Result := string.Empty; end; {$ENDIF} { TEditViewBase } procedure TEditViewBase.AfterConstruction; begin inherited AfterConstruction; FText.OnChanged := DoChanged; FText.OnTextChanged := FOnTextChange; FIsChanging := False; end; function TEditViewBase.CanRePaintBk(const View: IView; State: TViewState): Boolean; var Border: TViewBorder; begin if Assigned(FOnDrawViewBackgroud) then Result := True else begin Result := inherited CanRePaintBk(View, State); if (not Result) and (Assigned(FBackground)) then begin Border := TDrawableBorder(FBackground).Border; Result := Assigned(Border) and (Border.Style <> TViewBorderStyle.None) and (Border.Width > 0) and (Border.Color.GetColor(State) <> TAlphaColorRec.Null); end; end; end; procedure TEditViewBase.Change; begin if not FIsChanging and ([csLoading, csDestroying] * ComponentState = []){$IF CompilerVersion < 32} and not Released{$ENDIF} then begin FIsChanging := True; try DoChanged(FText); finally FIsChanging := False; end; end; end; constructor TEditViewBase.Create(AOwner: TComponent); var SaveChange: TNotifyEvent; begin inherited Create(AOwner); FIsChanging := True; FText := UI.Base.TTextSettings.Create(Self); if csDesigning in ComponentState then begin FDrawable := TDrawableIcon.Create(Self); FDrawable.SizeWidth := 16; FDrawable.SizeHeight := 16; FDrawable.OnChanged := DoDrawableChanged; if Assigned(Padding) then begin SaveChange := Padding.OnChange; Padding.OnChange := nil; Padding.Rect := RectF(6, 2, 6, 2); Padding.OnChange := SaveChange; end; end; SetAcceptsControls(False); end; function TEditViewBase.CreateBackground: TDrawable; begin Result := TEditDrawableBorder.Create(Self, TViewBrushKind.Solid, $FFFFFFFF); with TDrawableBorder(Result).Border do begin Width := 1; DefaultStyle := TViewBorderStyle.RectBorder; Style := DefaultStyle; Color.Default := $BFC0C0C0; Color.Focused := $FF0066cc; Color.Hovered := $FFC0C0C0; end; Result.OnChanged := DoBackgroundChanged; end; destructor TEditViewBase.Destroy; begin FreeAndNil(FText); FreeAndNil(FDrawable); inherited Destroy; end; procedure TEditViewBase.DoChanged(Sender: TObject); begin FGravity := FText.Gravity; if FText.IsSizeChange then begin RecalcSize; end else Repaint; if FText.IsEffectsChange then UpdateEffects; end; procedure TEditViewBase.DoDrawableChanged(Sender: TObject); begin DoChanged(Sender); end; procedure TEditViewBase.DoLayoutChanged(Sender: TObject); begin inherited DoLayoutChanged(Sender); end; procedure TEditViewBase.DoPaintBackground(var R: TRectF); begin R := RectF(R.Left + Padding.Left, R.Top + Padding.Top, R.Right - Padding.Right, R.Bottom - Padding.Bottom); if Assigned(FDrawable) and (not FDrawable.IsEmpty) then FDrawable.AdjustDraw(Canvas, R, True, DrawState); if (Assigned(FText)) then DoPaintText(R); end; procedure TEditViewBase.DoPaintText(var R: TRectF); begin if FText.Text = '' then FText.Draw(Canvas, FTextHint, R, GetAbsoluteOpacity, TViewState(8)) else FText.Draw(Canvas, R, GetAbsoluteOpacity, DrawState); end; function TEditViewBase.GetData: TValue; begin Result := Text; end; function TEditViewBase.GetDefaultSize: TSizeF; var MetricsService: IFMXDefaultMetricsService; begin if (TBehaviorServices.Current.SupportsBehaviorService(IFMXDefaultMetricsService, MetricsService, Self) or SupportsPlatformService(IFMXDefaultMetricsService, MetricsService)) and MetricsService.SupportsDefaultSize(TComponentKind.Edit) then Result := TSizeF.Create(MetricsService.GetDefaultSize(TComponentKind.Edit)) else Result := TSizeF.Create(100, 22); end; function TEditViewBase.GetDrawable: TDrawableIcon; begin if not Assigned(FDrawable) then begin FDrawable := TDrawableIcon.Create(Self); FDrawable.SizeWidth := 16; FDrawable.SizeHeight := 16; FDrawable.OnChanged := DoDrawableChanged; end; Result := FDrawable; end; function TEditViewBase.GetText: string; begin Result := FText.Text; end; procedure TEditViewBase.ImagesChanged; begin if Assigned(FDrawable) then FDrawable.Change; inherited ImagesChanged; end; procedure TEditViewBase.Loaded; begin inherited Loaded; FText.OnChanged := DoChanged; Change; end; procedure TEditViewBase.PaintBackground; var R: TRectF; begin if AbsoluteInVisible then Exit; R := RectF(0, 0, Width, Height); if Assigned(FOnDrawViewBackgroud) then FOnDrawViewBackgroud(Self, Canvas, R, DrawState) else inherited PaintBackground; DoPaintBackground(R); end; procedure TEditViewBase.SetData(const Value: TValue); begin if Value.IsEmpty then Text := string.Empty else if Value.IsType<TNotifyEvent> then FOnTextChange := Value.AsType<TNotifyEvent>() else Text := Value.ToString; end; procedure TEditViewBase.SetDrawable(const Value: TDrawableIcon); begin Drawable.Assign(Value); end; procedure TEditViewBase.SetGravity(const Value: TLayoutGravity); begin FGravity := Value; FText.Gravity := Value; end; procedure TEditViewBase.SetName(const Value: TComponentName); var ChangeText: Boolean; begin ChangeText := not (csLoading in ComponentState) and (Name = Text) and ((Owner = nil) or not (csLoading in TComponent(Owner).ComponentState)); inherited SetName(Value); if ChangeText then Text := Value; end; procedure TEditViewBase.SetText(const Value: string); begin FText.Text := Value; end; procedure TEditViewBase.SetTextHint(const Value: string); begin if FTextHint <> Value then begin FTextHint := Value; if FText.Text = '' then DoChanged(FText); end; end; procedure TEditViewBase.SetTextSettings(const Value: UI.Base.TTextSettings); begin FText := Value; end; function TEditViewBase.TextStored: Boolean; begin Result := (not Text.IsEmpty and not ActionClient) or (not (ActionClient and (ActionLink <> nil) and ActionLink.CaptionLinked and (Action is TContainedAction))); end; function TEditViewBase.ToString: string; begin Result := Format('%s ''%s''', [inherited ToString, FText]); end; { TEditDataModel } procedure TEditDataModel.Change; begin if FChanged then begin if not FValidating then begin FValidating := True; try Text := DoValidate(Text); finally FValidating := False; end; end; FChanged := False; try DoChange; finally end; end; end; constructor TEditDataModel.Create; begin inherited Create; FInputSupport := DefaultInputSupport; FCaret := TCaret.Create(Owner as TFmxObject); FCaret.Visible := InputSupport; FCaret.Color := TAlphaColorRec.Null; FCaret.ReadOnly := ReadOnly; end; destructor TEditDataModel.Destroy; begin FreeAndNil(FCaret); inherited; end; procedure TEditDataModel.DoChange; begin if (Owner <> nil) and Assigned(FOnChange) and not (csLoading in Owner.ComponentState) then FOnChange(Owner); end; procedure TEditDataModel.DoChangeTracking; begin FChanged := True; SendMessage(MM_EDIT_TEXT_CHANGING); if Assigned(FOnChangeTracking) and not (csLoading in Owner.ComponentState) then FOnChangeTracking(Owner); end; function TEditDataModel.DoFiltering(const Value: string): string; begin Result := FilterText(Value, FilterChar); end; function TEditDataModel.DoTruncating(const Value: string): string; begin Result := TruncateText(Value, MaxLength); end; function TEditDataModel.DoValidate(const Value: string): string; begin Result := DoTruncating(DoFiltering(Value)); if (Owner <> nil) and (Owner is TCustomEditView) and Assigned(FOnValidate) and not (csLoading in Owner.ComponentState) then FOnValidate(Owner, Result); end; function TEditDataModel.DoValidating(const Value: string): string; begin Result := Value; if (Owner <> nil) and (Owner is TCustomEditView) and Assigned(FOnValidating) and not (csLoading in Owner.ComponentState) then FOnValidating(Owner, Result); end; function TEditDataModel.GetText: string; begin Result := FTextSettingsInfo.Text; end; function TEditDataModel.HasSelection: Boolean; begin Result := Abs(SelLength) > 0; end; function TEditDataModel.SelectedText: string; begin if SelLength < 0 then Result := Text.Substring(SelStart - Abs(SelLength), Abs(SelLength)) else if SelLength > 0 then Result := Text.Substring(SelStart, SelLength) else Result := string.Empty; end; procedure TEditDataModel.SetCaret(const Value: TCaret); begin FCaret.Assign(Value); SendMessage(MM_EDIT_CARETCHANGED); end; procedure TEditDataModel.SetCaretPosition(const Value: Integer); begin FCaretPosition := EnsureRange(Value, 0, FTextSettingsInfo.Text.Length); SendMessage<Integer>(MM_EDIT_CARETPOSITION_CHANGED, Value); end; procedure TEditDataModel.SetCheckSpelling(const Value: Boolean); begin if FCheckSpelling <> Value then begin FCheckSpelling := Value; SendMessage<Boolean>(MM_EDIT_CHECKSPELLING_CHANGED, Value); end; end; procedure TEditDataModel.SetFilterChar(const Value: string); var OldText: string; begin if FFilterChar <> Value then begin FFilterChar := Value; {$IF CompilerVersion >= 32} SendMessage<string>(MM_EDIT_FILTERCHAR_CHANGED, Value); {$ENDIF} OldText := FTextSettingsInfo.Text; FTextSettingsInfo.Text := DoValidating(DoTruncating(DoFiltering(FTextSettingsInfo.Text))); if FTextSettingsInfo.Text <> OldText then begin DoChangeTracking; SendMessage<string>(MM_EDIT_TEXT_CHANGED, FTextSettingsInfo.Text); Change; end; end; end; procedure TEditDataModel.SetImeMode(const Value: TImeMode); begin if FImeMode <> Value then begin FImeMode := Value; SendMessage<TImeMode>(MM_EDIT_IMEMODE_CHANGED, Value); end; end; procedure TEditDataModel.SetKeyboardType(const Value: TVirtualKeyboardType); begin if FKeyboardType <> Value then begin FKeyboardType := Value; SendMessage<TVirtualKeyboardType>(MM_EDIT_KEYBOARDTYPE_CHANGED, Value); end; end; procedure TEditDataModel.SetKillFocusByReturn(const Value: Boolean); begin if FKillFocusByReturn <> Value then begin FKillFocusByReturn := Value; SendMessage<Boolean>(MM_EDIT_KILLFOCUSBYRETURN_CHANGED, Value); end; end; procedure TEditDataModel.SetMaxLength(const Value: Integer); begin if MaxLength <> Value then begin FMaxLength := Max(0, Value); Text := DoTruncating(Text); Change; SendMessage<Integer>(MM_EDIT_MAXLENGTH_CHANGED, Value); end; end; procedure TEditDataModel.SetPassword(const Value: Boolean); begin if FPassword <> Value then begin FPassword := Value; SendMessage<Boolean>(MM_EDIT_ISPASSWORD_CHANGED, Value); end; end; procedure TEditDataModel.SetReadOnly(const Value: Boolean); begin if FReadOnly <> Value then begin FReadOnly := Value; FCaret.ReadOnly := Value; SendMessage<Boolean>(MM_EDIT_READONLY_CHANGED, Value); end; end; procedure TEditDataModel.SetReturnKeyType(const Value: TReturnKeyType); begin if FReturnKeyType <> Value then begin FReturnKeyType := Value; SendMessage<TReturnKeyType>(MM_EDIT_RETURNKEYTYPE_CHANGED, Value); end; end; procedure TEditDataModel.SetSelLength(const Value: Integer); begin if FSelLength <> Value then begin FSelLength := Value; SendMessage<Integer>(MM_EDIT_SELLENGTH_CHANGED, Value); end; end; procedure TEditDataModel.SetSelStart(const Value: Integer); begin if FSelStart <> Value then begin FSelStart := EnsureRange(Value, 0, Text.Length); SendMessage<Integer>(MM_EDIT_SELSTART_CHANGED, Value); end; end; procedure TEditDataModel.SetText(const Value: string); var OldText: string; begin if Text <> Value then begin OldText := FTextSettingsInfo.Text; FTextSettingsInfo.Text := DoValidating(DoTruncating(DoFiltering(Value))); if FTextSettingsInfo.Text <> OldText then begin DoChangeTracking; SendMessage<string>(MM_EDIT_TEXT_CHANGED, FTextSettingsInfo.Text); Change; end; end; end; procedure TEditDataModel.SetTextWithoutValidation(const Value: string); begin if Text <> Value then begin FTextSettingsInfo.Text := Value; DoChangeTracking; end; end; procedure TEditDataModel.SetTyping(const Value: Boolean); begin if FTyping <> Value then begin FTyping := Value; SendMessage(MM_EDIT_TYPING_CHANGED); end; end; procedure TEditDataModel.ResultTextSettingsChanged; begin SendMessage(MM_EDIT_TEXT_SETTINGS_CHANGED); end; { TCustomEditView } procedure TCustomEditView.BeginSelection; begin SelectionMode := TSelectionMode.TextSelection; FTextService.BeginSelection; end; function TCustomEditView.CheckGravity(const SrcX, EditRectWidth, WholeTextWidth: Single): Single; begin case FGravity of // 中间 TLayoutGravity.CenterHorizontal, TLayoutGravity.Center, TLayoutGravity.CenterHBottom: Result := SrcX + ((EditRectWidth - WholeTextWidth) / 2); // 右边 TLayoutGravity.RightTop, TLayoutGravity.RightBottom, TLayoutGravity.CenterVRight: Result := SrcX + (EditRectWidth - WholeTextWidth); else Result := SrcX; end; end; procedure TCustomEditView.CMGesture(var EventInfo: TGestureEventInfo); var LocalPoint: TPointF; begin if EventInfo.GestureID = igiLongTap then begin LocalPoint := AbsoluteToLocal(EventInfo.Location); LongTap(LocalPoint.X, LocalPoint.Y); end else if EventInfo.GestureID = igiDoubleTap then DblTap else inherited; end; procedure TCustomEditView.CopyToClipboard; begin if (FClipboardSvc = nil) or Password then Exit; if InputSupport and not SelText.IsEmpty then FClipboardSvc.SetClipboard(SelText); if not InputSupport and not Text.IsEmpty then FClipboardSvc.SetClipboard(Text); end; constructor TCustomEditView.Create(AOwner: TComponent); var PlatformTextService: IFMXTextService; begin inherited Create(AOwner); EnableExecuteAction := False; FModel := TEditDataModel.Create(Self); FModel.FTextSettingsInfo := FText; FModel.OnChange := DoTextChange; FContentRect.Left := 0; FContentRect.Top := 0; FContentRect.Right := 0; FContentRect.Bottom := 0; FTextLayout := TTextLayoutManager.DefaultTextLayout.Create; if not TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService, IInterface(FClipboardSvc)) then FClipboardSvc := nil; if TPlatformServices.Current.SupportsPlatformService(IFMXTextService, IInterface(PlatformTextService)) then FTextService := PlatformTextService.GetTextServiceClass.Create(Self, False); TPlatformServices.Current.SupportsPlatformService(ILoupeService, IInterface(FLoupeService)); FCursorFill := TBrush.Create(TBrushKind.Solid, TAlphaColorRec.Black); FSelectionFill := TBrush.Create(TBrushKind.Solid, $7F3399FF); AutoCapture := True; FFirstVisibleChar := 1; FInvisibleTextWidth := 0; SetAcceptsControls(False); Touch.InteractiveGestures := Touch.InteractiveGestures + [TInteractiveGesture.DoubleTap, TInteractiveGesture.LongTap]; FSpellMenuItems := TList<TMenuItem>.Create; FSpellFill := TBrush.Create(TBrushKind.Solid, TAlphaColorRec.Red); FSpellUnderlineBrush := TStrokeBrush.Create(TBrushKind.Solid, TAlphaColorRec.Red); FSpellUnderlineBrush.Dash := TStrokeDash.Dot; FSpellUnderlineBrush.Thickness := 1; FModel.Receiver := Self; end; function TCustomEditView.CreatePopupMenu: TPopupMenu; var TmpItem: TMenuItem; begin Result := TPopupMenu.Create(Self); Result.Stored := False; TmpItem := TMenuItem.Create(Result); TmpItem.Parent := Result; TmpItem.Text := SEditCut; TmpItem.StyleName := CutStyleName; TmpItem.OnClick := DoCut; TmpItem := TMenuItem.Create(Result); TmpItem.Parent := Result; TmpItem.Text := SEditCopy; TmpItem.StyleName := CopyStyleName; TmpItem.OnClick := DoCopy; TmpItem := TMenuItem.Create(Result); TmpItem.Parent := Result; TmpItem.Text := SEditPaste; TmpItem.StyleName := PasteStyleName; TmpItem.OnClick := DoPaste; TmpItem := TMenuItem.Create(Result); TmpItem.Parent := Result; TmpItem.Text := SEditDelete; TmpItem.StyleName := DeleteStyleName; TmpItem.OnClick := DoDelete; TmpItem := TMenuItem.Create(Result); TmpItem.Parent := Result; TmpItem.Text := SMenuSeparator; TmpItem := TMenuItem.Create(Result); TmpItem.Parent := Result; TmpItem.Text := SEditSelectAll; TmpItem.StyleName := SelectAllStyleName; TmpItem.OnClick := DoSelectAll; end; procedure TCustomEditView.CutToClipboard; begin if Observers.IsObserving(TObserverMapping.EditLinkID) then if not TLinkObservers.EditLinkEdit(Observers) then begin TLinkObservers.EditLinkReset(Observers); Exit; end else TLinkObservers.EditLinkModified(Observers); if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueModified(Observers); CopyToClipboard; DeleteSelection; end; procedure TCustomEditView.DblTap; begin SelectWord; end; procedure TCustomEditView.DeleteSelection; begin if ReadOnly or not InputSupport or (SelLength = 0) then Exit; Model.Text := Text.Remove(SelStart, SelLength); CaretPosition := SelStart; SelLength := 0; end; destructor TCustomEditView.Destroy; begin FModel.Receiver := nil; FModel.Free; FLoupeService := nil; FreeAndNil(FCursorFill); FreeAndNil(FSelectionFill); FreeAndNil(FEditPopupMenu); FreeAndNil(FTextService); FClipboardSvc := nil; FSpellService := nil; Finalize(FSpellingRegions); FreeAndNil(FSpellMenuItems); FreeAndNil(FSpellFill); FreeAndNil(FSpellUnderlineBrush); FreeAndNil(FTextLayout); inherited Destroy; end; procedure TCustomEditView.DoChangeTracking; begin UpdateSpelling; end; procedure TCustomEditView.DoCopy(Sender: TObject); begin CopyToClipboard; end; procedure TCustomEditView.DoCut(Sender: TObject); begin CutToClipboard; end; procedure TCustomEditView.DoDelete(Sender: TObject); begin if Observers.IsObserving(TObserverMapping.EditLinkID) then if not TLinkObservers.EditLinkEdit(Observers) then begin TLinkObservers.EditLinkReset(Observers); Exit; end else TLinkObservers.EditLinkModified(Observers); if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueModified(Observers); DeleteSelection; end; procedure TCustomEditView.DoEnter; var Form: TCommonCustomForm; begin inherited DoEnter; Form := TCommonCustomForm(Root); if not Model.ReadOnly and Model.InputSupport and not FTextService.HasMarkedText and ((Form = nil) or (Form.FormState - [TFmxFormState.Showing, TFmxFormState.Engaged, TFmxFormState.Modal] = [])) then SelectAll else begin UpdateSelectionPointPositions; UpdateCaretPosition; end; end; procedure TCustomEditView.DoExit; begin {$IF CompilerVersion < 34} if FScene <> nil then begin Model.Change; if Observers.IsObserving(TObserverMapping.EditLinkID) then TLinkObservers.EditLinkUpdate(Observers); if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueUpdate(Observers); inherited DoExit; UpdateSelectionPointPositions; {$IFDEF ANDROID} UpdateAndroidKeyboardServiceState; Self.FocusToNext; {$ENDIF} end else {$ENDIF} inherited DoExit; end; procedure TCustomEditView.DoInitStyle; var ColorObject: TColorObject; begin RealignContent; { Caret color} if FindStyleResource<TColorObject>(CaretColorStyleResouceName, ColorObject) then Model.Caret.DefaultColor := ColorObject.Color else Model.Caret.DefaultColor := TAlphaColorRec.Null; if not (csDesigning in ComponentState) then begin {$IFDEF MSWINDOWS} Model.Caret.Color := TAlphaColorRec.Black; {$ELSE} {$IFDEF IOS} Model.Caret.Color := $ff0066cc; {$ELSE} Model.Caret.Color := TAlphaColorRec.Black; {$ENDIF} {$ENDIF} end; { Selection points } if FindStyleResource<TSelectionPoint>(LeftSelectionPointStyleResourceName, FLeftSelPt) then begin FLeftSelPt.OnTrack := DoLeftSelPtChangePosition; FLeftSelPt.OnMouseDown := DoLeftSelPtMouseDown; FLeftSelPt.OnMouseUp := DoSelPtMouseUp; FLeftSelPt.Visible := False; end; if FindStyleResource<TSelectionPoint>(RightSelectionPointStyleResourceName, FRightSelPt) then begin FRightSelPt.OnTrack := DoRightSelPtChangePosition; FRightSelPt.OnMouseDown := DoRightSelPtMouseDown; FRightSelPt.OnMouseUp := DoSelPtMouseUp; FRightSelPt.Visible := False; end; TextSettings.Change; UpdateTextLayout; end; procedure TCustomEditView.DoLeftSelPtChangePosition(Sender: TObject; var X, Y: Single); var CurrentPoint: TPointF; NewSelStart: Integer; OldSelStart: Integer; OldSelLength: Integer; NewSelLength: Integer; OldSelEnd: Integer; begin if FLeftSelPt = nil then Exit; CurrentPoint := FLeftSelPt.Position.Point; OldSelStart := Model.SelStart; OldSelLength := Model.SelLength; OldSelEnd := Model.SelStart + Model.SelLength; NewSelStart := GetCaretPosition(X); NewSelLength := OldSelLength + OldSelStart - NewSelStart; Model.DisableNotify; try if NewSelStart < OldSelEnd - 1 then begin X := GetCharX(NewSelStart); Model.SelStart := NewSelStart; Model.SelLength := NewSelLength; end else begin X := GetCharX(OldSelEnd - 1); Model.SelStart := OldSelEnd - 1; Model.SelLength := 1; end; finally Model.EnableNotify; end; Y := CurrentPoint.Y; SetLoupePosition(TSelectionPointType.Left); UpdateSelectionPointPositions; end; procedure TCustomEditView.DoLeftSelPtMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin BeginSelection; SetLoupePosition(TSelectionPointType.Left); ShowLoupe; end; procedure TCustomEditView.DoPaintText(var ARect: TRectF); var i: Integer; State: TCanvasSaveState; WholeTextWidth: Single; EditRectWidth: Single; T: string; procedure DrawSelection; var SelectionRect: TRectF; begin SelectionRect := GetSelRect; Canvas.FillRect(SelectionRect, 0, 0, AllCorners, AbsoluteOpacity, FSelectionFill); end; procedure DrawLeftAndRightSelectionSide; var SelectionRect: TRectF; HalfCaretWidth: Single; SideRect: TRectF; begin SelectionRect := GetSelRect; HalfCaretWidth := Model.Caret.Flasher.Size.Width / 2; FCursorFill.Color := Model.Caret.Flasher.Color; // Draw Left selection side SideRect := RectF(SelectionRect.Left - HalfCaretWidth, SelectionRect.Top, SelectionRect.Left + HalfCaretWidth, SelectionRect.Bottom); Canvas.FillRect(SideRect, 0, 0, AllCorners, AbsoluteOpacity, FCursorFill); // Draw Right selection side SideRect := RectF(SelectionRect.Right - HalfCaretWidth, SelectionRect.Top, SelectionRect.Right + HalfCaretWidth, SelectionRect.Bottom); Canvas.FillRect(SideRect, 0, 0, AllCorners, AbsoluteOpacity, FCursorFill); end; var Shift, BP, EP, J: Integer; Rgn: TRegion; LText: string; VisibleCharPos: Single; R: TRectF; begin if Text = '' then begin FText.Draw(Canvas, FTextHint, ARect, GetAbsoluteOpacity, TViewState(8)); Exit; end; if ((FTextService = nil)) or (FTextService.Text.IsEmpty and (not FTextService.HasMarkedText)) then Exit; State := Canvas.SaveState; try { Draw selection } if IsFocused and Model.HasSelection then begin DrawSelection; { left picker -> | selected text | <- right picker } if HaveSelectionPickers then DrawLeftAndRightSelectionSide; end; { draw text } Canvas.IntersectClipRect(ARect); Canvas.Fill.Color := FText.Color.GetStateColor(DrawState); R := ARect; if Model.Password then begin R.Right := R.Left + GetPasswordCharWidth - 1; R.Top := LineTop - ContentRect.Top + ((LineHeight - R.Width) / 2); R.Bottom := R.Top + RectWidth(R); T := FTextService.CombinedText; WholeTextWidth := T.Length * GetPasswordCharWidth; EditRectWidth := ContentRect.Width; if WholeTextWidth < EditRectWidth then case FText.HorzAlign of TTextAlign.Trailing: OffsetRect(R, (EditRectWidth - WholeTextWidth), 0); TTextAlign.Center: OffsetRect(R, ((EditRectWidth - WholeTextWidth) / 2), 0); end; for i := FFirstVisibleChar to T.Length do begin Canvas.FillEllipse(R, AbsoluteOpacity, Canvas.Fill); OffsetRect(R, R.Width + 1, 0); end; end else begin FTextService.DrawSingleLine(Canvas, R, FFirstVisibleChar, FText.Font, AbsoluteOpacity, FillTextFlags, FText.HorzAlign, FText.VertAlign); end; //Spell highlighting if Model.CheckSpelling and (FSpellService <> nil) and not FTextService.HasMarkedText and not Text.IsEmpty then begin if FUpdateSpelling then begin LText := Text; Shift := 0; while (LText.Length > 0) and FMX.Text.FindWordBound(LText, 0, BP, EP) do begin if System.Length(FSpellService.CheckSpelling(LText.Substring(BP, EP - BP + 1))) > 0 then begin Rgn := FTextLayout.RegionForRange(TTextRange.Create(Shift + BP, EP - BP + 1)); for J := Low(Rgn) to High(Rgn) do begin SetLength(FSpellingRegions, System.Length(FSpellingRegions) + 1); FSpellingRegions[High(FSpellingRegions)] := Rgn[J]; R := ContentRect; FSpellingRegions[High(FSpellingRegions)].Offset(-R.Left, -R.Top); end; end; LText := LText.Remove(0, EP + 1); Inc(Shift, EP + 1); end; FUpdateSpelling := False; end; if System.Length(FSpellingRegions) > 0 then begin if FFirstVisibleChar > 1 then begin Rgn := FTextLayout.RegionForRange(TTextRange.Create(FFirstVisibleChar - 1, 1)); if System.Length(Rgn) > 0 then VisibleCharPos := Rgn[0].Left else VisibleCharPos := 0; end else VisibleCharPos := 0; for I := Low(FSpellingRegions) to High(FSpellingRegions) do Canvas.DrawLine(TPointF.Create(FSpellingRegions[I].Left - VisibleCharPos, FSpellingRegions[I].Bottom), TPointF.Create(FSpellingRegions[I].Right - VisibleCharPos, FSpellingRegions[I].Bottom), AbsoluteOpacity, FSpellUnderlineBrush); end; if not FSpellHightlightRect.IsEmpty then Canvas.FillRect(FSpellHightlightRect, 0, 0, [], 0.2, FSpellFill); end; finally Canvas.RestoreState(State); end; end; procedure TCustomEditView.DoPaste(Sender: TObject); begin PasteFromClipboard; end; procedure TCustomEditView.DoRealign; begin inherited DoRealign; RealignContent; CaretPosition := GetOriginCaretPosition; end; procedure TCustomEditView.DoRightSelPtChangePosition(Sender: TObject; var X, Y: Single); var CurrentPoint: TPointF; NewSelEnd: Integer; OldSelStart: Integer; OldSelLength: Integer; NewSelLength: Integer; OldSelEnd: Integer; MinSelEnd: Integer; begin if FRightSelPt = nil then Exit; CurrentPoint := FRightSelPt.Position.Point; Y := CurrentPoint.Y; OldSelStart := Model.SelStart; OldSelLength := Model.SelLength; OldSelEnd := Model.SelStart + Model.SelLength; MinSelEnd := Model.SelStart + 1; NewSelEnd := GetCaretPosition(X); NewSelLength := OldSelLength + NewSelEnd - OldSelEnd; Model.DisableNotify; try if NewSelEnd > MinSelEnd then begin X := GetCharX(NewSelEnd); Model.SelStart := NewSelEnd - NewSelLength; Model.SelLength := NewSelLength; end else begin X := GetCharX(MinSelEnd); Model.SelStart := OldSelStart; Model.SelLength := 1; end; finally Model.EnableNotify; end; SetLoupePosition(TSelectionPointType.Right); UpdateSelectionPointPositions; end; procedure TCustomEditView.DoRightSelPtMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin BeginSelection; SetLoupePosition(TSelectionPointType.Right); ShowLoupe; end; procedure TCustomEditView.DoSelectAll(Sender: TObject); begin SelectAll; end; procedure TCustomEditView.DoSelPtMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin EndSelection; end; procedure TCustomEditView.DoTextChange(Sender: TObject); begin {$IFDEF ANDROID} if (MaxLength > 0) and (System.Length(Text) > MaxLength) then Text := Text.SubString(0, MaxLength); {$ENDIF} if Assigned(FOnModelChange) then FOnModelChange(Sender); end; procedure TCustomEditView.DoTyping; begin if Assigned(Model.OnTyping) then Model.OnTyping(Self); end; procedure TCustomEditView.EndIMEInput; {$IFDEF ANDROID} var LText: string; {$ENDIF} begin // Windows TextService controls CaretPosition and Text itself. // We have to update Text and CaretPosition only, if Edit initiate it. {$IFNDEF MSWINDOWS} Model.DisableNotify; try {$IFDEF ANDROID} LText := FTextService.CombinedText; if (Model.MaxLength > 0) and (System.Length(LText) > Model.MaxLength) then LText := LText.Substring(0, Model.MaxLength); Model.Text := LText; {$ELSE} Model.Text := FTextService.CombinedText; {$ENDIF} finally Model.EnableNotify; end; FTextService.Text := Model.Text; // FTextService.CombinedText; FTextService.CaretPosition := Point(GetOriginCaretPosition + FTextService.CombinedText.Length - FTextService.Text.Length, 0); {$ENDIF} RepaintEdit; end; procedure TCustomEditView.EndSelection; begin HideLoupe; SelectionMode := TSelectionMode.None; FTextService.EndSelection; end; function TCustomEditView.FindContextMenuItem( const AItemName: string): TMenuItem; var MenuObject: TFmxObject; begin Result := nil; if FEditPopupMenu <> nil then begin MenuObject := FEditPopupMenu.FindStyleResource(AItemName); if MenuObject is TMenuItem then Result := TMenuItem(MenuObject); end; end; function TCustomEditView.GetCaret: TCustomCaret; begin Result := Model.Caret; end; function TCustomEditView.GetCaretPosition: Integer; begin if FTextService <> nil then Result := FTextService.TargetClausePosition.X else Result := -1; end; function TCustomEditView.GetCharX(a: Integer): Single; var WholeTextWidth: Single; EditRectWidth: Single; Rgn: TRegion; T: string; begin if Model.Password then begin T := FTextService.CombinedText; EditRectWidth := GetPasswordCharWidth; WholeTextWidth := T.Length * EditRectWidth + Padding.Left; Result := ContentRect.Left; if a > 0 then begin if a <= T.Length then Result := Result + (a - FFirstVisibleChar + 1) * EditRectWidth else Result := Result + (T.Length - FFirstVisibleChar + 1) * EditRectWidth; end; EditRectWidth := ViewRect.Width; if WholeTextWidth < EditRectWidth then Result := CheckGravity(Result, EditRectWidth, WholeTextWidth); end else begin Rgn := FTextLayout.RegionForRange(TTextRange.Create(0, 1)); if System.Length(Rgn) > 0 then Result := Rgn[0].Left else Result := 0; if (FFirstVisibleChar - 1) < a then begin Rgn := FTextLayout.RegionForRange(TTextRange.Create(FFirstVisibleChar - 1, a - FFirstVisibleChar + 1)); if System.Length(Rgn) > 0 then Result := Result + Rgn[High(Rgn)].Width; end; EditRectWidth := ViewRect.Width; WholeTextWidth := ContentRect.Width + Padding.Left; if WholeTextWidth < EditRectWidth then Result := CheckGravity(Result, EditRectWidth, WholeTextWidth); end; end; function TCustomEditView.GetCheckSpelling: Boolean; begin Result := Model.CheckSpelling; end; function TCustomEditView.GetCaretPosition(const Value: Single): Integer; var Tmp, WholeTextWidth, EditRectWidth, PwdW: Single; CombinedText: string; begin Result := FFirstVisibleChar - 1; CombinedText := FTextService.CombinedText; if not CombinedText.IsEmpty then begin if Model.Password then begin PwdW := GetPasswordCharWidth; WholeTextWidth := CombinedText.Length * PwdW; EditRectWidth := ViewRect.Width; Tmp := Value; if WholeTextWidth < EditRectWidth then Tmp := CheckGravity(Value, EditRectWidth, WholeTextWidth); Result := Result + Trunc((Tmp - ContentRect.Left) / PwdW); if Result < 0 then Result := 0 else if Result > CombinedText.Length then Result := CombinedText.Length; end else Result := FTextLayout.PositionAtPoint(TPointF.Create(Value + FInvisibleTextWidth, FTextLayout.TextRect.Top + FTextLayout.TextHeight / 2)); end; end; function TCustomEditView.GetEditPopupMenu: TPopupMenu; begin if FEditPopupMenu = nil then FEditPopupMenu := CreatePopupMenu; Result := FEditPopupMenu; end; function TCustomEditView.GetFilterChar: string; begin Result := Model.FilterChar; end; function TCustomEditView.GetImeMode: TImeMode; begin Result := Model.ImeMode; end; function TCustomEditView.GetInputSupport: Boolean; begin Result := Model.InputSupport; end; function TCustomEditView.GetKeyboardType: TVirtualKeyboardType; begin Result := Model.KeyboardType; end; function TCustomEditView.GetKillFocusByReturn: Boolean; begin Result := Model.KillFocusByReturn; end; function TCustomEditView.GetLength: Integer; begin Result := Model.FTextSettingsInfo.Text.Length; end; function TCustomEditView.GetMaxLength: Integer; begin Result := Model.MaxLength; end; function TCustomEditView.GetOnChange: TNotifyEvent; begin Result := FOnModelChange; end; function TCustomEditView.GetOnChangeTracking: TNotifyEvent; begin Result := Model.OnChangeTracking; end; function TCustomEditView.GetOnTyping: TNotifyEvent; begin Result := Model.OnTyping; end; function TCustomEditView.GetOnValidate: TValidateTextEvent; begin Result := Model.OnValidate; end; function TCustomEditView.GetOnValidating: TValidateTextEvent; begin Result := Model.OnValidating; end; function TCustomEditView.GetOriginCaretPosition: Integer; begin if FTextService <> nil then Result := FTextService.CaretPosition.X else Result := -1; end; function TCustomEditView.GetPassword: Boolean; begin Result := Model.Password; end; function TCustomEditView.GetPasswordCharWidth: Single; begin Result := FText.Font.Size / 2; end; function TCustomEditView.GetReadOnly: Boolean; begin Result := Model.ReadOnly; end; function TCustomEditView.GetReturnKeyType: TReturnKeyType; begin Result := Model.ReturnKeyType; end; function TCustomEditView.GetSelectionBounds: TRect; begin Result := Rect(Model.SelStart, 0, Model.SelStart + Model.SelLength, 0); end; {$IF CompilerVersion >= 33} function TCustomEditView.GetSelectionPointSize: TSizeF; begin Result.Width := Model.SelLength; Result.Height := 0; end; {$ENDIF} function TCustomEditView.GetSelfCaret: TCaret; begin Result := Model.Caret; end; function TCustomEditView.GetSelLength: Integer; begin Result := Abs(Model.SelLength); end; {$IFDEF ANDROID} procedure TCustomEditView.UpdateAndroidKeyboardServiceState; var ASvc: IFMXVirtualKeyboardService; AContext: TRttiContext; AType: TRttiType; AField: TRttiField; AInst: TVirtualKeyboardAndroid; begin if not Assigned(FVKState) then begin if (not Assigned(Screen.FocusControl)) and TPlatformServices.Current.SupportsPlatformService (IFMXVirtualKeyboardService, ASvc) then begin AInst := ASvc as TVirtualKeyboardAndroid; AContext := TRttiContext.Create; AType := AContext.GetType(TVirtualKeyboardAndroid); AField := AType.GetField('FState'); if AField.GetValue(AInst).AsOrdinal <> 0 then begin FVKState := PByte(AInst); Inc(FVKState, AField.Offset); end; end; end; if Assigned(FVKState) and (FVKState^ <> 0) then FVKState^ := 0; end; {$ENDIF} function TCustomEditView.GetSelRect: TRectF; var Offset, StartPosition, EndPosition: Integer; begin Result := ContentRect; Result.Top := Trunc(LineTop); Result.Bottom := Result.Top + LineHeight; {$IFNDEF ANDROID} if GetOriginCaretPosition <= Min(Model.SelStart, Model.SelStart + Model.SelLength) then Offset := FTextService.CombinedText.Length - FTextService.Text.Length else Offset := 0; {$ELSE} Offset := 0; {$ENDIF} StartPosition := Model.SelStart + Offset; EndPosition := Model.SelStart + Model.SelLength + Offset; Result.Left := GetCharX(Min(StartPosition, EndPosition)); Result.Right := GetCharX(Max(StartPosition, EndPosition)); end; function TCustomEditView.GetSelStart: Integer; begin if Model.SelLength > 0 then Result := Model.SelStart else if Model.SelLength < 0 then Result := Model.SelStart + Model.SelLength else Result := GetOriginCaretPosition; end; function TCustomEditView.GetSelText: string; begin Result := Model.SelectedText; end; function TCustomEditView.GetTargetClausePointF: TPointF; var Str: String; begin Str := FTextService.CombinedText.Substring(0, Round(FTextService.TargetClausePosition.X) ); if FFirstVisibleChar > 1 then Str := Str.Substring(FFirstVisibleChar - 1, MaxInt); Result.X := TextWidth(0, Str.Length); Result.Y := (ContentRect.Height / 2) + FText.Font.Size / 2 + IMEWindowGap; Result.Offset(ContentRect.TopLeft); Result := LocalToAbsolute(Result); end; function TCustomEditView.GetText: string; begin Result := FTextService.CombinedText; end; function TCustomEditView.GetTextService: TTextService; begin Result := FTextService; end; procedure TCustomEditView.GoToTextBegin; begin CaretPosition := 0; end; procedure TCustomEditView.GoToTextEnd; begin CaretPosition := Text.Length; end; function TCustomEditView.HasSelection: Boolean; begin Result := Model.HasSelection; end; function TCustomEditView.HasText: Boolean; begin Result := Text.Length > 0; end; function TCustomEditView.HaveSelectionPickers: Boolean; begin Result := (FLeftSelPt <> nil) and (FRightSelPt <> nil); end; procedure TCustomEditView.HideCaret; begin Model.Caret.Hide; end; procedure TCustomEditView.HideInputMethod; {$IF Defined(ANDROID) or Defined(IOS)} var AService: IFMXVirtualKeyboardService; {$ENDIF} begin {$IF Defined(ANDROID) or Defined(IOS)} try if TPlatformServices.Current.SupportsPlatformService(IFMXVirtualKeyboardService, AService) then begin AService.HideVirtualKeyboard(); end; except end; {$ENDIF} end; procedure TCustomEditView.HideLoupe; begin if FLoupeService <> nil then FLoupeService.Hide; end; procedure TCustomEditView.IMEStateUpdated; var CombinedText: string; begin CombinedText := FTextService.CombinedText; FTextLayout.Text := CombinedText; SetCaretPosition(GetOriginCaretPosition); Model.SetTextWithoutValidation(CombinedText); // Windows TextService controls CaretPosition and Text itself. // We have to update Text and CaretPosition only, if Edit initiate it. {$IFNDEF MSWINDOWS} if Model.SelLength > 0 then begin Model.DisableNotify; try Model.SelLength := 0; finally Model.EnableNotify; end; UpdateSelectionPointPositions; end; {$ENDIF} LinkObserversValueModified(Self.Observers); DoChangeTracking; DoTyping; {$IFDEF ANDROID} FModel.DoChange; {$ENDIF} end; procedure TCustomEditView.InsertText(const AText: string); var OldText: string; SelStart, SelLength: Integer; begin if Model.ReadOnly and not Model.InputSupport then Exit; OldText := Text; SelStart := Min(Model.SelStart, Model.SelStart + Model.SelLength); SelLength := Abs(Model.SelLength); OldText := OldText.Remove(SelStart, SelLength); SelStart := CaretPosition; if Model.SelLength < 0 then SelStart := SelStart + Model.SelLength; OldText := OldText.Insert(SelStart, AText); Model.DisableNotify; try Model.SelLength := 0; finally Model.EnableNotify; end; if (Model.MaxLength <= 0) or (OldText.Length <= Model.MaxLength) then begin SetTextInternal(OldText); CaretPosition := SelStart + AText.Length; end; end; procedure TCustomEditView.KeyDown(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState); var TmpS: string; OldCaretPosition: Integer; LCaret: Integer; IsCtrlOrCmd, KeyHandled: Boolean; begin if not Model.InputSupport then Exit; KeyHandled := False; try if Observers.IsObserving(TObserverMapping.EditLinkID) then begin if (Key = vkBack) or (Key = vkDelete) or ((Key = vkInsert) and (ssShift in Shift)) then if not TLinkObservers.EditLinkEdit(Observers) then begin TLinkObservers.EditLinkReset(Observers); KeyHandled := True; Exit; end; if (KeyChar >= #32) and not TLinkObservers.EditLinkIsValidChar(Observers, KeyChar) then begin KeyHandled := True; Exit; end; case KeyChar of ^H, ^V, ^X, #32..High(Char): if not TLinkObservers.EditLinkEdit(Observers) then begin TLinkObservers.EditLinkReset(Observers); KeyHandled := True; Exit; end; #27: begin TLinkObservers.EditLinkReset(Observers); SelectAll; KeyHandled := True; Exit; end; end; if TLinkObservers.EditLinkIsEditing(Observers) then TLinkObservers.EditLinkModified(Observers); end; if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueModified(Observers); inherited; OldCaretPosition := GetOriginCaretPosition; FLastChar := KeyChar; FLastKey := Key; IsCtrlOrCmd := Shift * [ssCtrl, ssCommand] <> []; case Key of vkA: if IsCtrlOrCmd and (Shift * [ssAlt, ssShift] = []) then begin SelectAll; KeyHandled := True; end; vkC: if IsCtrlOrCmd then begin CopyToClipboard; KeyHandled := True; end; vkV: if IsCtrlOrCmd then begin PasteFromClipboard; DoTyping; KeyHandled := True; end; vkX: if IsCtrlOrCmd and not Model.ReadOnly then begin CutToClipboard; DoTyping; KeyHandled := True; end; vkZ: if IsCtrlOrCmd then begin if Observers.IsObserving(TObserverMapping.EditLinkID) then TLinkObservers.EditLinkReset(Observers); if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueUpdate(Observers); KeyHandled := True; end; vkReturn: begin Model.DisableNotify; try Model.Typing := False; finally Model.EnableNotify; end; Model.Change; if Observers.IsObserving(TObserverMapping.EditLinkID) then TLinkObservers.EditLinkUpdate(Observers); if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueUpdate(Observers); if Model.KillFocusByReturn and (Root <> nil) then Root.SetFocused(nil); // not need to perform KeyHandled := True; end; vkEnd: begin CaretPosition := Text.Length; KeyHandled := True; end; vkHome: begin CaretPosition := 0; KeyHandled := True; end; vkLeft: begin if IsCtrlOrCmd then begin CaretPosition := GetPrevLexemeBegin(Text, GetOriginCaretPosition); KeyHandled := True; end else if (GetOriginCaretPosition > 0) and not Text.IsEmpty then begin if Text.Chars[GetOriginCaretPosition - 1].IsLowSurrogate then CaretPosition := GetOriginCaretPosition - 2 else CaretPosition := GetOriginCaretPosition - 1; KeyHandled := True; end; end; vkRight: begin if IsCtrlOrCmd then begin CaretPosition := GetNextLexemeBegin(Text, GetOriginCaretPosition); KeyHandled := True; end else if (Text.Length > GetOriginCaretPosition) then begin if Text.Chars[GetOriginCaretPosition].IsHighSurrogate then CaretPosition := GetOriginCaretPosition + 2 else CaretPosition := GetOriginCaretPosition + 1; KeyHandled := True; end; end; vkDelete: begin if not Model.ReadOnly then begin if Model.HasSelection then begin if Shift = [ssShift] then CutToClipboard else DeleteSelection; DoTyping; KeyHandled := True; end else begin TmpS := Text; if not TmpS.IsEmpty then begin if IsCtrlOrCmd then begin //Delete whole word LCaret := GetNextLexemeBegin(Text, GetOriginCaretPosition); if LCaret < 0 then Exit; TmpS := TmpS.Remove(LCaret, GetOriginCaretPosition - LCaret); end else begin LCaret := GetOriginCaretPosition; //Delete single character if (Text.Length > 1) and (GetOriginCaretPosition < Text.Length) and Text.Chars[GetOriginCaretPosition].IsHighSurrogate then TmpS := TmpS.Remove(GetOriginCaretPosition, 2) else TmpS := TmpS.Remove(GetOriginCaretPosition, 1); end; SetTextInternal(TmpS); CaretPosition := LCaret; DoTyping; KeyHandled := True; end; end; end; end; vkBack: if not Model.ReadOnly then begin if Model.HasSelection then begin DeleteSelection; DoTyping; KeyHandled := True; end else begin TmpS := Text; if not TmpS.IsEmpty then begin if IsCtrlOrCmd then begin //Delete whole word LCaret := GetPrevLexemeBegin(Text, GetOriginCaretPosition); if LCaret < 0 then Exit; TmpS := TmpS.Remove(LCaret, GetOriginCaretPosition - LCaret); end else begin LCaret := GetOriginCaretPosition - 1; if TmpS.Chars[LCaret].IsLowSurrogate then begin Dec(LCaret); TmpS := TmpS.Remove(LCaret, 2) end else TmpS := TmpS.Remove(LCaret, 1); end; SetTextInternal(TmpS); CaretPosition := LCaret; DoTyping; KeyHandled := True; end; end; end; vkInsert: if Shift = [ssShift] then begin PasteFromClipboard; DoTyping; KeyHandled := True; end else if IsCtrlOrCmd then begin CopyToClipboard; KeyHandled := True; end; end; if (KeyChar <> #0) and not Model.FilterChar.IsEmpty and not Model.FilterChar.Contains(KeyChar) then KeyChar := #0; if Key in [vkEnd, vkHome, vkLeft, vkRight] then begin Model.DisableNotify; try if ssShift in Shift then begin Model.SelStart := GetOriginCaretPosition; Model.SelLength := Model.SelLength - (GetOriginCaretPosition - OldCaretPosition); end else Model.SelLength := 0; RepaintEdit; UpdateSelectionPointPositions; KeyHandled := True; finally Model.EnableNotify; end; end; if (Ord(KeyChar) >= 32) and not Model.ReadOnly then begin {$IF (not Defined(ANDROID)) or (CompilerVersion < 33)} FCharsBuffer := FCharsBuffer + KeyChar; if not KeyChar.IsHighSurrogate then begin Model.DisableNotify; try Model.Typing:= True; finally Model.EnableNotify; end; InsertText(FCharsBuffer); FCharsBuffer := string.Empty; DoTyping; end; KeyHandled := True; {$ELSE} // On the Android we use proxy native EditText for inputting any kind of text. So implementation TTextService takes // care on any kind of text inputting. Therefore, we don't need to intercept inputting latin chars also. {$ENDIF} end; //if ResourceControl <> nil then // ResourceControl.UpdateEffects; finally if KeyHandled then begin Key := 0; KeyChar := #0; end; end; end; procedure TCustomEditView.Loaded; begin inherited Loaded; DoInitStyle; end; procedure TCustomEditView.LongTap(const X, Y: Single); begin if SelectionMode <> TSelectionMode.TextSelection then begin SelectionMode := TSelectionMode.CursorPosChanging; if FLoupeService <> nil then begin FLoupeService.SetLoupeMode(TLoupeMode.Circle); ShowLoupe; SetLoupePosition(X, Y); end; end; end; procedure TCustomEditView.MMCaretPositionChanged( var Message: TDispatchMessageWithValue<Integer>); begin SetCaretPosition(Message.Value); end; procedure TCustomEditView.MMCheckSpellingChanged( var AMessage: TDispatchMessageWithValue<Boolean>); var I: Integer; begin if Model.CheckSpelling then begin if not TPlatformServices.Current.SupportsPlatformService(IFMXSpellCheckerService, IInterface(FSpellService)) then FSpellService := nil; FUpdateSpelling := not Text.IsEmpty; end else begin for I := 0 to FSpellMenuItems.Count - 1 do FSpellMenuItems[I].Parent := nil; FSpellMenuItems.Clear; FSpellService := nil; SetLength(FSpellingRegions, 0); FUpdateSpelling := False; FSpellHightlightRect := TRectF.Empty; end; end; procedure TCustomEditView.MMEditButtonsChanged(var Message: TDispatchMessage); begin end; {$IF CompilerVersion >= 34} procedure TCustomEditView.MMGetCaretPositionByPoint( var Message: TDispatchMessageWithValue<TCustomEditModel.TGetCaretPositionInfo>); begin Message.Value.CaretPosition := GetCaretPosition(Message.Value.HitPoint.X); end; {$ENDIF} {$IF CompilerVersion >= 32} procedure TCustomEditView.MMFilterCharChanged(var Message: TDispatchMessage); begin if FTextService <> nil then FTextService.FilterChar := Model.FilterChar; end; {$ENDIF} procedure TCustomEditView.MMImeModeChanged(var AMessage: TDispatchMessage); begin if Model.Password then FTextService.SetImeMode(TImeMode.imDisable) else FTextService.SetImeMode(Model.ImeMode); end; procedure TCustomEditView.MMMaxLengthChanged(var Message: TDispatchMessage); begin if FTextService <> nil then FTextService.MaxLength := Model.MaxLength; end; procedure TCustomEditView.MMPasswordChanged(var AMessage: TDispatchMessage); begin if Model.Password then FTextService.SetImeMode(TImeMode.imDisable) else FTextService.SetImeMode(Model.ImeMode); RepaintEdit; end; procedure TCustomEditView.MMPromptTextChanged(var Message: TDispatchMessage); begin Repaint; end; procedure TCustomEditView.MMSelLengthChanged( var AMessage: TDispatchMessageWithValue<Integer>); begin UpdateSelectionPointPositions; RepaintEdit; end; procedure TCustomEditView.MMSelStartChanged( var AMessage: TDispatchMessageWithValue<Integer>); begin UpdateSelectionPointPositions; RepaintEdit; end; procedure TCustomEditView.MMTextChanged(var AMessage: TDispatchMessageWithValue<string>); var LText: string; begin LText := AMessage.Value; if FTextService.CombinedText <> LText then begin FTextLayout.Text := LText; {$IF (not Defined(ANDROID)) or (CompilerVersion > 32)} FTextService.Text := LText; {$ELSE} FTextService.Text := PackText(LText); {$ENDIF} UpdateFirstVisibleChar; if FTextService.CaretPosition.X > LText.Length then SetCaretPosition(LText.Length) else UpdateCaretPosition; RepaintEdit; end; end; procedure TCustomEditView.MMTextChanging( var AMessage: TDispatchMessageWithValue<string>); begin DoChangeTracking; end; procedure TCustomEditView.MMTextSettingsChanged(var AMessage: TDispatchMessage); begin if ([csLoading, csDesigning] * ComponentState = []){$IF CompilerVersion < 32} and not Released{$ENDIF} then begin UpdateTextHeight; if not FDisableAlign then RealignContent; RepaintEdit; end; UpdateTextLayout; end; procedure TCustomEditView.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); var NewPosition: Integer; begin inherited; Model.DisableNotify; try if (Button = TMouseButton.mbLeft) and Model.InputSupport then begin NewPosition := GetCaretPosition(X); if ssShift in Shift then Model.SelLength := NewPosition - Model.SelStart else Model.SelLength := 0; CaretPosition := NewPosition; Model.SelStart := NewPosition; if ssDouble in Shift then begin SelectionMode := TSelectionMode.None; SelectWord; end else {$IF not Defined(IOS) and not Defined(ANDROID)} BeginSelection; {$ENDIF} end else UpdateCaretPosition; finally Model.EnableNotify; end; end; procedure TCustomEditView.MouseMove(Shift: TShiftState; X, Y: Single); function DefineNewCarretPosition(const AX: Single): Integer; begin Result := GetCaretPosition(AX); if AX > ContentRect.Right then Inc(Result); end; var OldCaretPosition: Integer; begin inherited; { Changing cursor position } if SelectionMode = TSelectionMode.CursorPosChanging then begin if FLoupeService <> nil then begin FLoupeService.SetLoupeMode(TLoupeMode.Circle); SetLoupePosition(X, Y); ShowLoupe; end; CaretPosition := DefineNewCarretPosition(X); end; { Changing selection bounds } if SelectionMode = TSelectionMode.TextSelection then begin OldCaretPosition := GetOriginCaretPosition; Model.DisableNotify; try {$IFNDEF ANDROID} CaretPosition := DefineNewCarretPosition(X); Model.SelStart := GetOriginCaretPosition; {$ELSE} if Model.SelLength = 0 then Model.SelStart := OldCaretPosition; Model.SelStart := DefineNewCarretPosition(X); {$ENDIF} Model.SelLength := Model.SelLength - (Model.SelStart - OldCaretPosition); finally Model.EnableNotify; end; end; end; procedure TCustomEditView.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin inherited; HideLoupe; if SelectionMode = TSelectionMode.CursorPosChanging then FTextService.EndSelection; SelectionMode := TSelectionMode.None; UpdateSelectionPointPositions; end; function TCustomEditView.ParentFrame: TFrame; var P: TFmxObject; begin Result := nil; P := Self; while P <> nil do begin if P is TFrame then begin Result := P as TFrame; Break; end else P := P.Parent; end; end; procedure TCustomEditView.PasteFromClipboard; var OldText, Value: string; LCaretPosition: Integer; begin if ReadOnly or not InputSupport then Exit; if Observers.IsObserving(TObserverMapping.EditLinkID) then if not TLinkObservers.EditLinkEdit(Observers) then begin TLinkObservers.EditLinkReset(Observers); Exit; end else TLinkObservers.EditLinkModified(Observers); if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueModified(Observers); if (FClipboardSvc <> nil) and not FClipboardSvc.GetClipboard.IsEmpty then begin OldText := Model.Text; OldText := OldText.Remove(SelStart, SelLength); Value := FClipboardSvc.GetClipboard.ToString.Split([sLineBreak], 1, TStringSplitOptions.None)[0]; OldText := OldText.Insert(SelStart, Value); if MaxLength > 0 then OldText := OldText.Substring(0, MaxLength); LCaretPosition := SelStart + Value.Length; Model.Text := OldText; Model.CaretPosition := LCaretPosition; Model.SelStart := LCaretPosition; Model.SelLength := 0; end; end; procedure TCustomEditView.PlayClickEffect; begin end; {$IF CompilerVersion >= 34} procedure TCustomEditView.PMDoBeforeExit(var AMessage: TDispatchMessage); begin if FScene <> nil then begin Model.Change; if Observers.IsObserving(TObserverMapping.EditLinkID) then TLinkObservers.EditLinkUpdate(Observers); if Observers.IsObserving(TObserverMapping.ControlValueID) then TLinkObservers.ControlValueUpdate(Observers); inherited; UpdateSelectionPointPositions; end else inherited; end; {$ENDIF} procedure TCustomEditView.PMGetTextContentRect( var Message: TDispatchMessageWithValue<TRectF>); begin Message.Value := ContentRect; end; procedure TCustomEditView.PMInit(var Message: TDispatchMessage); begin if FTextService <> nil then begin FTextService.MaxLength := Model.MaxLength; FTextLayout.Text := Model.Text; {$IF (not Defined(ANDROID)) or (CompilerVersion > 32)} FTextService.Text := Model.Text; {$ELSE} FTextService.Text := PackText(Model.Text); {$ENDIF} if FTextService.CaretPosition.X > Model.Text.Length then SetCaretPosition(Text.Length); end; RepaintEdit; UpdateTextLayout; end; procedure TCustomEditView.RealignContent; var Size: TSizeF; Pos: TPointF; OldDisableAlign: Boolean; begin OldDisableAlign := FDisableAlign; try FDisableAlign := True; if FTextHeight <= 0 then UpdateTextHeight; Pos.X := 0; Pos.Y := 0; Size.cx := Max(Width - Pos.X, 0); Size.cy := Max(Height - Pos.Y, 0); // 计算行高 FLineHeight := Max(Min(Size.cy, FTextHeight + Max(1, Round(FTextHeight / 10))), 0); // 计算出内容区矩形 FContentRect := RectF(Pos.X + Padding.Left, Pos.Y + Padding.Top, Size.cx - Padding.Right, Size.cy - Padding.Bottom); if Assigned(FDrawable) and (not FDrawable.IsEmpty) then FDrawable.AdjustDraw(Canvas, FContentRect, False, DrawState); // 计算出文本顶部位置 case FText.VertAlign of TTextAlign.Center: FLineTop := FContentRect.Top + Max((FContentRect.Height - FLineHeight) / 2, 0); TTextAlign.Leading: FLineTop := FContentRect.Top; TTextAlign.Trailing: FLineTop := Max(FContentRect.Height - FLineHeight, 0) + FContentRect.Top; end; FTextLayout.TopLeft := ContentRect.TopLeft; UpdateLayoutSize; finally FDisableAlign := OldDisableAlign; end; end; procedure TCustomEditView.RepaintEdit; begin Repaint; end; procedure TCustomEditView.Replace(const AStartPos, ALength: Integer; const AStr: string); begin end; procedure TCustomEditView.ResetSelection; var LCaretPosition: Integer; begin LCaretPosition := GetSelStart + GetSelLength; SelLength := 0; CaretPosition := LCaretPosition; end; procedure TCustomEditView.Resize; begin inherited Resize; RealignContent; UpdateSpelling; end; procedure TCustomEditView.SelectAll; var CaretPos: Integer; begin if InputSupport then begin CaretPos := CaretPosition; try SelStart := 0; SelLength := Text.Length; finally CaretPosition := CaretPos; end; end; end; procedure TCustomEditView.SelectWord; var WordBeginIndex, WordEndIndex: Integer; CaretPos: Integer; begin if Text.Length = 0 then Exit; CaretPos := GetOriginCaretPosition; if FindWordBound(Text, CaretPos, WordBeginIndex, WordEndIndex) and InRange(CaretPos, WordBeginIndex, WordEndIndex + 1) then begin Model.SelStart := WordBeginIndex; Model.SelLength := Max(WordEndIndex - Model.SelStart + 1, 0); end else Model.SelLength := 0; end; procedure TCustomEditView.SetCaret(const Value: TCaret); begin Model.Caret := Value; end; procedure TCustomEditView.SetCaretPosition(const Value: Integer); var P: TPoint; begin if FTextService <> nil then begin P.X := 0; P.Y := 0; if Value < 0 then P.X := 0 else if Value > Text.Length then P.X := Text.Length else P.X := Value; FTextService.CaretPosition := P; UpdateFirstVisibleChar; Model.DisableNotify; try Model.CaretPosition := P.X; if Model.SelLength <= 0 then Model.SelStart := Value; finally Model.EnableNotify; end; UpdateSelectionPointPositions; RepaintEdit; UpdateCaretPosition; end; end; procedure TCustomEditView.SetCheckSpelling(const Value: Boolean); begin Model.CheckSpelling := Value; end; procedure TCustomEditView.SetFilterChar(const Value: string); begin Model.FilterChar := Value; end; procedure TCustomEditView.SetImeMode(const Value: TImeMode); begin Model.ImeMode := Value; end; procedure TCustomEditView.SetInputSupport(const Value: Boolean); begin Model.InputSupport := Value; end; procedure TCustomEditView.SetKeyboardType(Value: TVirtualkeyboardType); begin Model.KeyboardType := Value; end; procedure TCustomEditView.SetKillFocusByReturn(const Value: Boolean); begin Model.KillFocusByReturn := Value; end; procedure TCustomEditView.SetLoupePosition(const X, Y: Single); var LoupePos: TPointF; ZoomPos: TPointF; begin if FLoupeService <> nil then begin LoupePos := TPointF.Create(X - FLoupeService.GetWidth / 2, Y - FLoupeService.GetHeight); LoupePos := LocalToAbsolute(LoupePos); ZoomPos := LocalToAbsolute(TPointF.Create(X, Y)); FLoupeService.SetPosition(LoupePos); FLoupeService.SetZoomRegionCenter(ZoomPos); ShowLoupe; end; end; procedure TCustomEditView.SetMaxLength(const Value: Integer); begin Model.MaxLength := Value; end; procedure TCustomEditView.SetOnChange(const Value: TNotifyEvent); begin FOnModelChange := Value; end; procedure TCustomEditView.SetOnChangeTracking(const Value: TNotifyEvent); begin Model.OnChangeTracking := Value; end; procedure TCustomEditView.SetOnTyping(const Value: TNotifyEvent); begin Model.OnTyping := Value; end; procedure TCustomEditView.SetOnValidate(const Value: TValidateTextEvent); begin Model.OnValidate := Value; end; procedure TCustomEditView.SetOnValidating(const Value: TValidateTextEvent); begin Model.OnValidating := Value; end; procedure TCustomEditView.SetPassword(const Value: Boolean); begin Model.Password := Value; end; procedure TCustomEditView.SetReadOnly(const Value: Boolean); begin Model.ReadOnly := Value; end; procedure TCustomEditView.SetReturnKeyType(Value: TReturnKeyType); begin Model.ReturnKeyType := Value; end; procedure TCustomEditView.SetLoupePosition( const ASelectionPointType: TSelectionPointType); var SelectionRect: TRectF; ZoomCenter: TPointF; LoupePos: TPointF; begin SelectionRect := GetSelRect; if FLoupeService <> nil then begin case ASelectionPointType of TSelectionPointType.Left: begin ZoomCenter := TPointF.Create(SelectionRect.Left, SelectionRect.Top + SelectionRect.Height / 2); LoupePos := SelectionRect.TopLeft + TPointF.Create(-FLoupeService.GetWidth / 2, -FLoupeService.GetHeight) + TPointF.Create(0, -LOUPE_OFFSET); end; TSelectionPointType.Right: begin ZoomCenter := TPointF.Create(SelectionRect.Right, SelectionRect.Top + SelectionRect.Height / 2); LoupePos := TPointF.Create(SelectionRect.Right, SelectionRect.Top) + TPointF.Create(-FLoupeService.GetWidth / 2, -FLoupeService.GetHeight) + TPointF.Create(0, -LOUPE_OFFSET); end; end; ZoomCenter := LocalToAbsolute(ZoomCenter); LoupePos := LocalToAbsolute(LoupePos); FLoupeService.SetPosition(LoupePos); FLoupeService.SetZoomRegionCenter(ZoomCenter); end; end; procedure TCustomEditView.SetSelectionFill(const Value: TBrush); begin FSelectionFill.Assign(Value); end; procedure TCustomEditView.SetSelectionMode(const Value: TSelectionMode); begin FSelectionMode := Value; if FLoupeService <> nil then case Value of TSelectionMode.None: ; TSelectionMode.TextSelection: FLoupeService.SetLoupeMode(TLoupeMode.Rectangle); TSelectionMode.CursorPosChanging: FLoupeService.SetLoupeMode(TLoupeMode.Circle); end; end; procedure TCustomEditView.SetSelLength(const Value: Integer); begin Model.SelLength := Value; end; procedure TCustomEditView.SetSelStart(const Value: Integer); begin Model.SelLength := 0; Model.SelStart := Value; Model.CaretPosition := Value; end; procedure TCustomEditView.SetText(const Value: string); begin if FTextService.CombinedText <> Value then begin SetTextInternal(Value); SetCaretPosition(Min(Value.Length, FTextService.CaretPosition.X)); Model.DisableNotify; try Model.SelStart := 0; Model.SelLength := 0; finally Model.EnableNotify; end; Model.Change; RepaintEdit; end; end; procedure TCustomEditView.SetTextInternal(const Value: string); begin {$IF CompilerVersion > 32} {$IFDEF ANDROID} FTextService.Text := Value; Model.Text := Value; {$ELSE} Model.Text := Value; FTextService.Text := Model.Text; {$ENDIF} FTextLayout.Text := Model.Text; {$ELSE} Model.Text := Value; FTextLayout.Text := Model.Text; {$IFNDEF ANDROID} FTextService.Text := Model.Text; {$ELSE} FTextService.Text := PackText(Model.Text); {$ENDIF} {$ENDIF} UpdateCaretPosition; end; procedure TCustomEditView.ShowCaret; begin Model.Caret.Show; end; function TCustomEditView.ShowContextMenu( const ScreenPosition: TPointF): Boolean; function ShowDefaultMenu: Boolean; begin Result := False; if EditPopupMenu <> nil then try if Root <> nil then EditPopupMenu.Parent := Root.GetObject; Result := True; UpdatePopupMenuItems; if Model.CheckSpelling and (FSpellService <> nil) and (System.Length(FSpellingRegions) > 0) then UpdateSpellPopupMenu(ScreenToLocal(ScreenPosition)); EditPopupMenu.PopupComponent := Self; EditPopupMenu.Popup(Round(ScreenPosition.X), Round(ScreenPosition.Y)); finally EditPopupMenu.Parent := nil; end; end; function ShowUsersPopupMenu: Boolean; begin Result := ShowContextMenu(ScreenPosition) end; begin Result := False; if not (csDesigning in ComponentState) then if (PopupMenu <> nil) then Result := ShowUsersPopupMenu else Result := ShowDefaultMenu; end; procedure TCustomEditView.ShowLoupe; begin if FLoupeService <> nil then begin FLoupeService.SetLoupeScale(TCustomMagnifierGlass.DefaultLoupeScale); FLoupeService.ShowFor(Self); end; end; procedure TCustomEditView.SpellFixContextMenuHandler(Sender: TObject); var LPos: Integer; BP, EP: Integer; begin if Sender is TMenuItem then begin LPos := TMenuItem(Sender).Tag; if (LPos > -1) and FMX.Text.FindWordBound(Text, LPos, BP, EP) then Text := Text.Substring(0, BP) + TMenuItem(Sender).Text + Text.Substring(EP + 1); end; end; procedure TCustomEditView.StartIMEInput; begin FTextService.CaretPosition := Point(GetOriginCaretPosition, 0); end; function TCustomEditView.TextWidth(const AStart, ALength: Integer): Single; var Rgn: TRegion; S, L, I: Integer; begin if Model.Password then Result := GetPasswordCharWidth * ALength else begin if AStart < FTextLayout.Text.Length then begin S := AStart; L := ALength; if FTextLayout.Text.Chars[S].IsLowSurrogate then begin Inc(S); Dec(L); end; Rgn := FTextLayout.RegionForRange(TTextRange.Create(S, L)); Result := 0; for I := Low(Rgn) to High(Rgn) do Result := Result + Rgn[I].Width; end else if AStart = FTextLayout.Text.Length then Result := FTextLayout.TextWidth else Result := 0; end; end; procedure TCustomEditView.UpdateCaretPosition; var CaretHeight: Single; Pos: TPointF; begin if IsFocused then begin CaretHeight := Trunc(LineHeight); Pos.Y := Trunc(LineTop); // {$IFNDEF IOS} // CaretHeight := Trunc(LineHeight); // Pos.Y := Trunc(LineTop); // {$ELSE} // CaretHeight := Trunc(ContentRect.Height); // Pos.Y := Trunc(ContentRect.Top); // {$ENDIF} if FTextService.HasMarkedText then Pos.X := GetCharX(FTextService.TargetClausePosition.X) else Pos.X := GetCharX(FTextService.CaretPosition.X); Pos.X := Max(0, Min(Pos.X, ContentRect.Right - Model.Caret.Size.cx + 1)); Model.Caret.BeginUpdate; try Model.Caret.Pos := Pos; Model.Caret.Size := TPointF.Create(Min(Model.Caret.Size.cx, ContentRect.Width), CaretHeight); finally Model.Caret.EndUpdate; end; end; end; procedure TCustomEditView.UpdateFirstVisibleChar; var MarkedPosition: Integer; LEditRect: TRectF; TempStr: string; begin FTextLayout.Text := FTextService.CombinedText; MarkedPosition := FTextService.TargetClausePosition.X; if FFirstVisibleChar >= (MarkedPosition + 1) then begin FFirstVisibleChar := MarkedPosition; if FFirstVisibleChar < 1 then FFirstVisibleChar := 1; end else begin LEditRect := ContentRect; if FTextLayout.TextWidth > LEditRect.Width then begin //Text is longer than content width TempStr := FTextService.CombinedText; if MarkedPosition < (FFirstVisibleChar - 1) then //New position is lefter than left visual character FFirstVisibleChar := MarkedPosition else //Looking for the shift when caret position will be visible while (TextWidth(FFirstVisibleChar - 1, MarkedPosition - FFirstVisibleChar + 1) > LEditRect.Width) and (FFirstVisibleChar < TempStr.Length) do Inc(FFirstVisibleChar); end else //Text fits content FFirstVisibleChar := 1; end; if (FFirstVisibleChar > 0) and (FTextLayout.Text.Length > 0) then begin if FTextLayout.Text.Chars[FFirstVisibleChar - 1].IsLowSurrogate then Inc(FFirstVisibleChar); FInvisibleTextWidth := TextWidth(0, FFirstVisibleChar - 1); end; end; procedure TCustomEditView.UpdateLayoutSize; var LSize: TPointF; begin LSize := TTextLayout.MaxLayoutSize; if FText.HorzAlign <> TTextAlign.Leading then LSize.X := ContentRect.Width; if FText.VertAlign <> TTextAlign.Leading then LSize.Y := ContentRect.Height; // fixed by 凌风 if LSize.X < 0 then LSize.X := 0; if LSize.Y < 0 then LSize.Y := 0; // fix end FTextLayout.MaxSize := LSize; end; procedure TCustomEditView.UpdatePopupMenuItems; var SelTextIsValid: Boolean; procedure SetParam(AParamName : string; AValue : Boolean) ; var LMenuItem : TMenuItem; begin LMenuITem := FindContextMenuItem(AParamName); if LMenuItem <> nil then LMenuItem.Enabled := AValue; end; begin SelTextIsValid := not SelText.IsEmpty; SetParam(CutStyleName, SelTextIsValid and not Model.ReadOnly and Model.InputSupport and not Model.Password); SetParam(CopyStyleName, SelTextIsValid and not Model.Password); if FClipboardSvc <> nil then SetParam(PasteStyleName, (not FClipBoardSvc.GetClipboard.IsEmpty) and (not Model.ReadOnly) and Model.InputSupport) else SetParam(PasteStyleName, False); SetParam(DeleteStyleName, SelTextIsValid and not Model.ReadOnly and Model.InputSupport); SetParam(SelectAllStyleName, SelText <> Text); end; procedure TCustomEditView.UpdateSelectionPointPositions; var R: TRectF; IsParentFocused: Boolean; begin IsParentFocused := (ParentControl <> nil) and ParentControl.IsFocused; Model.Caret.TemporarilyHidden := Model.HasSelection and IsParentFocused; if HaveSelectionPickers then begin FLeftSelPt.Visible := (Model.SelLength > 0) and IsParentFocused and (Model.SelStart + 1 >= FFirstVisibleChar); FRightSelPt.Visible := (Model.SelLength > 0) and IsParentFocused and (GetCharX(Model.SelStart + Model.SelLength) < ContentRect.Right); R := GetSelRect; FLeftSelPt.Position.X := R.Left; {$IF Defined(ANDROID) and (CompilerVersion > 32)} FLeftSelPt.Position.Y := R.Bottom + 2 * FLeftSelPt.GripSize; {$ELSE} FLeftSelPt.Position.Y := R.Top - 2 * FLeftSelPt.GripSize; {$ENDIF} FRightSelPt.Position.X := R.Right; FRightSelPt.Position.Y := R.Bottom + 2 * FLeftSelPt.GripSize; end; end; procedure TCustomEditView.UpdateSpelling; begin if Model.CheckSpelling then begin FUpdateSpelling := True; SetLength(FSpellingRegions, 0); end; end; procedure TCustomEditView.UpdateSpellPopupMenu(const APoint: TPointF); var I, J, BP, EP: Integer; LPos: Integer; Spells: TArray<string>; LMenuItem: TMenuItem; begin for I := 0 to FSpellMenuItems.Count - 1 do FSpellMenuItems[I].Parent := nil; FSpellMenuItems.Clear; for I := Low(FSpellingRegions) to High(FSpellingRegions) do if FSpellingRegions[I].Contains(APoint) then begin LPos := FTextLayout.PositionAtPoint(APoint); if (LPos > -1) and FMX.Text.FindWordBound(Text, LPos, BP, EP) then begin Spells := FSpellService.CheckSpelling(Text.Substring(BP, EP - BP + 1)); if System.Length(Spells) > 0 then begin for J := Low(Spells) to High(Spells) do begin LMenuItem := TMenuItem.Create(EditPopupMenu); LMenuItem.Text := Spells[J]; LMenuItem.Font.Style := LMenuItem.Font.Style + [TFontStyle.fsBold]; LMenuItem.Tag := LPos; LMenuItem.OnClick := SpellFixContextMenuHandler; EditPopupMenu.InsertObject(FSpellMenuItems.Count, LMenuItem); FSpellMenuItems.Add(LMenuItem); end; LMenuItem := TMenuItem.Create(EditPopupMenu); LMenuItem.Text := SMenuSeparator; EditPopupMenu.InsertObject(FSpellMenuItems.Count, LMenuItem); FSpellMenuItems.Add(LMenuItem); end; end; Break; end; end; procedure TCustomEditView.UpdateTextHeight; begin FTextHeight := 0; if Assigned(FText) then begin TCanvasManager.MeasureCanvas.Font.Assign(FText.Font); FTextHeight := TCanvasManager.MeasureCanvas.TextHeight('Lb|y'); // do not localize end; end; procedure TCustomEditView.UpdateTextLayout; begin FTextLayout.BeginUpdate; try FTextLayout.HorizontalAlign := FText.HorzAlign; FTextLayout.VerticalAlign := FText.VertAlign; FTextLayout.Font := FText.Font; FTextLayout.TopLeft := ContentRect.TopLeft; UpdateLayoutSize; finally FTextLayout.EndUpdate; end; UpdateTextHeight; end; { TEditView } constructor TEditView.Create(AOwner: TComponent); begin inherited Create(AOwner); Gravity := TLayoutGravity.CenterVertical; Cursor := crIBeam; CanFocus := True; DragMode := TDragMode.dmManual; HitTest := True; end; destructor TEditView.Destroy; begin inherited Destroy; end; initialization {$IFDEF ANDROID} // 解决 Android 下键盘事件不响应的问题 //RegisterKeyMapping(23, 23, TKeyKind.Functional); {$ENDIF} end.
{ zpatchbuilder x1nixmzeng (September 2010) Checksum functionality Thanks to TheivingSix and aluigi } unit ZPatch; interface uses Windows, Classes, SysUtils; const NO_KEY = $0; type ZPatchNode = record Success : Boolean; // Marks successful checksum FileName : String; // Path to file Checksum : LongWord; // When successful, the patch file checksum FileSize : Longword; // When successful, the size of the patch file end; procedure Checksum(var PatchNode : ZPatchNode); procedure SetLambda(key:byte); function GetLambda : byte; implementation var MRSBYTE : byte = NO_KEY; // Set the encryption byte // procedure SetLambda(key:byte); begin MRSBYTE := key; end; // Get the encryption byte // function GetLambda : byte; begin result := MRSBYTE; end; // Decryption routine with space to patch the assembly // procedure Decrypt(var InByte: Byte; Key: Byte = NO_KEY); overload; var bAL, bDl : Byte; begin if Key = NO_KEY then begin bAL := InByte; bDl := bAL; bDl := bDl shr 3; bAL := bAL shl 5; bDl := bDl or bAL; InByte := not bDl; asm nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; end; end else begin InByte := InByte - Key; asm nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; end; end; end; // MRS checksum (I think this uses code by ThievingSix) // procedure ResourceChecksum(var PatchNode : ZPatchNode); var FStream : TFileStream; i, j, tmp : LongWord; MRSVER : array[1..4] of byte; EoCDR : array[1..22] of byte; TotalFiles : word; CDPosition : longword; CDFH : array[1..46] of byte; fnlen, exlen, cmtlen : word; begin try FStream := TFileStream.Create(PatchNode.FileName, 0); except PatchNode.Success := False; Exit; end; PatchNode.FileSize := FStream.Size; PatchNode.Checksum := 0; // Check MRS header FStream.Read(MRSVER, 4); for i:=1 to 4 do decrypt(MRSVER[i],MRSBYTE); if (MRSVER[1]<>byte('P')) or (MRSVER[2]<>byte('K')) or (MRSVER[3]<>$3) or (MRSVER[4]<>$4) then begin PatchNode.Success := False; FStream.Free; Exit; end; // Skip to the end of central directory record FStream.Position := FStream.Size - 22; FillChar(EoCDR, 22, #0); FStream.Read(EoCDR, 22); for i:=1 to 22 do decrypt(EoCDR[i],MRSBYTE); TotalFiles := (EoCDR[11] * $1) + (EoCDR[12] * $100); CDPosition := (EoCDR[17] * $1) + (EoCDR[18] * $100) + (EoCDR[19] * $10000) + (EoCDR[20] * $1000000); // Skip to central directory record FStream.Position := CDPosition; for j:=1 to TotalFiles do begin fillchar(CDFH, 46, #0); FStream.Read(CDFH, 46); for i:=1 to 46 do decrypt(CDFH[i],MRSBYTE); // CRC checksum for this file entry tmp := (CDFH[17] * $1) + (CDFH[18] * $100) + (CDFH[19] * $10000) + (CDFH[20] * $1000000); fnlen := (CDFH[29] * $1) + (CDFH[30] * $100); exlen := (CDFH[31] * $1) + (CDFH[32] * $100); cmtlen := (CDFH[33] * $1) + (CDFH[34] * $100); Inc(PatchNode.Checksum, tmp); FStream.Seek(fnlen + exLen + cmtLen, soCurrent); end; PatchNode.Success := True; FStream.Free; end; // Non-MRS file checksum (aluigi) // procedure BinaryChecksum(var PatchNode : ZPatchNode); var FStream : TFileStream; tmp, i : LongWord; begin try FStream := TFileStream.Create(PatchNode.FileName, 0); except PatchNode.Success := False; Exit; end; PatchNode.FileSize := FStream.Size; PatchNode.Checksum := PatchNode.FileSize; PatchNode.Success := True; for i := 1 to (PatchNode.FileSize div 4) do begin FStream.Read(tmp, 4); Inc(PatchNode.Checksum, tmp); end; if (PatchNode.FileSize mod 4) <> 0 then begin tmp := 0; FStream.Read(tmp, (PatchNode.FileSize mod 4)); Inc(PatchNode.Checksum, tmp); end; FStream.Free; end; // Checksum file // procedure Checksum(var PatchNode : ZPatchNode); begin PatchNode.FileSize := 0; PatchNode.Checksum := 0; if lowercase(extractfileext(PatchNode.FileName)) = '.mrs' then ResourceChecksum(PatchNode) else BinaryChecksum(PatchNode); end; end.
unit NtUtils.Shellcode.Dll; interface uses Winapi.WinNt, NtUtils.Exceptions, Ntapi.ntpsapi; const PROCESS_INJECT_DLL = PROCESS_QUERY_LIMITED_INFORMATION or PROCESS_VM_WRITE or PROCESS_VM_OPERATION or PROCESS_CREATE_THREAD; INJECT_DEAFULT_TIMEOUT = 5000 * MILLISEC; // Inject a DLL into a process using LoadLibraryW function RtlxInjectDllProcess(hProcess: THandle; DllName: String; Timeout: Int64 = INJECT_DEAFULT_TIMEOUT): TNtxStatus; // Injects a DLL into a process using a shellcode with LdrLoadDll. // Forwards error codes and tries to prevent deadlocks. function RtlxInjectDllProcessEx(hProcess: THandle; DllPath: String; Timeout: Int64 = INJECT_DEAFULT_TIMEOUT): TNtxStatus; implementation uses Ntapi.ntdef, Ntapi.ntwow64, Ntapi.ntldr, Ntapi.ntstatus, NtUtils.Objects, NtUtils.Processes, NtUtils.Threads, NtUtils.Shellcode, NtUtils.Processes.Memory; function RtlxInjectDllProcess(hProcess: THandle; DllName: String; Timeout: Int64): TNtxStatus; var TargetIsWoW64: Boolean; Names: TArray<AnsiString>; Addresses: TArray<Pointer>; Memory: TMemory; hxThread: IHandle; begin // Prevent WoW64 -> Native Result := RtlxAssertWoW64Compatible(hProcess, TargetIsWoW64); if not Result.IsSuccess then Exit; SetLength(Names, 1); Names[0] := 'LoadLibraryW'; // Find function's address Result := RtlxFindKnownDllExports(kernel32, TargetIsWoW64, Names, Addresses); if not Result.IsSuccess then Exit; // Write DLL path into process' memory Result := NtxAllocWriteMemoryProcess(hProcess, PWideChar(DllName), (Length(DllName) + 1) * SizeOf(WideChar), Memory); if not Result.IsSuccess then Exit; // Create a thread Result := RtlxCreateThread(hxThread, hProcess, Addresses[0], Memory.Address); if not Result.IsSuccess then begin NtxFreeMemoryProcess(hProcess, Memory.Address, Memory.Size); Exit; end; // Sychronize with it Result := RtlxSyncThreadProcess(hProcess, hxThread.Handle, 'Remote::LoadLibraryW', Timeout); // Undo memory allocation only if the thread exited if not Result.Matches(STATUS_WAIT_TIMEOUT, 'NtWaitForSingleObject') then NtxFreeMemoryProcess(hProcess, Memory.Address, Memory.Size); if Result.Location = 'Remote::LoadLibraryW' then begin // LoadLibraryW returns the address of the DLL. It needs to be non-null if Result.Status = 0 then Result.Status := STATUS_UNSUCCESSFUL else Result.Status := STATUS_SUCCESS; end; end; { Native DLL loader } type TLdrLoadDll = function (DllPath: PWideChar; DllCharacteristics: PCardinal; const DllName: UNICODE_STRING; out DllHandle: HMODULE): NTSTATUS; stdcall; TLdrLockLoaderLock = function(Flags: Cardinal; var Disposition: TLdrLoaderLockDisposition; out Cookie: NativeUInt): NTSTATUS; stdcall; TLdrUnlockLoaderLock = function(Flags: Cardinal; Cookie: NativeUInt): NTSTATUS; stdcall; // The shellcode we are going to injects requires some data to work with TDllLoaderContext = record LdrLoadDll: TLdrLoadDll; LdrLockLoaderLock: TLdrLockLoaderLock; LdrUnlockLoaderLock: TLdrUnlockLoaderLock; DllName: UNICODE_STRING; DllHandle: HMODULE; DllNameBuffer: array [ANYSIZE_ARRAY] of Char; end; PDllLoaderContext = ^TDllLoaderContext; {$IFDEF Win64} TDllLoaderContextWoW64 = record LdrLoadDll: Wow64Pointer; LdrLockLoaderLock: Wow64Pointer; LdrUnlockLoaderLock: Wow64Pointer; DllName: UNICODE_STRING32; DllHandle: Wow64Pointer; DllNameBuffer: array [ANYSIZE_ARRAY] of Char; end; PDllLoaderContextWoW64 = ^TDllLoaderContextWoW64; {$ENDIF} // **NOTE** // This function was used to generate the raw assembly listed below. // Keep it in sync with the code when applying changes. function DllLoader(Context: PDllLoaderContext): NTSTATUS; stdcall; var Disposition: TLdrLoaderLockDisposition; Cookie: NativeUInt; begin // Try to acquire loader lock to prevent possible deadlocks Result := Context.LdrLockLoaderLock(LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY, Disposition, Cookie); if not NT_SUCCESS(Result) then Exit; case Disposition of // Undo aquiring if necessary LdrLoaderLockDispositionLockAcquired: Context.LdrUnlockLoaderLock(0, Cookie); // Can't load DLLs now, exit LdrLoaderLockDispositionLockNotAcquired: Exit(STATUS_POSSIBLE_DEADLOCK); end; // Fix DLL name pointer Context.DllName.Buffer := PWideChar(@Context.DllNameBuffer); // Load the DLL Result := Context.LdrLoadDll(nil, nil, Context.DllName, Context.DllHandle); end; const {$IFDEF Win64} // NOTE: Keep it in sync with the function code above DllLoaderRaw64: array [0..137] of Byte = ( $55, $48, $83, $EC, $30, $48, $8B, $EC, $48, $89, $4D, $40, $B9, $02, $00, $00, $00, $48, $8D, $55, $28, $4C, $8D, $45, $20, $48, $8B, $45, $40, $FF, $50, $08, $89, $45, $2C, $83, $7D, $2C, $00, $7C, $58, $8B, $45, $28, $83, $E8, $01, $85, $C0, $74, $09, $83, $E8, $01, $85, $C0, $75, $1A, $EB, $0F, $33, $C9, $48, $8B, $55, $20, $48, $8B, $45, $40, $FF, $50, $10, $EB, $09, $C7, $45, $2C, $94, $01, $00, $C0, $EB, $2D, $48, $8B, $45, $40, $48, $8B, $4D, $40, $48, $8D, $49, $30, $48, $89, $48, $20, $33, $C9, $33, $D2, $48, $8B, $45, $40, $4C, $8D, $40, $18, $48, $8B, $45, $40, $4C, $8D, $48, $28, $48, $8B, $45, $40, $FF, $10, $89, $45, $2C, $8B, $45, $2C, $48, $8D, $65, $30, $5D, $C3 ); {$ENDIF} // NOTE: Keep it in sync with the function code above DllLoaderRaw32: array [0..111] of Byte = ( $55, $8B, $EC, $83, $C4, $F4, $8D, $45, $F4, $50, $8D, $45, $F8, $50, $6A, $02, $8B, $45, $08, $FF, $50, $04, $89, $45, $FC, $83, $7D, $FC, $00, $7C, $48, $8B, $45, $F8, $48, $74, $05, $48, $74, $10, $EB, $17, $8B, $45, $F4, $50, $6A, $00, $8B, $45, $08, $FF, $50, $08, $EB, $09, $C7, $45, $FC, $94, $01, $00, $C0, $EB, $26, $8B, $45, $08, $83, $C0, $18, $8B, $55, $08, $89, $42, $10, $8B, $45, $08, $83, $C0, $14, $50, $8B, $45, $08, $83, $C0, $0C, $50, $6A, $00, $6A, $00, $8B, $45, $08, $FF, $10, $89, $45, $FC, $8B, $45, $FC, $8B, $E5, $5D, $C2, $04, $00 ); function RtlxpPrepareLoaderContextNative(DllPath: String; out Memory: IMemory): TNtxStatus; var Context: PDllLoaderContext; Names: TArray<AnsiString>; Addresses: TArray<Pointer>; begin SetLength(Names, 3); Names[0] := 'LdrLoadDll'; Names[1] := 'LdrLockLoaderLock'; Names[2] := 'LdrUnlockLoaderLock'; // Find required functions Result := RtlxFindKnownDllExportsNative(ntdll, Names, Addresses); if not Result.IsSuccess then Exit; // Allocate the context Memory := TAutoMemory.Allocate(SizeOf(TDllLoaderContext) + Length(DllPath) * SizeOf(WideChar)); Context := Memory.Address; Context.LdrLoadDll := Addresses[0]; Context.LdrLockLoaderLock := Addresses[1]; Context.LdrUnlockLoaderLock := Addresses[2]; Context.DllName.FromString(DllPath); // Copy the dll path Move(PWideChar(DllPath)^, Context.DllNameBuffer, Length(DllPath) * SizeOf(WideChar)); end; {$IFDEF Win64} function RtlxpPrepareLoaderContextWoW64(DllPath: String; out Memory: IMemory): TNtxStatus; var Context: PDllLoaderContextWoW64; Names: TArray<AnsiString>; Addresses: TArray<Pointer>; begin SetLength(Names, 3); Names[0] := 'LdrLoadDll'; Names[1] := 'LdrLockLoaderLock'; Names[2] := 'LdrUnlockLoaderLock'; // Find the required functions in the WoW64 ntdll Result := RtlxFindKnownDllExportsWoW64(ntdll, Names, Addresses); if not Result.IsSuccess then Exit; // Allocate WoW64 loader context Memory := TAutoMemory.Allocate(SizeOf(TDllLoaderContextWoW64) + Length(DllPath) * SizeOf(WideChar)); Context := Memory.Address; Context.LdrLoadDll := Wow64Pointer(Addresses[0]); Context.LdrLockLoaderLock := Wow64Pointer(Addresses[1]); Context.LdrUnlockLoaderLock := Wow64Pointer(Addresses[2]); Context.DllName.Length := System.Length(DllPath) * SizeOf(WideChar); Context.DllName.MaximumLength := Context.DllName.Length + SizeOf(WideChar); // Copy the dll path Move(PWideChar(DllPath)^, Context.DllNameBuffer, Length(DllPath) * SizeOf(WideChar)); end; {$ENDIF} function RtlxpPrepareLoaderContext(DllPath: String; TargetIsWoW64: Boolean; out Memory: IMemory; out Code: TMemory): TNtxStatus; begin {$IFDEF Win64} if TargetIsWoW64 then begin // Native -> WoW64 Code.Address := @DllLoaderRaw32; Code.Size := SizeOf(DllLoaderRaw32); Result := RtlxpPrepareLoaderContextWoW64(DllPath, Memory); Exit; end; {$ENDIF} // Native -> Native / WoW64 -> WoW64 Result := RtlxpPrepareLoaderContextNative(DllPath, Memory); {$IFDEF Win64} Code.Address := @DllLoaderRaw64; Code.Size := SizeOf(DllLoaderRaw64); {$ELSE} Code.Address := @DllLoaderRaw32; Code.Size := SizeOf(DllLoaderRaw32); {$ENDIF} end; function RtlxInjectDllProcessEx(hProcess: THandle; DllPath: String; Timeout: Int64): TNtxStatus; var TargetIsWoW64: Boolean; hxThread: IHandle; Context: IMemory; Code: TMemory; RemoteContext, RemoteCode: TMemory; begin // Prevent WoW64 -> Native Result := RtlxAssertWoW64Compatible(hProcess, TargetIsWoW64); if not Result.IsSuccess then Exit; // Prepare the loader context Result := RtlxpPrepareLoaderContext(DllPath, TargetIsWoW64, Context, Code); if not Result.IsSuccess then Exit; // Copy the context and the code into the target Result := RtlxAllocWriteDataCodeProcess(hProcess, Context.Address, Context.Size, RemoteContext, Code.Address, Code.Size, RemoteCode); if not Result.IsSuccess then Exit; // Create a remote thread skipping attaching to existing DLLs to prevent // deadlocks. Result := NtxCreateThread(hxThread, hProcess, RemoteCode.Address, RemoteContext.Address, THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH); if not Result.IsSuccess then begin NtxFreeMemoryProcess(hProcess, RemoteCode.Address, RemoteCode.Size); NtxFreeMemoryProcess(hProcess, RemoteContext.Address, RemoteContext.Size); Exit; end; // Sync with the thread Result := RtlxSyncThreadProcess(hProcess, hxThread.Handle, 'Remote::LdrLoadDll', Timeout); // Undo memory allocation if not Result.Matches(STATUS_WAIT_TIMEOUT, 'NtWaitForSingleObject') then begin NtxFreeMemoryProcess(hProcess, RemoteCode.Address, RemoteCode.Size); NtxFreeMemoryProcess(hProcess, RemoteContext.Address, RemoteContext.Size); end; end; end.
{*******************************************************} { } { Delphi DBX Framework } { } { Copyright(c) 1995-2018 Embarcadero Technologies, Inc. } { All rights reserved } { } {*******************************************************} unit Data.DBXMySqlMetaDataWriter; interface uses Data.DBXCommonTable, Data.DBXMetaDataReader, Data.DBXMetaDataWriter, Data.DBXPlatform, System.SysUtils; type TDBXMySqlCustomMetaDataWriter = class(TDBXBaseMetaDataWriter) protected procedure MakeSqlDataType(const Buffer: TStringBuilder; const DataType: TDBXDataTypeDescription; const ColumnRow: TDBXTableRow; const Overrides: TDBXInt32s); override; function CanCreateIndexAsKey(const Index: TDBXTableRow; const IndexColumns: TDBXTable): Boolean; override; procedure MakeSqlCreateIndex(const Buffer: TStringBuilder; const Index: TDBXTableRow; const IndexColumns: TDBXTable); override; procedure MakeSqlDropIndex(const Buffer: TStringBuilder; const Index: TDBXTableRow); override; procedure MakeSqlDropForeignKey(const Buffer: TStringBuilder; const ForeignKey: TDBXTableRow); override; procedure MakeSqlColumnTypeCast(const Buffer: TStringBuilder; const Column: TDBXTable); override; private function UnicodeSpecificationRequired(const ColumnRow: TDBXTableRow): Boolean; function HasAutoIncrementColumn(const Index: TDBXTableRow): Boolean; function FindCastType(const Column: TDBXTableRow): string; end; TDBXMySqlMetaDataWriter = class(TDBXMySqlCustomMetaDataWriter) public constructor Create; procedure Open; override; protected function GetSqlAutoIncrementKeyword: string; override; function IsCatalogsSupported: Boolean; override; function IsSchemasSupported: Boolean; override; function GetAlterTableSupport: Integer; override; function GetSqlRenameTable: string; override; end; implementation uses Data.DBXCommon, Data.DBXMetaDataNames, Data.DBXMySqlMetaDataReader; procedure TDBXMySqlCustomMetaDataWriter.MakeSqlDataType(const Buffer: TStringBuilder; const DataType: TDBXDataTypeDescription; const ColumnRow: TDBXTableRow; const Overrides: TDBXInt32s); begin inherited MakeSqlDataType(Buffer, DataType, ColumnRow, Overrides); case DataType.DbxDataType of TDBXDataTypes.AnsiStringType, TDBXDataTypes.WideStringType: if UnicodeSpecificationRequired(ColumnRow) then Buffer.Append(' CHARACTER SET utf8'); TDBXDataTypes.Int8Type, TDBXDataTypes.Int16Type, TDBXDataTypes.Int32Type, TDBXDataTypes.Int64Type, TDBXDataTypes.UInt8Type, TDBXDataTypes.UInt16Type, TDBXDataTypes.UInt32Type, TDBXDataTypes.UInt64Type: if ColumnRow.Value[TDBXColumnsIndex.IsUnsigned].GetBoolean(False) then Buffer.Append(' unsigned'); end; end; function TDBXMySqlCustomMetaDataWriter.UnicodeSpecificationRequired(const ColumnRow: TDBXTableRow): Boolean; var CustomReader: TDBXMySqlCustomMetaDataReader; DefaultIsUnicode: Boolean; UnicodeRequested: Boolean; begin CustomReader := TDBXMySqlCustomMetaDataReader(FReader); DefaultIsUnicode := CustomReader.DefaultCharSetUnicode; UnicodeRequested := ColumnRow.Value[TDBXColumnsIndex.IsUnicode].GetBoolean(DefaultIsUnicode); Result := UnicodeRequested; end; function TDBXMySqlCustomMetaDataWriter.CanCreateIndexAsKey(const Index: TDBXTableRow; const IndexColumns: TDBXTable): Boolean; begin Result := False; end; procedure TDBXMySqlCustomMetaDataWriter.MakeSqlCreateIndex(const Buffer: TStringBuilder; const Index: TDBXTableRow; const IndexColumns: TDBXTable); begin if not Index.Value[TDBXIndexesIndex.IsPrimary].GetBoolean(False) then inherited MakeSqlCreateIndex(Buffer, Index, IndexColumns) else begin MakeSqlAlterTablePrefix(Buffer, Index); Buffer.Append(TDBXSQL.Add); Buffer.Append(TDBXSQL.Space); Buffer.Append(TDBXSQL.Primary); Buffer.Append(TDBXSQL.Space); Buffer.Append(TDBXSQL.Key); Buffer.Append(TDBXSQL.Space); MakeSqlCreateIndexColumnList(Buffer, IndexColumns); Buffer.Append(TDBXSQL.Semicolon); Buffer.Append(TDBXSQL.Nl); end; end; function TDBXMySqlCustomMetaDataWriter.HasAutoIncrementColumn(const Index: TDBXTableRow): Boolean; var CatalogName: string; SchemaName: string; TableName: string; ColumnsTable: TDBXTable; HasAutoIncrement: Boolean; begin CatalogName := Index.Value[TDBXIndexesIndex.CatalogName].GetWideString(NullString); SchemaName := Index.Value[TDBXIndexesIndex.SchemaName].GetWideString(NullString); TableName := Index.Value[TDBXIndexesIndex.TableName].GetWideString(NullString); ColumnsTable := FReader.FetchColumns(CatalogName, SchemaName, TableName); HasAutoIncrement := False; while ColumnsTable.Next do begin if ColumnsTable.Value[TDBXColumnsIndex.IsAutoIncrement].AsBoolean then begin HasAutoIncrement := True; break; end; end; ColumnsTable.Close; ColumnsTable.Free; Result := HasAutoIncrement; end; procedure TDBXMySqlCustomMetaDataWriter.MakeSqlDropIndex(const Buffer: TStringBuilder; const Index: TDBXTableRow); begin if Index.Value[TDBXIndexesIndex.IsPrimary].GetBoolean then begin if HasAutoIncrementColumn(Index) then Exit; end; MakeSqlAlterTablePrefix(Buffer, Index); Buffer.Append(TDBXSQL.Drop); Buffer.Append(TDBXSQL.Space); if Index.Value[TDBXIndexesIndex.IsPrimary].GetBoolean then begin Buffer.Append(TDBXSQL.Primary); Buffer.Append(TDBXSQL.Space); Buffer.Append(TDBXSQL.Key); end else begin Buffer.Append(TDBXSQL.Index); Buffer.Append(TDBXSQL.Space); MakeSqlIdentifier(Buffer, Index.Value[TDBXIndexesIndex.IndexName].AsString); end; Buffer.Append(TDBXSQL.Semicolon); Buffer.Append(TDBXSQL.Nl); end; procedure TDBXMySqlCustomMetaDataWriter.MakeSqlDropForeignKey(const Buffer: TStringBuilder; const ForeignKey: TDBXTableRow); begin MakeSqlAlterTablePrefix(Buffer, ForeignKey); Buffer.Append(TDBXSQL.Drop); Buffer.Append(TDBXSQL.Space); Buffer.Append(TDBXSQL.Foreign); Buffer.Append(TDBXSQL.Space); Buffer.Append(TDBXSQL.Key); Buffer.Append(TDBXSQL.Space); MakeSqlIdentifier(Buffer, ForeignKey.Value[TDBXForeignKeysIndex.ForeignKeyName].AsString); Buffer.Append(TDBXSQL.Semicolon); Buffer.Append(TDBXSQL.Nl); end; function TDBXMySqlCustomMetaDataWriter.FindCastType(const Column: TDBXTableRow): string; var TypeName: string; DataType: TDBXDataTypeDescription; DbType: Integer; begin TypeName := Column.Value[TDBXColumnsIndex.TypeName].AsString; DataType := FindDataType(TypeName, Column, nil); DbType := DataType.DbxDataType; case DbType of TDBXDataTypes.AnsiStringType, TDBXDataTypes.WideStringType: Result := TDBXSQL.Char + TDBXSQL.OpenParen + IntToStr(Column.Value[TDBXColumnsIndex.Precision].AsInt64) + TDBXSQL.CloseParen; TDBXDataTypes.SingleType, TDBXDataTypes.DoubleType, TDBXDataTypes.BcdType: Result := TDBXSQL.Decimal; TDBXDataTypes.TimeStampType: Result := TDBXSQL.Datetime; TDBXDataTypes.TimeType: Result := TDBXSQL.Time; TDBXDataTypes.DateType: Result := TDBXSQL.Date; TDBXDataTypes.BooleanType, TDBXDataTypes.Int8Type, TDBXDataTypes.Int16Type, TDBXDataTypes.Int32Type, TDBXDataTypes.Int64Type: Result := TDBXSQL.Signed; TDBXDataTypes.BytesType, TDBXDataTypes.VarBytesType: Result := TDBXSQL.Binary + TDBXSQL.OpenParen + IntToStr(Column.Value[TDBXColumnsIndex.Precision].AsInt64) + TDBXSQL.CloseParen; else Result := NullString; end; end; procedure TDBXMySqlCustomMetaDataWriter.MakeSqlColumnTypeCast(const Buffer: TStringBuilder; const Column: TDBXTable); var Original: TDBXTableRow; NewType, OldType, TypeName: string; begin Original := Column.OriginalRow; OldType := FindCastType(Original); NewType := FindCastType(Column); if NewType.IsEmpty or (NewType = OldType) then MakeSqlIdentifier(Buffer, Original.Value[TDBXColumnsIndex.ColumnName].GetWideString(NullString)) else begin TypeName := Column.Value[TDBXColumnsIndex.TypeName].AsString; if (TypeName = TDBXSQL.FYear) then begin Buffer.Append(TDBXSQL.FYear); Buffer.Append(TDBXSQL.OpenParen); Buffer.Append(TDBXSQL.Makedate); Buffer.Append(TDBXSQL.OpenParen); end; Buffer.Append(TDBXSQL.Cast); Buffer.Append(TDBXSQL.OpenParen); MakeSqlIdentifier(Buffer, Original.Value[TDBXColumnsIndex.ColumnName].GetWideString(NullString)); Buffer.Append(TDBXSQL.Space); Buffer.Append(TDBXSQL.cAs); Buffer.Append(TDBXSQL.Space); MakeSqlDataType(Buffer, Column.Value[TDBXColumnsIndex.TypeName].AsString, Column); Buffer.Append(TDBXSQL.CloseParen); if (TypeName = TDBXSQL.FYear) then begin Buffer.Append(TDBXSQL.Comma); Buffer.Append(1); Buffer.Append(TDBXSQL.CloseParen); Buffer.Append(TDBXSQL.CloseParen); end; end; end; constructor TDBXMySqlMetaDataWriter.Create; begin inherited Create; Open; end; procedure TDBXMySqlMetaDataWriter.Open; begin if FReader = nil then FReader := TDBXMySqlMetaDataReader.Create; end; function TDBXMySqlMetaDataWriter.GetSqlAutoIncrementKeyword: string; begin Result := 'auto_increment primary key'; end; function TDBXMySqlMetaDataWriter.IsCatalogsSupported: Boolean; begin Result := True; end; function TDBXMySqlMetaDataWriter.IsSchemasSupported: Boolean; begin Result := False; end; function TDBXMySqlMetaDataWriter.GetAlterTableSupport: Integer; begin Result := TDBXAlterTableOperation.DropColumn or TDBXAlterTableOperation.AddColumn or TDBXAlterTableOperation.DropDefaultValue or TDBXAlterTableOperation.ChangeDefaultValue or TDBXAlterTableOperation.RenameTable; end; function TDBXMySqlMetaDataWriter.GetSqlRenameTable: string; begin Result := 'RENAME TABLE :SCHEMA_NAME.:TABLE_NAME TO :NEW_SCHEMA_NAME.:NEW_TABLE_NAME'; end; end.
unit IdCoderMIME; interface uses Classes, IdCoder3to4; type TIdEncoderMIME = class(TIdEncoder3to4) public constructor Create(AOwner: TComponent); override; end; TIdDecoderMIME = class(TIdDecoder4to3) public constructor Create(AOwner: TComponent); override; end; const GBase64CodeTable: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; {Do not Localize} var GBase64DecodeTable: TIdDecodeTable; implementation uses IdGlobal, SysUtils; { TIdCoderMIME } constructor TIdDecoderMIME.Create(AOwner: TComponent); begin inherited; FDecodeTable := GBase64DecodeTable; FFillChar := '='; {Do not Localize} end; { TIdEncoderMIME } constructor TIdEncoderMIME.Create(AOwner: TComponent); begin inherited; FCodingTable := GBase64CodeTable; FFillChar := '='; {Do not Localize} end; initialization TIdDecoder4to3.ConstructDecodeTable(GBase64CodeTable, GBase64DecodeTable); end.
{ *************************************************************************** } { } { Kylix and Delphi Cross-Platform Visual Component Library } { } { Copyright (c) 1999, 2001 Borland Software Corporation } { } { *************************************************************************** } unit DBXpress; {$Z+} interface {$IFDEF MSWINDOWS} uses Windows; {$ENDIF} {$IFDEF LINUX} uses Libc; {$ENDIF} const MAXNAMELEN = 64; SQL_ERROR = -1; SQL_NULL_DATA = 100; SQL_SUCCESS = $0000; DBXERR_NOMEMORY = $0001; DBXERR_INVALIDFLDTYPE = $0002; DBXERR_INVALIDHNDL = $0003; DBXERR_INVALIDTIME = $0004; DBXERR_NOTSUPPORTED = $0005; DBXERR_INVALIDXLATION = $0006; DBXERR_INVALIDPARAM = $0007; DBXERR_OUTOFRANGE = $0008; DBXERR_SQLPARAMNOTSET = $0009; DBXERR_EOF = $000A; DBXERR_INVALIDUSRPASS = $000B; DBXERR_INVALIDPRECISION = $000C; DBXERR_INVALIDLEN = $000D; DBXERR_INVALIDXISOLEVEL = $000E; DBXERR_INVALIDXTXNID = $000F; DBXERR_DUPLICATETXNID = $0010; DBXERR_DRIVERRESTRICTED = $0011; DBXERR_LOCALTRANSACTIVE = $0012; DBXERR_MULTIPLETRANSNOTENABLED = $0013; DBX_MAXSTATICERRORS = $0014; MaxReservedStaticErrors = 255; // traceFlags trUNKNOWN = $0000; trQPREPARE = $0001; { prepared query statements } trQEXECUTE = $0002; { executed query statements } trERROR = $0004; { vendor errors } trSTMT = $0008; { statement ops (i.e. allocate, free) } trCONNECT = $0010; { connect / disconnect } trTRANSACT = $0020; { transaction } trBLOB = $0040; { blob i/o } trMISC = $0080; { misc. } trVENDOR = $0100; { vendor calls } trDATAIN = $0200; { parameter bound data } trDATAOUT = $0400; { trace fetched data } // eSQLTableType eSQLTable = $0001; eSQLView = $0002; eSQLSystemTable = $0004; eSQLSynonym = $0008; eSQLTempTable = $0010; eSQLLocal = $0020; // eSQLProcType eSQLProcedure = $0001; eSQLFunction = $0002; eSQLPackage = $0004; eSQLSysProcedure = $0008; // eSQLColType eSQLRowId = $0001; eSQLRowVersion = $0002; eSQLAutoIncr = $0004; eSQLDefault = $0008; // eSQLIndexType eSQLNonUnique = $0001; eSQLUnique = $0002; eSQLPrimaryKey = $0004; { Field Types (Logical) } fldUNKNOWN = 0; fldZSTRING = 1; { Null terminated string } fldDATE = 2; { Date (32 bit) } fldBLOB = 3; { Blob } fldBOOL = 4; { Boolean (16 bit) } fldINT16 = 5; { 16 bit signed number } fldINT32 = 6; { 32 bit signed number } fldFLOAT = 7; { 64 bit floating point } fldBCD = 8; { BCD } fldBYTES = 9; { Fixed number of bytes } fldTIME = 10; { Time (32 bit) } fldTIMESTAMP = 11; { Time-stamp (64 bit) } fldUINT16 = 12; { Unsigned 16 bit Integer } fldUINT32 = 13; { Unsigned 32 bit Integer } fldFLOATIEEE = 14; { 80-bit IEEE float } fldVARBYTES = 15; { Length prefixed var bytes } fldLOCKINFO = 16; { Look for LOCKINFO typedef } fldCURSOR = 17; { For Oracle Cursor type } fldINT64 = 18; { 64 bit signed number } fldUINT64 = 19; { Unsigned 64 bit Integer } fldADT = 20; { Abstract datatype (structure) } fldARRAY = 21; { Array field type } fldREF = 22; { Reference to ADT } fldTABLE = 23; { Nested table (reference) } fldDATETIME = 24; { DateTime structure field } fldFMTBCD = 25; { BCD Variant type: required by Midas, same as BCD for DBExpress} MAXLOGFLDTYPES = 26; { Number of logical fieldtypes } { Sub Types (Logical) } { fldFLOAT subtype } fldstMONEY = 21; { Money } { fldBLOB subtypes } fldstMEMO = 22; { Text Memo } fldstBINARY = 23; { Binary data } fldstFMTMEMO = 24; { Formatted Text } fldstOLEOBJ = 25; { OLE object (Paradox) } fldstGRAPHIC = 26; { Graphics object } fldstDBSOLEOBJ = 27; { dBASE OLE object } fldstTYPEDBINARY = 28; { Typed Binary data } fldstACCOLEOBJ = 30; { Access OLE object } fldstHMEMO = 33; { CLOB } fldstHBINARY = 34; { BLOB } fldstBFILE = 36; { BFILE } { fldZSTRING subtype } fldstPASSWORD = 1; { Password } fldstFIXED = 31; { CHAR type } fldstUNICODE = 32; { Unicode } { fldINT32 subtype } fldstAUTOINC = 29; { fldADT subtype } fldstADTNestedTable = 35; { ADT for nested table (has no name) } { fldDATE subtype } fldstADTDATE = 37; { DATE (OCIDate) with in an ADT } type DBINAME = packed array [0..31] of Char; { holds a name } FLDVchk = ( { Field Val Check type } fldvNOCHECKS, { Does not have explicit val checks } fldvHASCHECKS, { One or more val checks on the field } fldvUNKNOWN { Dont know at this time } ); FLDRights = ( { Field Rights } fldrREADWRITE, { Field can be Read/Written } fldrREADONLY, { Field is Read only } fldrNONE, { No Rights on this field } fldrUNKNOWN { Dont know at this time } ); PFLDDesc = ^FLDDesc; FLDDesc = packed record { Field Descriptor } iFldNum : Word; { Field number (1..n) } szName : DBINAME; { Field name } iFldType : Word; { Field type } iSubType : Word; { Field subtype (if applicable) } iUnits1 : SmallInt; { Number of Chars, digits etc } iUnits2 : SmallInt; { Decimal places etc. } iOffset : Word; { Offset in the record (computed) } iLen : LongWord; { Length in bytes (computed) } iNullOffset : Word; { For Null bits (computed) } efldvVchk : FLDVchk; { Field Has vcheck (computed) } efldrRights : FLDRights; { Field Rights (computed) } bCalcField : WordBool; { Is Calculated field (computed) } iUnUsed : packed array [0..1] of Word; end; pObjAttrDesc = ^ObjAttrDesc; ObjAttrDesc = packed record iFldNum : Word; { Field id } pszAttributeName: PChar; { Object attribute name } end; pObjTypeDesc = ^ObjTypeDesc; ObjTypeDesc = packed record iFldNum : Word; { Field id } szTypeName : DBINAME; { Object type name } end; pObjParentDesc = ^ObjParentDesc; ObjParentDesc = packed record iFldNum : Word; { Field id } iParentFldNum : Word; { Parent Field id } end; SQLResult = Word; var getSQLDriver : function(VendorLib, SResourceFile: PChar; out pDriver): SQLResult; stdcall; type pCBType = ^CBType; CBType = ( { Call back type } cbGENERAL, { General purpose } cbRESERVED1, cbRESERVED2, cbINPUTREQ, { Input requested } cbRESERVED4, cbRESERVED5, cbBATCHRESULT, { Batch processing rslts } cbRESERVED7, cbRESTRUCTURE, { Restructure } cbRESERVED9, cbRESERVED10, cbRESERVED11, cbRESERVED12, cbRESERVED13, cbRESERVED14, cbRESERVED15, cbRESERVED16, cbRESERVED17, cbTABLECHANGED, { Table changed notification } cbRESERVED19, cbCANCELQRY, { Allow user to cancel Query } cbSERVERCALL, { Server Call } cbRESERVED22, cbGENPROGRESS, { Generic Progress report. } cbDBASELOGIN, { dBASE Login } cbDELAYEDUPD, { Delayed Updates } cbFIELDRECALC, { Field(s) recalculation } cbTRACE, { Trace } cbDBLOGIN, { Database login } cbDETACHNOTIFY, { DLL Detach Notification } cbNBROFCBS { Number of cbs } ); TSQLDriverOption = (eDrvBlobSize, eDrvCallBack, eDrvCallBackInfo, eDrvRestrict); TSQLConnectionOption = ( eConnAutoCommit, eConnBlockingMode, eConnBlobSize, eConnRoleName, eConnWaitOnLocks, eConnCommitRetain, eConnTxnIsoLevel, eConnNativeHandle, eConnServerVersion, eConnCallBack, eConnHostName, eConnDatabaseName, eConnCallBackInfo, eConnObjectMode, eConnMaxActiveComm, eConnServerCharSet, eConnSqlDialect, eConnRollbackRetain, eConnObjectQuoteChar, eConnConnectionName, eConnOSAuthentication, eConnSupportsTransaction, eConnMultipleTransaction, eConnServerPort,eConnOnLine, eConnTrimChar, eConnQualifiedName, eConnCatalogName, eConnSchemaName, eConnObjectName, eConnQuotedObjectName, eConnCustomInfo, eConnTimeOut); TSQLCommandOption = ( eCommRowsetSize, eCommBlobSize, eCommBlockRead, eCommBlockWrite, eCommParamCount, eCommNativeHandle, eCommCursorName, eCommStoredProc, eCommSQLDialect, eCommTransactionID, eCommPackageName, eCommTrimChar, eCommQualifiedName, eCommCatalogName, eCommSchemaName, eCommObjectName, eCommQuotedObjectName); TSQLCursorOption = (eCurObjectAttrName, eCurObjectTypeName, eCurParentFieldID); CBRType = (cbrUSEDEF, cbrCONTINUE, cbrABORT, cbrCHKINPUT, cbrYES, cbrNO, cbrPARTIALASSIST, cbrSKIP, cbrRETRY); TSQLMetaDataOption = (eMetaCatalogName, eMetaSchemaName, eMetaDatabaseName, eMetaDatabaseVersion, eMetaTransactionIsoLevel, eMetaSupportsTransaction, eMetaMaxObjectNameLength, eMetaMaxColumnsInTable, eMetaMaxColumnsInSelect, eMetaMaxRowSize, eMetaMaxSQLLength, eMetaObjectQuoteChar, eMetaSQLEscapeChar, eMetaProcSupportsCursor, eMetaProcSupportsCursors, eMetaSupportsTransactions, eMetaPackageName); TSQLObjectType = (eObjTypeDatabase, eObjTypeDataType, eObjTypeTable, eObjTypeView, eObjTypeSynonym, eObjTypeProcedure, eObjTypeUser, eObjTypeRole, eObjTypeUDT, eObjTypePackage); TTransIsolationLevel = (xilREADCOMMITTED, xilREPEATABLEREAD, xilDIRTYREAD, xilCUSTOM); pTTransactionDesc = ^TTransactionDesc; TTransactionDesc = packed record TransactionID : LongWord; { Transaction id } GlobalID : LongWord; { Global transaction id } IsolationLevel : TTransIsolationLevel; {Transaction Isolation level} CustomIsolation : LongWord; { DB specific custom isolation } end; TSTMTParamType = (paramUNKNOWN, paramIN, paramOUT, paramINOUT, paramRET); { Function Result } TypedEnum = Integer; SQLDATE = Longint; SQLTIME = Longint; pTRACECat = ^TRACECat; { trace categories } TRACECat = TypedEnum; type { forward declarations } ISQLDriver = interface; ISQLConnection = interface; ISQLCommand = interface; ISQLCursor = interface; ISQLMetaData = interface; { Trace callback } TSQLCallbackEvent = function( CallType: TRACECat; CBInfo: Pointer): CBRType; stdcall; { class Pointers } pSQLDriver = ^ISQLDriver; pSQLConnection = ^ISQLConnection; pSQLCommand = ^ISQLCommand; pSQLCursor = ^ISQLCursor; ISQLDriver = interface function getSQLConnection(out pConn: ISQLConnection): SQLResult; stdcall; function SetOption(eDOption: TSQLDriverOption; PropValue: LongInt): SQLResult; stdcall; function GetOption(eDOption: TSQLDriverOption; PropValue: Pointer; MaxLength: SmallInt; out Length: SmallInt): SQLResult; stdcall; end; ISQLConnection = interface function connect(ServerName: PChar; UserName: PChar; Password: PChar): SQLResult; stdcall; function disconnect: SQLResult; stdcall; function getSQLCommand(out pComm: ISQLCommand): SQLResult; stdcall; function getSQLMetaData(out pMetaData: ISQLMetaData): SQLResult; stdcall; function SetOption(eConnectOption: TSQLConnectionOption; lValue: LongInt): SQLResult; stdcall; function GetOption(eDOption: TSQLConnectionOption; PropValue: Pointer; MaxLength: SmallInt; out Length: SmallInt): SQLResult; stdcall; function beginTransaction(TranID: LongWord): SQLResult; stdcall; function commit(TranID: LongWord): SQLResult; stdcall; function rollback(TranID: LongWord): SQLResult; stdcall; function getErrorMessage(Error: PChar): SQLResult; overload; stdcall; function getErrorMessageLen(out ErrorLen: SmallInt): SQLResult; stdcall; end; ISQLCommand = interface function SetOption( eSqlCommandOption: TSQLCommandOption; ulValue: Integer): SQLResult; stdcall; function GetOption(eSqlCommandOption: TSQLCommandOption; PropValue: Pointer; MaxLength: SmallInt; out Length: SmallInt): SQLResult; stdcall; function setParameter( ulParameter: Word ; ulChildPos: Word ; eParamType: TSTMTParamType ; uLogType: Word; uSubType: Word; iPrecision: Integer; iScale: Integer; Length: LongWord ; pBuffer: Pointer; lInd: Integer): SQLResult; stdcall; function getParameter(ParameterNumber: Word; ulChildPos: Word; Value: Pointer; Length: Integer; var IsBlank: Integer): SQLResult; stdcall; function prepare(SQL: PChar; ParamCount: Word): SQLResult; stdcall; function execute(var Cursor: ISQLCursor): SQLResult; stdcall; function executeImmediate(SQL: PChar; var Cursor: ISQLCursor): SQLResult; stdcall; function getNextCursor(var Cursor: ISQLCursor): SQLResult; stdcall; function getRowsAffected(var Rows: LongWord): SQLResult; stdcall; function close: SQLResult; stdcall; function getErrorMessage(Error: PChar): SQLResult; overload; stdcall; function getErrorMessageLen(out ErrorLen: SmallInt): SQLResult; stdcall; end; ISQLCursor = interface function SetOption(eOption: TSQLCursorOption; PropValue: LongInt): SQLResult; stdcall; function GetOption(eOption: TSQLCursorOption; PropValue: Pointer; MaxLength: SmallInt; out Length: SmallInt): SQLResult; stdcall; function getErrorMessage(Error: PChar): SQLResult; overload; stdcall; function getErrorMessageLen(out ErrorLen: SmallInt): SQLResult; stdcall; function getColumnCount(var pColumns: Word): SQLResult; stdcall; function getColumnNameLength( ColumnNumber: Word; var pLen: Word): SQLResult; stdcall; function getColumnName(ColumnNumber: Word; pColumnName: PChar): SQLResult; stdcall; function getColumnType(ColumnNumber: Word; var puType: Word; var puSubType: Word): SQLResult; stdcall; function getColumnLength(ColumnNumber: Word; var pLength: LongWord): SQLResult; stdcall; function getColumnPrecision(ColumnNumber: Word; var piPrecision: SmallInt): SQLResult; stdcall; function getColumnScale(ColumnNumber: Word; var piScale: SmallInt): SQLResult; stdcall; function isNullable(ColumnNumber: Word; var Nullable: LongBool): SQLResult; stdcall; function isAutoIncrement(ColumnNumber: Word; var AutoIncr: LongBool): SQLResult; stdcall; function isReadOnly(ColumnNumber: Word; var ReadOnly: LongBool): SQLResult; stdcall; function isSearchable(ColumnNumber: Word; var Searchable: LongBool): SQLResult; stdcall; function isBlobSizeExact(ColumnNumber: Word; var IsExact: LongBool): SQLResult; stdcall; function next: SQLResult; stdcall; function getString(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getShort(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getLong(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getDouble(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getBcd(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getTimeStamp(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getTime(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getDate(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getBytes(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool): SQLResult; stdcall; function getBlobSize(ColumnNumber: Word; var Length: LongWord; var IsBlank: LongBool): SQLResult; stdcall; function getBlob(ColumnNumber: Word; Value: Pointer; var IsBlank: LongBool; Length: LongWord): SQLResult; stdcall; end; ISQLMetaData = interface function SetOption(eDOption: TSQLMetaDataOption; PropValue: LongInt): SQLResult; stdcall; function GetOption(eDOption: TSQLMetaDataOption; PropValue: Pointer; MaxLength: SmallInt; out Length: SmallInt): SQLResult; stdcall; function getObjectList(eObjType: TSQLObjectType; out Cursor: ISQLCursor): SQLResult; stdcall; function getTables(TableName: PChar; TableType: LongWord; out Cursor: ISQLCursor): SQLResult; stdcall; function getProcedures(ProcedureName: PChar; ProcType: LongWord; out Cursor: ISQLCursor): SQLResult; stdcall; function getColumns(TableName: PChar; ColumnName: PChar; ColType: LongWord; Out Cursor: ISQLCursor): SQLResult; stdcall; function getProcedureParams(ProcName: PChar; ParamName: PChar; out Cursor: ISQLCursor): SQLResult; stdcall; function getIndices(TableName: PChar; IndexType: LongWord; out Cursor: ISQLCursor): SQLResult; stdcall; function getErrorMessage(Error: PChar): SQLResult; overload; stdcall; function getErrorMessageLen(out ErrorLen: SmallInt): SQLResult; stdcall; end; implementation end.
{*******************************************************} { } { Borland Delphi Visual Component Library } { Win32 Synchronization objects } { } { Copyright (c) 1997,98 Inprise Corporation } { } {*******************************************************} unit SyncObjs; interface uses Sysutils, Windows, Messages, Classes; type TSynchroObject = class(TObject) public procedure Acquire; virtual; procedure Release; virtual; end; THandleObject = class(TSynchroObject) private FHandle: THandle; FLastError: Integer; public destructor Destroy; override; property LastError: Integer read FLastError; property Handle: THandle read FHandle; end; TWaitResult = (wrSignaled, wrTimeout, wrAbandoned, wrError); TEvent = class(THandleObject) public constructor Create(EventAttributes: PSecurityAttributes; ManualReset, InitialState: Boolean; const Name: string); function WaitFor(Timeout: DWORD): TWaitResult; procedure SetEvent; procedure ResetEvent; end; TSimpleEvent = class(TEvent) public constructor Create; end; TCriticalSection = class(TSynchroObject) private FSection: TRTLCriticalSection; public constructor Create; destructor Destroy; override; procedure Acquire; override; procedure Release; override; procedure Enter; procedure Leave; end; implementation { TSynchroObject } procedure TSynchroObject.Acquire; begin end; procedure TSynchroObject.Release; begin end; { THandleObject } destructor THandleObject.Destroy; begin CloseHandle(FHandle); inherited Destroy; end; { TEvent } constructor TEvent.Create(EventAttributes: PSecurityAttributes; ManualReset, InitialState: Boolean; const Name: string); begin FHandle := CreateEvent(EventAttributes, ManualReset, InitialState, PChar(Name)); end; function TEvent.WaitFor(Timeout: DWORD): TWaitResult; begin case WaitForSingleObject(Handle, Timeout) of WAIT_ABANDONED: Result := wrAbandoned; WAIT_OBJECT_0: Result := wrSignaled; WAIT_TIMEOUT: Result := wrTimeout; WAIT_FAILED: begin Result := wrError; FLastError := GetLastError; end; else Result := wrError; end; end; procedure TEvent.SetEvent; begin Windows.SetEvent(Handle); end; procedure TEvent.ResetEvent; begin Windows.ResetEvent(Handle); end; { TSimpleEvent } constructor TSimpleEvent.Create; begin FHandle := CreateEvent(nil, True, False, nil); end; { TCriticalSection } constructor TCriticalSection.Create; begin inherited Create; InitializeCriticalSection(FSection); end; destructor TCriticalSection.Destroy; begin DeleteCriticalSection(FSection); inherited Destroy; end; procedure TCriticalSection.Acquire; begin EnterCriticalSection(FSection); end; procedure TCriticalSection.Release; begin LeaveCriticalSection(FSection); end; procedure TCriticalSection.Enter; begin Acquire; end; procedure TCriticalSection.Leave; begin Release; end; end.
unit LetterFrm; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Mask, Buttons, ExtCtrls, ComCtrls, Utilits, ToolWin, CommCons; type TLetterForm = class(TForm) BtnPanel: TPanel; OkBtn: TBitBtn; CancelBtn: TBitBtn; TopicGroupBox: TGroupBox; MessagGroupBox: TGroupBox; TopicEdit: TMaskEdit; MessagMemo: TMemo; TextOpenDialog: TOpenDialog; TextSaveDialog: TSaveDialog; DialogStatusBar: TStatusBar; MessagToolBar: TToolBar; LoadToolButton: TToolButton; SaveToolButton: TToolButton; NewToolButton: TToolButton; ToolButton1: TToolButton; CopyToolButton: TToolButton; CutToolButton: TToolButton; PasteToolButton: TToolButton; UndoToolButton: TToolButton; ToolButton2: TToolButton; ToolButton3: TToolButton; ExtToolButton: TToolButton; CryptToolButton: TToolButton; EditToolButton: TToolButton; ToolButton4: TToolButton; procedure BtnPanelResize(Sender: TObject); procedure FormCreate(Sender: TObject); procedure LoadToolButtonClick(Sender: TObject); procedure SaveToolButtonClick(Sender: TObject); procedure MessagMemoChange(Sender: TObject); procedure NewToolButtonClick(Sender: TObject); procedure CopyToolButtonClick(Sender: TObject); procedure CutToolButtonClick(Sender: TObject); procedure PasteToolButtonClick(Sender: TObject); procedure UndoToolButtonClick(Sender: TObject); procedure TopicEditChange(Sender: TObject); procedure MessagMemoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure ExtToolButtonClick(Sender: TObject); procedure CryptToolButtonClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure EditToolButtonClick(Sender: TObject); private FReadOnly, FNew: Boolean; protected procedure SetReadOnly(Value: Boolean); public InputDoc: Boolean; property ReadOnly: Boolean read FReadOnly write SetReadOnly default False; procedure SetNew; procedure UpdState; end; var LetterForm: TLetterForm; implementation uses LettersFrm; {$R *.DFM} procedure TLetterForm.SetReadOnly(Value: Boolean); begin TopicEdit.ReadOnly := Value; TopicEdit.ParentColor := Value; MessagMemo.ReadOnly := Value; MessagMemo.ParentColor := Value; NewToolButton.Enabled := not Value; LoadToolButton.Enabled := not Value; CutToolButton.Enabled := not Value; PasteToolButton.Enabled := not Value; UndoToolButton.Enabled := not Value; FReadOnly := Value; end; procedure TLetterForm.BtnPanelResize(Sender: TObject); const BtnDist=5; begin OkBtn.Left := (BtnPanel.ClientWidth-OkBtn.Width-CancelBtn.Width-BtnDist) div 2; CancelBtn.Left := OkBtn.Left+OkBtn.Width+BtnDist; TopicEdit.Width := TopicGroupBox.ClientWidth - 2*TopicEdit.Left; end; procedure TLetterForm.FormCreate(Sender: TObject); begin MessagToolBar.Images := LettersForm.ChildMenu.Images; TextSaveDialog.Filter := TextOpenDialog.Filter; FReadOnly := False; FNew := False; InputDoc := False; end; procedure TLetterForm.SetNew; begin FNew := True; end; procedure TLetterForm.LoadToolButtonClick(Sender: TObject); const MesTitle: PChar = 'Вставка текста из файла'; var F: file; L: Integer; Buf: PChar; begin if TextOpenDialog.Execute then begin AssignFile(F, TextOpenDialog.FileName); FileMode := 0; {$I-} Reset(F, 1); {$I+} if IOResult=0 then begin try L := FileSize(F); GetMem(Buf, L+1); try BlockRead(F, Buf^, L); if MessageBox(Handle, 'Файл в DOS-кодировке?', MesTitle, MB_YESNOCANCEL+MB_ICONQUESTION)=ID_YES then DosToWinL(Buf, L); Buf[L] := #0; MessagMemo.SelText := StrPas(Buf); finally FreeMem(Buf); end; finally CloseFile(F); end; end else MessageBox(Handle, PChar('Не могу открыть [' +TextOpenDialog.FileName+']'), MesTitle, MB_OK+MB_ICONERROR); end; end; procedure TLetterForm.SaveToolButtonClick(Sender: TObject); const MesTitle: PChar = 'Сохранение в файл'; var F: file; L: Integer; Buf: PChar; begin if TextSaveDialog.Execute then begin AssignFile(F, TextSaveDialog.FileName); {$I-} Rewrite(F, 1); {$I+} if IOResult=0 then begin try L := Length(MessagMemo.Text); GetMem(Buf, L+1); try StrPCopy(Buf, MessagMemo.Text); if MessageBox(Handle, 'Преобразовать в DOS-кодировку?', MesTitle, MB_YESNOCANCEL+MB_ICONQUESTION)=ID_YES then WinToDosL(Buf, L); BlockWrite(F, Buf^, L); finally FreeMem(Buf); end; finally CloseFile(F); end; end else MessageBox(Handle, PChar('Не могу открыть [' +TextOpenDialog.FileName+']'), MesTitle, MB_OK+MB_ICONERROR); end; end; procedure TLetterForm.MessagMemoChange(Sender: TObject); begin DialogStatusBar.Panels[0].Text := IntToStr(Length(MessagMemo.Text)); end; procedure TLetterForm.NewToolButtonClick(Sender: TObject); begin MessagMemo.Clear; MessagMemoChange(nil); end; procedure TLetterForm.CopyToolButtonClick(Sender: TObject); begin MessagMemo.CopyToClipboard; end; procedure TLetterForm.CutToolButtonClick(Sender: TObject); begin MessagMemo.CutToClipboard; end; procedure TLetterForm.PasteToolButtonClick(Sender: TObject); begin MessagMemo.PasteFromClipboard; end; procedure TLetterForm.UndoToolButtonClick(Sender: TObject); begin MessagMemo.Undo; end; procedure TLetterForm.TopicEditChange(Sender: TObject); begin MessagMemo.MaxLength := erMaxVar-Length(TopicEdit.Text)-2-SignSize; end; procedure TLetterForm.FormShow(Sender: TObject); begin if FNew {and (Length(TopicEdit.Text)=0)} then begin TopicEdit.Text := DateToStr(Date)+' - '; end; TopicEditChange(nil); end; procedure TLetterForm.MessagMemoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (Key=VK_RETURN) and (Shift=[ssCtrl]) then ModalResult := mrOk; end; procedure TLetterForm.UpdState; var S: string; begin S := ''; if InputDoc then S := S+'В'; if CryptToolButton.Down then S := S+'Ш'; DialogStatusBar.Panels[1].Text := S; end; procedure TLetterForm.ExtToolButtonClick(Sender: TObject); begin if FReadOnly then ExtToolButton.Down := not ExtToolButton.Down else begin if not ExtToolButton.Down then CryptToolButton.Down := False; UpdState; end; end; procedure TLetterForm.CryptToolButtonClick(Sender: TObject); begin if FReadOnly then CryptToolButton.Down := not CryptToolButton.Down else begin if CryptToolButton.Down then ExtToolButton.Down := True; UpdState; end; end; procedure TLetterForm.EditToolButtonClick(Sender: TObject); const MesTitle: PChar = 'Просмотр письма'; var FN: string; F: TextFile; I: Integer; ResCode: DWord; begin FN := PostDir+'letter.txt'; AssignFile(F, FN); Rewrite(F); if IOResult=0 then begin WriteLn(F, 'Тема: '+TopicEdit.Text); WriteLn(F, 'Сообщение:'); with MessagMemo.Lines do begin for I := 0 to Count-1 do WriteLn(F, Strings[I]); end; CloseFile(F); RunAndWait('notepad.exe '+FN, SW_SHOW, ResCode); Erase(F); end else MessageBox(Handle, PChar('Ошибка создания временного файла '+FN), MesTitle, MB_OK or MB_ICONERROR); end; end.
program MatrixSummen (input, output); { ueberprueft bei einer Matrix von integer-Zahlen, ob jede Spaltensumme groesser ist als die Zeilensumme einer angegebenen Zeile } const ZEILENMAX = 3; SPALTENMAX = 4; type tMatrix = array [1..ZEILENMAX, 1..SPALTENMAX] of integer; var Matrix : tMatrix; ZeilenNr, SpaltenNr, Eingabe : integer; function ZeilenSummeKleiner (var inMatrix : tMatrix; inZeilenNr : integer) : boolean; { ergibt true, falls die Summe aller Elemente mit dem uebergebenen Zeilenindex kleiner ist als jede Spaltensumme } var ZeilenSumme: integer; { Summe der eingegebenen Zeilenmatrix } SpaltenSumme: integer; { Summe einzelner Spalten bis SPALTENMAX } i: integer; { Laufvariable Zeilenmatrix } j: integer; { Laufvariable Spaltenmatrix } begin ZeilenSumme := 0; ZeilenSummeKleiner := true; { Bilden der Summe aller Spalten für die angegebene Zeile inZeilenNr} for i := 1 to SPALTENMAX do ZeilenSumme := ZeilenSumme + inMatrix[inZeilenNr][i]; j := 1; repeat { Durchlaufen, bis eine der Spaltensumme kleiner ist als die Zeilensumme } SpaltenSumme := 0; for i := 1 to ZEILENMAX do SpaltenSumme := SpaltenSumme + inMatrix[i][j]; j := j + 1; until (SpaltenSumme < ZeilenSumme) Or (j >= SPALTENMAX); { Erneut überprüfen, ob tatsächlich die Spaltensumme kleiner ist als Zeilensumme, den es gibt ja noch die Möglichkeit, dass einfach alle Spalten überprüft wurden bis j>= SPALTENMAX } if (SpaltenSumme <= ZeilenSumme) then ZeilenSummeKleiner := false; end;{ ZeilenSummeKleiner } begin { Matrixelemente einlesen } for ZeilenNr := 1 to ZEILENMAX Do for SpaltenNr := 1 to SPALTENMAX Do read (Matrix[ZeilenNr, SpaltenNr]); repeat write ('Welche Zeile soll ueberprueft werden ? (1..', ZEILENMAX, ') (anderes = Ende) '); readln (Eingabe); if (Eingabe > 0) And (Eingabe <= ZEILENMAX) then begin ZeilenNr := Eingabe; { hier wird die Funktion ZeilenSummeKleiner aufgerufen } if ZeilenSummeKleiner (Matrix,ZeilenNr) then writeln ('Jede Spaltensumme ist groesser als die ', 'Zeilensumme der ' , ZeilenNr, '. Zeile.') else writeln ('Es sind nicht alle Spaltensummen groesser als die ', 'Zeilensumme der ', ZeilenNr, '. Zeile.') end; until (Eingabe <= 0) Or (Eingabe > ZEILENMAX) end. { MatrixSummen }
{ ******************************************************* } { } { Delphi FireMonkey Platform } { } { Copyright(c) 2016 Embarcadero Technologies, Inc. } { All rights reserved } { } { ******************************************************* } unit FMX.Canvas.GPU; interface {$SCOPEDENUMS ON} {$HINTS OFF} uses System.Types, System.UITypes, System.UIConsts, System.Classes, System.Generics.Collections, System.Messaging, FMX.Types, FMX.Types3D, FMX.Graphics, FMX.Canvas.GPU.Helpers; type TCustomCanvasGpu = class; TBitmapCtx = class private [Weak] FCanvas: TCustomCanvasGpu; FTexture: TTexture; FRenderTarget: TTexture; FAccess: TMapAccess; FData: Pointer; FContextLostId: Integer; FContextBeforeLosingId: Integer; FWidth: Integer; FHeight: Integer; FBitmapScale: Single; FBytesPerLine: Integer; FPixelFormat: TPixelFormat; procedure ContextBeforeLosingHandler(const Sender: TObject; const Msg: TMessage); procedure ContextLostHandler(const Sender: TObject; const Msg: TMessage); function GetTexture: TTexture; function GetRenderTarget: TTexture; function GetPaintingTexture: TTexture; procedure CreateBuffer; procedure FreeBuffer; public constructor Create(const AWidth, AHeight: Integer; const AScale: Single); destructor Destroy; override; property Access: TMapAccess read FAccess write FAccess; property Canvas: TCustomCanvasGpu read FCanvas write FCanvas; property Texture: TTexture read GetTexture; property BytesPerLine: Integer read FBytesPerLine; property RenderTarget: TTexture read GetRenderTarget; property PaintingTexture: TTexture read GetPaintingTexture; property PixelFormat: TPixelFormat read FPixelFormat; property Height: Integer read FHeight; property Width: Integer read FWidth; end; TCustomCanvasGpu = class(TCanvas) private class var FModulateColor: TAlphaColor; FAlignToPixels: Boolean; FFlushCountPerFrame: Integer; FPrimitiveCountPerFrame: Integer; private FContext: TContext3D; public procedure DrawTexture(const ARect, ATexRect: TRectF; const AColor: TAlphaColor; const ATexture: TTexture); virtual; abstract; class property ModulateColor: TAlphaColor read FModulateColor write FModulateColor; class property AlignToPixels: Boolean read FAlignToPixels write FAlignToPixels; class property FlushCountPerFrame: Integer read FFlushCountPerFrame; class property PrimitiveCountPerFrame: Integer read FPrimitiveCountPerFrame; property Context: TContext3D read FContext; end; procedure RegisterCanvasClasses; procedure UnregisterCanvasClasses; implementation uses {$IFDEF MSWINDOWS} FMX.Platform.Win, {$ENDIF} System.Math, FMX.Consts, FMX.Platform, FMX.Forms, FMX.TextLayout, FMX.TextLayout.GPU, FMX.StrokeBuilder, System.Math.Vectors; const MinValidAlphaValue = 1 / 256; type TCanvasSaveStateCtx = class(TCanvasSaveState) private FClippingEnabled: Boolean; FSavedClipRect: TRect; protected procedure AssignTo(Dest: TPersistent); override; public procedure Assign(Source: TPersistent); override; property SavedClipRect: TRect read FSavedClipRect; end; TCanvasGpu = class(TCustomCanvasGpu, IModulateCanvas) private class var FCurrentCanvas: TCanvasGpu; FGlobalBeginScene: Integer; FCanvasHelper: TCanvasHelper; FStrokeBuilder: TStrokeBuilder; private [Weak] FSaveCanvas: TCanvasGpu; FSavedScissorRect: TRect; FClippingEnabled: Boolean; FCurrentClipRect: TRect; procedure InternalFillPolygon(const Points: TPolygon; const AOpacity: Single; const ABrush: TBrush; const PolyBounds: TRectF); class procedure CreateResources; class procedure FreeResources; private procedure AlignToPixel(var Point: TPointF); inline; function TransformBounds(const Bounds: TCornersF): TCornersF; inline; procedure TransformCallback(var Position: TPointF); { IModulateCanvas } function GetModulateColor: TAlphaColor; procedure SetModulateColor(const AColor: TAlphaColor); protected function TransformPoint(const P: TPointF): TPointF; reintroduce; inline; function TransformRect(const Rect: TRectF): TRectF; reintroduce; inline; function CreateSaveState: TCanvasSaveState; override; { begin and } function DoBeginScene(const AClipRects: PClipRects = nil; AContextHandle: THandle = 0): Boolean; override; procedure DoEndScene; override; procedure DoFlush; override; { creation } constructor CreateFromWindow(const AParent: TWindowHandle; const AWidth, AHeight: Integer; const AQuality: TCanvasQuality = TCanvasQuality.SystemDefault); override; constructor CreateFromBitmap(const ABitmap: TBitmap; const AQuality: TCanvasQuality = TCanvasQuality.SystemDefault); override; constructor CreateFromPrinter(const APrinter: TAbstractPrinter); override; { Bitmaps } class function DoInitializeBitmap(const Width, Height: Integer; const Scale: Single; var PixelFormat: TPixelFormat): THandle; override; class procedure DoFinalizeBitmap(var Bitmap: THandle); override; class function DoMapBitmap(const Bitmap: THandle; const Access: TMapAccess; var Data: TBitmapData): Boolean; override; class procedure DoUnmapBitmap(const Bitmap: THandle; var Data: TBitmapData); override; { states } procedure DoBlendingChanged; override; { drawing } procedure DoFillRect(const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); override; procedure DoFillPath(const APath: TPathData; const AOpacity: Single; const ABrush: TBrush); override; procedure DoFillEllipse(const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); override; function DoFillPolygon(const Points: TPolygon; const AOpacity: Single; const ABrush: TBrush): Boolean; override; procedure DoDrawBitmap(const ABitmap: TBitmap; const SrcRect, DstRect: TRectF; const AOpacity: Single; const HighSpeed: Boolean = False); override; procedure DoDrawLine(const APt1, APt2: TPointF; const AOpacity: Single; const ABrush: TStrokeBrush); override; procedure DoDrawRect(const ARect: TRectF; const AOpacity: Single; const ABrush: TStrokeBrush); override; function DoDrawPolygon(const Points: TPolygon; const AOpacity: Single; const ABrush: TStrokeBrush): Boolean; override; procedure DoDrawPath(const APath: TPathData; const AOpacity: Single; const ABrush: TStrokeBrush); override; procedure DoDrawEllipse(const ARect: TRectF; const AOpacity: Single; const ABrush: TStrokeBrush); override; public destructor Destroy; override; { caps } class function GetCanvasStyle: TCanvasStyles; override; class function GetAttribute(const Value: TCanvasAttribute) : Integer; override; { buffer } procedure SetSize(const AWidth, AHeight: Integer); override; procedure Clear(const Color: TAlphaColor); override; procedure ClearRect(const ARect: TRectF; const AColor: TAlphaColor = 0); override; { cliping } procedure IntersectClipRect(const ARect: TRectF); override; procedure ExcludeClipRect(const ARect: TRectF); override; { drawing } procedure MeasureLines(const ALines: TLineMetricInfo; const ARect: TRectF; const AText: string; const WordWrap: Boolean; const Flags: TFillTextFlags; const ATextAlign: TTextAlign; const AVTextAlign: TTextAlign = TTextAlign.Center); override; function PtInPath(const APoint: TPointF; const APath: TPathData) : Boolean; override; { external } procedure DrawTexture(const DstRect, SrcRect: TRectF; const AColor: TAlphaColor; const ATexture: TTexture); override; end; { TCanvasSaveStateCtx } procedure TCanvasSaveStateCtx.Assign(Source: TPersistent); var LSource: TCanvasGpu; begin inherited Assign(Source); if Source is TCanvasGpu then begin LSource := TCanvasGpu(Source); FClippingEnabled := LSource.FClippingEnabled; FSavedClipRect := LSource.FCurrentClipRect; end; end; procedure TCanvasSaveStateCtx.AssignTo(Dest: TPersistent); var LDest: TCanvasGpu; begin if Dest is TCanvasGpu then begin LDest := TCanvasGpu(Dest); LDest.FClippingEnabled := FClippingEnabled; LDest.FCurrentClipRect := FSavedClipRect; if FClippingEnabled then LDest.FCanvasHelper.ScissorRect := FSavedClipRect else begin LDest.FCanvasHelper.ResetScissorRect; LDest.FCanvasHelper.SetScissorRectWithoutUpdate(FSavedClipRect); end; end; inherited AssignTo(Dest); end; { TBitmapCtx } constructor TBitmapCtx.Create(const AWidth, AHeight: Integer; const AScale: Single); begin inherited Create; FHeight := AHeight; FWidth := AWidth; FBitmapScale := AScale; FPixelFormat := TContextManager.DefaultContextClass.PixelFormat; if FPixelFormat = TPixelFormat.None then raise ECannotFindSuitablePixelFormat.CreateResFmt (@SCannotFindSuitablePixelFormat, [ClassName]); FBytesPerLine := FWidth * PixelFormatBytes[FPixelFormat]; FAccess := TMapAccess.Read; FContextBeforeLosingId := TMessageManager.DefaultManager.SubscribeToMessage (TContextBeforeLosingMessage, ContextBeforeLosingHandler); FContextLostId := TMessageManager.DefaultManager.SubscribeToMessage (TContextLostMessage, ContextLostHandler); end; destructor TBitmapCtx.Destroy; begin TMessageManager.DefaultManager.Unsubscribe(TContextLostMessage, FContextLostId); TMessageManager.DefaultManager.Unsubscribe(TContextBeforeLosingMessage, FContextBeforeLosingId); if (TCanvasGpu.FCanvasHelper <> nil) and (TCanvasGpu.FGlobalBeginScene > 0) then TCanvasGpu.FCanvasHelper.Flush; if FRenderTarget <> nil then FRenderTarget.DisposeOf; if FTexture <> nil then FTexture.DisposeOf; FreeBuffer; inherited; end; procedure TBitmapCtx.CreateBuffer; begin if FData = nil then GetMem(FData, FHeight * FBytesPerLine); end; procedure TBitmapCtx.FreeBuffer; begin if FData <> nil then begin FreeMem(FData); FData := nil; end; end; procedure TBitmapCtx.ContextBeforeLosingHandler(const Sender: TObject; const Msg: TMessage); begin {$IFNDEF ANDROID} if (FTexture = nil) and (FRenderTarget <> nil) and (FBytesPerLine > 0) and (FCanvas <> nil) and (FCanvas.Context <> nil) then begin CreateBuffer; FCanvas.Context.CopyToBits(FData, FBytesPerLine, TRect.Create(0, 0, FWidth, FHeight)); end; {$ENDIF} end; procedure TBitmapCtx.ContextLostHandler(const Sender: TObject; const Msg: TMessage); begin {$IFNDEF ANDROID} if (FTexture = nil) and (FRenderTarget <> nil) and (FBytesPerLine > 0) and (FCanvas <> nil) and (FCanvas.Context <> nil) then begin FRenderTarget.DisposeOf; FRenderTarget := nil; end; {$ENDIF} if FTexture <> nil then begin FTexture.DisposeOf; FTexture := nil; end; end; function TBitmapCtx.GetPaintingTexture: TTexture; begin if FRenderTarget <> nil then Result := FRenderTarget else Result := Texture; end; function TBitmapCtx.GetRenderTarget: TTexture; begin if FRenderTarget = nil then begin FRenderTarget := TTexture.Create; FRenderTarget.SetSize(FWidth, FHeight); FRenderTarget.Style := [TTextureStyle.RenderTarget]; ITextureAccess(FRenderTarget).TextureScale := FBitmapScale; if FData <> nil then begin FRenderTarget.Initialize; FRenderTarget.UpdateTexture(FData, FBytesPerLine); end; if FTexture <> nil then begin FTexture.DisposeOf; FTexture := nil; end; end; Result := FRenderTarget; end; function TBitmapCtx.GetTexture: TTexture; begin if FTexture = nil then begin FTexture := TTexture.Create; FTexture.SetSize(FWidth, FHeight); FTexture.Style := [TTextureStyle.Dynamic, TTextureStyle.Volatile]; if FData <> nil then FTexture.UpdateTexture(FData, FBytesPerLine); end; Result := FTexture; end; { TCanvasGpu } function PrepareColor(const SrcColor: TAlphaColor; const Opacity: Single) : TAlphaColor; begin if Opacity < 1 then begin TAlphaColorRec(Result).R := Round(TAlphaColorRec(SrcColor).R * Opacity); TAlphaColorRec(Result).G := Round(TAlphaColorRec(SrcColor).G * Opacity); TAlphaColorRec(Result).B := Round(TAlphaColorRec(SrcColor).B * Opacity); TAlphaColorRec(Result).A := Round(TAlphaColorRec(SrcColor).A * Opacity); end else if (TAlphaColorRec(SrcColor).A < $FF) then Result := PremultiplyAlpha(SrcColor) else Result := SrcColor; end; constructor TCanvasGpu.CreateFromWindow(const AParent: TWindowHandle; const AWidth, AHeight: Integer; const AQuality: TCanvasQuality = TCanvasQuality.SystemDefault); var Multisample: TMultisample; begin inherited CreateFromWindow(AParent, AWidth, AHeight, AQuality); case Quality of TCanvasQuality.HighPerformance: Multisample := TMultisample.None; TCanvasQuality.HighQuality: Multisample := TMultisample.FourSamples; else Multisample := TMultisample.None; end; FContext := TContextManager.CreateFromWindow(AParent, AWidth, AHeight, Multisample, True); {$IFDEF MSWINDOWS} if WindowHandleToPlatform(Parent).Form.Transparency then WindowHandleToPlatform(Parent).CreateBuffer(Width, Height); {$ENDIF} end; constructor TCanvasGpu.CreateFromBitmap(const ABitmap: TBitmap; const AQuality: TCanvasQuality = TCanvasQuality.SystemDefault); var Multisample: TMultisample; H: TBitmapCtx; begin inherited CreateFromBitmap(ABitmap, AQuality); if not Bitmap.HandleAllocated then raise ECanvasException.Create('Handle not allocated'); case Quality of TCanvasQuality.HighPerformance: Multisample := TMultisample.None; TCanvasQuality.HighQuality: Multisample := TMultisample.FourSamples; else Multisample := TMultisample.None; end; H := TBitmapCtx(Bitmap.Handle); FContext := TContextManager.CreateFromTexture(H.RenderTarget, Multisample, True); H.Canvas := Self; end; constructor TCanvasGpu.CreateFromPrinter(const APrinter: TAbstractPrinter); begin // Just a stub implementation - not used. end; destructor TCanvasGpu.Destroy; begin if Bitmap <> nil then TBitmapCtx(Bitmap.Handle).Canvas := nil; FContext.DisposeOf; inherited Destroy; end; class function TCanvasGpu.GetCanvasStyle: TCanvasStyles; begin Result := [TCanvasStyle.NeedGPUSurface]; end; class function TCanvasGpu.GetAttribute(const Value: TCanvasAttribute): Integer; begin case Value of TCanvasAttribute.MaxBitmapSize: begin Result := TContextManager.DefaultContextClass.MaxTextureSize; end else Result := inherited; end; if Result < 0 then Result := $FFFF; end; function TCanvasGpu.CreateSaveState: TCanvasSaveState; begin Result := TCanvasSaveStateCtx.Create; end; procedure TCanvasGpu.Clear(const Color: TAlphaColor); begin if FContext <> nil then begin FCanvasHelper.Flush; FContext.Clear([TClearTarget.Color, TClearTarget.Depth, TClearTarget.Stencil], Color, 1, 0); end; end; procedure TCanvasGpu.ClearRect(const ARect: TRectF; const AColor: TAlphaColor); begin FCanvasHelper.Flush; try FContext.SetContextState(TContextState.csAlphaBlendOff); FCanvasHelper.FillRect(TransformBounds(CornersF(ARect)), AColor); FCanvasHelper.Flush; finally FContext.SetContextState(TContextState.csAlphaBlendOn); end; end; procedure TCanvasGpu.SetSize(const AWidth, AHeight: Integer); begin inherited; if FContext <> nil then FContext.SetSize(Width, Height); {$IFDEF MSWINDOWS} if (Parent <> nil) and WindowHandleToPlatform(Parent).Form.Transparency then WindowHandleToPlatform(Parent).ResizeBuffer(Width, Height); {$ENDIF} end; procedure TCanvasGpu.AlignToPixel(var Point: TPointF); procedure AlignValue(var Value: Single; const Scale: Single); inline; begin Value := Trunc(Value * Scale) / Scale; end; begin AlignValue(Point.X, Scale); AlignValue(Point.Y, Scale); end; function TCanvasGpu.TransformBounds(const Bounds: TCornersF): TCornersF; begin case MatrixMeaning of TMatrixMeaning.Unknown: begin Result[0] := Bounds[0] * Matrix; Result[1] := Bounds[1] * Matrix; Result[2] := Bounds[2] * Matrix; Result[3] := Bounds[3] * Matrix; end; TMatrixMeaning.Identity: Result := Bounds; TMatrixMeaning.Translate: begin Result[0] := Bounds[0] + MatrixTranslate; Result[1] := Bounds[1] + MatrixTranslate; Result[2] := Bounds[2] + MatrixTranslate; Result[3] := Bounds[3] + MatrixTranslate; end; end; if FAlignToPixels then begin AlignToPixel(Result[0]); AlignToPixel(Result[1]); AlignToPixel(Result[2]); AlignToPixel(Result[3]); end; end; function TCanvasGpu.TransformPoint(const P: TPointF): TPointF; begin Result := inherited; if FAlignToPixels then AlignToPixel(Result); end; function TCanvasGpu.TransformRect(const Rect: TRectF): TRectF; begin Result := inherited; if FAlignToPixels then begin AlignToPixel(Result.TopLeft); AlignToPixel(Result.BottomRight); end; end; function TCanvasGpu.DoBeginScene(const AClipRects: PClipRects; AContextHandle: THandle): Boolean; begin if FGlobalBeginScene = 0 then begin FCanvasHelper.SetContext(Context); FCanvasHelper.BeginRender; TTextLayoutNG.BeginRender; end else begin FCanvasHelper.Flush; FCanvasHelper.SetContext(Context); FContext.SetMatrix(TMatrix3D.Identity); FContext.SetContextState(TContextState.cs2DScene); FContext.SetContextState(TContextState.csAllFace); FContext.SetContextState(TContextState.csZWriteOff); FContext.SetContextState(TContextState.csZTestOff); end; Inc(FGlobalBeginScene); FSaveCanvas := FCurrentCanvas; if (FSaveCanvas <> nil) and FSaveCanvas.FClippingEnabled then FSavedScissorRect := FCanvasHelper.ScissorRect; FCurrentCanvas := Self; Result := inherited DoBeginScene(AClipRects) and (FContext <> nil) and FContext.BeginScene; if Result then begin FClippingEnabled := False; FCurrentClipRect := TRect.Create(0, 0, Width, Height); FCanvasHelper.ResetScissorRect; FCanvasHelper.UpdateDrawingMode; end; end; procedure TCanvasGpu.DoEndScene; begin if FContext <> nil then begin FCanvasHelper.Flush; FContext.EndScene; if FSaveCanvas <> nil then begin FCanvasHelper.SetContext(FSaveCanvas.FContext); if FSaveCanvas.FClippingEnabled then FCanvasHelper.ScissorRect := FSavedScissorRect; end; FCurrentCanvas := FSaveCanvas; FSaveCanvas := nil; Dec(FGlobalBeginScene); if FGlobalBeginScene = 0 then begin FCanvasHelper.EndRender; TTextLayoutNG.EndRender; FFlushCountPerFrame := FCanvasHelper.FlushCountPerFrame; FPrimitiveCountPerFrame := FCanvasHelper.PrimitiveCountPerFrame; end; {$IFDEF MSWINDOWS} if (Parent <> nil) and WindowHandleToPlatform(Parent).Form.Transparency then Context.CopyToBits(WindowHandleToPlatform(Parent).BufferBits, Width * 4, Rect(0, 0, Width, Height)); {$ENDIF} end; inherited; end; procedure TCanvasGpu.DoBlendingChanged; begin inherited; if FContext <> nil then begin FCanvasHelper.Flush; if Blending then FContext.SetContextState(TContextState.csAlphaBlendOn) else FContext.SetContextState(TContextState.csAlphaBlendOff); end; end; procedure TCanvasGpu.IntersectClipRect(const ARect: TRectF); var Intersection: TRect; TopLeft, BottomRight: TPointF; begin FClippingEnabled := True; TopLeft := ARect.TopLeft * Matrix; BottomRight := ARect.BottomRight * Matrix; Intersection := TRect.Intersect(FCurrentClipRect, Rect(Trunc(TopLeft.X), Trunc(TopLeft.Y), Round(BottomRight.X), Round(BottomRight.Y))); FCurrentClipRect := Intersection; FCanvasHelper.ScissorRect := Intersection; end; procedure TCanvasGpu.ExcludeClipRect(const ARect: TRectF); begin end; class procedure TCanvasGpu.CreateResources; begin FCanvasHelper := TCanvasHelper.Create; FStrokeBuilder := TStrokeBuilder.Create; end; procedure TCanvasGpu.DoFlush; begin if FCanvasHelper <> nil then FCanvasHelper.Flush; end; class procedure TCanvasGpu.FreeResources; begin FStrokeBuilder.Free; FCanvasHelper.Free; end; function GetStrokeOpacity(const AOpacity: Single; const ABrush: TStrokeBrush): Single; const MinValidStrokeThickness = 2 / 256; begin if ABrush.Thickness < 1 then if ABrush.Thickness < MinValidStrokeThickness then Result := 0 else Result := AOpacity * (ABrush.Thickness - MinValidStrokeThickness) / (1 - MinValidStrokeThickness) else Result := AOpacity; end; procedure TCanvasGpu.DoDrawLine(const APt1, APt2: TPointF; const AOpacity: Single; const ABrush: TStrokeBrush); var LOpacity: Single; begin LOpacity := GetStrokeOpacity(AOpacity, ABrush); if LOpacity >= MinValidAlphaValue then begin FStrokeBuilder.Matrix := Matrix; FStrokeBuilder.Brush := ABrush; FStrokeBuilder.BuildLine(APt1, APt2, LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; end; end; procedure TCanvasGpu.DoDrawRect(const ARect: TRectF; const AOpacity: Single; const ABrush: TStrokeBrush); var LOpacity: Single; begin LOpacity := GetStrokeOpacity(AOpacity, ABrush); if LOpacity >= MinValidAlphaValue then begin FStrokeBuilder.Matrix := Matrix; FStrokeBuilder.Brush := ABrush; FStrokeBuilder.BuildLine(ARect.TopLeft, ARect.TopLeft + PointF(ARect.Width, 0.0), LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; FStrokeBuilder.BuildLine(ARect.TopLeft + PointF(ARect.Width, 0.0), ARect.BottomRight, LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; FStrokeBuilder.BuildLine(ARect.BottomRight, ARect.TopLeft + PointF(0.0, ARect.Height), LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; FStrokeBuilder.BuildLine(ARect.TopLeft + PointF(0.0, ARect.Height), ARect.TopLeft, LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; end; end; procedure TCanvasGpu.DoDrawEllipse(const ARect: TRectF; const AOpacity: Single; const ABrush: TStrokeBrush); var LOpacity: Single; Center, Radius: TPointF; begin LOpacity := GetStrokeOpacity(AOpacity, ABrush); if LOpacity >= MinValidAlphaValue then begin if (ARect.Width >= 0) and (ARect.Height >= 0) then begin FStrokeBuilder.Matrix := Matrix; FStrokeBuilder.Brush := ABrush; Center.X := (ARect.Left + ARect.Right) / 2; Center.Y := (ARect.Top + ARect.Bottom) / 2; Radius.X := ARect.Width / 2; Radius.Y := ARect.Height / 2; if (ABrush.Dash <> TStrokeDash.Solid) and (ABrush.Dash <> TStrokeDash.Custom) then FStrokeBuilder.BuildIntermEllipse(Center, Radius, LOpacity) else FStrokeBuilder.BuildSolidEllipse(Center, Radius, LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; end; end; end; function TCanvasGpu.DoDrawPolygon(const Points: TPolygon; const AOpacity: Single; const ABrush: TStrokeBrush): Boolean; var LOpacity: Single; begin LOpacity := GetStrokeOpacity(AOpacity, ABrush); if LOpacity >= MinValidAlphaValue then begin FStrokeBuilder.Matrix := Matrix; FStrokeBuilder.Brush := ABrush; if (ABrush.Dash <> TStrokeDash.Solid) and (ABrush.Dash <> TStrokeDash.Custom) then FStrokeBuilder.BuildIntermPolygon(Points, LOpacity) else FStrokeBuilder.BuildSolidPolygon(Points, LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; end; Result := True; end; procedure TCanvasGpu.DoDrawPath(const APath: TPathData; const AOpacity: Single; const ABrush: TStrokeBrush); var LOpacity: Single; begin LOpacity := GetStrokeOpacity(AOpacity, ABrush); if LOpacity >= MinValidAlphaValue then begin FStrokeBuilder.Matrix := Matrix; FStrokeBuilder.Brush := ABrush; if (ABrush.Dash <> TStrokeDash.Solid) and (ABrush.Dash <> TStrokeDash.Custom) then FStrokeBuilder.BuildIntermPath(APath, LOpacity) else FStrokeBuilder.BuildSolidPath(APath, LOpacity); if Length(FStrokeBuilder.Indices) > 2 then begin FCanvasHelper.FillTriangles(FStrokeBuilder.Vertices, FStrokeBuilder.Colors, FStrokeBuilder.Indices, Length(FStrokeBuilder.Vertices), Length(FStrokeBuilder.Indices) div 3); Inc(FPrimitiveCountPerFrame); end; end; end; procedure TCanvasGpu.DoFillRect(const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); var B: TBitmapCtx; Bmp: TBitmap; DstRect: TRectF; Gradient: TGradient; begin if FContext <> nil then begin if ABrush.Kind = TBrushKind.Gradient then begin if AOpacity < 1 then begin Gradient := TGradient.Create; Gradient.Assign(ABrush.Gradient); Gradient.ApplyOpacity(AOpacity); FCanvasHelper.GradientRect(TransformBounds(CornersF(ARect)), Gradient); Gradient.Free; end else FCanvasHelper.GradientRect(TransformBounds(CornersF(ARect)), ABrush.Gradient); end else if ABrush.Kind = TBrushKind.Bitmap then begin Bmp := ABrush.Bitmap.Bitmap; if Bmp.HandleAllocated then begin B := TBitmapCtx(Bmp.Handle); case ABrush.Bitmap.WrapMode of TWrapMode.Tile: FCanvasHelper.TexQuad(TransformPoint(PointF(ARect.Left, ARect.Top)), TransformPoint(PointF(ARect.Right, ARect.Top)), TransformPoint(PointF(ARect.Right, ARect.Bottom)), TransformPoint(PointF(ARect.Left, ARect.Bottom)), PointF(0, 0), PointF(ARect.Width / Bmp.Width, 0), PointF(ARect.Width / Bmp.Width, ARect.Height / Bmp.Height), PointF(0, ARect.Height / Bmp.Height), PrepareColor(FModulateColor, AOpacity), B.PaintingTexture); TWrapMode.TileOriginal: begin DstRect := RectF(0, 0, Bmp.Width, Bmp.Height); IntersectRect(DstRect, DstRect, ARect); FCanvasHelper.TexRect(TransformBounds(CornersF(DstRect)), CornersF(DstRect), B.PaintingTexture, PrepareColor(FModulateColor, AOpacity)); end; TWrapMode.TileStretch: FCanvasHelper.TexRect(TransformBounds(CornersF(ARect)), B.PaintingTexture, PrepareColor(FModulateColor, AOpacity)); end; end; end else FCanvasHelper.FillRect(TransformBounds(CornersF(ARect)), PrepareColor(ABrush.Color, AOpacity)); end; end; procedure TCanvasGpu.TransformCallback(var Position: TPointF); begin Position := TransformPoint(Position); end; procedure TCanvasGpu.DoFillEllipse(const ARect: TRectF; const AOpacity: Single; const ABrush: TBrush); var B: TBitmapCtx; Bmp: TBitmap; DstRect: TRectF; Gradient: TGradient; begin if (ARect.Width >= 0) and (ARect.Height >= 0) and (FContext <> nil) then begin if ABrush.Kind = TBrushKind.Gradient then begin if AOpacity < 1 then begin Gradient := TGradient.Create; Gradient.Assign(ABrush.Gradient); Gradient.ApplyOpacity(AOpacity); FCanvasHelper.GradientEllipse(ARect, Gradient, TransformCallback); Gradient.Free; end else FCanvasHelper.GradientEllipse(ARect, ABrush.Gradient, TransformCallback); end else if ABrush.Kind = TBrushKind.Bitmap then begin Bmp := ABrush.Bitmap.Bitmap; if Bmp.HandleAllocated then begin B := TBitmapCtx(Bmp.Handle); case ABrush.Bitmap.WrapMode of TWrapMode.Tile: FCanvasHelper.TexEllipse(ARect, TRectF.Create(0, 0, ARect.Width / Bmp.Width, ARect.Height / Bmp.Height), PrepareColor(FModulateColor, AOpacity), B.PaintingTexture, TransformCallback); TWrapMode.TileOriginal: begin DstRect := TRectF.Create(0, 0, Bmp.Width, Bmp.Height); IntersectRect(DstRect, DstRect, ARect); FCanvasHelper.TexEllipse(ARect, RectF(0, 0, ARect.Width / DstRect.Width, ARect.Height / DstRect.Height), PrepareColor(FModulateColor, AOpacity), B.PaintingTexture, TransformCallback); end; TWrapMode.TileStretch: FCanvasHelper.TexEllipse(ARect, PrepareColor(FModulateColor, AOpacity), B.PaintingTexture, TransformCallback); end; end; end else FCanvasHelper.FillEllipse(ARect, PrepareColor(ABrush.Color, AOpacity), TransformCallback); end; end; procedure TCanvasGpu.MeasureLines(const ALines: TLineMetricInfo; const ARect: TRectF; const AText: string; const WordWrap: Boolean; const Flags: TFillTextFlags; const ATextAlign: TTextAlign; const AVTextAlign: TTextAlign); begin end; { Bitmaps } class function TCanvasGpu.DoInitializeBitmap(const Width, Height: Integer; const Scale: Single; var PixelFormat: TPixelFormat): THandle; var H: TBitmapCtx; begin H := TBitmapCtx.Create(Width, Height, Scale); {$IFDEF AUTOREFCOUNT} H.__ObjAddRef; {$ENDIF} Result := THandle(H); PixelFormat := H.PixelFormat; end; class procedure TCanvasGpu.DoFinalizeBitmap(var Bitmap: THandle); var H: TBitmapCtx; begin H := TBitmapCtx(Bitmap); {$IFDEF AUTOREFCOUNT} H.__ObjRelease; {$ENDIF} H.DisposeOf; end; class function TCanvasGpu.DoMapBitmap(const Bitmap: THandle; const Access: TMapAccess; var Data: TBitmapData): Boolean; var Handle: TBitmapCtx; Context: TContext3D; begin Handle := TBitmapCtx(Bitmap); Handle.FAccess := Access; Handle.CreateBuffer; Data.Data := Handle.FData; Data.Pitch := Handle.FBytesPerLine; if Access <> TMapAccess.Write then begin if Handle.Canvas <> nil then TCanvasGpu(Handle.Canvas).Context.CopyToBits(Data.Data, Data.Pitch, TRect.Create(0, 0, Handle.Width, Handle.Height)) else if Handle.FRenderTarget <> nil then begin Context := TContextManager.CreateFromTexture(Handle.FRenderTarget, TMultisample.None, False); try Context.CopyToBits(Data.Data, Data.Pitch, Rect(0, 0, Handle.Width, Handle.Height)) finally Context.DisposeOf; end; end; end; if Access <> TMapAccess.Read then begin if Handle.FTexture <> nil then Handle.FTexture.DisposeOf; Handle.FTexture := nil; end; Result := True; end; class procedure TCanvasGpu.DoUnmapBitmap(const Bitmap: THandle; var Data: TBitmapData); var H: TBitmapCtx; begin H := TBitmapCtx(Bitmap); if (H.Access <> TMapAccess.Read) and (H.FRenderTarget <> nil) then H.FRenderTarget.UpdateTexture(H.FData, H.FBytesPerLine); if H.FRenderTarget <> nil then H.FreeBuffer; end; procedure TCanvasGpu.DrawTexture(const DstRect, SrcRect: TRectF; const AColor: TAlphaColor; const ATexture: TTexture); begin FCanvasHelper.TexRect(TransformBounds(CornersF(DstRect)), CornersF(SrcRect.Left, SrcRect.Top, SrcRect.Width, SrcRect.Height), ATexture, $FFFFFFFF); end; procedure TCanvasGpu.DoDrawBitmap(const ABitmap: TBitmap; const SrcRect, DstRect: TRectF; const AOpacity: Single; const HighSpeed: Boolean); var B: TBitmapCtx; Bmp: TBitmap; begin if FContext <> nil then begin Bmp := ABitmap; if Bmp.HandleAllocated then begin B := TBitmapCtx(Bmp.Handle); FCanvasHelper.TexRect(TransformBounds(CornersF(DstRect)), CornersF(SrcRect.Left, SrcRect.Top, SrcRect.Width, SrcRect.Height), B.PaintingTexture, PrepareColor(FModulateColor, AOpacity)); end; end; end; { Path } function TCanvasGpu.PtInPath(const APoint: TPointF; const APath: TPathData): Boolean; var Polygon: TPolygon; I, PointCount: Integer; Temp1, Temp2: TPointF; begin Result := False; if APath = nil then Exit; APath.FlattenToPolygon(Polygon, 1); PointCount := Length(Polygon); if PointCount < 3 then Exit; Temp1 := Polygon[0]; for I := 0 to PointCount - 1 do begin Temp2 := Polygon[(I + 1) mod PointCount]; if APoint.Y > Min(Temp1.Y, Temp2.Y) then if APoint.Y <= Max(Temp1.Y, Temp2.Y) then if APoint.X <= Max(Temp1.X, Temp2.X) then if not SameValue(Temp1.Y, Temp2.Y, TEpsilon.Vector) then begin if SameValue(Temp1.X, Temp2.X, TEpsilon.Vector) or (APoint.X <= (APoint.Y - Temp1.Y) * (Temp2.X - Temp1.X) / (Temp2.Y - Temp1.Y) + Temp1.X) then Result := not Result; end; Temp1 := Temp2; end; end; procedure TCanvasGpu.InternalFillPolygon(const Points: TPolygon; const AOpacity: Single; const ABrush: TBrush; const PolyBounds: TRectF); var DstRect: TRectF; Vertices: TCanvasHelper.TVertexArray; Colors: TCanvasHelper.TAlphaColorArray; FillColors: TCanvasHelper.TAlphaColorArray; TexCoords: TCanvasHelper.TVertexArray; Indices: TCanvasHelper.TIndexArray; Point: TPointF; InitIndex, CurIndex, PrevIndex, PlaceAt: Integer; PrevMode: TDrawingMode; B: TBitmapCtx; Bmp: TBitmap; Gradient: TGradient; begin InitIndex := -1; PrevIndex := -1; CurIndex := 0; SetLength(Vertices, 0); SetLength(Colors, 0); SetLength(Indices, 0); SetLength(TexCoords, 0); Bmp := nil; if ABrush.Kind = TBrushKind.Bitmap then Bmp := ABrush.Bitmap.Bitmap; for Point in Points do begin if (Point.X < $FFFF) and (Point.Y < $FFFF) then begin PlaceAt := Length(Vertices); SetLength(Vertices, PlaceAt + 1); Vertices[PlaceAt] := TransformPoint(Point); PlaceAt := Length(Colors); SetLength(Colors, PlaceAt + 1); Colors[PlaceAt] := PrepareColor($FFFFFFFF, AOpacity); SetLength(FillColors, PlaceAt + 1); FillColors[PlaceAt] := PrepareColor(ABrush.Color, AOpacity); SetLength(TexCoords, PlaceAt + 1); if (ABrush.Kind = TBrushKind.Bitmap) and (ABrush.Bitmap.WrapMode = TWrapMode.Tile) and (Bmp <> nil) and not Bmp.IsEmpty then TexCoords[PlaceAt] := TPointF.Create((Point.X - PolyBounds.Left) / Bmp.Width, (Point.Y - PolyBounds.Top) / Bmp.Height) else TexCoords[PlaceAt] := TPointF.Create((Point.X - PolyBounds.Left) / PolyBounds.Width, (Point.Y - PolyBounds.Top) / PolyBounds.Height); if InitIndex = -1 then InitIndex := CurIndex; if (InitIndex <> -1) and (PrevIndex <> -1) and (InitIndex <> PrevIndex) then begin PlaceAt := Length(Indices); SetLength(Indices, PlaceAt + 3); Indices[PlaceAt] := InitIndex; Indices[PlaceAt + 1] := PrevIndex; Indices[PlaceAt + 2] := CurIndex; end; PrevIndex := CurIndex; Inc(CurIndex); end else begin InitIndex := -1; PrevIndex := -1; end; end; PrevMode := FCanvasHelper.DrawingMode; if Bitmap <> nil then begin // Clear working stencil surface before drawing shape. FCanvasHelper.DrawingMode := TDrawingMode.ClearStencil; FCanvasHelper.FillTriangles(Vertices, Colors, Indices, Length(Vertices), Length(Indices) div 3); end; FCanvasHelper.DrawingMode := TDrawingMode.WriteStencilInvert; FCanvasHelper.FillTriangles(Vertices, Colors, Indices, Length(Vertices), Length(Indices) div 3); FCanvasHelper.DrawingMode := TDrawingMode.ReadStencil; if ABrush.Kind = TBrushKind.Gradient then begin if AOpacity < 1 then begin Gradient := TGradient.Create; Gradient.Assign(ABrush.Gradient); Gradient.ApplyOpacity(AOpacity); FCanvasHelper.GradientTriangles(Gradient, Vertices, TexCoords, Indices, Length(Vertices), Length(Indices) div 3); Gradient.Free; end else FCanvasHelper.GradientTriangles(ABrush.Gradient, Vertices, TexCoords, Indices, Length(Vertices), Length(Indices) div 3) end else if (ABrush.Kind = TBrushKind.Bitmap) and (Bmp <> nil) and Bmp.HandleAllocated then begin B := TBitmapCtx(Bmp.Handle); case ABrush.Bitmap.WrapMode of TWrapMode.Tile: FCanvasHelper.TexTriangles(B.PaintingTexture, Vertices, TexCoords, Colors, Indices, Length(Vertices), Length(Indices) div 3); TWrapMode.TileOriginal: begin DstRect := TRectF.Create(0, 0, Bmp.Width, Bmp.Height); IntersectRect(DstRect, DstRect, PolyBounds); FCanvasHelper.TexRect(TransformBounds(CornersF(DstRect)), CornersF(DstRect), B.PaintingTexture, PrepareColor(FModulateColor, AOpacity)); end; TWrapMode.TileStretch: FCanvasHelper.TexTriangles(B.PaintingTexture, Vertices, TexCoords, Colors, Indices, Length(Vertices), Length(Indices) div 3); end; end else FCanvasHelper.FillTriangles(Vertices, FillColors, Indices, Length(Vertices), Length(Indices) div 3); FCanvasHelper.DrawingMode := TDrawingMode.ClearStencil; FCanvasHelper.FillTriangles(Vertices, Colors, Indices, Length(Vertices), Length(Indices) div 3); FCanvasHelper.DrawingMode := PrevMode; end; function TCanvasGpu.DoFillPolygon(const Points: TPolygon; const AOpacity: Single; const ABrush: TBrush): Boolean; function ComputeBounds(const Points: TPolygon): TRectF; var P: TPointF; begin if Length(Points) > 0 then begin Result.Left := High(Integer); Result.Top := High(Integer); Result.Right := Low(Integer); Result.Bottom := Low(Integer); for P in Points do begin Result.Left := Min(Result.Left, P.X); Result.Top := Min(Result.Top, P.Y); Result.Right := Max(Result.Right, P.X); Result.Bottom := Max(Result.Bottom, P.Y); end; end else Result := TRectF.Create(0, 0, 0, 0); end; begin InternalFillPolygon(Points, AOpacity, ABrush, ComputeBounds(Points)); Result := True; end; procedure TCanvasGpu.DoFillPath(const APath: TPathData; const AOpacity: Single; const ABrush: TBrush); var Points: TPolygon; begin APath.FlattenToPolygon(Points, 1); InternalFillPolygon(Points, AOpacity, ABrush, APath.GetBounds); end; function TCanvasGpu.GetModulateColor: TAlphaColor; begin Result := FModulateColor; end; procedure TCanvasGpu.SetModulateColor(const AColor: TAlphaColor); begin FModulateColor := AColor; end; procedure RegisterCanvasClasses; begin TCanvasManager.RegisterCanvas(TCanvasGpu, True, False); TTextLayoutManager.RegisterTextLayout(TTextLayoutNG, TCanvasGpu); TCanvasGpu.CreateResources; end; procedure UnregisterCanvasClasses; begin TCanvasGpu.FreeResources; end; initialization TCustomCanvasGpu.ModulateColor := $FFFFFFFF; TCustomCanvasGpu.AlignToPixels := False; end.
unit ANovoPlanoCorte; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, formularios, Grids, CGrades, Componentes1, ExtCtrls, PainelGradiente, UnDadosProduto, StdCtrls, Localizacao, Mask, numericos, Buttons, UnOrdemProducao, DBKeyViolation, Constantes; type TFNovoPlanoCorte = class(TFormularioPermissao) PainelGradiente1: TPainelGradiente; PanelColor1: TPanelColor; PanelColor2: TPanelColor; Grade: TRBStringGridColor; Localiza: TConsultaPadrao; Label7: TLabel; Label15: TLabel; SpeedButton6: TSpeedButton; Label16: TLabel; EPlanoCorte: Tnumerico; EFilial: TEditLocaliza; EDatEmissao: TEditColor; Label1: TLabel; BAdicionar: TBitBtn; BCancelar: TBitBtn; BGravar: TBitBtn; BImprimir: TBitBtn; BFechar: TBitBtn; ENumCNC: Tnumerico; Label2: TLabel; Label8: TLabel; SpeedButton2: TSpeedButton; LMateriaPrima: TLabel; EMateriaPrima: TEditColor; ValidaGravacao1: TValidaGravacao; EPerUtilizacaoChapa: Tnumerico; Label3: TLabel; EChapa: TEditColor; SpeedButton1: TSpeedButton; Label4: TLabel; CPecaAvulsa: TCheckBox; procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure BFecharClick(Sender: TObject); procedure BAdicionarClick(Sender: TObject); procedure GradeCarregaItemGrade(Sender: TObject; VpaLinha: Integer); procedure BGravarClick(Sender: TObject); procedure GradeDadosValidos(Sender: TObject; var VpaValidos: Boolean); procedure GradeMudouLinha(Sender: TObject; VpaLinhaAtual, VpaLinhaAnterior: Integer); procedure BCancelarClick(Sender: TObject); procedure BImprimirClick(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure GradeAntesExclusao(Sender: TObject; var VpaPermiteExcluir: Boolean); procedure GradeDepoisExclusao(Sender: TObject); procedure EMateriaPrimaKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure SpeedButton2Click(Sender: TObject); procedure EMateriaPrimaChange(Sender: TObject); procedure EMateriaPrimaExit(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); private { Private declarations } VprOperacao : TRBDOperacaoCadastro; VprAcao : Boolean; VprDPlanoCorte : TRBDPlanoCorteCorpo; VprDItemPlanoCorte : TRBDPlanoCorteItem; procedure CarTitulosGrade; procedure InicilizaTela; procedure CarDTela; procedure EstadoBotoes(VpaEstado : Boolean); function DadosValidos : String; procedure CarDClasse; procedure CancelaPlanoCorte; function DadosAcoValidos : boolean; function LocalizaMateriaPrima : Boolean; function ExisteMateriaPrima : Boolean; public { Public declarations } function NovoPlanoCorte : Boolean; end; var FNovoPlanoCorte: TFNovoPlanoCorte; implementation uses APrincipal, FunObjeto, ConstMsg, ALocalizaFracaoOP, ALocalizaProdutos, UnProdutos, ANovaNotaFiscaisFor, AMostraEstoqueChapas; {$R *.DFM} { ****************** Na criação do Formulário ******************************** } procedure TFNovoPlanoCorte.FormCreate(Sender: TObject); begin { abre tabelas } { chamar a rotina de atualização de menus } VprAcao := false; CarTitulosGrade; VprDPlanoCorte := TRBDPlanoCorteCorpo.cria; end; { ******************* Quando o formulario e fechado ************************** } procedure TFNovoPlanoCorte.FormClose(Sender: TObject; var Action: TCloseAction); begin { fecha tabelas } { chamar a rotina de atualização de menus } VprDPlanoCorte.free; Action := CaFree; end; {((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( Ações Diversas )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))} {******************************************************************************} procedure TFNovoPlanoCorte.CarTitulosGrade; begin Grade.Cells[1,0] := 'ID'; Grade.Cells[2,0] := 'Quantidade'; Grade.Cells[3,0] := 'Código'; Grade.Cells[4,0] := 'Produto'; end; {******************************************************************************} procedure TFNovoPlanoCorte.InicilizaTela; begin LimpaComponentes(PanelColor1,0); VprDPlanoCorte.free; VprDPlanoCorte := TRBDPlanoCorteCorpo.cria; Grade.ADados := VprDPlanoCorte.Itens; Grade.CarregaGrade; with VprDPlanoCorte do begin CodFilial := varia.CodigoEmpFil; DatEmissao := now; SeqPlanoCorte := 0; CodUsuario := varia.CodigoUsuario; end; CarDTela; ActiveControl := EMateriaPrima; EstadoBotoes(true); ValidaGravacao1.execute; end; {******************************************************************************} function TFNovoPlanoCorte.LocalizaMateriaPrima: Boolean; begin FlocalizaProduto := TFlocalizaProduto.CriarSDI(self,'',true); result := FlocalizaProduto.LocalizaProduto(VprDPlanoCorte.SeqMateriaPrima,VprDPlanoCorte.CodMateriaPrima,VprDPlanoCorte.NomMateriaPrima,VprDPlanoCorte.DensidadeVolumetricaMP,VprDPlanoCorte.EspessuraChapaMP); FlocalizaProduto.Free; if result then result := DadosAcoValidos; if result then begin EMateriaPrima.Text := VprDPlanoCorte.CodMateriaPrima; LMateriaPrima.Caption := VprDPlanoCorte.NomMateriaPrima; end; end; {******************************************************************************} procedure TFNovoPlanoCorte.CarDTela; begin EFilial.AInteiro := VprDPlanoCorte.CodFilial; EFilial.Atualiza; EPlanoCorte.AsInteger := VprDPlanoCorte.SeqPlanoCorte; EDatEmissao.Text := FormatDateTime('DD/MM/YYYY HH:MM:SS', VprDPlanoCorte.DatEmissao); ENumCNC.AsInteger := VprDPlanoCorte.NumCNC; EMateriaPrima.Text := VprDPlanoCorte.CodMateriaPrima; LMateriaPrima.Caption := VprDPlanoCorte.NomMateriaPrima; end; {******************************************************************************} procedure TFNovoPlanoCorte.EMateriaPrimaChange(Sender: TObject); begin if VprOperacao in [ocInsercao,ocEdicao] then ValidaGravacao1.execute; end; {******************************************************************************} procedure TFNovoPlanoCorte.EMateriaPrimaExit(Sender: TObject); begin ExisteMateriaPrima; end; {******************************************************************************} procedure TFNovoPlanoCorte.EMateriaPrimaKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin case key of VK_F3 : LocalizaMateriaPrima; end; end; procedure TFNovoPlanoCorte.EstadoBotoes(VpaEstado : Boolean); begin BGravar.Enabled := VpaEstado; BCancelar.Enabled := VpaEstado; BAdicionar.Enabled := VpaEstado; BImprimir.Enabled := not VpaEstado; BFechar.Enabled := not VpaEstado; end; {******************************************************************************} function TFNovoPlanoCorte.ExisteMateriaPrima: Boolean; begin result := true; if EMateriaPrima.Text <> '' then begin result := FunProdutos.ExisteProduto(EMateriaPrima.Text,VprDPlanoCorte.SeqMateriaPrima,VprDPlanoCorte.NomMateriaPrima,VprDPlanoCorte.DensidadeVolumetricaMP,VprDPlanoCorte.EspessuraChapaMP); if result then LMateriaPrima.Caption := VprDPlanoCorte.NomMateriaPrima else result := LocalizaMateriaPrima; if result then begin result := DadosAcoValidos; end; end; if not result then begin EMateriaPrima.Clear; LMateriaPrima.Caption := ''; end; end; {******************************************************************************} function TFNovoPlanoCorte.DadosAcoValidos: boolean; begin result := true; if (VprDPlanoCorte.DensidadeVolumetricaMP = 0) then begin aviso('DENSIDADE VOLUMÉTRICA NÃO PREENCHIDA!!!'#13'É necessário preencher a densidade volumetrica da materia prima.'); result := false; end; if result then begin if (VprDPlanoCorte.EspessuraChapaMP = 0) then begin aviso('ESPESSURA AÇO NÃO PREENCHIDA!!!'#13'É necessário preencher a espessura da chapa de aço.'); result := false; end; end; end; {******************************************************************************} function TFNovoPlanoCorte.DadosValidos : String; var VpfLaco : Integer; VpfDItemPlanoCorte : TRBDPlanoCorteItem; begin result := ''; if VprDPlanoCorte.Itens.Count = 0 then result := 'NENHUM PRODUTO FOI ADICIONADO!!!'#13+'É necessário adicionar pelo menos 1 produto'; if result = '' then begin for VpfLaco := 0 to VprDPlanoCorte.Itens.Count - 1 do begin VpfDItemPlanoCorte := TRBDPlanoCorteItem(VprDPlanoCorte.Itens[VpfLaco]); if VpfDItemPlanoCorte.SeqIdentificacao = 0 then result := 'IDENTIFICAÇÃO NÃO PREENCHIDA!!!'#13'É necessário preencher a identificação de todos os produtos.'; end; end; if Result = '' then begin if CPecaAvulsa.Checked then begin if EPerUtilizacaoChapa.AValor <> 0 then Result :='PERCENTUAL UTILIZAÇÃO DA CHAPA NÃO PODE SER PREENCHIDO!!!'#13'Não é permitido preencher o percentual de utilização da chapa quando a peça é avulsa.'; if VprDPlanoCorte.SeqChapa <> 0 then Result :='A CHAPA NÃO PODE SER PREENCHIDO!!!'#13'Não é permitido preencher a chapa quando a peça é avulsa.'; end else begin if EPerUtilizacaoChapa.AValor = 0 then Result :='PERCENTUAL UTILIZAÇÃO DA CHAPA NÃO PREENCHIDO!!!'#13'É necessário preencher o percentual de utilização da chapa'; end; end; end; {******************************************************************************} procedure TFNovoPlanoCorte.CarDClasse; begin VprDPlanoCorte.NumCNC := ENumCNC.AsInteger; VprDPlanoCorte.PerChapa := EPerUtilizacaoChapa.AValor; VprDPlanoCorte.SeqChapa := EChapa.AInteiro; end; {******************************************************************************} procedure TFNovoPlanoCorte.CancelaPlanoCorte; begin FunOrdemProducao.ExtornaPlanoCortecomImpresso(VprDPlanoCorte); end; {******************************************************************************} function TFNovoPlanoCorte.NovoPlanoCorte : Boolean; begin VprOperacao := ocInsercao; InicilizaTela; showmodal; result := VprAcao; end; {******************************************************************************} procedure TFNovoPlanoCorte.SpeedButton1Click(Sender: TObject); begin FMostraEstoqueChapas := TFMostraEstoqueChapas.CriarSDI(self,'',true); FMostraEstoqueChapas.MostraEstoqueChapasProduto(VprDPlanoCorte.SeqMateriaPrima,VprDPlanoCorte); FMostraEstoqueChapas.Free; EChapa.AInteiro := VprDPlanoCorte.SeqChapa; end; {******************************************************************************} procedure TFNovoPlanoCorte.SpeedButton2Click(Sender: TObject); begin LocalizaMateriaPrima; end; {******************************************************************************} procedure TFNovoPlanoCorte.BFecharClick(Sender: TObject); begin close; end; {******************************************************************************} procedure TFNovoPlanoCorte.BAdicionarClick(Sender: TObject); begin FLocalizaFracaoOP := TFLocalizaFracaoOP.CriarSDI(self,'',FPrincipal.VerificaPermisao('FLocalizaFracaoOP')); FLocalizaFracaoOP.LocalizaFracao(VprDPlanoCorte); FLocalizaFracaoOP.free; Grade.CarregaGrade; Grade.Row := 1; end; {******************************************************************************} procedure TFNovoPlanoCorte.GradeAntesExclusao(Sender: TObject; var VpaPermiteExcluir: Boolean); var VpfDPlanoItem : TRBDPlanoCorteItem; VpfDFracao : TRBDPlanoCorteFracao; VpfLaco : Integer; begin VpfDPlanoItem := TRBDPlanoCorteItem(VprDPlanoCorte.Itens[Grade.ALinha -1]); for VpfLaco := 0 to VpfDPlanoItem.Fracoes.Count - 1 do begin VpfDFracao := TRBDPlanoCorteFracao(VpfDPlanoItem.Fracoes[VpfLaco]); FunOrdemProducao.SetaPlanoCorteGerado(VpfDFracao.CodFilial,VpfDFracao.SeqOrdem,VpfDFracao.SeqFracao,false); end; end; procedure TFNovoPlanoCorte.GradeCarregaItemGrade(Sender: TObject; VpaLinha: Integer); begin VprDItemPlanoCorte := TRBDPlanoCorteItem(VprDPlanoCorte.Itens[VpaLinha-1]); if VprDItemPlanoCorte.SeqIdentificacao <> 0 then Grade.Cells[1,VpaLinha]:= IntToStr(VprDItemPlanoCorte.SeqIdentificacao) else Grade.Cells[1,VpaLinha]:= ''; if VprDItemPlanoCorte.QtdProduto <> 0 then Grade.Cells[2,VpaLinha]:= IntToStr(VprDItemPlanoCorte.QtdProduto) else Grade.Cells[2,VpaLinha]:= ''; Grade.Cells[3,VpaLinha]:= VprDItemPlanoCorte.CodProduto; Grade.Cells[4,VpaLinha]:= VprDItemPlanoCorte.NomProduto; end; {******************************************************************************} procedure TFNovoPlanoCorte.BGravarClick(Sender: TObject); var VpfResultado : String; begin VpfResultado := DadosValidos; if VpfResultado = '' then begin CarDClasse; VpfResultado := FunOrdemProducao.GravaDPlanoCorte(VprDPlanoCorte); end; if VpfResultado = '' then begin EstadoBotoes(false); EPlanoCorte.AsInteger := VprDPlanoCorte.SeqPlanoCorte; VprAcao := true; end else aviso(VpfResultado); end; {******************************************************************************} procedure TFNovoPlanoCorte.GradeDadosValidos(Sender: TObject; var VpaValidos: Boolean); begin VpaValidos := true; if VprDPlanoCorte.Itens.Count > 0 then begin if Grade.Cells[1,Grade.ALinha] <> '' then VprDItemPlanoCorte.SeqIdentificacao := StrToInt(Grade.Cells[1,Grade.ALinha]) else VprDItemPlanoCorte.SeqIdentificacao := 0; end; end; procedure TFNovoPlanoCorte.GradeDepoisExclusao(Sender: TObject); begin end; {******************************************************************************} procedure TFNovoPlanoCorte.GradeMudouLinha(Sender: TObject; VpaLinhaAtual, VpaLinhaAnterior: Integer); begin if VprDPlanoCorte.Itens.Count > 0 then begin VprDItemPlanoCorte:= TRBDPlanoCorteItem(VprDPlanoCorte.Itens[VpaLinhaAtual-1]); end; end; {******************************************************************************} procedure TFNovoPlanoCorte.BCancelarClick(Sender: TObject); begin CancelaPlanoCorte; close; end; {******************************************************************************} procedure TFNovoPlanoCorte.BImprimirClick(Sender: TObject); begin FunOrdemProducao.ImprimeEtiquetasPlanoCorte(VprDPlanoCorte); end; {******************************************************************************} procedure TFNovoPlanoCorte.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose := true; if not VprAcao then BCancelar.Click; end; Initialization { *************** Registra a classe para evitar duplicidade ****************** } RegisterClasses([TFNovoPlanoCorte]); end.
unit NtUtils.Transactions; interface uses Winapi.WinNt, Ntapi.nttmapi, NtUtils.Exceptions, NtUtils.Objects; type TTransactionProperties = record IsolationLevel: Cardinal; IsolationFlags: Cardinal; Timeout: TLargeInteger; Outcome: TTransactionOutcome; Description: String; end; // Create a transaction object function NtxCreateTransaction(out hxTransaction: IHandle; Description: String = ''; Name: String = ''; Root: THandle = 0; Attributes: Cardinal = 0): TNtxStatus; // Open existing transaction by name function NtxOpenTransaction(out hxTransaction: IHandle; DesiredAccess: TAccessMask; Name: String; Root: THandle = 0; Attributes: Cardinal = 0) : TNtxStatus; // Open a transaction object by id function NtxOpenTransactionById(out hxTransaction: IHandle; const Uow: TGuid; DesiredAccess: TAccessMask; Attributes: Cardinal = 0): TNtxStatus; // Enumerate transactions on the system function NtxEnumerateTransactions(out Guids: TArray<TGuid>; KtmObjectType: TKtmObjectType = KtmObjectTransaction; RootObject: THandle = 0) : TNtxStatus; type NtxTransaction = class // Query fixed-size information class function Query<T>(hTransaction: THandle; InfoClass : TTransactionInformationClass; out Buffer: T): TNtxStatus; static; end; // Query transaction properties function NtxQueryPropertiesTransaction(hTransaction: THandle; out Properties: TTransactionProperties): TNtxStatus; // Commit a transaction function NtxCommitTransaction(hTransaction: THandle; Wait: Boolean = True) : TNtxStatus; // Abort a transaction function NtxRollbackTransaction(hTransaction: THandle; Wait: Boolean = True): TNtxStatus; implementation uses Ntapi.ntdef, Ntapi.ntstatus; function NtxCreateTransaction(out hxTransaction: IHandle; Description: String; Name: String; Root: THandle; Attributes: Cardinal): TNtxStatus; var hTransaction: THandle; ObjName, ObjDescription: UNICODE_STRING; ObjAttr: TObjectAttributes; pDescription: PUNICODE_STRING; begin InitializeObjectAttributes(ObjAttr, nil, Attributes, Root); if Name <> '' then begin ObjName.FromString(Name); ObjAttr.ObjectName := @ObjName; end; if Description <> '' then begin ObjDescription.FromString(Description); pDescription := @ObjDescription; end else pDescription := nil; Result.Location := 'NtCreateTransaction'; Result.Status := NtCreateTransaction(hTransaction, TRANSACTION_ALL_ACCESS, @ObjAttr, nil, 0, 0, 0, 0, nil, pDescription); if Result.IsSuccess then hxTransaction := TAutoHandle.Capture(hTransaction); end; function NtxOpenTransaction(out hxTransaction: IHandle; DesiredAccess: TAccessMask; Name: String; Root: THandle; Attributes: Cardinal): TNtxStatus; var hTransaction: THandle; ObjName: UNICODE_STRING; ObjAttr: TObjectAttributes; begin ObjName.FromString(Name); InitializeObjectAttributes(ObjAttr, @ObjName, Attributes, Root); Result.Location := 'NtOpenTransaction'; Result.LastCall.CallType := lcOpenCall; Result.LastCall.AccessMask := DesiredAccess; Result.LastCall.AccessMaskType := @TmTxAccessType; Result.Status := NtOpenTransaction(hTransaction, DesiredAccess, ObjAttr, nil, 0); if Result.IsSuccess then hxTransaction := TAutoHandle.Capture(hTransaction); end; function NtxEnumerateTransactions(out Guids: TArray<TGuid>; KtmObjectType: TKtmObjectType; RootObject: THandle): TNtxStatus; var Buffer: TKtmObjectCursor; Required: Cardinal; begin Result.Location := 'NtEnumerateTransactionObject'; Result.LastCall.CallType := lcQuerySetCall; Result.LastCall.InfoClass := Cardinal(KtmObjectType); Result.LastCall.InfoClassType := TypeInfo(TKtmObjectType); FillChar(Buffer, SizeOf(Buffer), 0); SetLength(Guids, 0); repeat Result.Status := NtEnumerateTransactionObject(0, KtmObjectType, @Buffer, SizeOf(Buffer), Required); if not Result.IsSuccess then Break; SetLength(Guids, Length(Guids) + 1); Guids[High(Guids)] := Buffer.ObjectIds[0]; until False; if Result.Status = STATUS_NO_MORE_ENTRIES then Result.Status := STATUS_SUCCESS; end; function NtxOpenTransactionById(out hxTransaction: IHandle; const Uow: TGuid; DesiredAccess: TAccessMask; Attributes: Cardinal = 0): TNtxStatus; var hTransaction: THandle; ObjAttr: TObjectAttributes; begin InitializeObjectAttributes(ObjAttr, nil, Attributes); Result.Location := 'NtOpenTransaction'; Result.LastCall.CallType := lcOpenCall; Result.LastCall.AccessMask := DesiredAccess; Result.LastCall.AccessMaskType := @TmTxAccessType; Result.Status := NtOpenTransaction(hTransaction, DesiredAccess, ObjAttr, @Uow, 0); if Result.IsSuccess then hxTransaction := TAutoHandle.Capture(hTransaction); end; class function NtxTransaction.Query<T>(hTransaction: THandle; InfoClass: TTransactionInformationClass; out Buffer: T): TNtxStatus; begin Result.Location := 'NtQueryInformationTransaction'; Result.LastCall.CallType := lcQuerySetCall; Result.LastCall.InfoClass := Cardinal(InfoClass); Result.LastCall.InfoClassType := TypeInfo(TTransactionInformationClass); Result.LastCall.Expects(TRANSACTION_QUERY_INFORMATION, @TmTxAccessType); Result.Status := NtQueryInformationTransaction(hTransaction, InfoClass, @Buffer, SizeOf(Buffer), nil); end; function NtxQueryPropertiesTransaction(hTransaction: THandle; out Properties: TTransactionProperties): TNtxStatus; const BUFFER_SIZE = SizeOf(TTransactionPropertiesInformation) + MAX_TRANSACTION_DESCRIPTION_LENGTH * SizeOf(WideChar); var Buffer: PTransactionPropertiesInformation; begin Result.Location := 'NtQueryInformationTransaction'; Result.LastCall.CallType := lcQuerySetCall; Result.LastCall.InfoClass := Cardinal(TransactionPropertiesInformation); Result.LastCall.InfoClassType := TypeInfo(TTransactionInformationClass); Result.LastCall.Expects(TRANSACTION_QUERY_INFORMATION, @TmTxAccessType); Buffer := AllocMem(BUFFER_SIZE); Result.Status := NtQueryInformationTransaction(hTransaction, TransactionPropertiesInformation, Buffer, BUFFER_SIZE, nil); if Result.IsSuccess then begin Properties.IsolationLevel := Buffer.IsolationLevel; Properties.IsolationFlags := Buffer.IsolationFlags; Properties.Timeout := Buffer.Timeout; Properties.Outcome := Buffer.Outcome; SetString(Properties.Description, Buffer.Description, Buffer.DescriptionLength div SizeOf(WideChar)); end; FreeMem(Buffer); end; function NtxCommitTransaction(hTransaction: THandle; Wait: Boolean): TNtxStatus; begin Result.Location := 'NtCommitTransaction'; Result.LastCall.Expects(TRANSACTION_COMMIT, @TmTxAccessType); Result.Status := NtCommitTransaction(hTransaction, Wait); end; function NtxRollbackTransaction(hTransaction: THandle; Wait: Boolean): TNtxStatus; begin Result.Location := 'NtRollbackTransaction'; Result.LastCall.Expects(TRANSACTION_ROLLBACK, @TmTxAccessType); Result.Status := NtRollbackTransaction(hTransaction, Wait); end; end.
UNIT MaidOutfit; CONST GameDir = 'D:\Games\Steam\steamapps\common\Skyrim Special Edition'; JsonFile = '\data\meshes\dcc-maid\outfits.json'; IMPLEMENTATION FUNCTION MaidReplaceFormID( Input: String; OutfitID: String; VariantName: String; EditPrefix: Boolean; ): String; VAR Output: String; BEGIN Output := Input; Output := Util.PregReplace('%Variant%',VariantName,Output); Output := Util.PregReplace('%ID%',OutfitID,Output); IF(EditPrefix = TRUE) THEN BEGIN Output := Util.PregReplace('dcc_maid_','dcc_maidx_',Output); END; Result := Output; END; //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// PROCEDURE MaidBuildOutfits(Plugin: IInterface); VAR JSON: TJsonObject; OutfitIter: Integer; Outfit: TJsonObject; ArmorIter: Integer; Armor: TJsonObject; VariantIter: Integer; VariantName: String; ArmaForm: IInterface; ArmoForm: IInterface; CraftForm: IInterface; TemperForm: IInterface; BEGIN // load in the json file. JSON := TJsonObject.Create; JSON.LoadFromFile(GameDir + JsonFile); // look at the outfits. FOR OutfitIter := 0 TO (JSON.A['Outfits'].Count - 1) DO BEGIN Outfit := JSON.A['Outfits'].O[OutfitIter]; FOR ArmorIter := 0 TO (Outfit.A['Armors'].Count - 1) DO BEGIN Armor := Outfit.A['Armors'].O[ArmorIter]; FOR VariantIter := 0 TO 2 DO BEGIN VariantName := Skyrim.GetArmorTypeWord(VariantIter); AddMessage('=== Building ' + Outfit.S['ID'] + ' ' + VariantName); AddMessage(StringOfChar('=',80)); AddMessage(''); ArmaForm := MaidBuildArmaRecord( Plugin, JSON, Outfit, Armor, VariantName ); AddMessage(''); ArmoForm := MaidBuildArmoRecord( Plugin, JSON, Outfit, Armor, VariantName, ArmaForm ); AddMessage(''); CraftForm := MaidBuildCraftRecord( Plugin, JSON, Outfit, Armor, VariantName, ArmoForm ); AddMessage(''); TemperForm := MaidBuildTemperRecord( Plugin, JSON, Outfit, Armor, VariantName, ArmoForm ); AddMessage(''); END; END; END; END; //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// FUNCTION MaidBuildArmaRecord( Plugin: IInterface; JSON: TJsonObject; OutfitEntry: TJsonObject; ArmorEntry: TJsonObject; VariantName: String ): IInterface; VAR DestID: String; DestForm: IInterface; SourceID: String; SourceForm: IInterface; TextureCount: Integer; TextureIter: Integer; ShapeName: String; TextureSetID: String; TextureSet: IInterface; BEGIN SourceID := MaidReplaceFormID( JSON.O['Sources'].O[ArmorEntry.S['Source']].S['ARMA'], OutfitEntry.S['ID'], VariantName, FALSE ); DestID := MaidReplaceFormID( JSON.O['Outputs'].O[ArmorEntry.S['Source']].S['ARMA'], OutfitEntry.S['ID'], VariantName, TRUE ); DestForm := Skyrim.FormFind(Plugin,'ARMA',DestID); TextureCount := ArmorEntry.O['Textures'].Count; // make sure we can load the template form. SourceForm := Skyrim.FormFind(Plugin,'ARMA',SourceID); IF(NOT Assigned(SourceForm)) THEN BEGIN RAISE Exception.Create('Source ARMA Not Found: ' + SourceID); END; // make sure all the textures exist before we do something crazy. FOR TextureIter := 0 TO (TextureCount - 1) DO BEGIN ShapeName := ArmorEntry.O['Textures'].Names[TextureIter]; TextureSetID := ArmorEntry.O['Textures'].S[ShapeName]; TextureSet := Skyrim.FormFind(Plugin,'TXST',TextureSetID); IF(NOT Assigned(TextureSet)) THEN BEGIN RAISE Exception.Create('TXST Not Found: ' + TextureSetID); END; END; // see if this form is already done. IF(DestForm <> NIL) THEN BEGIN AddMessage('!!! Keeping Existing ' + DestID); END ELSE BEGIN AddMessage('+++ ARMA: ' + DestID); DestForm := FormCopy(SourceForm); Skyrim.FormSetEditorID(DestForm,DestID); END; // update the textures. FOR TextureIter := 0 TO (TextureCount - 1) DO BEGIN ShapeName := ArmorEntry.O['Textures'].Names[TextureIter]; TextureSetID := ArmorEntry.O['Textures'].S[ShapeName]; TextureSet := Skyrim.FormFind(Plugin,'TXST',TextureSetID); AddMessage('*** TXST: ' + ShapeName + ' -> ' + TextureSetID); Skyrim.ArmaSetModelTextureSetByShape( DestForm, Skyrim.ArmaModelFemaleThird, ShapeName, TextureSet ); END; Result := DestForm; END; //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// FUNCTION MaidBuildArmoRecord( Plugin: IInterface; JSON: TJsonObject; OutfitEntry: TJsonObject; ArmorEntry: TJsonObject; VariantName: String; ArmaForm: IInterface ): IInterface; VAR DestID: String; DestForm: IInterface; SourceID: String; SourceForm: IInterface; ArmoName: String; BEGIN SourceID := MaidReplaceFormID( JSON.O['Sources'].O[ArmorEntry.S['Source']].S['ARMO'], OutfitEntry.S['ID'], VariantName, FALSE ); DestID := MaidReplaceFormID( JSON.O['Outputs'].O[ArmorEntry.S['Source']].S['ARMO'], OutfitEntry.S['ID'], VariantName, TRUE ); DestForm := Skyrim.FormFind(Plugin,'ARMO',DestID); ArmoName := OutfitEntry.S['Prefix'] + ' ' + VariantName + ' Maid ' + JSON.O['Names'].S[ArmorEntry.S['Source']]; // make sure we can load the template form. SourceForm := Skyrim.FormFind(Plugin,'ARMO',SourceID); IF(NOT Assigned(SourceForm)) THEN BEGIN RAISE Exception.Create('Source ARMO Not Found: ' + SourceID); END; // see if this form is already done. IF(DestForm <> NIL) THEN BEGIN AddMessage('!!! Keeping Existing ' + DestID); END ELSE BEGIN AddMessage('+++ ARMO: ' + DestID); DestForm := FormCopy(SourceForm); Skyrim.FormSetEditorID(DestForm,DestID); END; // doit reel gud AddMessage('*** FULL: ' + ArmoName); Skyrim.FormSetName(DestForm,ArmoName); AddMessage('*** ARMA: ' + EditorID(ArmaForm)); Skyrim.ArmoSetModelByIndex(DestForm,0,ArmaForm); Result := DestForm; END; //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// FUNCTION MaidBuildCraftRecord( Plugin: IInterface; Json: TJsonObject; OutfitEntry: TJsonObject; ArmorEntry: TJsonObject; VariantName: String; ArmoForm: IInterface ): IInterface; VAR SourceID: String; SourceForm: IInterface; DestID: String; DestForm: IInterface; BEGIN SourceID := MaidReplaceFormID( JSON.O['Sources'].O[ArmorEntry.S['Source']].S['Craft'], OutfitEntry.S['ID'], VariantName, FALSE ); DestID := MaidReplaceFormID( JSON.O['Outputs'].O[ArmorEntry.S['Source']].S['Craft'], OutfitEntry.S['ID'], VariantName, TRUE ); DestForm := Skyrim.FormFind(Plugin,'COBJ',DestID); // check that the template exists. SourceForm := Skyrim.FormFind(Plugin,'COBJ',SourceID); IF(NOT Assigned(SourceForm)) THEN BEGIN RAISE Exception.Create('Source Craft COBJ Not Found: ' + SourceID); END; // check if it is already done. IF(DestForm <> NIL) THEN BEGIN AddMessage('!!! Keeping Existing ' + DestID); END ELSE BEGIN AddMessage('+++ COBJ: ' + DestID); DestForm := FormCopy(SourceForm); Skyrim.FormSetEditorID(DestForm,DestID); END; // finish him AddMessage('*** CNAM: ' + EditorID(ArmoForm)); Skyrim.CobjSetCreatedObject(DestForm,ArmoForm); Result := DestForm; END; //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// FUNCTION MaidBuildTemperRecord( Plugin: IInterface; Json: TJsonObject; OutfitEntry: TJsonObject; ArmorEntry: TJsonObject; VariantName: String; ArmoForm: IInterface ): IInterface; VAR SourceID: String; SourceForm: IInterface; DestID: String; DestForm: IInterface; BEGIN SourceID := MaidReplaceFormID( JSON.O['Sources'].O[ArmorEntry.S['Source']].S['Temper'], OutfitEntry.S['ID'], VariantName, FALSE ); DestID := MaidReplaceFormID( JSON.O['Outputs'].O[ArmorEntry.S['Source']].S['Temper'], OutfitEntry.S['ID'], VariantName, TRUE ); DestForm := Skyrim.FormFind(Plugin,'COBJ',DestID); // check that the template exists. SourceForm := Skyrim.FormFind(Plugin,'COBJ',SourceID); IF(NOT Assigned(SourceForm)) THEN BEGIN RAISE Exception.Create('Source Temper COBJ Not Found: ' + SourceID); END; // check if it is already done. IF(DestForm <> NIL) THEN BEGIN AddMessage('!!! Keeping Existing ' + DestID); END ELSE BEGIN AddMessage('+++ COBJ: ' + DestID); DestForm := FormCopy(SourceForm); Skyrim.FormSetEditorID(DestForm,DestID); END; // finish him AddMessage('*** CNAM: ' + EditorID(ArmoForm)); Skyrim.CobjSetCreatedObject(DestForm,ArmoForm); Result := DestForm; END; END.
unit LoanApprovalDetail; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, BasePopupDetail, Vcl.StdCtrls, Vcl.DBCtrls, RzDBEdit, RzDBCmbo, Vcl.Mask, RzEdit, RzButton, RzTabs, RzLabel, Vcl.Imaging.pngimage, Vcl.ExtCtrls, RzPanel; type TfrmLoanAppvDetail = class(TfrmBasePopupDetail) edAppvTerm: TRzDBNumericEdit; edAppvAmount: TRzDBNumericEdit; dteDateApproved: TRzDBDateTimeEdit; dbluAppvMethod: TRzDBLookupComboBox; mmRemarks: TRzDBMemo; urlRecommendedAmount: TRzURLLabel; urlDesiredTerm: TRzURLLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; lblAppliedAmount: TLabel; procedure FormCreate(Sender: TObject); procedure urlRecommendedAmountClick(Sender: TObject); procedure urlDesiredTermClick(Sender: TObject); private { Private declarations } function ConfirmApproval: string; public { Public declarations } protected procedure Save; override; procedure Cancel; override; procedure BindToObject; override; function ValidEntry: boolean; override; end; var frmLoanAppvDetail: TfrmLoanAppvDetail; implementation {$R *.dfm} uses LoanData, LoansAuxData, Loan, FormsUtil, IFinanceDialogs, Assessment, IFinanceGlobal; procedure TfrmLoanAppvDetail.FormCreate(Sender: TObject); begin inherited; OpenDropdownDataSources(tsDetail); // applied amount lblAppliedAmount.Caption := FormatCurr('###,##0.00',ln.AppliedAmount); // recommended amount urlRecommendedAmount.Caption := FormatCurr('###,##0.00',ln.Assessment.RecommendedAmount); // desired term urlDesiredTerm.Caption := IntToStr(ln.DesiredTerm); end; procedure TfrmLoanAppvDetail.Save; begin ln.Save; end; procedure TfrmLoanAppvDetail.urlDesiredTermClick(Sender: TObject); begin inherited; if (ln.Action = laApproving) and (ln.IsAssessed) then edAppvTerm.Value := ln.DesiredTerm; end; procedure TfrmLoanAppvDetail.urlRecommendedAmountClick(Sender: TObject); begin inherited; if (ln.Action = laApproving) and (ln.IsAssessed) and (ln.Assessment.Recommendation = rcApprove) then edAppvAmount.Value := ln.Assessment.RecommendedAmount; end; procedure TfrmLoanAppvDetail.BindToObject; begin inherited; end; procedure TfrmLoanAppvDetail.Cancel; begin ln.Cancel; end; function TfrmLoanAppvDetail.ValidEntry: boolean; var error: string; begin if dteDateApproved.Text = '' then error := 'Please enter date approved.' else if edAppvAmount.Value <= 0 then error := 'Invalid value for approved amount.' else if edAppvTerm.Value <= 0 then error := 'Invalid value for approved term.' else if dbluAppvMethod.Text = '' then error := 'Please select approval method.' else if edAppvTerm.Value > ln.LoanClass.Term then error := 'Approved term exceeds the maximum term set for the selected loan class.' else if edAppvAmount.Value > ln.LoanClass.MaxLoan then error := 'Approved amount exceeds the maximum loanable amount for the selected loan class.' else if edAppvAmount.Value > ifn.User.CreditLimit then error := 'Approved amount exceeds YOUR approved credit limit.' else if edAppvAmount.Value > ln.Assessment.RecommendedAmount then error := ConfirmApproval; Result := error = ''; if not Result then ShowErrorBox(error); end; function TfrmLoanAppvDetail.ConfirmApproval: string; var msg: string; begin msg := 'Amount to be approved is greater than the recommended amount. Do you want to proceed?'; if ShowDecisionBox(msg) = mrYes then Result := '' else Result := 'Approving process cancelled.'; end; end.
unit MapSetFieldValueBasedOnLayerValueUnit; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, wwdblook, RPFiler, RPDefine, RPBase, ComObj, RPCanvas, RPrinter, Db, DBTables, Wwtable, MapObjects2_TLB, MapSetupObjectType, ComCtrls, Grids; type TSetFieldValueFromMapLayerDialog = class(TForm) ScreenLabelTable: TTable; TempTable: TTable; ReportPrinter: TReportPrinter; ReportFiler: TReportFiler; PrintDialog: TPrintDialog; UserFieldDefinitionTable: TTable; MapLayersAvailableTable: TwwTable; AssessmentYearControlTable: TTable; MapParcelIDFormatTable: TTable; ProgressBar: TProgressBar; ParcelLookupTable: TTable; CommercialSiteTable: TTable; ResidentialSiteTable: TTable; ResidentialBldgTable: TTable; CommercialBldgTable: TTable; PageControl1: TPageControl; TabSheet1: TTabSheet; SourceGroupBox: TGroupBox; Label1: TLabel; Label2: TLabel; MapFieldComboBox: TComboBox; MapLayersLookupCombo: TwwDBLookupCombo; DestinationGroupBox: TGroupBox; Label5: TLabel; Label6: TLabel; ScreenComboBox: TComboBox; FieldComboBox: TComboBox; GroupBox1: TGroupBox; TrialRunCheckBox: TCheckBox; AssessmentYearRadioGroup: TRadioGroup; AddInventoryIfNeededCheckBox: TCheckBox; cb_CommercialParcelsOnly: TCheckBox; cb_ResidentialParcelsOnly: TCheckBox; Panel1: TPanel; StartButton: TBitBtn; CancelButton: TBitBtn; TabSheet2: TTabSheet; GroupBox2: TGroupBox; Label3: TLabel; ed_FieldToExcludeOn: TEdit; sg_Exclusions: TStringGrid; Label4: TLabel; procedure ScreenComboBoxChange(Sender: TObject); procedure MapLayersLookupComboCloseUp(Sender: TObject; LookupTable, FillTable: TDataSet; modified: Boolean); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure StartButtonClick(Sender: TObject); procedure ReportPrintHeader(Sender: TObject); procedure ReportPrint(Sender: TObject); procedure CancelButtonClick(Sender: TObject); private { Private declarations } public { Public declarations } ScreenLabelList : TList; MapSetupObject : TMapSetupObject; SourceLayer, ParcelLayer : IMoMapLayer; FieldToExcludeOn, DestinationFieldName, DestinationTableName, SourceLayerName, SourceFieldName, AssessmentYear, UnitName : String; AddInventoryRecordsIfNeeded, TrialRun, Cancelled, CommercialParcelsOnly, ResidentialParcelsOnly : Boolean; ReportSection, ProcessingType : Integer; Map : TMap; ExclusionsList : TStringList; Procedure InitializeForm; Procedure AddInventorySite(AssessmentYear : String; TableName : String; SwisSBLKey : String); end; var SetFieldValueFromMapLayerDialog: TSetFieldValueFromMapLayerDialog; implementation {$R *.DFM} uses PASUtils, Prclocat, Utilitys, PASTypes, DataAccessUnit, GlblVars, GlblCnst, MapUtilitys, WinUtils, Preview; const rsMain = 0; rsMultipleMatch = 1; {========================================================} Procedure FillChangeBoxes(ScreenComboBox, FieldComboBox : TComboBox; ScreenLabelList : TList; FillScreenBox, FillFieldBox : Boolean); var I : Integer; begin {Add blank items to the front of the list to blank it out.} If FillScreenBox then begin ScreenComboBox.Items.Clear; For I := 0 to (ScreenLabelList.Count - 1) do If (ScreenComboBox.Items.IndexOf(RTrim(ScreenLabelPtr(ScreenLabelList[I])^.ScreenName)) = -1) then ScreenComboBox.Items.Add(RTrim(ScreenLabelPtr(ScreenLabelList[I])^.ScreenName)); ScreenComboBox.Items.Insert(0, ''); end; {If FillScreenBox} If FillFieldBox then begin FieldComboBox.Items.Clear; For I := 0 to (ScreenLabelList.Count - 1) do If (RTrim(ScreenLabelPtr(ScreenLabelList[I])^.ScreenName) = ScreenComboBox.Items[ScreenComboBox.ItemIndex]) then FieldComboBox.Items.Add(RTrim(ScreenLabelPtr(ScreenLabelList[I])^.LabelName)); FieldComboBox.Items.Insert(0, ''); end; {If FillFieldBox} end; {FillChangeBoxes} {==================================================================} Procedure TSetFieldValueFromMapLayerDialog.InitializeForm; begin OpenTablesForForm(Self, NextYear); ScreenLabelList := TList.Create; UnitName := 'MapSetFieldValueBasedOnLayerValueUnit'; ReportSection := rsMain; ExclusionsList := TStringList.Create; LoadScreenLabelList(ScreenLabelList, ScreenLabelTable, UserFieldDefinitionTable, True, True, True, [slAll]); FillChangeBoxes(ScreenComboBox, FieldComboBox, ScreenLabelList, True, False); end; {InitializeForm} {====================================================================} Procedure TSetFieldValueFromMapLayerDialog.ScreenComboBoxChange(Sender: TObject); {Synchronize the field combo box with the screen combo box.} begin with Sender as TComboBox do If (Deblank(Text) = '') then FieldComboBox.ItemIndex := 0 {The first value is blank.} else FillChangeBoxes(TComboBox(Sender), FieldComboBox, ScreenLabelList, False, True); end; {ScreenComboBoxChange} {====================================================================} Procedure TSetFieldValueFromMapLayerDialog.MapLayersLookupComboCloseUp(Sender: TObject; LookupTable, FillTable: TDataSet; modified: Boolean); var dc : IMoDataConnection; LayerFileName, LayerDatabaseName : OLEVariant; RecordSet : IMORecordSet; FieldList : TStringList; TableDescription : IMoTableDesc; Fields : IMoFields; Field : IMoField; I : Integer; begin SourceLayerName := MapLayersAvailableTable.FieldByName('LayerName').Text; dc := IMoDataConnection(CreateOleObject('MapObjects2.DataConnection')); LayerDatabaseName := MapSetupObject.GetLayerDatabaseName(SourceLayerName); dc.database := GetLayerTypePrefix(MapSetupObject.GetLayerType(SourceLayerName)) + LayerDatabaseName; SourceLayer := IMoMapLayer(CreateOleObject('MapObjects2.MapLayer')); LayerFileName := MapSetupObject.GetLayerLocation(SourceLayerName); SourceLayer.Geodataset := dc.FindGeoDataset(LayerFileName); FieldList := TStringList.Create; {Go through based on the source layer.} RecordSet := SourceLayer.Records; Fields := RecordSet.Fields; TableDescription := IMoTableDesc(CreateOleObject('MapObjects2.TableDesc')); TableDescription := RecordSet.TableDesc; Fields := RecordSet.Fields; For I := 0 to (TableDescription.FieldCount - 1) do begin Field := Fields.Item(TableDescription.FieldName[I]); FieldList.Add(Field.Name); end; {For I := 0 to (TableDescription.FieldCount - 1) do} MapFieldComboBox.Items.Assign(FieldList); FieldList.Free; end; {MapLayersLookupComboCloseUp} {==================================================================} Procedure TSetFieldValueFromMapLayerDialog.StartButtonClick(Sender: TObject); var _ScreenName, _LabelName, NewFileName : String; I : Integer; Quit : Boolean; begin CancelButton.Enabled := True; TrialRun := TrialRunCheckBox.Checked; ParcelLookupTable.IndexName := MapSetupObject.PASIndex; AddInventoryRecordsIfNeeded := AddInventoryIfNeededCheckBox.Checked; CommercialParcelsOnly := cb_CommercialParcelsOnly.Checked; ResidentialParcelsOnly := cb_ResidentialParcelsOnly.Checked; GetValuesFromStringGrid(sg_Exclusions, ExclusionsList, True); FieldToExcludeOn := ed_FieldToExcludeOn.Text; _ScreenName := ScreenComboBox.Items[ScreenComboBox.ItemIndex]; _LabelName := FieldComboBox.Items[FieldComboBox.ItemIndex]; For I := 0 to (ScreenLabelList.Count - 1) do If (_Compare(ScreenLabelPtr(ScreenLabelList[I])^.LabelName, _LabelName, coEqual) and _Compare(ScreenLabelPtr(ScreenLabelList[I])^.ScreenName, _ScreenName, coEqual)) then begin DestinationTableName := Trim(ScreenLabelPtr(ScreenLabelList[I])^.TableName); DestinationFieldName := Trim(ScreenLabelPtr(ScreenLabelList[I])^.FieldName); end; case AssessmentYearRadioGroup.ItemIndex of 0 : begin ProcessingType := ThisYear; AssessmentYear := GlblThisYear; end; 1 : begin ProcessingType := NextYear; AssessmentYear := GlblNextYear; end; end; {case AssessmentYearRadioGroup.ItemIndex of} OpenTableForProcessingType(TempTable, DestinationTableName, ProcessingType, Quit); OpenTableForProcessingType(ResidentialSiteTable, ResidentialSiteTableName, ProcessingType, Quit); OpenTableForProcessingType(ResidentialBldgTable, ResidentialBldgTableName, ProcessingType, Quit); OpenTableForProcessingType(CommercialSiteTable, CommercialSiteTableName, ProcessingType, Quit); OpenTableForProcessingType(CommercialBldgTable, CommercialBldgTableName, ProcessingType, Quit); SourceFieldName := MapFieldComboBox.Items[MapFieldComboBox.ItemIndex]; If PrintDialog.Execute then begin AssignPrinterSettings(PrintDialog, ReportPrinter, ReportFiler, [ptBoth], False, Quit); Cancelled := False; GlblPreviewPrint := False; If not Cancelled then If PrintDialog.PrintToFile then begin GlblPreviewPrint := True; NewFileName := GetPrintFileName(Self.Caption, True); ReportFiler.FileName := NewFileName; GlblDefaultPreviewZoomPercent := 100; try PreviewForm := TPreviewForm.Create(Self); PreviewForm.FilePrinter.FileName := NewFileName; PreviewForm.FilePreview.FileName := NewFileName; ReportFiler.Execute; PreviewForm.ShowModal; finally PreviewForm.Free; end end else ReportPrinter.Execute; end; {If PrintDialog.Execute} end; {StartButtonClick} {==================================================================} Procedure SetReportTabs(Sender : TObject); begin with Sender as TBaseReport do begin ClearTabs; SetTab(0.4, pjCenter, 2.2, 5, BOXLINEAll, 25); {Parcel ID 1} SetTab(2.6, pjCenter, 1.5, 5, BOXLINEAll, 25); {Value 1} SetTab(4.3, pjCenter, 2.2, 5, BOXLINEAll, 25); {Parcel ID 1} SetTab(6.5, pjCenter, 1.5, 5, BOXLINEAll, 25); {Value 1} Println(#9 + 'Parcel ID' + #9 + 'New Value' + #9 + 'Parcel ID' + #9 + 'New Value'); ClearTabs; SetTab(0.4, pjLeft, 2.2, 5, BOXLINEAll, 0); {Parcel ID 1} SetTab(2.6, pjLeft, 1.5, 5, BOXLINEAll, 0); {Value 1} SetTab(4.3, pjLeft, 2.2, 5, BOXLINEAll, 0); {Parcel ID 1} SetTab(6.5, pjLeft, 1.5, 5, BOXLINEAll, 0); {Value 1} end; {with Sender as TBaseReport do} end; {SetReportTabs} {==================================================================} Procedure PrintMultipleMatchSectionHeader(Sender : TObject); begin with Sender as TBaseReport do begin Underline := True; Bold := True; Println(#9 + 'Parcels with multiple matches in the layer:'); Underline := False; Bold := False; Println(''); SetReportTabs(Sender); end; {with Sender as TBaseReport do} end; {PrintMultipleMatchSectionHeader} {==================================================================} Procedure TSetFieldValueFromMapLayerDialog.ReportPrintHeader(Sender: TObject); begin with Sender as TBaseReport do begin {Print the date and page number.} SectionTop := 0.25; SectionLeft := 0.5; SectionRight := PageWidth - 0.5; SetFont('Times New Roman',8); PrintHeader('Page: ' + IntToStr(CurrentPage), pjRight); PrintHeader('Date: ' + DateToStr(Date) + ' Time: ' + TimeToStr(Now), pjLeft); SectionTop := 0.5; SetFont('Times New Roman',10); Bold := True; Home; PrintCenter('Set Data Field Value from Map Layer', (PageWidth / 2)); Bold := False; CRLF; CRLF; ClearTabs; SetTab(0.3, pjLeft, 7.5, 0, BOXLINENONE, 0); Println(#9 + 'Source: Layer = ' + Trim(SourceLayerName) + ', Field = ' + SourceFieldName); Println(#9 + 'Set value for table ' + Trim(TempTable.TableName) + ' \ field ' + Trim(DestinationFieldName)); Println(''); If _Compare(ReportSection, rsMultipleMatch, coEqual) then PrintMultipleMatchSectionHeader(Sender) else SetReportTabs(Sender); end; {with Sender as TBaseReport do} end; {ReportPrintHeader} {====================================================================} Procedure TSetFieldValueFromMapLayerDialog.AddInventorySite(AssessmentYear : String; TableName : String; SwisSBLKey : String); var AddSiteRecord : Boolean; begin If _Compare(TableName, 'PRes', coContains) then begin AddSiteRecord := False; If _Compare(Copy(TableName, 2, 200), Copy(ResidentialSiteTableName, 2, 200), coEqual) then AddSiteRecord := True; If AddSiteRecord then begin with ResidentialSiteTable do try Insert; FieldByName('TaxRollYr').Text := AssessmentYear; FieldByName('SwisSBLKey').Text := SwisSBLKey; FieldByName('Site').AsInteger := 1; Post; except Cancel; SystemSupport(001, ResidentialSiteTable, 'Error inserting residential site record for parcel ' + SwisSBLKey + '.', UnitName, GlblErrorDlgBox); end; {If we add a site record, we must add a building record.} with ResidentialBldgTable do try Insert; FieldByName('TaxRollYr').Text := AssessmentYear; FieldByName('SwisSBLKey').Text := SwisSBLKey; FieldByName('Site').AsInteger := 1; Post; except Cancel; end; end; {If ((UpcaseStr(RTrim(ChangeRec.TableName)) = UpcaseStr(ResidentialSiteTableName)) or} {Now, if this is not the site, insert the subrecord.} If _Compare(Copy(TableName, 2, 200), Copy(ResidentialSiteTableName, 2, 200), coNotEqual) then with TempTable do try Insert; FieldByName('TaxRollYr').Text := AssessmentYear; FieldByName('SwisSBLKey').Text := SwisSBLKey; FieldByName('Site').AsInteger := 1; If _Compare(Copy(TableName, 2, 200), Copy(ResidentialLandTableName, 2, 200), coEqual) then FieldByName('LandNumber').AsInteger := 1; If _Compare(Copy(TableName, 2, 200), Copy(ResidentialForestTableName, 2, 200), coEqual) then FieldByName('ForestNumber').AsInteger := 1; If _Compare(Copy(TableName, 2, 200), Copy(ResidentialImprovementsTableName, 2, 200), coEqual) then FieldByName('ImprovementNumber').AsInteger := 1; Post; except Cancel; SystemSupport(003, TempTable, 'Error inserting record for table ' + TempTable.TableName + ' Parcel ' + SwisSBLKey + '.', UnitName, GlblErrorDlgBox); end; end; {If (UpcaseStr(Take(5, ChangeRec.TableName)) = 'TPRES')} If _Compare(TableName, 'PCOM', coContains) then begin AddSiteRecord := False; If _Compare(Copy(TableName, 2, 200), Copy(CommercialSiteTableName, 2, 200), coEqual) then AddSiteRecord := True; If AddSiteRecord then begin with CommercialSiteTable do try Insert; FieldByName('TaxRollYr').Text := AssessmentYear; FieldByName('SwisSBLKey').Text := SwisSBLKey; FieldByName('Site').AsInteger := 1; Post; except Cancel; SystemSupport(004, CommercialSiteTable, 'Error inserting commercial site record for parcel ' + SwisSBLKey + '.', UnitName, GlblErrorDlgBox); end; If not _Locate(CommercialBldgTable, [AssessmentYear, SwisSBLKey, 1, 1, 1], '', []) then with CommercialBldgTable do try Insert; FieldByName('TaxRollYr').Text := AssessmentYear; FieldByName('SwisSBLKey').Text := SwisSBLKey; FieldByName('Site').AsInteger := 1; FieldByName('BuildingNumber').AsInteger := 1; FieldByName('BuildingSection').AsInteger := 1; Post; except Cancel; end; end; {If ((UpcaseStr(RTrim(ChangeRec.TableName)) = ...} {Now, if this is not the site, insert the subrecord.} If _Compare(Copy(TableName, 2, 200), Copy(CommercialSiteTableName, 2, 200), coNotEqual) then with TempTable do try Insert; FieldByName('TaxRollYr').Text := AssessmentYear; FieldByName('SwisSBLKey').Text := SwisSBLKey; FieldByName('Site').AsInteger := 1; If _Compare(Copy(TableName, 2, 200), Copy(CommercialLandTableName, 2, 200), coEqual) then FieldByName('LandNumber').AsInteger := 1; If _Compare(Copy(TableName, 2, 200), Copy(CommercialBldgTableName, 2, 200), coEqual) then begin FieldByName('BuildingNumber').AsInteger := 1; FieldByName('BuildingSection').AsInteger := 1; end; If _Compare(Copy(TableName, 2, 200), Copy(CommercialImprovementsTableName, 2, 200), coEqual) then FieldByName('ImprovementNumber').AsInteger := 1; If _Compare(Copy(TableName, 2, 200), Copy(CommercialRentTableName, 2, 200), coEqual) then FieldByName('UseNumber').AsInteger := 1; Post; except Cancel; SystemSupport(006, TempTable, 'Error inserting record for table ' + TempTable.TableName + ' Parcel ' + SwisSBLKey + '.', UnitName, GlblErrorDlgBox); end; end; {If (UpcaseStr(Take(5, ChangeRec.TableName)) = 'TPCOM')} end; {AddInventorySite} {==================================================================} Function MeetsCriteria(ParcelTable : TDataSet; ResidentialParcelsOnly : Boolean; CommercialParcelsOnly : Boolean) : Boolean; begin Result := True; If ResidentialParcelsOnly then Result := PropertyIsResidential(ParcelTable.FieldByName('PropertyClassCode').Text); If CommercialParcelsOnly then Result := not PropertyIsResidential(ParcelTable.FieldByName('PropertyClassCode').Text); end; {MeetsCriteria} {==================================================================} Procedure TSetFieldValueFromMapLayerDialog.ReportPrint(Sender: TObject); var Done, FirstTimeThrough : Boolean; SourceRecordSet, ParcelRecordSet : IMORecordSet; ParcelLayerPolygon : IMOPolygon; LinkFieldName : OLEVariant; ExclusionValue, NewValue, SwisSBLKey, FirstMatch : String; ValuesMatched, NumberChanged, NumberPrintedThisPage : LongInt; MultipleMatchList : TStringList; I, ColonPos : Integer; ParcelLayerField : IMOField; begin MultipleMatchList := TStringList.Create; Done := False; FirstTimeThrough := True; {For each parcel, find the centroid in the source layer.} ParcelRecordSet := ParcelLayer.Records; LinkFieldName := MapSetupObject.MapFileKeyField; NumberChanged := 0; NumberPrintedThisPage := 0; ProgressBar.Position := 0; ProgressBar.Max := ParcelRecordSet.Count - 1; ParcelRecordSet.MoveFirst; repeat If FirstTimeThrough then FirstTimeThrough := False else ParcelRecordSet.MoveNext; If ParcelRecordSet.EOF then Done := True; ProgressBar.Position := ProgressBar.Position + 1; Application.ProcessMessages; If not Done then begin ParcelLayerField := ParcelRecordSet.Fields.Item('Shape'); ParcelLayerPolygon := IMoPolygon(CreateOleObject('MapObjects2.Polygon')); ParcelLayerPolygon := IMoPolygon(IDispatch(ParcelLayerField.Value)); (*Map.FlashShape(ParcelLayerPolygon, 2);*) {We will only set the value if the centroid of the parcel is in the source layer area. This eliminates parcels that split across areas - usually only by a little.} SourceRecordSet := SourceLayer.SearchShape(ParcelLayerPolygon.Centroid, moContainedBy, ''); SourceRecordSet.MoveFirst; ValuesMatched := 0; FirstMatch := ''; while (not SourceRecordSet.EOF) do begin If (FindParcelForMapRecord(ParcelLookupTable, MapParcelIDFormatTable, AssessmentYearControlTable, MapSetupObject, ParcelRecordSet.Fields.Item(LinkFieldName).Value, AssessmentYear) and MeetsCriteria(ParcelLookupTable, ResidentialParcelsOnly, CommercialParcelsOnly)) then begin SwisSBLKey := ExtractSSKey(ParcelLookupTable); NewValue := SourceRecordSet.Fields.Item(SourceFieldName).Value; If _Compare(FieldToExcludeOn, coBlank) then ExclusionValue := '' else ExclusionValue := SourceRecordSet.Fields.Item(FieldToExcludeOn).Value; If _Compare(ExclusionsList.IndexOf(ExclusionValue), -1, coEqual) then begin Inc(ValuesMatched); If _Compare(ValuesMatched, 1, coGreaterThan) then begin If _Compare(ValuesMatched, 2, coEqual) then MultipleMatchList.Append('*' + FirstMatch); MultipleMatchList.Append(ConvertSwisSBLToDashDot(SwisSBLKey) + ':' + NewValue); end else begin If ((not _Locate(TempTable, [AssessmentYear, SwisSBLKey], '', [])) and AddInventoryRecordsIfNeeded) then AddInventorySite(AssessmentYear, TempTable.TableName, SwisSBLKey); If _Locate(TempTable, [AssessmentYear, SwisSBLKey], '', []) then begin Inc(NumberChanged); Inc(NumberPrintedThisPage); with Sender as TBaseReport do begin If (_Compare(NumberPrintedThisPage, 1, coGreaterThan) and Odd(NumberPrintedThisPage)) then begin Println(''); If (LinesLeft < 5) then begin NewPage; NumberPrintedThisPage := 1; end; end; {If ((NumberChanged > 1) and ...} Print(#9 + ConvertSwisSBLToDashDot(SwisSBLKey) + #9 + NewValue); end; {with Sender as TBaseReport do} If not TrialRun then with TempTable do try Edit; FieldByName(DestinationFieldName).Text := NewValue; Post; except end; FirstMatch := ConvertSwisSBLToDashDot(SwisSBLKey) + ':' + NewValue; end; {If _Locate(TempTable, [AssessmentYear, SwisSBLKey], '', [])} end; {else of If _Compare(ValuesMatched, 1, coGreaterThan)} end; {If _Compare(ExclusionList.IndexOf(ExclusionValue), -1, coEqual)} end; {If FindParcelForMapRecord(ParcelLookupTable, ...} SourceRecordSet.MoveNext; end; {while (not SourceRecordSet.EOF) do} end; {If ((not Done) and ...} until (Done or Cancelled); {Search by Source layer.} (* SourceRecordSet := SourceLayer.Records; LinkFieldName := MapSetupObject.MapFileKeyField; NumberChanged := 0; NumberPrintedThisPage := 0; ProgressBar.Position := 0; ProgressBar.Max := SourceRecordSet.Count - 1; SourceRecordSet.MoveFirst; repeat If FirstTimeThrough then FirstTimeThrough := False else SourceRecordSet.MoveNext; If SourceRecordSet.EOF then Done := True; ProgressBar.Position := ProgressBar.Position + 1; Application.ProcessMessages; If ((not Done) and ((not ContinuousLineType) or _Compare(SourceRecordSet.Fields.Item('LineType').Value, 'Continuous', coEqual))) then begin SourceLayerField := SourceRecordSet.Fields.Item('Shape'); SourceLayerPolygon := IMoPolygon(CreateOleObject('MapObjects2.Polygon')); SourceLayerPolygon := IMoPolygon(IDispatch(SourceLayerField.Value)); Map.FlashShape(SourceLayerPolygon, 3); {We will only set the value if the centroid of the parcel is in the source layer area. This eliminates parcels that split across areas - usually only by a little.} SearchRecordSet := ParcelLayer.SearchShape(SourceLayerPolygon, moCentroidInPolygon, ''); SearchRecordSet.MoveFirst; while (not SearchRecordSet.EOF) do begin If FindParcelForMapRecord(ParcelLookupTable, MapParcelIDFormatTable, AssessmentYearControlTable, MapSetupObject, SearchRecordSet.Fields.Item(LinkFieldName).Value, AssessmentYear) then begin ParcelLayerField := SearchRecordSet.Fields.Item('Shape'); ParcelLayerPolygon := IMoPolygon(CreateOleObject('MapObjects2.Polygon')); ParcelLayerPolygon := IMoPolygon(IDispatch(ParcelLayerField.Value)); SwisSBLKey := ExtractSSKey(ParcelLookupTable); If ((not _Locate(TempTable, [AssessmentYear, SwisSBLKey], '', [])) and AddInventoryRecordsIfNeeded) then AddInventorySite(AssessmentYear, TempTable.TableName, SwisSBLKey); If _Locate(TempTable, [AssessmentYear, SwisSBLKey], '', []) then begin Inc(NumberChanged); Inc(NumberPrintedThisPage); NewValue := SourceRecordSet.Fields.Item(SourceFieldName).Value; with Sender as TBaseReport do begin If ((NumberPrintedThisPage > 1) and Odd(NumberPrintedThisPage)) then begin Println(''); If (LinesLeft < 5) then begin NewPage; NumberPrintedThisPage := 0; end; end; {If ((NumberChanged > 1) and ...} Print(#9 + ConvertSwisSBLToDashDot(SwisSBLKey) + #9 + NewValue); end; {with Sender as TBaseReport do} If not TrialRun then with TempTable do try Edit; FieldByName(DestinationFieldName).Text := NewValue; Post; except end; end; {If _Locate(TempTable, [AssessmentYear, SwisSBLKey], '', [])} end; {If FindParcelForMapRecord(ParcelLookupTable, ...} SearchRecordSet.MoveNext; end; {while (not SearchRecordSet.EOF) do} end; {If ((not Done) and ...} until (Done or Cancelled); *) with Sender as TBaseReport do begin Println(''); ClearTabs; SetTab(0.3, pjLeft, 7.5, 0, BOXLINENONE, 0); Bold := True; Println(#9 + 'Total Changed = ' + IntToStr(NumberChanged)); Bold := False; If (MultipleMatchList.Count > 0) then begin ReportSection := rsMultipleMatch; If (LinesLeft < 10) then NewPage else PrintMultipleMatchSectionHeader(Sender); For I := 0 to (MultipleMatchList.Count - 1) do begin ColonPos := Pos(':', MultipleMatchList[I]); SwisSBLKey := Copy(MultipleMatchList[I], 1, (ColonPos - 1)); NewValue := Copy(MultipleMatchList[I], (ColonPos + 1), 200); If ((I > 0) and Odd(I + 1)) then begin Println(''); If (LinesLeft < 5) then NewPage; end; {If ((I > 0) and ...} Print(#9 + SwisSBLKey + #9 + NewValue); end; {For I := 0 to (MultipleMatchList.Count - 1) do} Println(''); end; {If (MultipleMatchList.Count > 0)} end; {with Sender as TBaseReport do} MultipleMatchList.Free; Close; end; {ReportPrint} {==============================================================================} Procedure TSetFieldValueFromMapLayerDialog.CancelButtonClick(Sender: TObject); begin Cancelled := True; end; {==================================================================} Procedure TSetFieldValueFromMapLayerDialog.FormClose( Sender: TObject; var Action: TCloseAction); begin ExclusionsList.Free; CloseTablesForForm(Self); Action := caFree; end; end.
unit setsu; interface uses Windows, Controls, Forms, Classes, SysUtils, Registry, gdip_gfx, toolu; type _SetsContainer = record CellSize: integer; Border: integer; Space: integer; Radius: integer; PrevMonth: boolean; NextMonth: boolean; BaseAlpha: integer; Blur: boolean; Position: integer; Font: _FontData; TodayMarkColor: cardinal; FillToday: boolean; end; _Sets = class public FirstRun: boolean; X: integer; Y: integer; container: _SetsContainer; cancel_container: _SetsContainer; constructor Create; procedure Load; procedure Save; procedure StoreSetsContainer; procedure RestoreSetsContainer; procedure CopySetsContainer(var dst: _SetsContainer; var src: _SetsContainer); end; var sets: _Sets; implementation //------------------------------------------------------------------------------ constructor _Sets.Create; begin inherited Create; end; //------------------------------------------------------------------------------ procedure _Sets.Load; var reg: TRegistry; begin // defaults // FirstRun := true; X := -100; Y := -100; container.CellSize := 28; container.Border := 14; container.Space := 14; container.Radius := 20; StrCopy(container.Font.name, pchar(toolu.GetFont)); container.Font.size := 12; container.Font.color := $ffd0d0d0; container.Font.color2 := $ffff0000; container.Font.bold := true; container.Font.italic := false; container.BaseAlpha := 10; container.Blur := true; container.PrevMonth := true; container.NextMonth := true; container.Position := 1; container.TodayMarkColor := $ff646464; container.FillToday := false; // load sets // reg := TRegistry.Create; reg.RootKey := HKEY_CURRENT_USER; if reg.OpenKey('Software\Holmes\Descal', false) then begin try X := SetRange(reg.ReadInteger('X'), 0, 100000); Y := SetRange(reg.ReadInteger('Y'), 0, 100000); except end; try container.CellSize := SetRange(reg.ReadInteger('CellSize'), 10, 50); container.Border := SetRange(reg.ReadInteger('Border'), 0, 40); container.Radius := SetRange(reg.ReadInteger('Radius'), 0, 40); container.BaseAlpha := SetRange(reg.ReadInteger('BaseAlpha'), 0, 255); container.Blur := reg.ReadBool('Blur'); container.PrevMonth := reg.ReadBool('PrevMonth'); container.NextMonth := reg.ReadBool('NextMonth'); container.Position := SetRange(reg.ReadInteger('Position'), 0, 2); container.TodayMarkColor := uint(reg.ReadInteger('TodayMarkColor')); container.FillToday := reg.ReadBool('FillToday'); except end; // font // try StrCopy(container.Font.name, pchar(reg.ReadString('FontName'))); container.Font.size := SetRange(reg.ReadInteger('FontSize'), 6, 72); container.Font.color := uint(reg.ReadInteger('FontColor')); container.Font.color2 := uint(reg.ReadInteger('FontColor2')); container.Font.bold := reg.ReadBool('FontBold'); container.Font.italic := reg.ReadBool('FontItalic'); except end; FirstRun := false; reg.CloseKey; end; // finalization // reg.free; end; //------------------------------------------------------------------------------ procedure _Sets.Save; var reg: TRegistry; begin reg := TRegistry.Create; reg.RootKey := HKEY_CURRENT_USER; if reg.OpenKey('Software\Holmes\Descal', true) then begin reg.WriteInteger('X', X); reg.WriteInteger('Y', Y); reg.WriteInteger('CellSize', container.CellSize); reg.WriteInteger('Border', container.Border); reg.WriteInteger('Radius', container.Radius); reg.WriteBool('Blur', container.Blur); reg.WriteInteger('BaseAlpha', container.BaseAlpha); reg.WriteBool('PrevMonth', container.PrevMonth); reg.WriteBool('NextMonth', container.NextMonth); reg.WriteInteger('Position', container.Position); reg.WriteInteger('TodayMarkColor', container.TodayMarkColor); reg.WriteBool('FillToday', container.FillToday); // font // reg.WriteString('FontName', pchar(@container.Font.name[0])); reg.WriteInteger('FontSize', container.Font.size); reg.WriteInteger('FontColor', container.Font.color); reg.WriteInteger('FontColor2', container.Font.color2); reg.WriteBool('FontBold', container.Font.bold); reg.WriteBool('FontItalic', container.Font.italic); reg.CloseKey; end; reg.free; end; //------------------------------------------------------------------------------ procedure _Sets.StoreSetsContainer; begin CopySetsContainer(cancel_container, container); end; //------------------------------------------------------------------------------ procedure _Sets.RestoreSetsContainer; begin CopySetsContainer(container, cancel_container); end; //------------------------------------------------------------------------------ procedure _Sets.CopySetsContainer(var dst: _SetsContainer; var src: _SetsContainer); begin dst.CellSize := src.CellSize; dst.Border := src.Border; dst.Space := src.Space; dst.Radius := src.Radius; dst.BaseAlpha := src.BaseAlpha; dst.Blur := src.Blur; dst.PrevMonth := src.PrevMonth; dst.NextMonth := src.NextMonth; dst.Position := src.Position; dst.TodayMarkColor := src.TodayMarkColor; dst.FillToday := src.FillToday; CopyFontData(src.Font, dst.Font); end; //------------------------------------------------------------------------------ end.
Unit UnAtualizacao1; interface Uses Classes, DbTables,SysUtils; Type TAtualiza1 = Class Private Aux : TQuery; DataBase : TDataBase; procedure AtualizaSenha( Senha : string ); public function AtualizaTabela(VpaNumAtualizacao : Integer) : Boolean; function AtualizaBanco : Boolean; constructor criar( aowner : TComponent; ADataBase : TDataBase ); end; Const CT_SenhaAtual = '9774'; implementation Uses FunSql, ConstMsg, FunNumeros, Registry, Constantes, FunString, funvalida, AAtualizaSistema; {*************************** cria a classe ************************************} constructor TAtualiza1.criar( aowner : TComponent; ADataBase : TDataBase ); begin inherited Create; Aux := TQuery.Create(aowner); DataBase := ADataBase; Aux.DataBaseName := 'BaseDados'; end; {*************** atualiza senha na base de dados ***************************** } procedure TAtualiza1.AtualizaSenha( Senha : string ); var ini : TRegIniFile; senhaInicial : string; begin try if not DataBase.InTransaction then DataBase.StartTransaction; // atualiza regedit Ini := TRegIniFile.Create('Software\Systec\Sistema'); senhaInicial := Ini.ReadString('SENHAS','BANCODADOS', ''); // guarda senha do banco Ini.WriteString('SENHAS','BANCODADOS', Criptografa(senha)); // carrega senha do banco // atualiza base de dados LimpaSQLTabela(aux); AdicionaSQLTabela(Aux, 'grant connect, to DBA identified by ''' + senha + ''''); Aux.ExecSQL; if DataBase.InTransaction then DataBase.commit; ini.free; except if DataBase.InTransaction then DataBase.Rollback; Ini.WriteString('SENHAS','BANCODADOS', senhaInicial); ini.free; end; end; {*********************** atualiza o banco de dados ****************************} function TAtualiza1.AtualizaBanco : boolean; begin result := true; AdicionaSQLAbreTabela(Aux,'Select I_Ult_Alt from Cfg_Geral '); if Aux.FieldByName('I_Ult_Alt').AsInteger < CT_VersaoBanco Then result := AtualizaTabela(Aux.FieldByName('I_Ult_Alt').AsInteger); end; {**************************** atualiza a tabela *******************************} function TAtualiza1.AtualizaTabela(VpaNumAtualizacao : Integer) : Boolean; var VpfErro : String; begin result := true; repeat Try if VpaNumAtualizacao < 262 Then begin VpfErro := '262'; ExecutaComandoSql(Aux, ' create table CADREQUISICAOMATERIAL ' + ' ( ' + ' I_EMP_FIL integer not null, ' + ' I_COD_REQ integer not null, ' + ' I_COD_USU integer null, ' + ' I_USU_REQ integer null, ' + ' L_OBS_REQ long varchar null, ' + ' D_DAT_REQ date null, ' + ' D_ULT_ALT date null, ' + ' C_SIT_REQ char(1) null, ' + ' primary key (I_EMP_FIL, I_COD_REQ) ' + ' ); ' + ' comment on table CADREQUISICAOMATERIAL is ''REQUISICAO DE MATERIAL''; ' + ' comment on column CADREQUISICAOMATERIAL.I_EMP_FIL is ''CODIGO EMPRESA FILIAL ''; ' + ' comment on column CADREQUISICAOMATERIAL.I_COD_REQ is ''CODIGO DA REQUISICAO ''; ' + ' comment on column CADREQUISICAOMATERIAL.I_COD_USU is ''CODIGO DO USUARIO QUE CEDE O MATERIAL ''; ' + ' comment on column CADREQUISICAOMATERIAL.I_USU_REQ is ''CODIGO DO USUARIO QUE PEGA O MATERIAL ''; ' + ' comment on column CADREQUISICAOMATERIAL.L_OBS_REQ is ''OBSERVACAO''; ' + ' comment on column CADREQUISICAOMATERIAL.D_DAT_REQ is ''DATA DA REQUISICAO ''; ' + ' comment on column CADREQUISICAOMATERIAL.D_ULT_ALT is ''DATA DA ALTERACAO''; ' + ' comment on column CADREQUISICAOMATERIAL.C_SIT_REQ is ''SITUACAO DA REQUISICAO ''; ' ); ExecutaComandoSql(Aux, ' create table MOVREQUISICAOMATERIAL ' + ' ( ' + ' I_EMP_FIL integer not null, ' + ' I_COD_REQ integer not null, ' + ' I_SEQ_PRO integer not null, ' + ' C_COD_UNI char(2) null, ' + ' N_QTD_PRO numeric(17,3) null, ' + ' primary key (I_EMP_FIL, I_COD_REQ, I_SEQ_PRO) ' + ' ); ' + ' comment on table MOVREQUISICAOMATERIAL is ''MOVIMENTO DE REQUISICAO DE MATERIAL ''; ' + ' comment on column MOVREQUISICAOMATERIAL.I_EMP_FIL is ''CODIGO EMPRESA FILIAL ''; ' + ' comment on column MOVREQUISICAOMATERIAL.I_COD_REQ is ''CODIGO DA REQUISICAO ''; ' + ' comment on column MOVREQUISICAOMATERIAL.I_SEQ_PRO is ''CODIGO DO PRODUTO''; ' + ' comment on column MOVREQUISICAOMATERIAL.C_COD_UNI is ''CODIGO DA UNIDADE ''; ' + ' comment on column MOVREQUISICAOMATERIAL.N_QTD_PRO is ''QUANTIDADE DE PRODUTO''; ' ); ExecutaComandoSql(Aux, ' alter table MOVREQUISICAOMATERIAL ' + ' add foreign key FK_MOVREQUI_REF_14803_CADREQUI (I_EMP_FIL, I_COD_REQ) ' + ' references CADREQUISICAOMATERIAL (I_EMP_FIL, I_COD_REQ) on update restrict on delete restrict; ' + ' alter table MOVREQUISICAOMATERIAL ' + ' add foreign key FK_MOVREQUI_REF_14804_CADPRODU (I_SEQ_PRO) ' + ' references CADPRODUTOS (I_SEQ_PRO) on update restrict on delete restrict; ' + ' alter table MOVREQUISICAOMATERIAL ' + ' add foreign key FK_MOVREQUI_REF_14804_CADUNIDA (C_COD_UNI) ' + ' references CADUNIDADE (C_COD_UNI) on update restrict on delete restrict; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 262'); end; if VpaNumAtualizacao < 263 Then begin VpfErro := '263'; ExecutaComandoSql(Aux, ' create unique index CADREQUISICAOMATERIAL_PK on CADREQUISICAOMATERIAL (I_EMP_FIL asc, I_COD_REQ asc); ' + ' create unique index MOVREQUISICAOMATERIAL_PK on MOVREQUISICAOMATERIAL (I_EMP_FIL asc, I_COD_REQ asc, I_SEQ_PRO asc); ' + ' create index Ref_148037_FK on MOVREQUISICAOMATERIAL (I_EMP_FIL asc, I_COD_REQ asc); ' + ' create index Ref_148044_FK on MOVREQUISICAOMATERIAL (I_SEQ_PRO asc); ' + ' create index Ref_148048_FK on MOVREQUISICAOMATERIAL (C_COD_UNI asc); ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 263'); end; if VpaNumAtualizacao < 264 Then begin VpfErro := '264'; ExecutaComandoSql(Aux,' alter table cfg_fiscal' + ' add I_VIA_ROM INTEGER NULL; ' + ' alter table cadtransportadoras ' + ' add C_PLA_VEI char(10) null; ' + ' alter table movcaixaestoque ' + ' add D_DAT_CAN date null ' ); ExecutaComandoSql(Aux,'Update CFG_GERAL set I_Ult_Alt = 264'); ExecutaComandoSql(Aux,'comment on column cfg_fiscal.I_VIA_ROM is ''QUANTIDADE DE VIAS DO ROMANEIO'''); ExecutaComandoSql(Aux,'comment on column cadtransportadoras.C_PLA_VEI is ''PLACA DO VEICULO'''); ExecutaComandoSql(Aux,'comment on column movcaixaestoque.D_DAT_CAN is ''DATA DO CANCELAMENTO DA CAIXA'''); end; if VpaNumAtualizacao < 265 Then begin VpfErro := '265'; ExecutaComandoSql(Aux,' create table MOVORDEMPRODUCAO ' + ' ( ' + ' I_EMP_FIL integer not null, ' + ' I_NRO_ORP integer not null, ' + ' I_SEQ_PRO integer not null, ' + ' C_COD_UNI char(2) null, ' + ' N_QTD_PRO numeric(17,8) null, ' + ' D_ULT_ALT date null, ' + ' C_UNI_PAI char(2) null, ' + ' primary key (I_EMP_FIL, I_NRO_ORP, I_SEQ_PRO) ' + ' ); ' + ' comment on table MOVORDEMPRODUCAO is ''MOVORDEMPRODUCAO''; ' + ' comment on column MOVORDEMPRODUCAO.I_EMP_FIL is ''CODIGO DA FILIAL''; ' + ' comment on column MOVORDEMPRODUCAO.I_NRO_ORP is ''CODIGO DA ORDEM DE PRODUCAO''; ' + ' comment on column MOVORDEMPRODUCAO.I_SEQ_PRO is ''CODIGO DO PRODUTO''; ' + ' comment on column MOVORDEMPRODUCAO.C_COD_UNI is ''CODIGO DA UNIDADE''; ' + ' comment on column MOVORDEMPRODUCAO.N_QTD_PRO is ''QUANTIDADE DE PRODUTOS''; ' + ' comment on column MOVORDEMPRODUCAO.D_ULT_ALT is ''DATA DA ULTIMA ALTERACAO''; ' + ' comment on column MOVORDEMPRODUCAO.C_UNI_PAI is ''C_UNI_PAI''; ' ); ExecutaComandoSql(Aux,' create table CADTURNOS ' + ' ( ' + ' I_EMP_FIL integer not null, ' + ' I_COD_TUR integer not null, ' + ' C_DES_TUR char(30) null, ' + ' H_HOR_INI time null, ' + ' H_HOR_FIM time null, ' + ' N_QTD_HOR numeric(10,3) null, ' + ' primary key (I_EMP_FIL, I_COD_TUR) ' + ' ); ' + ' comment on table CADTURNOS is ''CADASTRO DE TURNOS''; ' + ' comment on column CADTURNOS.I_EMP_FIL is ''CODIGO EMPRESA FILIAL''; ' + ' comment on column CADTURNOS.I_COD_TUR is ''CODIGO DO TURNO''; ' + ' comment on column CADTURNOS.C_DES_TUR is ''DESCRICAO DO TURNO''; ' + ' comment on column CADTURNOS.H_HOR_INI is ''HRA DE INICIO DO TURNO''; ' + ' comment on column CADTURNOS.H_HOR_FIM is ''HORA DE FIM DO TRUNO''; ' + ' comment on column CADTURNOS.N_QTD_HOR is ''QUANTIDADE DE HORAS EFETIVAS''; ' + ' alter table MOVORDEMPRODUCAO ' + ' add foreign key FK_MOVORDEM_REF_16248_CADORDEM (I_EMP_FIL, I_NRO_ORP) ' + ' references CADORDEMPRODUCAO (I_EMP_FIL, I_NRO_ORP) on update restrict on delete restrict; ' + ' alter table MOVORDEMPRODUCAO ' + ' add foreign key FK_MOVORDEM_REF_16249_CADPRODU (I_SEQ_PRO) ' + ' references CADPRODUTOS (I_SEQ_PRO) on update restrict on delete restrict; ' + ' alter table CADTURNOS ' + ' add foreign key FK_CADTURNO_REF_16250_CADFILIA (I_EMP_FIL) ' + ' references CADFILIAIS (I_EMP_FIL) on update restrict on delete restrict; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 265'); end; if VpaNumAtualizacao < 266 Then begin VpfErro := '266'; ExecutaComandoSql(Aux,' create unique index MOVORDEMPRODUCAO_PK on MOVORDEMPRODUCAO (I_EMP_FIL asc, I_NRO_ORP asc, I_SEQ_PRO asc); ' + ' create index Ref_162488_FK on MOVORDEMPRODUCAO (I_EMP_FIL asc, I_NRO_ORP asc); ' + ' create index Ref_162495_FK on MOVORDEMPRODUCAO (I_SEQ_PRO asc); ' + ' create unique index CADTURNOS_PK on CADTURNOS (I_EMP_FIL asc, I_COD_TUR asc); ' + ' create index Ref_162501_FK on CADTURNOS (I_EMP_FIL asc); ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 266'); end; if VpaNumAtualizacao < 267 Then begin VpfErro := '267'; ExecutaComandoSql(Aux,' alter table cadOrdemProducao ' + ' add N_PES_TOT numeric(17,8) null, ' + ' add N_PEC_HOR numeric(17,8) null' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 267'); end; if VpaNumAtualizacao < 268 Then begin VpfErro := '268'; ExecutaComandoSql(Aux,' alter table cfg_fiscal ' + ' add C_CAL_PES char(1) null; ' + ' alter table cfg_produto ' + ' add C_MOS_RES char(1) null; ' + ' alter table cadprodutos ' + ' add N_LIQ_CAI numeric(17,8) null, ' + ' add C_UNI_VEN char(2) null ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 268'); ExecutaComandoSql(Aux,'comment on column cfg_fiscal.C_CAL_PES is ''PERMITE O CALCULO DO PESO LIQUIDO AO NATO AUTOMATICAMENTE'''); ExecutaComandoSql(Aux,'comment on column cfg_produto.C_MOS_RES is ''MOSTRA RESERVADO'''); ExecutaComandoSql(Aux,'comment on column cadprodutos.N_LIQ_CAI is ''PESO LIQUIDO DA CAIXA'''); ExecutaComandoSql(Aux,'comment on column cadprodutos.C_UNI_VEN is ''UNIDADE DE VANDA PARA USO DE CAIXA'''); end; if VpaNumAtualizacao < 269 Then begin VpfErro := '269'; ExecutaComandoSql(Aux,' alter table movNotasfiscais ' + ' add N_LIQ_CAI numeric(17,8) null, ' + ' add C_UNI_VEN char(2) null ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 269'); ExecutaComandoSql(Aux,'comment on column movNotasfiscais.N_LIQ_CAI is ''PESO LIQUIDO DA CAIXA'''); ExecutaComandoSql(Aux,'comment on column movNotasfiscais.C_UNI_VEN is ''UNIDADE DE VANDA PARA USO DE CAIXA'''); end; if VpaNumAtualizacao < 270 Then begin VpfErro := '270'; ExecutaComandoSql(Aux,' alter table cfg_geral ' + ' add D_DAT_SIS date null ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 270'); end; if VpaNumAtualizacao < 271 Then begin VpfErro := '271'; ExecutaComandoSql(Aux,' alter table cadclientes ' + ' modify C_PRA_CLI char(80) null; ' + ' alter table movrequisicaomaterial ' + ' add C_COD_PRO char(20) null '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 271'); end; if VpaNumAtualizacao < 272 Then begin VpfErro := '272'; ExecutaComandoSql(Aux,' alter table cadturnos ' + ' add D_ULT_ALT DATE null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 272'); end; if VpaNumAtualizacao < 273 Then begin VpfErro := '273'; ExecutaComandoSql(Aux,' alter table cfg_servicos ' + ' add I_SIT_PAD integer null; ' + ' alter table movordemproducao ' + ' add C_COD_PRO char(20) null '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 273'); end; if VpaNumAtualizacao < 274 Then begin VpfErro := '274'; ExecutaComandoSql(Aux, ' create table CADSETORESESTOQUE ' + ' ( ' + ' I_COD_SET integer not null, ' + ' C_NOM_SET char(30) null, ' + ' D_ULT_ALT date null, ' + ' primary key (I_COD_SET) ' + ' ); ' + ' comment on table CADSETORESESTOQUE is ''SETORES DO MOVIMENTO DE ESTOQUE ''; ' + ' comment on column CADSETORESESTOQUE.I_COD_SET is ''CODIGO DO SETOR DE ESTOQUE''; ' + ' comment on column CADSETORESESTOQUE.C_NOM_SET is ''NOME DO SETOR DE ESTOQUE''; ' ); ExecutaComandoSql(Aux, ' alter table movestoqueprodutos ' + ' add I_COD_SET integer null ' ); ExecutaComandoSql(Aux, ' alter table movestoqueprodutos ' + ' add foreign key FK_MOVSETOR_REF_1487 (I_COD_SET) ' + ' references CADSETORESESTOQUE(I_COD_SET) on update restrict on delete restrict; ' ); ExecutaComandoSql(Aux,' create unique index CADSETORESESTOQUE_PK on CADSETORESESTOQUE (I_COD_SET asc); ' + ' create index Ref_89733_FK on movestoqueprodutos(I_COD_SET asc); ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 274'); end; if VpaNumAtualizacao < 275 Then begin VpfErro := '275'; ExecutaComandoSql(Aux,' alter table cfg_geral' + ' add C_SEN_LIB char(10) null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 275'); end; if VpaNumAtualizacao < 276 Then begin VpfErro := '276'; ExecutaComandoSql(Aux,' alter table caditenscusto' + ' add C_TIP_LUC char(1) null,' + ' add I_DES_IMP integer null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 276'); end; if VpaNumAtualizacao < 277 Then begin VpfErro := '277'; ExecutaComandoSql(Aux,' alter table cadcontatos' + ' modify C_FON_CON char(20) null,' + ' modify C_FAX_CON char(20) null; ' + ' create index cadorcamentosCP_01 on cadorcamentos(D_DAT_ENT asc); '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 277'); end; if VpaNumAtualizacao < 278 Then begin VpfErro := '278'; ExecutaComandoSql(Aux,' alter table movQdadeProduto ' + ' modify N_VLR_CUS numeric(17,7) null,' + ' modify N_VLR_COM numeric(17,7) null, ' + ' modify N_CUS_COM numeric(17,7) null; ' + ' alter table CadItensCusto ' + ' modify N_PER_PAD numeric(17,8) null,' + ' modify N_VLR_PAD numeric(17,8) null; ' + ' alter table MovItensCusto ' + ' modify N_VLR_CUS numeric(17,8) null,' + ' modify N_PER_CUS numeric(17,8) null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 278'); end; if VpaNumAtualizacao < 279 Then begin VpfErro := '279'; ExecutaComandoSql(Aux,' alter table CFG_GERAL ' + ' Add I_DEC_CUS integer null;' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 279'); end; if VpaNumAtualizacao < 280 Then begin VpfErro := '280'; ExecutaComandoSql(Aux,' alter table movitenscusto ' + ' Add I_DES_IMP integer null;' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 280'); end; if VpaNumAtualizacao < 281 Then begin VpfErro := '281'; ExecutaComandoSql(Aux,' alter table cfg_servicos ' + ' add I_OPE_PCP integer null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 281'); end; if VpaNumAtualizacao < 282 Then begin VpfErro := '282'; ExecutaComandoSql(Aux,' alter table cfg_fiscal ' + ' add C_ITE_AUT char(1) null, ' + ' add C_ORD_CAI char(1) null; ' + ' alter table cfg_produto ' + ' add C_VAL_CUS char(1) null'); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 282'); end; if VpaNumAtualizacao < 283 Then begin VpfErro := '283'; ExecutaComandoSql(Aux,' alter table MovQdadeProduto ' + ' add N_VLR_MAR numeric(17,7) null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 283'); end; if VpaNumAtualizacao < 284 Then begin VpfErro := '284'; ExecutaComandoSql(Aux,' alter table MovQdadeProduto ' + ' add N_VLR_DES numeric(17,7) null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 284'); end; if VpaNumAtualizacao < 285 Then begin VpfErro := '285'; ExecutaComandoSql(Aux,' alter table CadProdutos ' + ' add C_UNI_COM char(2) null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 285'); end; if VpaNumAtualizacao < 286 Then begin VpfErro := '286'; ExecutaComandoSql(Aux,' alter table MovQdadeProduto ' + ' add N_VLR_PRO numeric(17,7) null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 286'); end; if VpaNumAtualizacao < 287 Then begin VpfErro := '287'; ExecutaComandoSql(Aux,' alter table MovComposicaoProduto ' + ' add N_QTD_COM numeric(17,7) null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 287'); end; if VpaNumAtualizacao < 288 Then begin VpfErro := '288'; ExecutaComandoSql(Aux,' alter table CFG_FISCAL ' + ' add C_MOS_TRO char(1) null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 288'); end; if VpaNumAtualizacao < 289 Then begin VpfErro := '289'; ExecutaComandoSql(Aux,' drop index MOVITENSCUSTO_PK;' + ' alter TABLE MovItensCusto drop primary key;' + ' alter table MovItensCusto add I_COD_TAB integer null;' + ' update MovItensCusto set i_cod_tab = (select min(i_cod_tab) from cadtabelapreco);' + ' alter table MovItensCusto modify I_COD_TAB integer not null;' + ' alter table MovItensCusto add primary key (i_cod_emp, i_cod_ite, i_seq_pro, i_cod_tab);' + ' create index MovItensCusto_PK on MovItensCusto(i_cod_emp, i_cod_ite, i_seq_pro, i_cod_tab asc);' + ' alter table movtabelapreco ' + ' add N_VLR_CUS numeric(17,7) null, ' + ' add N_VLR_PRO numeric(17,7) null, ' + ' add N_VLR_DES numeric(17,7) null, ' + ' add N_VLR_MAR numeric(17,7) null; ' + ' alter table movqdadeproduto ' + ' delete N_VLR_CUS , ' + ' delete N_VLR_PRO , ' + ' delete N_VLR_DES , ' + ' delete N_VLR_MAR ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 289'); end; if VpaNumAtualizacao < 290 Then begin VpfErro := '290'; ExecutaComandoSql(Aux,' alter table CFG_Produto ' + ' add I_OPE_REQ integer null, '+ ' add I_IMP_REQ integer null; ' ); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 290'); end; if VpaNumAtualizacao < 291 Then begin VpfErro := '291'; ExecutaComandoSql(Aux,' alter table CFG_Produto ' + ' add I_REQ_CAN integer null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 291'); end; if VpaNumAtualizacao < 292 Then begin VpfErro := '292'; ExecutaComandoSql(Aux,' alter table CadRequisicaoMaterial ' + ' add I_NRO_ORS integer null, ' + ' add I_NRO_ORP integer null, ' + ' add I_NRO_NOF integer null, ' + ' add I_NRO_PED integer null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 292'); end; if VpaNumAtualizacao < 293 Then begin VpfErro := '293'; ExecutaComandoSql(Aux,' alter table Cfg_Produto ' + ' add C_IMP_TAG char(1) null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 293'); end; if VpaNumAtualizacao < 294 Then begin VpfErro := '294'; ExecutaComandoSql(Aux,' alter table Cfg_Produto ' + ' add I_SIT_REQ integer null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 294'); end; if VpaNumAtualizacao < 295 Then begin VpfErro := '295'; ExecutaComandoSql(Aux,' alter table Cfg_Produto ' + ' add C_CUP_AUT char(1) null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 295'); end; if VpaNumAtualizacao < 296 Then begin VpfErro := '296'; ExecutaComandoSql(Aux,' alter table cadsituacoes ' + ' add I_QTD_DIA integer null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 296'); end; if VpaNumAtualizacao < 297 Then begin VpfErro := '297'; ExecutaComandoSql(Aux,' alter table cad_plano_conta ' + ' add C_TIP_CUS char(1) null, ' + ' add C_TIP_DES char(1) null;' + ' Update Cad_plano_conta set c_tip_cus = ''V''; ' + ' Update Cad_plano_conta set c_tip_des = ''F''; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 297'); end; if VpaNumAtualizacao < 298 Then begin VpfErro := '298'; ExecutaComandoSql(Aux,' alter table CADFORMASPAGAMENTO ' + ' add I_COD_SIT integer null; '); ExecutaComandoSql(Aux,'Update Cfg_Geral set I_Ult_Alt = 298'); end; if VpaNumAtualizacao < 299 Then begin VpfErro := '299'; ExecutaComandoSql(Aux,' alter table ITE_CAIXA ' + ' add FIL_ORI integer null; ' ); ExecutaComandoSql(Aux,' Update ITE_CAIXA set FIL_ORI = 11'); ExecutaComandoSql(Aux,' Update Cfg_Geral set I_Ult_Alt = 299'); end; except result := false; FAtualizaSistema.MostraErro(Aux.sql,'cfg_geral'); Erro(VpfErro + ' - OCORREU UM ERRO DURANTE A ATUALIZAÇAO DO SISTEMA inSIG.'); exit; end; until result; end; end.
// // Copyright (c) 2009-2010 Mikko Mononen memon@inside.org // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. // {$POINTERMATH ON} unit RN_RecastMesh; interface uses Math, SysUtils, RN_Helper, RN_Recast; /// Builds a polygon mesh from the provided contours. /// @ingroup recast /// @param[in,out] ctx The build context to use during the operation. /// @param[in] cset A fully built contour set. /// @param[in] nvp The maximum number of vertices allowed for polygons generated during the /// contour to polygon conversion process. [Limit: >= 3] /// @param[out] mesh The resulting polygon mesh. (Must be re-allocated.) /// @returns True if the operation completed successfully. function rcBuildPolyMesh(ctx: TrcContext; cset: PrcContourSet; const nvp: Integer; mesh: PrcPolyMesh): Boolean; /// Merges multiple polygon meshes into a single mesh. /// @ingroup recast /// @param[in,out] ctx The build context to use during the operation. /// @param[in] meshes An array of polygon meshes to merge. [Size: @p nmeshes] /// @param[in] nmeshes The number of polygon meshes in the meshes array. /// @param[in] mesh The resulting polygon mesh. (Must be pre-allocated.) /// @returns True if the operation completed successfully. function rcMergePolyMeshes(ctx: TrcContext; meshes: array of TrcPolyMesh; const nmeshes: Integer; mesh: PrcPolyMesh): Boolean; implementation uses RN_RecastHelper; type PrcEdge = ^TrcEdge; TrcEdge = record vert: array [0..1] of Word; polyEdge: array [0..1] of Word; poly: array [0..1] of Word; end; function buildMeshAdjacency(polys: PWord; const npolys: Integer; const nverts: Integer; const vertsPerPoly: Integer): Boolean; var maxEdgeCount,edgeCount: Integer; firstEdge,nextEdge: PWord; edges: PrcEdge; i,j: Integer; t: PWord; v0,v1: Word; edge,e1: PrcEdge; e: Word; p0,p1: PWord; begin // Based on code by Eric Lengyel from: // http://www.terathon.com/code/edges.php maxEdgeCount := npolys*vertsPerPoly; GetMem(firstEdge, sizeof(Word)*(nverts + maxEdgeCount)); nextEdge := firstEdge + nverts; edgeCount := 0; GetMem(edges, sizeof(TrcEdge)*maxEdgeCount); for i := 0 to nverts - 1 do firstEdge[i] := RC_MESH_NULL_IDX; for i := 0 to npolys - 1 do begin t := @polys[i*vertsPerPoly*2]; for j := 0 to vertsPerPoly - 1 do begin if (t[j] = RC_MESH_NULL_IDX) then break; v0 := t[j]; v1 := IfThen((j+1 >= vertsPerPoly) or (t[j+1] = RC_MESH_NULL_IDX), t[0], t[j+1]); if (v0 < v1) then begin edge := @edges[edgeCount]; edge.vert[0] := v0; edge.vert[1] := v1; edge.poly[0] := i; edge.polyEdge[0] := j; edge.poly[1] := i; edge.polyEdge[1] := 0; // Insert edge nextEdge[edgeCount] := firstEdge[v0]; firstEdge[v0] := edgeCount; Inc(edgeCount); end; end; end; for i := 0 to npolys - 1 do begin t := @polys[i*vertsPerPoly*2]; for j := 0 to vertsPerPoly - 1 do begin if (t[j] = RC_MESH_NULL_IDX) then break; v0 := t[j]; v1 := IfThen((j+1 >= vertsPerPoly) or (t[j+1] = RC_MESH_NULL_IDX), t[0], t[j+1]); if (v0 > v1) then begin //for (unsigned short e := firstEdge[v1]; e != RC_MESH_NULL_IDX; e := nextEdge[e]) e := firstEdge[v1]; while (e <> RC_MESH_NULL_IDX) do begin edge := @edges[e]; if (edge.vert[1] = v0) and (edge.poly[0] = edge.poly[1]) then begin edge.poly[1] := i; edge.polyEdge[1] := j; break; end; e := nextEdge[e]; end; end; end; end; // Store adjacency for i := 0 to edgeCount - 1 do begin e1 := @edges[i]; if (e1.poly[0] <> e1.poly[1]) then begin p0 := @polys[e1.poly[0]*vertsPerPoly*2]; p1 := @polys[e1.poly[1]*vertsPerPoly*2]; p0[vertsPerPoly + e1.polyEdge[0]] := e1.poly[1]; p1[vertsPerPoly + e1.polyEdge[1]] := e1.poly[0]; end; end; FreeMem(firstEdge); FreeMem(edges); Result := true; end; const VERTEX_BUCKET_COUNT = (1 shl 12); function computeVertexHash(x,y,z: Integer): Integer; const h1: Cardinal = $8da6b343; // Large multiplicative constants; const h2: Cardinal = $d8163841; // here arbitrarily chosen primes const h3: Cardinal = $cb1ab31f; var n: Cardinal; begin n := Cardinal(h1 * x + h2 * y + h3 * z); Result := Integer(n and (VERTEX_BUCKET_COUNT-1)); end; function addVertex(x,y,z: Word; verts: PWord; firstVert: PInteger; nextVert: PInteger; nv: PInteger): Word; var bucket,i: Integer; v: PWord; begin bucket := computeVertexHash(x, 0, z); i := firstVert[bucket]; while (i <> -1) do begin v := @verts[i*3]; if (v[0] = x) and (Abs(v[1] - y) <= 2) and (v[2] = z) then Exit(i); i := nextVert[i]; // next end; // Could not find, create new. i := nv^; Inc(nv^); v := @verts[i*3]; v[0] := x; v[1] := y; v[2] := z; nextVert[i] := firstVert[bucket]; firstVert[bucket] := i; Exit(i); end; function prev(i, n: Integer): Integer; begin Result := (i+n-1) mod n; end; function next(i, n: Integer): Integer; begin Result := (i+1) mod n; end; function area2(const a,b,c: PInteger): Integer; begin Result := (b[0] - a[0]) * (c[2] - a[2]) - (c[0] - a[0]) * (b[2] - a[2]); end; // Exclusive or: true iff exactly one argument is true. // The arguments are negated to ensure that they are 0/1 // values. Then the bitwise Xor operator may apply. // (This idea is due to Michael Baldwin.) function xorb(x, y: Boolean): Boolean; begin Result := not x xor not y; end; // Returns true iff c is strictly to the left of the directed // line through a to b. function left(const a,b,c: PInteger): Boolean; begin Result := area2(a, b, c) < 0; end; function leftOn(const a,b,c: PInteger): Boolean; begin Result := area2(a, b, c) <= 0; end; function collinear(const a,b,c: PInteger): Boolean; begin Result := area2(a, b, c) = 0; end; // Returns true iff ab properly intersects cd: they share // a point interior to both segments. The properness of the // intersection is ensured by using strict leftness. function intersectProp(const a,b,c,d: PInteger): Boolean; begin // Eliminate improper cases. if (collinear(a,b,c) or collinear(a,b,d) or collinear(c,d,a) or collinear(c,d,b)) then Exit(false); Result := xorb(left(a,b,c), left(a,b,d)) and xorb(left(c,d,a), left(c,d,b)); end; // Returns T iff (a,b,c) are collinear and point c lies // on the closed segement ab. function between(const a,b,c: PInteger): Boolean; begin if (not collinear(a, b, c)) then Exit(false); // If ab not vertical, check betweenness on x; else on y. if (a[0] <> b[0]) then Result := ((a[0] <= c[0]) and (c[0] <= b[0])) or ((a[0] >= c[0]) and (c[0] >= b[0])) else Result := ((a[2] <= c[2]) and (c[2] <= b[2])) or ((a[2] >= c[2]) and (c[2] >= b[2])); end; // Returns true iff segments ab and cd intersect, properly or improperly. function intersect(const a,b,c,d: PInteger): Boolean; begin if (intersectProp(a, b, c, d)) then Result := true else if (between(a, b, c) or between(a, b, d) or between(c, d, a) or between(c, d, b)) then Result := true else Result := false; end; function vequal(const a,b: PInteger): Boolean; begin Result := (a[0] = b[0]) and (a[2] = b[2]); end; // Returns T iff (v_i, v_j) is a proper internal *or* external // diagonal of P, *ignoring edges incident to v_i and v_j*. function diagonalie(i, j, n: Integer; const verts: PInteger; indices: PInteger): Boolean; var d0,d1,p0,p1: PInteger; k,k1: Integer; begin d0 := @verts[(indices[i] and $0fffffff) * 4]; d1 := @verts[(indices[j] and $0fffffff) * 4]; // For each edge (k,k+1) of P for k := 0 to n - 1 do begin k1 := next(k, n); // Skip edges incident to i or j if (not ((k = i) or (k1 = i) or (k = j) or (k1 = j))) then begin p0 := @verts[(indices[k] and $0fffffff) * 4]; p1 := @verts[(indices[k1] and $0fffffff) * 4]; if (vequal(d0, p0) or vequal(d1, p0) or vequal(d0, p1) or vequal(d1, p1)) then continue; if (intersect(d0, d1, p0, p1)) then Exit(false); end; end; Result := true; end; // Returns true iff the diagonal (i,j) is strictly internal to the // polygon P in the neighborhood of the i endpoint. function inCone(i, j, n: Integer; const verts: PInteger; indices: PInteger): Boolean; var pi,pj,pi1,pin1: PInteger; begin pi := @verts[(indices[i] and $0fffffff) * 4]; pj := @verts[(indices[j] and $0fffffff) * 4]; pi1 := @verts[(indices[next(i, n)] and $0fffffff) * 4]; pin1 := @verts[(indices[prev(i, n)] and $0fffffff) * 4]; // If P[i] is a convex vertex [ i+1 left or on (i-1,i) ]. if (leftOn(pin1, pi, pi1)) then Exit(left(pi, pj, pin1) and left(pj, pi, pi1)); // Assume (i-1,i,i+1) not collinear. // else P[i] is reflex. Result := not (leftOn(pi, pj, pi1) and leftOn(pj, pi, pin1)); end; // Returns T iff (v_i, v_j) is a proper internal // diagonal of P. function diagonal(i, j, n: Integer; const verts: PInteger; indices: PInteger): Boolean; begin Result := inCone(i, j, n, verts, indices) and diagonalie(i, j, n, verts, indices); end; function diagonalieLoose(i, j, n: Integer; const verts: PInteger; indices: PInteger): Boolean; var d0,d1,p0,p1: PInteger; k,k1: Integer; begin d0 := @verts[(indices[i] and $0fffffff) * 4]; d1 := @verts[(indices[j] and $0fffffff) * 4]; // For each edge (k,k+1) of P for k := 0 to n - 1 do begin k1 := next(k, n); // Skip edges incident to i or j if (not ((k = i) or (k1 = i) or (k = j) or (k1 = j))) then begin p0 := @verts[(indices[k] and $0fffffff) * 4]; p1 := @verts[(indices[k1] and $0fffffff) * 4]; if (vequal(d0, p0) or vequal(d1, p0) or vequal(d0, p1) or vequal(d1, p1)) then continue; if (intersectProp(d0, d1, p0, p1)) then Exit(false); end; end; Result := true; end; function inConeLoose(i, j, n: Integer; const verts: PInteger; indices: PInteger): Boolean; var pi,pj,pi1,pin1: PInteger; begin pi := @verts[(indices[i] and $0fffffff) * 4]; pj := @verts[(indices[j] and $0fffffff) * 4]; pi1 := @verts[(indices[next(i, n)] and $0fffffff) * 4]; pin1 := @verts[(indices[prev(i, n)] and $0fffffff) * 4]; // If P[i] is a convex vertex [ i+1 left or on (i-1,i) ]. if (leftOn(pin1, pi, pi1)) then Exit(leftOn(pi, pj, pin1) and leftOn(pj, pi, pi1)); // Assume (i-1,i,i+1) not collinear. // else P[i] is reflex. Result := not (leftOn(pi, pj, pi1) and leftOn(pj, pi, pin1)); end; function diagonalLoose(i, j, n: Integer; const verts: PInteger; indices: PInteger): Boolean; begin Result := inConeLoose(i, j, n, verts, indices) and diagonalieLoose(i, j, n, verts, indices); end; function triangulate(n: Integer; const verts: PInteger; indices: PInteger; tris: PInteger): Integer; var ntris,i,minLen,mini,i1,i2,dx,dy,len: Integer; dst,p0,p2: PInteger; k: Integer; begin ntris := 0; dst := tris; // The last bit of the index is used to indicate if the vertex can be removed. for i := 0 to n - 1 do begin i1 := next(i, n); i2 := next(i1, n); if (diagonal(i, i2, n, verts, indices)) then indices[i1] := Integer(indices[i1] or $80000000); end; while (n > 3) do begin minLen := -1; mini := -1; for i := 0 to n - 1 do begin i1 := next(i, n); if (indices[i1] and $80000000 <> 0) then begin p0 := @verts[(indices[i] and $0fffffff) * 4]; p2 := @verts[(indices[next(i1, n)] and $0fffffff) * 4]; dx := p2[0] - p0[0]; dy := p2[2] - p0[2]; len := dx*dx + dy*dy; if (minLen < 0) or (len < minLen) then begin minLen := len; mini := i; end; end; end; if (mini = -1) then begin // We might get here because the contour has overlapping segments, like this: // // A o-o=====o---o B // / |C D| \ // o o o o // : : : : // We'll try to recover by loosing up the inCone test a bit so that a diagonal // like A-B or C-D can be found and we can continue. minLen := -1; mini := -1; for i := 0 to n - 1 do begin i1 := next(i, n); i2 := next(i1, n); if (diagonalLoose(i, i2, n, verts, indices)) then begin p0 := @verts[(indices[i] and $0fffffff) * 4]; p2 := @verts[(indices[next(i2, n)] and $0fffffff) * 4]; dx := p2[0] - p0[0]; dy := p2[2] - p0[2]; len := dx*dx + dy*dy; if (minLen < 0) or (len < minLen) then begin minLen := len; mini := i; end; end; end; if (mini = -1) then begin // The contour is messed up. This sometimes happens // if the contour simplification is too aggressive. Exit(-ntris); end; end; i := mini; i1 := next(i, n); i2 := next(i1, n); //*dst++ := indices[i] and $0fffffff; //*dst++ := indices[i1] and $0fffffff; //*dst++ := indices[i2] and $0fffffff; dst^ := indices[i] and $0fffffff; Inc(dst); dst^ := indices[i1] and $0fffffff; Inc(dst); dst^ := indices[i2] and $0fffffff; Inc(dst); Inc(ntris); // Removes P[i1] by copying P[i+1]...P[n-1] left one index. Dec(n); for k := i1 to n - 1 do indices[k] := indices[k+1]; if (i1 >= n) then i1 := 0; i := prev(i1,n); // Update diagonal flags. if (diagonal(prev(i, n), i1, n, verts, indices)) then indices[i] := Integer(indices[i] or $80000000) else indices[i] := indices[i] and $0fffffff; if (diagonal(i, next(i1, n), n, verts, indices)) then indices[i1] := Integer(indices[i1] or $80000000) else indices[i1] := indices[i1] and $0fffffff; end; // Append the remaining triangle. //*dst++ := indices[0] and $0fffffff; //*dst++ := indices[1] and $0fffffff; //*dst++ := indices[2] and $0fffffff; dst^ := indices[0] and $0fffffff; Inc(dst); dst^ := indices[1] and $0fffffff; Inc(dst); dst^ := indices[2] and $0fffffff; //Inc(dst); Inc(ntris); Result := ntris; end; function countPolyVerts(const p: PWord; const nvp: Integer): Integer; var i: Integer; begin for i := 0 to nvp - 1 do if (p[i] = RC_MESH_NULL_IDX) then Exit(i); Result := nvp; end; function uleft(const a,b,c: PWord): Boolean; begin Result := (Integer(b[0]) - Integer(a[0])) * (Integer(c[2]) - Integer(a[2])) - (Integer(c[0]) - Integer(a[0])) * (Integer(b[2]) - Integer(a[2])) < 0; end; function getPolyMergeValue(pa, pb: PWord; const verts: PWord; ea, eb: PInteger; const nvp: Integer): Integer; var na,nb,i,j: Integer; va0,va1,vb0,vb1,va,vb,vc: Word; dx,dy: Integer; begin na := countPolyVerts(pa, nvp); nb := countPolyVerts(pb, nvp); // If the merged polygon would be too big, do not merge. if (na+nb-2 > nvp) then Exit(-1); // Check if the polygons share an edge. ea^ := -1; eb^ := -1; for i := 0 to na - 1 do begin va0 := pa[i]; va1 := pa[(i+1) mod na]; if (va0 > va1) then rcSwap(va0, va1); for j := 0 to nb - 1 do begin vb0 := pb[j]; vb1 := pb[(j+1) mod nb]; if (vb0 > vb1) then rcSwap(vb0, vb1); if (va0 = vb0) and (va1 = vb1) then begin ea^ := i; eb^ := j; break; end; end; end; // No common edge, cannot merge. if (ea^ = -1) or (eb^ = -1) then Exit(-1); // Check to see if the merged polygon would be convex. //unsigned short va, vb, vc; va := pa[(ea^+na-1) mod na]; vb := pa[ea^]; vc := pb[(eb^+2) mod nb]; if (not uleft(@verts[va*3], @verts[vb*3], @verts[vc*3])) then Exit(-1); va := pb[(eb^+nb-1) mod nb]; vb := pb[eb^]; vc := pa[(ea^+2) mod na]; if (not uleft(@verts[va*3], @verts[vb*3], @verts[vc*3])) then Exit(-1); va := pa[ea^]; vb := pa[(ea^+1) mod na]; dx := Integer(verts[va*3+0]) - Integer(verts[vb*3+0]); dy := Integer(verts[va*3+2]) - Integer(verts[vb*3+2]); Result := dx*dx + dy*dy; end; procedure mergePolys(pa, pb: PWord; ea, eb: Integer; tmp: PWord; const nvp: Integer); var na,nb,i,n: Integer; begin na := countPolyVerts(pa, nvp); nb := countPolyVerts(pb, nvp); // Merge polygons. FillChar(tmp[0], sizeof(Word)*nvp, $ff); n := 0; // Add pa for i := 0 to na-1 - 1 do begin tmp[n] := pa[(ea+1+i) mod na]; Inc(n); end; // Add pb for i := 0 to nb-1 - 1 do begin tmp[n] := pb[(eb+1+i) mod nb]; Inc(n); end; Move(tmp^, pa^, sizeof(Word) * nvp); end; procedure pushFront(v: Integer; arr: PInteger; an: PInteger); var i: Integer; begin Inc(an^); for i := an^ - 1 downto 1 do arr[i] := arr[i-1]; arr[0] := v; end; procedure pushBack(v: Integer; arr: PInteger; an: PInteger); begin arr[an^] := v; Inc(an^); end; function canRemoveVertex(ctx: TrcContext; mesh: PrcPolyMesh; const rem: Word): Boolean; var nvp,numRemovedVerts,numTouchedVerts,numRemainingEdges,i,j,k,m,nv,numRemoved,numVerts,maxEdges,nedges: Integer; p: PWord; edges: PInteger; a,b: Integer; e: PInteger; exists: Boolean; numOpenEdges: Integer; begin nvp := mesh.nvp; // Count number of polygons to remove. numRemovedVerts := 0; numTouchedVerts := 0; numRemainingEdges := 0; for i := 0 to mesh.npolys - 1 do begin p := @mesh.polys[i*nvp*2]; nv := countPolyVerts(p, nvp); numRemoved := 0; numVerts := 0; for j := 0 to nv - 1 do begin if (p[j] = rem) then begin Inc(numTouchedVerts); Inc(numRemoved); end; Inc(numVerts); end; if (numRemoved <> 0) then begin Inc(numRemovedVerts, numRemoved); Inc(numRemainingEdges, numVerts-(numRemoved+1)); end; end; // There would be too few edges remaining to create a polygon. // This can happen for example when a tip of a triangle is marked // as deletion, but there are no other polys that share the vertex. // In this case, the vertex should not be removed. if (numRemainingEdges <= 2) then Exit(false); // Find edges which share the removed vertex. maxEdges := numTouchedVerts*2; nedges := 0; GetMem(edges, SizeOf(Integer)*maxEdges*3); for i := 0 to mesh.npolys - 1 do begin p := @mesh.polys[i*nvp*2]; nv := countPolyVerts(p, nvp); // Collect edges which touches the removed vertex. //for (int j := 0, k := nv-1; j < nv; k := j++) j := 0; k := nv-1; while (j < nv) do begin if (p[j] = rem) or (p[k] = rem) then begin // Arrange edge so that a=rem. a := p[j]; b := p[k]; if (b = rem) then rcSwap(a,b); // Check if the edge exists exists := false; for m := 0 to nedges - 1 do begin e := @edges[m*3]; if (e[1] = b) then begin // Exists, increment vertex share count. Inc(e[2]); exists := true; end; end; // Add new edge. if (not exists) then begin e := @edges[nedges*3]; e[0] := a; e[1] := b; e[2] := 1; Inc(nedges); end; end; k := j; Inc(j); end; end; // There should be no more than 2 open edges. // This catches the case that two non-adjacent polygons // share the removed vertex. In that case, do not remove the vertex. numOpenEdges := 0; for i := 0 to nedges - 1 do begin if (edges[i*3+2] < 2) then Inc(numOpenEdges); end; FreeMem(edges); if (numOpenEdges > 2) then Exit(false); Result := true; end; function removeVertex(ctx: TrcContext; mesh: PrcPolyMesh; const rem: Word; const maxTris: Integer): Boolean; var nvp,numRemovedVerts,i,j,k,nv,nedges,nhole,nhreg,nharea: Integer; p,p2: PWord; edges,hole,hreg,harea: PInteger; hasRem,match,add: Boolean; e: PInteger; ea,eb,r,a: Integer; tris,tverts,thole: PInteger; pi: Integer; ntris: Integer; polys,pregs,pareas: PWord; tmpPoly: PWord; npolys: Integer; t: PInteger; bestMergeVal,bestPa,bestPb,bestEa,bestEb: Integer; pj,pk,pa,pb,last: PWord; v: Integer; begin nvp := mesh.nvp; // Count number of polygons to remove. numRemovedVerts := 0; for i := 0 to mesh.npolys - 1 do begin p := @mesh.polys[i*nvp*2]; nv := countPolyVerts(p, nvp); for j := 0 to nv - 1 do begin if (p[j] = rem) then Inc(numRemovedVerts); end; end; nedges := 0; GetMem(edges, SizeOf(Integer)*numRemovedVerts*nvp*4); nhole := 0; GetMem(hole, SizeOf(Integer)*numRemovedVerts*nvp); nhreg := 0; GetMem(hreg, SizeOf(Integer)*numRemovedVerts*nvp); nharea := 0; GetMem(harea, SizeOf(Integer)*numRemovedVerts*nvp); i := 0; while (i < mesh.npolys) do begin p := @mesh.polys[i*nvp*2]; nv := countPolyVerts(p, nvp); hasRem := false; for j := 0 to nv - 1 do if (p[j] = rem) then hasRem := true; if (hasRem) then begin // Collect edges which does not touch the removed vertex. j := 0; k := nv-1; while (j < nv) do begin if (p[j] <> rem) and (p[k] <> rem) then begin e := @edges[nedges*4]; e[0] := p[k]; e[1] := p[j]; e[2] := mesh.regs[i]; e[3] := mesh.areas[i]; Inc(nedges); end; k := j; Inc(j); end; // Remove the polygon. p2 := @mesh.polys[(mesh.npolys-1)*nvp*2]; if (p <> p2) then Move(p2^,p^,sizeof(Word)*nvp); //memset(p+nvp,0xff,sizeof(unsigned short)*nvp); FillChar(p[nvp], sizeof(Word)*nvp, $ff); mesh.regs[i] := mesh.regs[mesh.npolys-1]; mesh.areas[i] := mesh.areas[mesh.npolys-1]; Dec(mesh.npolys); Dec(i); end; Inc(i); end; // Remove vertex. for i := Integer(rem) to mesh.nverts - 2 do begin mesh.verts[i*3+0] := mesh.verts[(i+1)*3+0]; mesh.verts[i*3+1] := mesh.verts[(i+1)*3+1]; mesh.verts[i*3+2] := mesh.verts[(i+1)*3+2]; end; Dec(mesh.nverts); // Adjust indices to match the removed vertex layout. for i := 0 to mesh.npolys - 1 do begin p := @mesh.polys[i*nvp*2]; nv := countPolyVerts(p, nvp); for j := 0 to nv - 1 do if (p[j] > rem) then Dec(p[j]); end; for i := 0 to nedges - 1 do begin if (edges[i*4+0] > rem) then Dec(edges[i*4+0]); if (edges[i*4+1] > rem) then Dec(edges[i*4+1]); end; if (nedges = 0) then Exit(true); // Start with one vertex, keep appending connected // segments to the start and end of the hole. pushBack(edges[0], hole, @nhole); pushBack(edges[2], hreg, @nhreg); pushBack(edges[3], harea, @nharea); while (nedges <> 0) do begin match := false; i := 0; while i < nedges do begin ea := edges[i*4+0]; eb := edges[i*4+1]; r := edges[i*4+2]; a := edges[i*4+3]; add := false; if (hole[0] = eb) then begin // The segment matches the beginning of the hole boundary. pushFront(ea, hole, @nhole); pushFront(r, hreg, @nhreg); pushFront(a, harea, @nharea); add := true; end else if (hole[nhole-1] = ea) then begin // The segment matches the end of the hole boundary. pushBack(eb, hole, @nhole); pushBack(r, hreg, @nhreg); pushBack(a, harea, @nharea); add := true; end; if (add) then begin // The edge segment was added, remove it. edges[i*4+0] := edges[(nedges-1)*4+0]; edges[i*4+1] := edges[(nedges-1)*4+1]; edges[i*4+2] := edges[(nedges-1)*4+2]; edges[i*4+3] := edges[(nedges-1)*4+3]; Dec(nedges); match := true; Dec(i); end; Inc(i); end; if (not match) then break; end; GetMem(tris, SizeOf(Integer)*nhole*3); GetMem(tverts, SizeOf(Integer)*nhole*4); GetMem(thole, SizeOf(Integer)*nhole); // Generate temp vertex array for triangulation. for i := 0 to nhole - 1 do begin pi := hole[i]; tverts[i*4+0] := mesh.verts[pi*3+0]; tverts[i*4+1] := mesh.verts[pi*3+1]; tverts[i*4+2] := mesh.verts[pi*3+2]; tverts[i*4+3] := 0; thole[i] := i; end; // Triangulate the hole. ntris := triangulate(nhole, @tverts[0], @thole[0], tris); if (ntris < 0) then begin ntris := -ntris; ctx.log(RC_LOG_WARNING, 'removeVertex: triangulate() returned bad results.'); end; // Merge the hole triangles back to polygons. GetMem(polys, SizeOf(Word)*(ntris+1)*nvp); GetMem(pregs, SizeOf(Word)*ntris); GetMem(pareas, SizeOf(Word)*ntris); tmpPoly := @polys[ntris*nvp]; // Build initial polygons. npolys := 0; FillChar(polys[0], ntris*nvp*sizeof(Word), $ff); for j := 0 to ntris - 1 do begin t := @tris[j*3]; if (t[0] <> t[1]) and (t[0] <> t[2]) and (t[1] <> t[2]) then begin polys[npolys*nvp+0] := hole[t[0]]; polys[npolys*nvp+1] := hole[t[1]]; polys[npolys*nvp+2] := hole[t[2]]; pregs[npolys] := hreg[t[0]]; pareas[npolys] := harea[t[0]]; Inc(npolys); end; end; if (npolys = 0) then Exit(true); // Merge polygons. if (nvp > 3) then begin while (true) do begin // Find best polygons to merge. bestMergeVal := 0; bestPa := 0; bestPb := 0; bestEa := 0; bestEb := 0; for j := 0 to npolys-1 - 1 do begin pj := @polys[j*nvp]; for k := j+1 to npolys - 1 do begin pk := @polys[k*nvp]; v := getPolyMergeValue(pj, pk, mesh.verts, @ea, @eb, nvp); if (v > bestMergeVal) then begin bestMergeVal := v; bestPa := j; bestPb := k; bestEa := ea; bestEb := eb; end; end; end; if (bestMergeVal > 0) then begin // Found best, merge. pa := @polys[bestPa*nvp]; pb := @polys[bestPb*nvp]; mergePolys(pa, pb, bestEa, bestEb, tmpPoly, nvp); last := @polys[(npolys-1)*nvp]; if (pb <> last) then Move(last^, pb^, sizeof(Word)*nvp); pregs[bestPb] := pregs[npolys-1]; pareas[bestPb] := pareas[npolys-1]; Dec(npolys); end else begin // Could not merge any polygons, stop. break; end; end; end; // Store polygons. for i := 0 to npolys - 1 do begin if (mesh.npolys >= maxTris) then break; p := @mesh.polys[mesh.npolys*nvp*2]; FillChar(p[0],sizeof(Word)*nvp*2,$ff); for j := 0 to nvp - 1 do p[j] := polys[i*nvp+j]; mesh.regs[mesh.npolys] := pregs[i]; mesh.areas[mesh.npolys] := pareas[i]; Inc(mesh.npolys); if (mesh.npolys > maxTris) then begin ctx.log(RC_LOG_ERROR, Format('removeVertex: Too many polygons %d (max:%d).', [mesh.npolys, maxTris])); Exit(false); end; end; FreeMem(edges); FreeMem(hole); FreeMem(hreg); FreeMem(harea); FreeMem(tris); FreeMem(tverts); FreeMem(thole); FreeMem(polys); FreeMem(pregs); FreeMem(pareas); Result := true; end; /// @par /// /// @note If the mesh data is to be used to construct a Detour navigation mesh, then the upper /// limit must be retricted to <= #DT_VERTS_PER_POLYGON. /// /// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig function rcBuildPolyMesh(ctx: TrcContext; cset: PrcContourSet; const nvp: Integer; mesh: PrcPolyMesh): Boolean; var maxVertices, maxTris, maxVertsPerCont: Integer; i,j,k: Integer; vflags: PByte; firstVert,nextVert: PInteger; indices,tris: PInteger; polys: PWord; tmpPoly: PWord; cont: PrcContour; ntris: Integer; v,t: PInteger; npolys: Integer; bestMergeVal,bestPa,bestPb,bestEa,bestEb: Integer; pj,pk: PWord; ea,eb: Integer; pa,pb,lastPoly,p,q,va,vb: PWord; v1,nj: Integer; w,h: Integer; begin Assert(ctx <> nil); ctx.startTimer(RC_TIMER_BUILD_POLYMESH); rcVcopy(@mesh.bmin[0], @cset.bmin[0]); rcVcopy(@mesh.bmax[0], @cset.bmax[0]); mesh.cs := cset.cs; mesh.ch := cset.ch; mesh.borderSize := cset.borderSize; maxVertices := 0; maxTris := 0; maxVertsPerCont := 0; for i := 0 to cset.nconts - 1 do begin // Skip null contours. if (cset.conts[i].nverts < 3) then continue; Inc(maxVertices, cset.conts[i].nverts); Inc(maxTris, cset.conts[i].nverts - 2); maxVertsPerCont := rcMax(maxVertsPerCont, cset.conts[i].nverts); end; if (maxVertices >= $fffe) then begin ctx.log(RC_LOG_ERROR, Format('rcBuildPolyMesh: Too many vertices %d.', [maxVertices])); Exit(false); end; GetMem(vflags, SizeOf(Byte)*maxVertices); FillChar(vflags[0], SizeOf(Byte)*maxVertices, 0); GetMem(mesh.verts, SizeOf(Word)*maxVertices*3); GetMem(mesh.polys, SizeOf(Word)*maxTris*nvp*2); GetMem(mesh.regs, SizeOf(Word)*maxTris); GetMem(mesh.areas, SizeOf(Byte)*maxTris); mesh.nverts := 0; mesh.npolys := 0; mesh.nvp := nvp; mesh.maxpolys := maxTris; FillChar(mesh.verts[0], sizeof(Word)*maxVertices*3, 0); FillChar(mesh.polys[0], sizeof(Word)*maxTris*nvp*2, $ff); FillChar(mesh.regs[0], sizeof(Word)*maxTris, 0); FillChar(mesh.areas[0], sizeof(Byte)*maxTris, 0); GetMem(nextVert, SizeOf(Integer)*maxVertices); FillChar(nextVert[0], sizeof(integer)*maxVertices, 0); GetMem(firstVert, SizeOf(Integer)*VERTEX_BUCKET_COUNT); for i := 0 to VERTEX_BUCKET_COUNT - 1 do firstVert[i] := -1; GetMem(indices, SizeOf(Integer)*maxVertsPerCont); GetMem(tris, SizeOf(Integer)*maxVertsPerCont*3); GetMem(polys, SizeOf(Word)*(maxVertsPerCont+1)*nvp); tmpPoly := @polys[maxVertsPerCont*nvp]; for i := 0 to cset.nconts - 1 do begin cont := @cset.conts[i]; // Skip null contours. if (cont.nverts < 3) then continue; // Triangulate contour for j := 0 to cont.nverts - 1 do indices[j] := j; ntris := triangulate(cont.nverts, cont.verts, @indices[0], @tris[0]); if (ntris <= 0) then begin // Bad triangulation, should not happen. (* printf('\tconst float bmin[3] := begin%ff,%ff,%ffend;;\n', cset.bmin[0], cset.bmin[1], cset.bmin[2]); printf('\tconst float cs := %ff;\n', cset.cs); printf('\tconst float ch := %ff;\n', cset.ch); printf('\tconst int verts[] := begin\n'); for (int k := 0; k < cont.nverts; ++k) begin const int* v := &cont.verts[k*4]; printf('\t\t%d,%d,%d,%d,\n', v[0], v[1], v[2], v[3]); end; printf('\tend;;\n\tconst int nverts := sizeof(verts)/(sizeof(int)*4);\n');*) ctx.log(RC_LOG_WARNING, Format('rcBuildPolyMesh: Bad triangulation Contour %d.', [i])); ntris := -ntris; end; // Add and merge vertices. for j := 0 to cont.nverts - 1 do begin v := @cont.verts[j*4]; indices[j] := addVertex(v[0], v[1], v[2], mesh.verts, firstVert, nextVert, @mesh.nverts); if (v[3] and RC_BORDER_VERTEX <> 0) then begin // This vertex should be removed. //TEMP, otherwise polys on Tile edges are missing!!!!! vflags[indices[j]] := 1; end; end; // Build initial polygons. npolys := 0; FillChar(polys[0], maxVertsPerCont*nvp*sizeof(Word), $ff); for j := 0 to ntris - 1 do begin t := @tris[j*3]; if (t[0] <> t[1]) and (t[0] <> t[2]) and (t[1] <> t[2]) then begin polys[npolys*nvp+0] := indices[t[0]]; polys[npolys*nvp+1] := indices[t[1]]; polys[npolys*nvp+2] := indices[t[2]]; Inc(npolys); end; end; if (npolys = 0) then continue; // Merge polygons. if (nvp > 3) then begin while True do begin // Find best polygons to merge. bestMergeVal := 0; bestPa := 0; bestPb := 0; bestEa := 0; bestEb := 0; for j := 0 to npolys-1 - 1 do begin pj := @polys[j*nvp]; for k := j+1 to npolys - 1 do begin pk := @polys[k*nvp]; v1 := getPolyMergeValue(pj, pk, mesh.verts, @ea, @eb, nvp); if (v1 > bestMergeVal) then begin bestMergeVal := v1; bestPa := j; bestPb := k; bestEa := ea; bestEb := eb; end; end; end; if (bestMergeVal > 0) then begin // Found best, merge. pa := @polys[bestPa*nvp]; pb := @polys[bestPb*nvp]; mergePolys(pa, pb, bestEa, bestEb, tmpPoly, nvp); lastPoly := @polys[(npolys-1)*nvp]; if (pb <> lastPoly) then Move(lastPoly^, pb^, sizeof(Word)*nvp); Dec(npolys); end else begin // Could not merge any polygons, stop. break; end; end; end; // Store polygons. for j := 0 to npolys - 1 do begin p := @mesh.polys[mesh.npolys*nvp*2]; q := @polys[j*nvp]; for k := 0 to nvp - 1 do p[k] := q[k]; mesh.regs[mesh.npolys] := cont.reg; mesh.areas[mesh.npolys] := cont.area; Inc(mesh.npolys); if (mesh.npolys > maxTris) then begin ctx.log(RC_LOG_ERROR, Format('rcBuildPolyMesh: Too many polygons %d (max:%d).', [mesh.npolys, maxTris])); Exit(false); end; end; end; // Remove edge vertices. i := 0; while (i < mesh.nverts) do begin if (vflags[i] <> 0) then begin if (not canRemoveVertex(ctx, mesh, i)) then begin //C++ seems to be doing loop increase, so do we Inc(i); Continue; end; if (not removeVertex(ctx, mesh, i, maxTris)) then begin // Failed to remove vertex ctx.log(RC_LOG_ERROR, Format('rcBuildPolyMesh: Failed to remove edge vertex %d.', [i])); Exit(false); end; // Remove vertex // Note: mesh.nverts is already decremented inside removeVertex()! // Fixup vertex flags for j := i to mesh.nverts - 1 do vflags[j] := vflags[j+1]; Dec(i); end; Inc(i); end; // Calculate adjacency. if (not buildMeshAdjacency(mesh.polys, mesh.npolys, mesh.nverts, nvp)) then begin ctx.log(RC_LOG_ERROR, 'rcBuildPolyMesh: Adjacency failed.'); Exit(false); end; // Find portal edges if (mesh.borderSize > 0) then begin w := cset.width; h := cset.height; for i := 0 to mesh.npolys - 1 do begin p := @mesh.polys[i*2*nvp]; for j := 0 to nvp - 1 do begin if (p[j] = RC_MESH_NULL_IDX) then break; // Skip connected edges. if (p[nvp+j] <> RC_MESH_NULL_IDX) then continue; nj := j+1; if (nj >= nvp) or (p[nj] = RC_MESH_NULL_IDX) then nj := 0; va := @mesh.verts[p[j]*3]; vb := @mesh.verts[p[nj]*3]; if (va[0] = 0) and (vb[0] = 0) then p[nvp+j] := $8000 or 0 else if (va[2] = h) and (vb[2] = h) then p[nvp+j] := $8000 or 1 else if (va[0] = w) and (vb[0] = w) then p[nvp+j] := $8000 or 2 else if (va[2] = 0) and (vb[2] = 0) then p[nvp+j] := $8000 or 3; end; end; end; // Just allocate the mesh flags array. The user is resposible to fill it. GetMem(mesh.flags, sizeof(Word)*mesh.npolys); FillChar(mesh.flags[0], sizeof(Word) * mesh.npolys, $0); if (mesh.nverts > $ffff) then begin ctx.log(RC_LOG_ERROR, Format('rcBuildPolyMesh: The resulting mesh has too many vertices %d (max %d). Data can be corrupted.', [mesh.nverts, $ffff])); end; if (mesh.npolys > $ffff) then begin ctx.log(RC_LOG_ERROR, Format('rcBuildPolyMesh: The resulting mesh has too many polygons %d (max %d). Data can be corrupted.', [mesh.npolys, $ffff])); end; FreeMem(vflags); FreeMem(nextVert); FreeMem(firstVert); FreeMem(indices); FreeMem(tris); FreeMem(polys); ctx.stopTimer(RC_TIMER_BUILD_POLYMESH); Result := true; end; /// @see rcAllocPolyMesh, rcPolyMesh function rcMergePolyMeshes(ctx: TrcContext; meshes: array of TrcPolyMesh; const nmeshes: Integer; mesh: PrcPolyMesh): Boolean; var maxVerts,maxPolys,maxVertsPerMesh,i,j,k: Integer; nextVert,firstVert: PInteger; vremap: PWord; pmesh: PrcPolyMesh; ox,oz: Word; isMinX, isMinZ, isMaxX, isMaxZ, isOnBorder: Boolean; v,tgt,src: PWord; dir: Word; begin //rcAssert(ctx); //if (!nmeshes || !meshes) if (nmeshes = 0) {or !meshes)} then Exit(true); ctx.startTimer(RC_TIMER_MERGE_POLYMESH); mesh.nvp := meshes[0].nvp; mesh.cs := meshes[0].cs; mesh.ch := meshes[0].ch; rcVcopy(@mesh.bmin[0], @meshes[0].bmin[0]); rcVcopy(@mesh.bmax[0], @meshes[0].bmax[0]); maxVerts := 0; maxPolys := 0; maxVertsPerMesh := 0; for i := 0 to nmeshes - 1 do begin rcVmin(@mesh.bmin[0], @meshes[i].bmin[0]); rcVmax(@mesh.bmax[0], @meshes[i].bmax[0]); maxVertsPerMesh := rcMax(maxVertsPerMesh, meshes[i].nverts); Inc(maxVerts, meshes[i].nverts); Inc(maxPolys, meshes[i].npolys); end; mesh.nverts := 0; GetMem(mesh.verts, sizeof(Word)*maxVerts*3); mesh.npolys := 0; GetMem(mesh.polys, sizeof(Word)*maxPolys*2*mesh.nvp); FillChar(mesh.polys[0], sizeof(Word)*maxPolys*2*mesh.nvp, $ff); GetMem(mesh.regs, sizeof(Word)*maxPolys); FillChar(mesh.regs[0], sizeof(Word)*maxPolys, 0); GetMem(mesh.areas, sizeof(Byte)*maxPolys); FillChar(mesh.areas[0], sizeof(Byte)*maxPolys, 0); GetMem(mesh.flags, sizeof(Word)*maxPolys); FillChar(mesh.flags[0], sizeof(Word)*maxPolys, 0); GetMem(nextVert, sizeof(integer)*maxVerts); FillChar(nextVert[0], sizeof(integer)*maxVerts, 0); GetMem(firstVert, sizeof(integer)*VERTEX_BUCKET_COUNT); for i := 0 to VERTEX_BUCKET_COUNT - 1 do firstVert[i] := -1; GetMem(vremap, sizeof(Word)*maxVertsPerMesh); FillChar(vremap[0], sizeof(Word)*maxVertsPerMesh, 0); for i := 0 to nmeshes - 1 do begin pmesh := @meshes[i]; ox := floor((pmesh.bmin[0]-mesh.bmin[0])/mesh.cs+0.5); oz := floor((pmesh.bmin[2]-mesh.bmin[2])/mesh.cs+0.5); isMinX := (ox = 0); isMinZ := (oz = 0); isMaxX := (floor((mesh.bmax[0] - pmesh.bmax[0]) / mesh.cs + 0.5)) = 0; isMaxZ := (floor((mesh.bmax[2] - pmesh.bmax[2]) / mesh.cs + 0.5)) = 0; isOnBorder := (isMinX or isMinZ or isMaxX or isMaxZ); for j := 0 to pmesh.nverts - 1 do begin v := @pmesh.verts[j*3]; vremap[j] := addVertex(v[0]+ox, v[1], v[2]+oz, @mesh.verts, firstVert, nextVert, @mesh.nverts); end; for j := 0 to pmesh.npolys - 1 do begin tgt := @mesh.polys[mesh.npolys*2*mesh.nvp]; src := @pmesh.polys[j*2*mesh.nvp]; mesh.regs[mesh.npolys] := pmesh.regs[j]; mesh.areas[mesh.npolys] := pmesh.areas[j]; mesh.flags[mesh.npolys] := pmesh.flags[j]; Inc(mesh.npolys); for k := 0 to mesh.nvp - 1 do begin if (src[k] = RC_MESH_NULL_IDX) then break; tgt[k] := vremap[src[k]]; end; if (isOnBorder) then begin for k := mesh.nvp to mesh.nvp * 2 - 1 do begin if (src[k] and $8000 <> 0) and (src[k] <> $ffff) then begin dir := src[k] and $f; case dir of 0: // Portal x- if (isMinX) then tgt[k] := src[k]; 1: // Portal z+ if (isMaxZ) then tgt[k] := src[k]; 2: // Portal x+ if (isMaxX) then tgt[k] := src[k]; 3: // Portal z- if (isMinZ) then tgt[k] := src[k]; end; end; end; end; end; end; // Calculate adjacency. if (not buildMeshAdjacency(mesh.polys, mesh.npolys, mesh.nverts, mesh.nvp)) then begin ctx.log(RC_LOG_ERROR, 'rcMergePolyMeshes: Adjacency failed.'); Exit(false); end; if (mesh.nverts > $ffff) then begin ctx.log(RC_LOG_ERROR, Format('rcMergePolyMeshes: The resulting mesh has too many vertices %d (max %d). Data can be corrupted.', [mesh.nverts, $ffff])); end; if (mesh.npolys > $ffff) then begin ctx.log(RC_LOG_ERROR, Format('rcMergePolyMeshes: The resulting mesh has too many polygons %d (max %d). Data can be corrupted.', [mesh.npolys, $ffff])); end; FreeMem(nextVert); FreeMem(firstVert); FreeMem(vremap); ctx.stopTimer(RC_TIMER_MERGE_POLYMESH); Result := true; end; {bool rcCopyPolyMesh(ctx: TrcContext; const rcPolyMesh& src, rcPolyMesh& dst) begin rcAssert(ctx); // Destination must be empty. rcAssert(dst.verts == 0); rcAssert(dst.polys == 0); rcAssert(dst.regs == 0); rcAssert(dst.areas == 0); rcAssert(dst.flags == 0); dst.nverts := src.nverts; dst.npolys := src.npolys; dst.maxpolys := src.npolys; dst.nvp := src.nvp; rcVcopy(dst.bmin, src.bmin); rcVcopy(dst.bmax, src.bmax); dst.cs := src.cs; dst.ch := src.ch; dst.borderSize := src.borderSize; dst.verts := (unsigned short*)rcAlloc(sizeof(unsigned short)*src.nverts*3, RC_ALLOC_PERM); if (!dst.verts) begin ctx.log(RC_LOG_ERROR, 'rcCopyPolyMesh: Out of memory 'dst.verts' (%d).', src.nverts*3); return false; end; memcpy(dst.verts, src.verts, sizeof(unsigned short)*src.nverts*3); dst.polys := (unsigned short*)rcAlloc(sizeof(unsigned short)*src.npolys*2*src.nvp, RC_ALLOC_PERM); if (!dst.polys) begin ctx.log(RC_LOG_ERROR, 'rcCopyPolyMesh: Out of memory 'dst.polys' (%d).', src.npolys*2*src.nvp); return false; end; memcpy(dst.polys, src.polys, sizeof(unsigned short)*src.npolys*2*src.nvp); dst.regs := (unsigned short*)rcAlloc(sizeof(unsigned short)*src.npolys, RC_ALLOC_PERM); if (!dst.regs) begin ctx.log(RC_LOG_ERROR, 'rcCopyPolyMesh: Out of memory 'dst.regs' (%d).', src.npolys); return false; end; memcpy(dst.regs, src.regs, sizeof(unsigned short)*src.npolys); dst.areas := (unsigned char*)rcAlloc(sizeof(unsigned char)*src.npolys, RC_ALLOC_PERM); if (!dst.areas) begin ctx.log(RC_LOG_ERROR, 'rcCopyPolyMesh: Out of memory 'dst.areas' (%d).', src.npolys); return false; end; memcpy(dst.areas, src.areas, sizeof(unsigned char)*src.npolys); dst.flags := (unsigned short*)rcAlloc(sizeof(unsigned short)*src.npolys, RC_ALLOC_PERM); if (!dst.flags) begin ctx.log(RC_LOG_ERROR, 'rcCopyPolyMesh: Out of memory 'dst.flags' (%d).', src.npolys); return false; end; memcpy(dst.flags, src.flags, sizeof(unsigned short)*src.npolys); return true; end;} end.
unit Teste.Compilacao.Adapter; interface uses DUnitX.TestFramework, System.SysUtils, System.JSON, System.JSON.Readers, Vigilante.Infra.Compilacao.DataAdapter; type [TestFixture] TCompilacaoJSONDataAdapterTest = class private FJson: TJSONObject; FAdapter: ICompilacaoAdapter; procedure CarregarAdapterBuild(const Arquivo: TFileName); public [Setup] procedure Setup; [TearDown] procedure TearDown; [Test] procedure MapeouNumero; [Test] procedure MapeouNome; [Test] procedure MapeouSituacaoSucesso; [Test] procedure MapeouSituacaoFalha; [Test] procedure MapeouURL; [Test] procedure MapeouChangeSet; [Test] procedure JSONSemChangeSet; [Test] procedure JSONChangeSetNull; [Test] procedure JSONChangeSetVazio; [Test] procedure JSONChangeSetItemNull; [Test] procedure JSONChangeSetItemVazio; [Test] procedure JSONChangeSetItemNaoExiste; [Test] procedure MapeouBuildingTrue; [Test] procedure MapeouBuildingFalse; [Test] procedure MapeouBuidingNull; end; implementation uses System.IOUtils, System.Classes, Vigilante.Infra.Compilacao.JSONDataAdapter, Vigilante.Aplicacao.SituacaoBuild, Teste.Build.JSONData; procedure TCompilacaoJSONDataAdapterTest.Setup; begin end; procedure TCompilacaoJSONDataAdapterTest.TearDown; begin if Assigned(FJson) then FreeAndNil(FJson); end; procedure TCompilacaoJSONDataAdapterTest.CarregarAdapterBuild(const Arquivo: TFileName); begin if Assigned(FJson) then FreeAndNil(FJson); FJson := TJSONBuildMock.CarregarJSONDoArquivo<TJSONObject>(Arquivo); FAdapter := TCompilacaoJSONDataAdapter.Create(FJson); end; procedure TCompilacaoJSONDataAdapterTest.JSONChangeSetItemNaoExiste; begin CarregarAdapterBuild(ARQUIVO_JSON_CHANGESETITEM_NAOEXISTE); Assert.IsTrue(Length(FAdapter.ChangesSet)= 0); end; procedure TCompilacaoJSONDataAdapterTest.JSONChangeSetItemNull; begin CarregarAdapterBuild(ARQUIVO_JSON_CHANGESETITEM_NULL); Assert.IsTrue(Length(FAdapter.ChangesSet)= 0); end; procedure TCompilacaoJSONDataAdapterTest.JSONChangeSetItemVazio; begin CarregarAdapterBuild(ARQUIVO_JSON_CHANGESETITEM_VAZIO); Assert.IsTrue(Length(FAdapter.ChangesSet)= 0); end; procedure TCompilacaoJSONDataAdapterTest.JSONChangeSetNull; begin CarregarAdapterBuild(ARQUIVO_JSON_CHANGESET_NULL); Assert.IsTrue(Length(FAdapter.ChangesSet) = 0); end; procedure TCompilacaoJSONDataAdapterTest.JSONChangeSetVazio; begin CarregarAdapterBuild(ARQUIVO_JSON_CHANGESET_VAZIO); Assert.IsTrue(Length(FAdapter.ChangesSet) = 0); end; procedure TCompilacaoJSONDataAdapterTest.JSONSemChangeSet; begin CarregarAdapterBuild(ARQUIVO_JSON_CHANGESET_NAOEXISTE); Assert.IsTrue(Length(FAdapter.ChangesSet) = 0); end; procedure TCompilacaoJSONDataAdapterTest.MapeouBuidingNull; begin CarregarAdapterBuild(ARQUIVO_JSON_BUILDING_NULL); Assert.IsFalse(FAdapter.Building); end; procedure TCompilacaoJSONDataAdapterTest.MapeouBuildingFalse; begin CarregarAdapterBuild(ARQUIVO_JSON_SUCESSO); Assert.IsFalse(FAdapter.Building); end; procedure TCompilacaoJSONDataAdapterTest.MapeouBuildingTrue; begin CarregarAdapterBuild(ARQUIVO_JSON_BUILDING); Assert.IsTrue(FAdapter.Building); end; procedure TCompilacaoJSONDataAdapterTest.MapeouChangeSet; begin CarregarAdapterBuild(ARQUIVO_JSON_SUCESSO); Assert.IsNotNull(FAdapter.ChangesSet, 'N�o foi criado ChangeSet'); Assert.IsTrue(Length(FAdapter.ChangesSet) > 0); end; procedure TCompilacaoJSONDataAdapterTest.MapeouNome; begin CarregarAdapterBuild(ARQUIVO_JSON_SUCESSO); Assert.AreEqual('build-simulado #725', FAdapter.Nome); end; procedure TCompilacaoJSONDataAdapterTest.MapeouNumero; begin CarregarAdapterBuild(ARQUIVO_JSON_SUCESSO); Assert.AreEqual(725, FAdapter.Numero); end; procedure TCompilacaoJSONDataAdapterTest.MapeouSituacaoFalha; begin CarregarAdapterBuild(ARQUIVO_JSON_FALHA); Assert.AreEqual(sbFalhou, FAdapter.Situacao); end; procedure TCompilacaoJSONDataAdapterTest.MapeouSituacaoSucesso; begin CarregarAdapterBuild(ARQUIVO_JSON_SUCESSO); Assert.AreEqual(sbSucesso, FAdapter.Situacao); end; procedure TCompilacaoJSONDataAdapterTest.MapeouURL; const sURL_BUILD = 'http://jenkins/view/equipe/versao/job/build-simulado/725/'; begin CarregarAdapterBuild(ARQUIVO_JSON_SUCESSO); Assert.AreEqual(sURL_BUILD, FAdapter.URL); end; initialization TDUnitX.RegisterTestFixture(TCompilacaoJSONDataAdapterTest); end.
{**********************************************************************} {* Иллюстрация к книге "OpenGL в проектах Delphi" *} {* Краснов М.В. softgl@chat.ru *} {**********************************************************************} unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, OpenGL; type TfrmGL = class(TForm) procedure FormCreate(Sender: TObject); procedure FormPaint(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormResize(Sender: TObject); private DC : HDC; hrc: HGLRC; vLeft, vRight, vBottom, vTop, vNear, vFar : GLFloat; end; var frmGL: TfrmGL; implementation {$R *.DFM} {======================================================================= Перерисовка окна} procedure TfrmGL.FormPaint(Sender: TObject); begin glClear (GL_COLOR_BUFFER_BIT); // очистка буфера цвета // рисование шести сторон куба glBegin(GL_QUADS); glVertex3f(1.0, 1.0, 1.0); glVertex3f(-1.0, 1.0, 1.0); glVertex3f(-1.0, -1.0, 1.0); glVertex3f(1.0, -1.0, 1.0); glEnd; glBegin(GL_QUADS); glVertex3f(1.0, 1.0, -1.0); glVertex3f(1.0, -1.0, -1.0); glVertex3f(-1.0, -1.0, -1.0); glVertex3f(-1.0, 1.0, -1.0); glEnd; glBegin(GL_QUADS); glVertex3f(-1.0, 1.0, 1.0); glVertex3f(-1.0, 1.0, -1.0); glVertex3f(-1.0, -1.0, -1.0); glVertex3f(-1.0, -1.0, 1.0); glEnd; glBegin(GL_QUADS); glVertex3f(1.0, 1.0, 1.0); glVertex3f(1.0, -1.0, 1.0); glVertex3f(1.0, -1.0, -1.0); glVertex3f(1.0, 1.0, -1.0); glEnd; glBegin(GL_QUADS); glVertex3f(-1.0, 1.0, -1.0); glVertex3f(-1.0, 1.0, 1.0); glVertex3f(1.0, 1.0, 1.0); glVertex3f(1.0, 1.0, -1.0); glEnd; glBegin(GL_QUADS); glVertex3f(-1.0, -1.0, -1.0); glVertex3f(1.0, -1.0, -1.0); glVertex3f(1.0, -1.0, 1.0); glVertex3f(-1.0, -1.0, 1.0); glEnd; SwapBuffers(DC); end; {======================================================================= Формат пикселя} procedure SetDCPixelFormat (hdc : HDC); var pfd : TPixelFormatDescriptor; nPixelFormat : Integer; begin FillChar (pfd, SizeOf (pfd), 0); pfd.dwFlags := PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER; nPixelFormat := ChoosePixelFormat (hdc, @pfd); SetPixelFormat (hdc, nPixelFormat, @pfd); end; {======================================================================= Создание формы} procedure TfrmGL.FormCreate(Sender: TObject); begin DC := GetDC (Handle); SetDCPixelFormat(DC); hrc := wglCreateContext(DC); wglMakeCurrent(DC, hrc); glClearColor (0.5, 0.5, 0.75, 1.0); // цвет фона glColor3f (1.0, 0.0, 0.5); // текущий цвет примитивов vLeft := -1; vRight := 1; vBottom := -1; vTop := 1; vNear := 3; vFar := 10; glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); end; {======================================================================= Конец работы приложения} procedure TfrmGL.FormDestroy(Sender: TObject); begin wglMakeCurrent(0, 0); wglDeleteContext(hrc); ReleaseDC (Handle, DC); DeleteDC (DC); end; procedure TfrmGL.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin If Key = VK_ESCAPE then Close; If Key = VK_SPACE then begin If ssShift in Shift then begin vLeft := vLeft - 0.1; vRight := vRight + 0.1; vBottom := vBottom - 0.1; vTop := vTop + 0.1; end else begin vLeft := vLeft + 0.1; vRight := vRight - 0.1; vBottom := vBottom + 0.1; vTop := vTop - 0.1; end; FormResize(nil); end; If Key = VK_LEFT then begin If ssShift in Shift then vLeft := vLeft - 0.1 else vLeft := vLeft + 0.1; FormResize(nil); end; If Key = VK_RIGHT then begin If ssShift in Shift then vRight := vRight - 0.1 else vRight := vRight + 0.1; FormResize(nil); end; If Key = VK_DOWN then begin If ssShift in Shift then vBottom := vBottom - 0.1 else vBottom := vBottom + 0.1; FormResize(nil); end; If Key = VK_UP then begin If ssShift in Shift then vTop := vTop - 0.1 else vTop := vTop + 0.1; FormResize(nil); end; If Key = VK_INSERT then begin If ssShift in Shift then vNear := vNear - 0.1 else vNear := vNear + 0.1; FormResize(nil); end; If Key = VK_DELETE then begin If ssShift in Shift then vFar := vFar - 0.1 else vFar := vFar + 0.1; FormResize(nil); end; end; procedure TfrmGL.FormResize(Sender: TObject); begin glViewport(0, 0, ClientWidth, ClientHeight); glLoadIdentity; glFrustum (vLeft, vRight, vBottom, vTop, vNear, vFar); // задаем перспективу // этот фрагмент нужен для придания трёхмерности glTranslatef(0.0, 0.0, -8.0); // перенос объекта - ось Z glRotatef(30.0, 1.0, 0.0, 0.0); // поворот объекта - ось X glRotatef(70.0, 0.0, 1.0, 0.0); // поворот объекта - ось Y InvalidateRect(Handle, nil, False); end; end.
{*! * Fano Web Framework (https://fanoframework.github.io) * * @link https://github.com/fanoframework/fano * @copyright Copyright (c) 2018 Zamrony P. Juhara * @license https://github.com/fanoframework/fano/blob/master/LICENSE (MIT) *} unit RequestIntf; interface {$MODE OBJFPC} {$H+} uses ListIntf; type (*!------------------------------------------------ * interface for any class having capability as * HTTP request * * @author Zamrony P. Juhara <zamronypj@yahoo.com> *-----------------------------------------------*) IRequest = interface ['{32913245-599A-4BF4-B25D-7E2EF349F7BB}'] (*!------------------------------------------------ * get single query param value by its name *------------------------------------------------- * @param string key name of key * @param string defValue default value to use if key * does not exist * @return string value *------------------------------------------------*) function getQueryParam(const key: string; const defValue : string = '') : string; (*!------------------------------------------------ * get all query params *------------------------------------------------- * @return list of query string params *------------------------------------------------*) function getQueryParams() : IList; (*!------------------------------------------------ * get single cookie param value by its name *------------------------------------------------- * @param string key name of key * @param string defValue default value to use if key * does not exist * @return string value *------------------------------------------------*) function getCookieParam(const key: string; const defValue : string = '') : string; (*!------------------------------------------------ * get all cookies params *------------------------------------------------- * @return list of cookie params *------------------------------------------------*) function getCookieParams() : IList; (*!------------------------------------------------ * get request body data *------------------------------------------------- * @param string key name of key * @param string defValue default value to use if key * does not exist * @return string value *------------------------------------------------*) function getParsedBodyParam(const key: string; const defValue : string = '') : string; (*!------------------------------------------------ * get all request body data *------------------------------------------------- * @return array of parsed body params *------------------------------------------------*) function getParsedBodyParams() : IList; (*!------------------------------------------------ * test if current request is coming from AJAX request *------------------------------------------------- * @return true if ajax request false otherwise *------------------------------------------------*) function isXhr() : boolean; end; implementation end.
unit WkeIntf; interface uses Windows, WkeTypes; type IWkeWebView = interface; IWkeJs = interface; IWkeWebBase = interface ['{E8396C1B-5B38-44DA-8218-C8F60F1E162E}'] function GetWindowName: WideString; function GetHwnd: HWND; function GetResourceInstance: THandle; function GetBoundsRect: TRect; function GetDrawRect: TRect; function GetDrawDC: HDC; procedure ReleaseDC(const ADC: HDC); end; TWkeWebViewTitleChangeProc = procedure(const AWebView: IWkeWebView; const title: wkeString) of object; TWkeWebViewURLChangeProc = procedure(const AWebView: IWkeWebView; const url: wkeString) of object; TWkeWebViewPaintUpdatedProc = procedure(const AWebView: IWkeWebView; const hdc: HDC; x, y, cx, cy: Integer) of object; TWkeWebViewAlertBoxProc = procedure(const AWebView: IWkeWebView; const msg: wkeString; var bHandled: Boolean) of object; TWkeWebViewConfirmBoxProc = function(const AWebView: IWkeWebView; const msg: wkeString; var bHandled: Boolean): Boolean of object; TWkeWebViewPromptBoxProc = function(const AWebView: IWkeWebView; const msg, defaultResult, result: wkeString; var bHandled: Boolean): Boolean of object; TWkeWebViewConsoleMessageProc = procedure(const AWebView: IWkeWebView; const msg: PwkeConsoleMessage) of object; TWkeWebViewNavigationProc = function(const AWebView: IWkeWebView; navigationType: wkeNavigationType; const url: wkeString; var bHandled: Boolean): Boolean of object; TWkeWebViewCreateViewProc = function(const AWebView: IWkeWebView; info: PwkeNewViewInfo; var bHandled: Boolean): wkeWebView of object; TWkeWebViewDocumentReadyProc = procedure(const AWebView: IWkeWebView; const info: PwkeDocumentReadyInfo) of object; TWkeWebViewLoadingFinishProc = procedure(const AWebView: IWkeWebView; const url: wkeString; result: wkeLoadingResult; const failedReason: wkeString) of object; TWkeWindowClosingProc = function(const AWebView: IWkeWebView): Boolean of object; TWkeWindowDestroyProc = procedure(const AWebView: IWkeWebView) of object; TWkeContextMenuProc = procedure(const AWebView: IWkeWebView; x, y: Integer; flags: UINT) of object; TWkeWndProc = function (const AWebView: IWkeWebView; Msg: UINT; wParam: WPARAM; lParam: LPARAM; var bHandle: Boolean): LRESULT of object; TWkeWndDestoryProc = procedure(const AWebView: IWkeWebView) of object; TWkeInvalidateProc = procedure(const AWebView: IWkeWebView; var bHandled: Boolean) of object; IWkeWebView = interface ['{BE6B7350-E869-43AE-9602-EC4014278406}'] function GetWebView: TWebView; function GetName: WideString; function GetTransparent: Boolean; function GetTitle: WideString; function GetUserAgent: WideString; function GetCookie: WideString; function GetHostWindow: HWND; function GetWidth: Integer; function GetHeight: Integer; function GetContentWidth: Integer; function GetContentHeight: Integer; function GetViewDC(): Pointer; function GetCursorType: wkeCursorType; function GetDirty: Boolean; function GetFocused: Boolean; function GetCookieEnabled: Boolean; function GetMediaVolume: float; function GetCaretRect: wkeRect; function GetZoomFactor: float; function GetEnabled: Boolean; function GetJs: IWkeJs; function GetData1: Pointer; function GetData2: Pointer; function GetOnTitleChange: TWkeWebViewTitleChangeProc; function GetOnURLChange: TWkeWebViewURLChangeProc; function GetOnPaintUpdated: TWkeWebViewPaintUpdatedProc; function GetOnAlertBox: TWkeWebViewAlertBoxProc; function GetOnConfirmBox: TWkeWebViewConfirmBoxProc; function GetOnConsoleMessage: TWkeWebViewConsoleMessageProc; function GetOnCreateView: TWkeWebViewCreateViewProc; function GetOnDocumentReady: TWkeWebViewDocumentReadyProc; function GetOnLoadingFinish: TWkeWebViewLoadingFinishProc; function GetOnNavigation: TWkeWebViewNavigationProc; function GetOnPromptBox: TWkeWebViewPromptBoxProc; function GetOnInvalidate: TWkeInvalidateProc; function GetOnContextMenu: TWkeContextMenuProc; function GetOnWndProc: TWkeWndProc; function GetOnWndDestory: TWkeWndDestoryProc; procedure SetName(const Value: WideString); procedure SetTransparent(const Value: Boolean); procedure SetUserAgent(const Value: WideString); procedure SetHostWindow(const Value: HWND); procedure SetDirty(const Value: Boolean); procedure SetCookieEnabled(const Value: Boolean); procedure SetMediaVolume(const Value: float); procedure SetZoomFactor(const Value: float); procedure SetEnabled(const Value: Boolean); procedure SetData1(const Value: Pointer); procedure SetData2(const Value: Pointer); procedure SetOnTitleChange(const Value: TWkeWebViewTitleChangeProc); procedure SetOnURLChange(const Value: TWkeWebViewURLChangeProc); procedure SetOnPaintUpdated(const Value: TWkeWebViewPaintUpdatedProc); procedure SetOnAlertBox(const Value: TWkeWebViewAlertBoxProc); procedure SetOnConfirmBox(const Value: TWkeWebViewConfirmBoxProc); procedure SetOnConsoleMessage(const Value: TWkeWebViewConsoleMessageProc); procedure SetOnCreateView(const Value: TWkeWebViewCreateViewProc); procedure SetOnDocumentReady(const Value: TWkeWebViewDocumentReadyProc); procedure SetOnLoadingFinish(const Value: TWkeWebViewLoadingFinishProc); procedure SetOnNavigation(const Value: TWkeWebViewNavigationProc); procedure SetOnPromptBox(const Value: TWkeWebViewPromptBoxProc); procedure SetOnInvalidate(const Value: TWkeInvalidateProc); procedure SetOnContextMenu(const Value: TWkeContextMenuProc); procedure SetOnWndProc(const Value: TWkeWndProc); procedure SetOnWndDestory(const Value: TWkeWndDestoryProc); function ProcND(msg: UINT; wParam: WPARAM; lParam: LPARAM; var pbHandled: Boolean): LRESULT; procedure Close; procedure Show(nCmdShow: Integer = SW_SHOW); procedure Hide; function IsShowing: Boolean; procedure LoadURL(const url: WideString); procedure PostURL(const url: WideString; const postData: PAnsiChar; postLen: Integer); procedure LoadHTML(const html: WideString); overload; procedure LoadHTML(const html: PUtf8); overload; procedure LoadFile(const filename: WideString); procedure Load(const str: PUtf8); overload; procedure Load(const str: WideString); overload; procedure Update; procedure Invalidate; function IsLoading: Boolean; function IsLoadSucceeded: Boolean; (*document load sucessed*) function IsLoadFailed: Boolean; (*document load failed*) function IsLoadComplete: Boolean; (*document load complete*) function IsDocumentReady: Boolean; (*document ready*) procedure StopLoading; procedure Reload; procedure Resize(w: Integer; h: Integer); procedure AddDirtyArea(x, y, w, h: Integer); procedure LayoutIfNeeded; procedure RepaintIfNeeded; procedure Paint(bits: Pointer; pitch: Integer); overload; procedure Paint(bits: Pointer; bufWid, bufHei, xDst, yDst, w, h, xSrc, ySrc: Integer; bCopyAlpha: Boolean); overload; function CanGoBack: Boolean; function GoBack: Boolean; function CanGoForward: Boolean; function GoForward: Boolean; procedure EditerSelectAll; function EditerCanCopy: Boolean; procedure EditerCopy; function EditerCanCut: Boolean; procedure EditerCut; function EditerCanPaste: Boolean; procedure EditerPaste; function EditerCanDelete: Boolean; procedure EditerDelete; function EditerCanUndo: Boolean; procedure EditerUndo; function EditerCanRedo: Boolean; procedure EditerRedo; function MouseEvent(msg: UINT; x, y: Integer; flags: UINT): Boolean; function ContextMenuEvent(x, y: Integer; flags: UINT): Boolean; function MouseWheel(x, y, delta: Integer; flags: UINT): Boolean; function KeyUp(virtualKeyCode: UINT; flags: UINT; systemKey: Boolean): Boolean; function KeyDown(virtualKeyCode: UINT; flags: UINT; systemKey: Boolean): Boolean; function KeyPress(charCode: UINT; flags: UINT; systemKey: Boolean): Boolean; procedure SetFocus; procedure KillFocus; function RunJS(const script: PUtf8): jsValue; overload; function RunJS(const script: WideString): jsValue; overload; function GlobalExec: jsExecState; procedure Sleep(); //moveOffscreen procedure Wake(); //moveOnscreen function IsAwake: Boolean; procedure SetEditable(editable: Boolean); procedure BindObject(const objName: WideString; obj: TObject); procedure UnbindObject(const objName: WideString); property WebView: TWebView read GetWebView; property Name: WideString read GetName write SetName; property Transparent: Boolean read GetTransparent write SetTransparent; property Title: WideString read GetTitle; property UserAgent: WideString read GetUserAgent write SetUserAgent; property Cookie: WideString read GetCookie; property HostWindow: HWND read GetHostWindow write SetHostWindow; property Width: Integer read GetWidth; (*viewport width*) property Height: Integer read GetHeight; (*viewport height*) property ContentWidth: Integer read GetContentWidth; (*contents width*) property ContentHeight: Integer read GetContentHeight; (*contents height*) property CursorType: wkeCursorType read GetCursorType; property IsFocused: Boolean read GetFocused; property IsDirty: Boolean read GetDirty write SetDirty; property CookieEnabled: Boolean read GetCookieEnabled write SetCookieEnabled; property MediaVolume: float read GetMediaVolume write SetMediaVolume; property CaretRect: wkeRect read GetCaretRect; property ZoomFactor: float read GetZoomFactor write SetZoomFactor; property Enabled: Boolean read GetEnabled write SetEnabled; property Js: IWkeJs read GetJs; property Data1: Pointer read GetData1 write SetData1; property Data2: Pointer read GetData2 write SetData2; property OnTitleChange: TWkeWebViewTitleChangeProc read GetOnTitleChange write SetOnTitleChange; property OnURLChange: TWkeWebViewURLChangeProc read GetOnURLChange write SetOnURLChange; property OnPaintUpdated: TWkeWebViewPaintUpdatedProc read GetOnPaintUpdated write SetOnPaintUpdated; property OnAlertBox: TWkeWebViewAlertBoxProc read GetOnAlertBox write SetOnAlertBox; property OnConfirmBox: TWkeWebViewConfirmBoxProc read GetOnConfirmBox write SetOnConfirmBox; property OnPromptBox: TWkeWebViewPromptBoxProc read GetOnPromptBox write SetOnPromptBox; property OnConsoleMessage: TWkeWebViewConsoleMessageProc read GetOnConsoleMessage write SetOnConsoleMessage; property OnNavigation: TWkeWebViewNavigationProc read GetOnNavigation write SetOnNavigation; property OnCreateView: TWkeWebViewCreateViewProc read GetOnCreateView write SetOnCreateView; property OnDocumentReady: TWkeWebViewDocumentReadyProc read GetOnDocumentReady write SetOnDocumentReady; property OnLoadingFinish: TWkeWebViewLoadingFinishProc read GetOnLoadingFinish write SetOnLoadingFinish; property OnInvalidate: TWkeInvalidateProc read GetOnInvalidate write SetOnInvalidate; property OnContextMenu: TWkeContextMenuProc read GetOnContextMenu write SetOnContextMenu; property OnWndProc: TWkeWndProc read GetOnWndProc write SetOnWndProc; property OnWndDestory: TWkeWndDestoryProc read GetOnWndDestory write SetOnWndDestory; end; IWkeWindow = interface(IWkeWebView) ['{118FFC2A-9D80-46C1-823D-0A35DFDFDA1D}'] function GetTitle: WideString; function GetWindowHandle: HWND; function GetWindowType: wkeWindowType; function GetIsModaling: Boolean; function GetModalCode: Integer; function GetOnClosing: TWkeWindowClosingProc; function GetOnDestroy: TWkeWindowDestroyProc; procedure SetTitle(const AValue: WideString); procedure SetModalCode(const Value: Integer); procedure SetOnClosing(const AValue: TWkeWindowClosingProc); procedure SetOnDestroy(const AValue: TWkeWindowDestroyProc); procedure ShowWindow(); procedure HideWindow(); procedure EnableWindow(enable: Boolean); procedure CloseWindow; procedure DestroyWindow; function ShowModal(AParent: HWND = 0): Integer; procedure EndModal(nCode: Integer); procedure MoveWindow(x, y, width, height: Integer); procedure MoveToCenter; procedure ResizeWindow(width, height: Integer); property Title: WideString read GetTitle write SetTitle; property WindowHandle: HWND read GetWindowHandle; property WindowType: wkeWindowType read GetWindowType; property IsModaling: Boolean read GetIsModaling; property ModalCode: Integer read GetModalCode write SetModalCode; property OnClosing: TWkeWindowClosingProc read GetOnClosing write SetOnClosing; property OnDestroy: TWkeWindowDestroyProc read GetOnDestroy write SetOnDestroy; end; IWkeJsValue = interface; IWkeJsExecState = interface ['{5D6249B4-0BA3-4E3C-91FA-782889265C06}'] function GetWebView: TWebView; function GetProp(const AProp: WideString): IWkeJsValue; function GetExecState: jsExecState; function GetArg(const argIdx: Integer): IWkeJsValue; function GetArgCount: Integer; function GetArgType(const argIdx: Integer): jsType; function GetGlobalObject: IWkeJsValue; function GetData1: Pointer; function GetData2: Pointer; procedure SetProp(const AProp: WideString; const Value: IWkeJsValue); procedure SetData1(const Value: Pointer); procedure SetData2(const Value: Pointer); function jsInt(n: Integer): IWkeJsValue; function jsFloat(n: float): IWkeJsValue; function jsDouble(n: Double): IWkeJsValue; function jsBoolean(n: Boolean): IWkeJsValue; function jsUndefined(): IWkeJsValue; function jsNull(): IWkeJsValue; function jsTrue(): IWkeJsValue; function jsFalse(): IWkeJsValue; function jsString(const str: PUtf8): IWkeJsValue; function jsStringW(const str: Pwchar_t): IWkeJsValue; function jsObject(): IWkeJsValue; function jsArray(): IWkeJsValue; function jsFunction(fn: jsNativeFunction; argCount: Integer): IWkeJsValue; function Eval(const str: PUtf8): IWkeJsValue; function EvalW(const str: Pwchar_t): IWkeJsValue; function CallGlobal(func: jsValue; args: array of OleVariant): OleVariant; overload; function CallGlobal(const func: WideString; args: array of OleVariant): OleVariant; overload; function CallGlobalEx(func: jsValue; args: array of IWkeJsValue): IWkeJsValue; overload; function CallGlobalEx(const func: WideString; args: array of IWkeJsValue): IWkeJsValue; overload; function PropExist(const AProp: WideString): Boolean; procedure BindFunction(const name: WideString; fn: jsNativeFunction; argCount: Integer); procedure UnbindFunction(const name: WideString); procedure BindObject(const objName: WideString; obj: TObject); procedure UnbindObject(const objName: WideString); function CreateJsObject(obj: TObject): jsValue; property ExecState: jsExecState read GetExecState; //return the window object property GlobalObject: IWkeJsValue read GetGlobalObject; property Prop[const AProp: WideString]: IWkeJsValue read GetProp write SetProp; property ArgCount: Integer read GetArgCount; property ArgType[const argIdx: Integer]: jsType read GetArgType; property Arg[const argIdx: Integer]: IWkeJsValue read GetArg; property Data1: Pointer read GetData1 write SetData1; property Data2: Pointer read GetData2 write SetData2; property WebView: TWebView read GetWebView; end; IWkeJsObject = interface; IWkeJsValue = interface ['{7528CD28-D691-4B16-8AC3-FAC773D0F94B}'] function GetExecState: jsExecState; function GetValue: jsValue; function GetValueType: jsType; function GetData1: Pointer; function GetData2: Pointer; procedure SetData1(const Value: Pointer); procedure SetData2(const Value: Pointer); function IsNumber: Boolean; function IsString: Boolean; function IsBoolean: Boolean; function IsObject: Boolean; function IsFunction: Boolean; function IsUndefined: Boolean; function IsNull: Boolean; function IsArray: Boolean; function IsTrue: Boolean; function IsFalse: Boolean; function ToInt: Integer; function ToFloat: float; function ToDouble: Double; function ToBoolean: Boolean; function ToStringA: PUtf8; function ToStringW: Pwchar_t; function ToObject: IWkeJsObject; procedure SetAsInt(n: Integer); procedure SetAsFloat(n: float); procedure SetAsDouble(n: Double); procedure SetAsBoolean(n: Boolean); procedure SetAsUndefined(); procedure SetAsNull(); procedure SetAsTrue(); procedure SetAsFalse(); procedure SetAsString(const str: PUtf8); procedure SetAsStringW(const str: Pwchar_t); procedure SetAsObject(v: jsValue); procedure SetAsArray(v: jsValue); procedure SetAsFunction(fn: jsNativeFunction; argCount: Integer); property ExecState: jsExecState read GetExecState; property Value: jsValue read GetValue; property ValueType: jsType read GetValueType; property Data1: Pointer read GetData1 write SetData1; property Data2: Pointer read GetData2 write SetData2; end; IWkeJsObject = interface(IWkeJsValue) ['{7B4DF4BE-EB7E-4738-8F08-47C33857F6D8}'] function GetProp(const AName: WideString): IWkeJsValue; function GetPropAt(const AIndex: Integer): IWkeJsValue; function GetLength: Integer; procedure SetProp(const AName: WideString; const Value: IWkeJsValue); procedure SetPropAt(const AIndex: Integer; const Value: IWkeJsValue); procedure SetLength(const Value: Integer); function Call(func: jsValue; args: array of OleVariant): OleVariant; overload; function Call(const func: WideString; args: array of OleVariant): OleVariant; overload; function CallEx(func: jsValue; args: array of IWkeJsValue): IWkeJsValue; overload; function CallEx(const func: WideString; args: array of IWkeJsValue): IWkeJsValue; overload; function PropExist(const AProp: WideString): Boolean; property Length: Integer read GetLength write SetLength; property Prop[const AName: WideString]: IWkeJsValue read GetProp write SetProp; property PropAt[const AIndex: Integer]: IWkeJsValue read GetPropAt write SetPropAt; end; IWkeJsObjectRegInfo = interface ['{1C6015CD-6E76-4B6A-8302-5B49E283B198}'] function GetName: WideString; function GetValue: TObject; procedure SetName(const Value: WideString); procedure SetValue(const Value: TObject); property Name: WideString read GetName write SetName; property Value: TObject read GetValue write SetValue; end; TWkeJsObjectAction = (woaReg, woaUnreg, woaChanged); TWkeJsObjectListener = procedure (const AInfo: IWkeJsObjectRegInfo; Action: TWkeJsObjectAction) of object; IWkeJsObjectList = interface ['{C4752C12-92DC-4264-8DFF-B0C5C53D9C25}'] function GetCount: Integer; function GetItem(const Index: Integer): IWkeJsObjectRegInfo; function GetItemName(const Index: Integer): WideString; function GetItemByName(const AName: WideString): IWkeJsObjectRegInfo; function GetData1: Pointer; function GetData2: Pointer; procedure SetItem(const Index: Integer; const Value: IWkeJsObjectRegInfo); procedure SetItemByName(const AName: WideString; const Value: IWkeJsObjectRegInfo); procedure SetData1(const Value: Pointer); procedure SetData2(const Value: Pointer); procedure Invalidate; function Reg(const AName: WideString; const AItem: TObject): Integer; procedure UnReg(const Index: Integer); overload; procedure UnReg(const AName: WideString); overload; procedure Clear; function IndexOf(const AItem: TObject): Integer; function IndexOfName(const AName: WideString): Integer; function AddListener(const AListener: TWkeJsObjectListener): Integer; function RemoveListener(const AListener: TWkeJsObjectListener): Integer; property Count: Integer read GetCount; property Item[const Index: Integer]: IWkeJsObjectRegInfo read GetItem write SetItem; default; property ItemName[const Index: Integer]: WideString read GetItemName; property ItemByName[const AName: WideString]: IWkeJsObjectRegInfo read GetItemByName write SetItemByName; property Data1: Pointer read GetData1 write SetData1; property Data2: Pointer read GetData2 write SetData2; end; IWkeJs = interface ['{78D78225-D8EF-4960-8EAD-87191C1065B8}'] function GetGlobalExec: IWkeJsExecState; function GetData1: Pointer; function GetData2: Pointer; procedure SetData1(const Value: Pointer); procedure SetData2(const Value: Pointer); procedure BindFunction(const name: WideString; fn: jsNativeFunction; argCount: Integer); procedure UnbindFunction(const name: WideString); procedure BindObject(const objName: WideString; obj: TObject); procedure UnbindObject(const objName: WideString); procedure BindGetter(const name: WideString; fn: jsNativeFunction); procedure BindSetter(const name: WideString; fn: jsNativeFunction); function CreateJsObject(obj: TObject): jsValue; procedure GC(); property GlobalExec: IWkeJsExecState read GetGlobalExec; property Data1: Pointer read GetData1 write SetData1; property Data2: Pointer read GetData2 write SetData2; end; IWkeFileSystem = interface ['{FDF02472-1B02-4E43-9E79-398249F10B5A}'] function Open(const path: PUtf8): Boolean; procedure Close; function Size: Cardinal; function Read(buffer: Pointer; size: Cardinal): Integer; function Seek(offset: Integer; origin: Integer): Integer; end; TWkeGetFileSystemProc = function(const path: PUtf8; var Handled: Boolean): IWkeFileSystem of object; TWkeGetWkeWebBaseProc = function(const AFilter: WideString; const ATag: Pointer): IWkeWebBase of object; PIWke = ^IWke; IWke = interface ['{788F9BAC-A483-4097-9581-F7B4F30CF8EC}'] function GetDriverName: WideString; function GetSettings: wkeSettings; function GetWkeVersion: WideString; function GetGlobalObjects(): IWkeJsObjectList; function GetData1: Pointer; function GetData2: Pointer; function GetOnGetFileSystem: TWkeGetFileSystemProc; function GetOnGetWkeWebBase: TWkeGetWkeWebBaseProc; procedure SetDriverName(const Value: WideString); procedure SetSettings(const Value: wkeSettings); procedure SetData1(const Value: Pointer); procedure SetData2(const Value: Pointer); procedure SetOnGetFileSystem(const Value: TWkeGetFileSystemProc); procedure SetOnGetWkeWebBase(const Value: TWkeGetWkeWebBaseProc); procedure Configure(const settings: wkeSettings); function CreateWebView(const AThis: IWkeWebBase): IWkeWebView; overload; function CreateWebView(const AThis: IWkeWebBase; const AWebView: TWebView; const AOwnView: Boolean = True): IWkeWebView; overload; function CreateWebView(const AFilter: WideString = ''; const ATag: Pointer = nil): IWkeWebView; overload; function CreateWindow(type_: wkeWindowType; parent: HWND; x, y, width, height: Integer): IWkeWindow; function RunAppclition(const MainWnd: HWND): Integer; procedure ProcessMessages; procedure Terminate; function GetString(const str: wkeString): PUtf8; function GetStringW(const str: wkeString): Pwchar_t; function CreateExecState(const AExecState: JsExecState): IWkeJsExecState; function CreateJsValue(const AExecState: JsExecState): IWkeJsValue; overload; function CreateJsValue(const AExecState: JsExecState; const AValue: jsValue): IWkeJsValue; overload; procedure BindFunction(const name: WideString; fn: jsNativeFunction; argCount: Integer); overload; procedure BindFunction(es: jsExecState; const name: WideString; fn: jsNativeFunction; argCount: Integer); overload; procedure UnbindFunction(const name: WideString); overload; procedure UnbindFunction(es: jsExecState; const name: WideString); overload; procedure BindGetter(const name: WideString; fn: jsNativeFunction); procedure BindSetter(const name: WideString; fn: jsNativeFunction); procedure BindObject(es: jsExecState; const objName: WideString; obj: TObject); procedure UnbindObject(es: jsExecState; const objName: WideString); function CreateJsObject(es: jsExecState; obj: TObject): jsValue; function CreateFileSystem(const path: PUtf8): IWkeFileSystem; function CreateDefaultFileSystem(): IWkeFileSystem; property DriverName: WideString read GetDriverName write SetDriverName; property Settings: wkeSettings read GetSettings write SetSettings; property WkeVersion: WideString read GetWkeVersion; property GlobalObjects: IWkeJsObjectList read GetGlobalObjects; property Data1: Pointer read GetData1 write SetData1; property Data2: Pointer read GetData2 write SetData2; property OnGetFileSystem: TWkeGetFileSystemProc read GetOnGetFileSystem write SetOnGetFileSystem; property OnGetWkeWebBase: TWkeGetWkeWebBaseProc read GetOnGetWkeWebBase write SetOnGetWkeWebBase; end; function Wke: IWke; implementation uses WkeImportDefs; function Wke: IWke; type TWke = function(): PIWke; begin Assert(WkeExports<>nil); Result := TWke(WkeExports.Funcs[FuncIdx_Wke])^; end; end.
unit ExtraChargeForm; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, DictonaryForm, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters, Vcl.Menus, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, System.Actions, Vcl.ActnList, Vcl.StdCtrls, cxButtons, Vcl.ExtCtrls, ExtraChargeView; type TfrmExtraCharge = class(TfrmDictonary) private FViewExtraCharge: TViewExtraCharge; { Private declarations } protected procedure ApplyUpdates; override; procedure CancelUpdates; override; procedure ClearFormVariable; override; function HaveAnyChanges: Boolean; override; public constructor Create(AOwner: TComponent); override; property ViewExtraCharge: TViewExtraCharge read FViewExtraCharge; { Public declarations } end; var frmExtraCharge: TfrmExtraCharge; implementation {$R *.dfm} uses RepositoryDataModule; constructor TfrmExtraCharge.Create(AOwner: TComponent); begin inherited; FViewExtraCharge := TViewExtraCharge.Create(Self); FViewExtraCharge.Parent := Panel1; FViewExtraCharge.Align := alClient; end; procedure TfrmExtraCharge.ApplyUpdates; begin ViewExtraCharge.UpdateView; ViewExtraCharge.actCommit.Execute; end; procedure TfrmExtraCharge.CancelUpdates; begin ViewExtraCharge.UpdateView; ViewExtraCharge.actRollback.Execute; end; procedure TfrmExtraCharge.ClearFormVariable; begin frmExtraCharge := nil; end; function TfrmExtraCharge.HaveAnyChanges: Boolean; begin Result := ViewExtraCharge.ExtraChargeGroup.HaveAnyChanges; end; end.
unit GestionarCuentaCredito; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, UnitCuentaCredito, Vcl.StdCtrls; type TFormGestionarCuenta = class(TForm) Button1: TButton; Button3: TButton; Label1: TLabel; labelNumeroCuenta: TLabel; Atrás: TButton; Label2: TLabel; labelDeudaTotal: TLabel; procedure clicAtras(Sender: TObject); procedure onClose(Sender: TObject; var Action: TCloseAction); procedure onShow(Sender: TObject); procedure cerrrarCuentaClic(Sender: TObject); procedure clicCongelar(Sender: TObject); procedure atras(); private { Private declarations } public cuentaCredito: TCuentaCredito; numeroDeCuenta: string; deudaTotal: Currency; { Public declarations } end; var FormGestionarCuenta: TFormGestionarCuenta; implementation uses MenuGerente, GestionarCuentasCredito; {$R *.dfm} procedure TFormGestionarCuenta.atras; begin FormGestionarCuenta.Visible:= False; FormMenuGerente.Show; end; procedure TFormGestionarCuenta.cerrrarCuentaClic(Sender: TObject); begin //Cerrar cuenta cuentaCredito.actualizarEstado('cerrada'); showmessage('La cuenta ha sido cerrada exitosamente'); atras; end; procedure TFormGestionarCuenta.clicAtras(Sender: TObject); begin atras; end; procedure TFormGestionarCuenta.clicCongelar(Sender: TObject); begin cuentaCredito.actualizarEstado('congelada'); showmessage('La cuenta ha sido congelada exitosamente'); atras; end; procedure TFormGestionarCuenta.onClose(Sender: TObject; var Action: TCloseAction); begin Application.Terminate; end; procedure TFormGestionarCuenta.onShow(Sender: TObject); begin //toto numeroDeCuenta := GestionarCuentasCredito.FormGestionarCuentasCredito.numeroDeCuenta; labelNumeroCuenta.Caption := numeroDeCuenta; cuentaCredito := TCuentaCredito.Create; cuentaCredito.numeroDeCuenta := numeroDeCuenta; deudaTotal := GestionarCuentasCredito.FormGestionarCuentasCredito.deudaTotal; labelDeudaTotal.Caption := CurrToStrF(deudaTotal, ffCurrency, 2); end; end.
{* CustomSaveDialog.pas -------------------- Begin: 2006/04/01 Last revision: $Date: 2011-10-25 05:05:07 $ $Author: areeves $ Version number: $Revision: 1.7 $ Project: APHI General Purpose Delphi Libary Website: http://www.naadsm.org/opensource/delphi/ Author: Aaron Reeves <aaron.reeves@naadsm.org> ---------------------------------------------------- Copyright (C) 2010 Aaron Reeves 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. } (* Documentation generation tags begin with {* or /// Replacing these with (* or // foils the documentation generator *) unit CustomSaveDialog; interface uses Dialogs, ExtDlgs, ExtCtrls ; type /// Inherits from the VCL TSaveDialog TCustomSaveDialog = class( TSaveDialog(*TSavePictureDialog*) ) public procedure setImage( img: TImage ); end ; implementation {* Currently this method implements nothing. @param img used to display a graphical image on a form, the original file can be of many formats - a bitmap, icon, metafile, or JPG } procedure TCustomSaveDialog.setImage( img: TImage ); begin //self.ImageCtrl.Picture.Bitmap := img.Picture.Bitmap; end ; end.
unit testcalc; interface uses DUnitX.TestFramework, calculate; type [TestFixture] TTestCalc = class(TObject) private calc:TCalculate; public [Setup] procedure Setup; [TearDown] procedure TearDown; // Test with TestCase Attribute to supply parameters. [Test] [TestCase('TestA','1,2,3')] [TestCase('TestB','3,4,7')] procedure Test2(const A : uint32;const B : uint32; const R: uint32); end; implementation procedure TTestCalc.Setup; begin calc := TCalculate.Create; end; procedure TTestCalc.TearDown; begin calc.DisposeOf; end; procedure TTestCalc.Test2(const A : uint32;const B : uint32; const R: uint32); var v: uint32; begin //arrange //act v := calc.add(A,B); //assert if v = r then begin Assert.Pass('values match'); end else begin Assert.Fail('values do not match'); end; end; initialization TDUnitX.RegisterTestFixture(TTestCalc); end.
{**********************************************************************} {* Иллюстрация к книге "OpenGL в проектах Delphi" *} {* Краснов М.В. softgl@chat.ru *} {**********************************************************************} unit frmMain; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, OpenGL; const ImageWidth = 74; ImageHeight = 74; type TfrmGL = class(TForm) procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormPaint(Sender: TObject); procedure FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); private hrc: HGLRC; DC : HDC; Image : Array [0..ImageHeight-1, 0..ImageWidth - 1, 0..2] of GLUbyte; procedure MakeImage; procedure SetDCPixelFormat (hdc : HDC); end; var frmGL: TfrmGL; Down : Boolean = False; implementation {$R *.DFM} {======================================================================= Создание образа} procedure TfrmGL.MakeImage; var i, j : Integer; PixCol : TColor; Bitmap : TBitmap; begin Bitmap := TBitmap.Create; Bitmap.LoadFromFile ('Claudia.bmp'); For i := 0 to ImageHeight - 1 do For j := 0 to ImageWidth - 1 do begin PixCol := Bitmap.Canvas.Pixels [j, i]; Image[ImageHeight - i - 1][j][0] := PixCol and $FF; Image[ImageHeight - i - 1][j][1] := (PixCol and $FF00) shr 8; Image[ImageHeight - i - 1][j][2] := (PixCol and $FF0000) shr 16; end; Bitmap.Free; end; {======================================================================= Перерисовка окна} procedure TfrmGL.FormPaint(Sender: TObject); begin glViewPort (0, 0, ClientWidth, ClientHeight); glClearColor (0.5, 0.5, 0.75, 1.0); glClear(GL_COLOR_BUFFER_BIT); glRasterPos2f(-1.0, -1.0); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glDrawPixels(ImageWidth, ImageHeight, GL_RGB, GL_UNSIGNED_BYTE, @Image); end; {======================================================================= Создание окна} procedure TfrmGL.FormCreate(Sender: TObject); begin dc := GetDC (Handle); SetDCPixelFormat(DC); hrc := wglCreateContext(DC); wglMakeCurrent(DC, hrc); MakeImage; end; {======================================================================= Формат пикселя} procedure TfrmGL.SetDCPixelFormat (hdc : HDC); var pfd : TPixelFormatDescriptor; nPixelFormat : Integer; begin FillChar (pfd, SizeOf (pfd), 0); nPixelFormat := ChoosePixelFormat (hdc, @pfd); SetPixelFormat (hdc, nPixelFormat, @pfd); end; {======================================================================= Конец работы программы} procedure TfrmGL.FormDestroy(Sender: TObject); begin wglMakeCurrent(0, 0); wglDeleteContext(hrc); ReleaseDC (Handle, DC); DeleteDC (DC); end; procedure TfrmGL.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Down := True; end; procedure TfrmGL.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Down := False; end; procedure TfrmGL.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin If Down then begin {--- копирование части экрана ---} glRasterPos2f(2 * X / ClientWidth - 1, 2 * (ClientHeight - Y) / ClientHeight - 1); glCopyPixels (0, 0, ImageWidth, ImageHeight, GL_COLOR); glFlush end; end; end.
unit uClassicParser; {$I ..\Include\IntXLib.inc} interface uses {$IFDEF DELPHI} Generics.Collections, {$ENDIF DELPHI} uParserBase, uIParser, uStrRepHelper, uIntXLibTypes; type /// <summary> /// Classic parsing algorithm using multiplication (O[n^2]). /// </summary> TClassicParser = class sealed(TParserBase) public /// <summary> /// Creates new <see cref="ClassicParser" /> instance. /// </summary> /// <param name="pow2Parser">Parser for pow2 case.</param> constructor Create(pow2Parser: IIParser); /// <summary> /// Parses provided string representation of <see cref="TIntX" /> object. /// </summary> /// <param name="value">Number as string.</param> /// <param name="startIndex">Index inside string from which to start.</param> /// <param name="endIndex">Index inside string on which to end.</param> /// <param name="numberBase">Number base.</param> /// <param name="charToDigits">Char->digit dictionary.</param> /// <param name="digitsRes">Resulting digits.</param> /// <returns>Parsed integer length.</returns> function Parse(const value: String; startIndex: Integer; endIndex: Integer; numberBase: UInt32; charToDigits: TDictionary<Char, UInt32>; digitsRes: TIntXLibUInt32Array): UInt32; override; end; implementation constructor TClassicParser.Create(pow2Parser: IIParser); begin Inherited Create(pow2Parser); end; function TClassicParser.Parse(const value: String; startIndex: Integer; endIndex: Integer; numberBase: UInt32; charToDigits: TDictionary<Char, UInt32>; digitsRes: TIntXLibUInt32Array): UInt32; var newLength, j: UInt32; numberBaseLong, digit: UInt64; i: Integer; begin newLength := Inherited Parse(value, startIndex, endIndex, numberBase, charToDigits, digitsRes); // Maybe base method already parsed this number if (newLength <> 0) then begin result := newLength; Exit; end; // Do parsing in big cycle numberBaseLong := numberBase; i := startIndex; while i <= (endIndex) do begin digit := TStrRepHelper.GetDigit(charToDigits, value[i], numberBase); // Next multiply existing values by base and add this value to them if (newLength = 0) then begin if (digit <> 0) then begin digitsRes[0] := UInt32(digit); newLength := 1; end; end else begin j := 0; while j < (newLength) do begin digit := digit + digitsRes[j] * numberBaseLong; digitsRes[j] := UInt32(digit); digit := digit shr 32; Inc(j); end; if (digit <> 0) then begin digitsRes[newLength] := UInt32(digit); Inc(newLength); end end; Inc(i); end; result := newLength; end; end.
unit main; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types,FMX.Memo.Types,FMX.Platform.Win,FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Objects, FMX.Layouts,Windows,Messages, FMX.StdCtrls, FMX.Effects, FMX.Ani, System.Math.Vectors, FMX.Controls3D, FMX.Layers3D, FMX.Viewport3D, FMX.Controls.Presentation, FMX.ListBox, FMX.TreeView, FMX.Edit, System.Threading,IOUtils, FMX.Colors, FMX.ScrollBox, FMX.Memo, SyncObjs,XMLDoc, xmldom, XMLIntf; type TMyPseudoThreadPoolKurkulator = class(TObject) constructor Create(Files : TArray<System.string>); overload; destructor Destroy; public procedure DoKurkulate(oResult:TStrings; ProgressBar:Tline; XMLSavePath:string); private myFiles: TArray<System.string>; end; type TMForm = class(TForm) topl: TLayout; toplr: TRectangle; mlayout: TLayout; sgrip: TSizeGrip; MRect: TRectangle; GE: TGlowEffect; startAnim: TFloatAnimation; logoLayout: TLayout; logoImg: TImage; logoImg0: TImage; logoxanim: TFloatAnimation; logo0xanim: TFloatAnimation; toplanim: TFloatAnimation; closeBtn: TImage; canim: TColorAnimation; blure: TBlurEffect; MRectLayout: TLayout; editPath: TEdit; FolderBttn: TButton; Image1: TImage; splitLine: TLine; runBttn: TButton; runInfoLabel: TLabel; runRect: TRectangle; progressLine: TLine; findAnim: TFloatAnimation; memoLog: TMemo; splitLine0: TLine; progressLine0: TLine; pregressLine1: TLine; procedure toplrMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure startAnimProcess(Sender: TObject); procedure startAnimFinish(Sender: TObject); procedure logoxanimFinish(Sender: TObject); procedure logo0xanimFinish(Sender: TObject); procedure toplanimProcess(Sender: TObject); procedure toplanimFinish(Sender: TObject); procedure closeBtnMouseEnter(Sender: TObject); procedure closeBtnMouseLeave(Sender: TObject); procedure closeBtnClick(Sender: TObject); procedure FolderBttnClick(Sender: TObject); procedure sgripKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); procedure findAnimProcess(Sender: TObject); procedure runBttnClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure memoLogChange(Sender: TObject); procedure mlayoutPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); private { Private declarations } public { Public declarations } end; var MForm: TMForm; Files,Dirs : TArray<System.string>; Kurkulator : TMyPseudoThreadPoolKurkulator; KCounter : Integer = 0; // счётчик выполененных заданий в потоках T: TDateTime; LoopBreakByCloseWnd : Boolean = false; // прерывание цикла в пуле для корртного выхода из программы по нажатию кнопки закрытия окна // 317 строка implementation {$R *.fmx} procedure TMForm.closeBtnClick(Sender: TObject); begin LoopBreakByCloseWnd := true; Close; end; {$REGION 'Анимация кнопки закрытия окна'} procedure TMForm.closeBtnMouseEnter(Sender: TObject); begin TImage(Sender).Opacity:= 0.5; end; procedure TMForm.closeBtnMouseLeave(Sender: TObject); begin TImage(Sender).Opacity:= 1.0; end; procedure TMForm.findAnimProcess(Sender: TObject); begin blure.UpdateParentEffects; if KCounter=Length(Files) then begin findAnim.Enabled := false; progressLine.Visible := false; end; end; {$ENDREGION} // Нажатие кнопки выбора папки procedure TMForm.FolderBttnClick(Sender: TObject); var path:string; i: Integer; begin memoLog.Lines.Clear; SelectDirectory('Select folder', path, path); editPath.Text := path; editPath.Enabled := true; // поиск в отдельном потоке, чтобы не зависл иннтерфес // запускается анимация для отображения процесс поиска // progressLine.Visible:= true; -- временно выпилил, так как есть непотные глюки runInfoLabel.Text := '-'; TTask.run ( procedure begin Files := TDirectory.GetFiles(path, '*.*', TSearchOption.soAllDirectories); Dirs := TDirectory.GetDirectories(path,'*', TSearchOption.soAllDirectories); runInfoLabel.Text := length(Files).ToString + ' files and ' + length(Dirs).ToString + ' folders found'; TThread.Synchronize(nil, procedure var i:integer; begin for i:=0 to Length(Files) do begin memoLog.Lines.Add(' '+Files[i]); memoLog.RecalcUpdateRect; memoLog.GoToTextEnd; // проматываю в конец списка MForm.memoLog.UpdateContentSize; runInfoLabel.Repaint; end; end ); end ); Sleep(100); runBttn.Enabled := true; end; procedure TMForm.FormCreate(Sender: TObject); begin MRectLayout.Visible:= false; blure.Enabled := true; logoLayout.Visible := true; topl.Height := 0.01; logoImg.Position.X := -400; logoImg0.Position.X := 750; findAnim.StopValue := splitLine.Width-progressLine.Width; // получаю коенечную позицию линии для анимации поиска файлов end; procedure TMForm.logo0xanimFinish(Sender: TObject); begin toplanim.Enabled := true; end; procedure TMForm.logoxanimFinish(Sender: TObject); begin logo0xanim.Enabled := true; end; procedure TMForm.memoLogChange(Sender: TObject); begin memoLog.ScrollTo(0,5); end; procedure TMForm.mlayoutPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); begin blure.UpdateParentEffects; end; procedure TMForm.runBttnClick(Sender: TObject); var Pooool : TThreadPool; begin FolderBttn.Enabled := false; runBttn.Enabled := false; findAnim.StopValue := splitLine.Width-progressLine.Width; progressLine.Visible := true; findAnim.Enabled := true; T := Time; memoLog.Lines.Clear; memoLog.Lines.Add(#13#10+' Kurkulation started :: '+ TimeToStr(T) +#13#10) ; Kurkulator := TMyPseudoThreadPoolKurkulator.Create(Files); TTask.run( procedure begin Kurkulator.DoKurkulate(memoLog.Lines, progressLine0, editPath.Text); end ); end; procedure TMForm.sgripKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); begin findAnim.StopValue := splitLine.Width-progressLine.Width; end; procedure TMForm.startAnimFinish(Sender: TObject); begin mlayout.Enabled := true; mlayout.Opacity := 1; logoxanim.Enabled := true; end; procedure TMForm.startAnimProcess(Sender: TObject); begin GE.UpdateParentEffects; end; procedure TMForm.toplanimFinish(Sender: TObject); begin MRectLayout.Visible:=true; topl.Height := 25; end; procedure TMForm.toplanimProcess(Sender: TObject); begin sgrip.Opacity := sgrip.Opacity + 0.05; logoLayout.Opacity := logoLayout.Opacity - 0.1; end; procedure TMForm.toplrMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); var hw : HWND; begin hw := FindWindow(nil,PChar(MForm.Caption)); ReleaseCapture; SendMessage(hw, WM_SysCommand,61458,0); end; { TMyPseudoThreadPoolCalculator } destructor TMyPseudoThreadPoolKurkulator.Destroy; var i:integer; begin Inherited Destroy; for i:=0 to Length(myFiles)-1 do myFiles[i]:=''; end; procedure TMyPseudoThreadPoolKurkulator.DoKurkulate(oResult:TStrings; ProgressBar:Tline;XMLSavePath:string); var pbv: single; sumArray : TArray<Int64>; XML : IXMLDOCUMENT; RootNode, CurNode, PrevNode : IXMLNODE; k: Integer; begin KCounter := 0; ProgressBar.Visible := True; ProgressBar.Width := 0; pbv := TLine(ProgressBar.Parent).Width/Length(myFiles); TParallel.For(0,length(myFiles)-1, procedure (i:integer; breaker: TParallel.TLoopState) var fs: TFileStream; j: Int64; sum: Int64; buf: TArray<Byte>; begin sum := 0; fs := TFileStream.Create(myFiles[i],fmOpenRead); SetLength(sumArray,length(myFiles)); SetLength(buf,fs.Size); fs.Read(buf,fs.Size); for j := 0 to fs.Size-1 do begin sum := sum + buf[j]; // суммирую if LoopBreakByCloseWnd then begin {breaker.Break; {--->} Application.Terminate; end; // завершение программы по нажатию кнопки закрытия окна end; TInterlocked.Increment(KCounter); // подсчёт выполенных задач sumArray[i] := sum; TThread.Synchronize(nil, procedure begin oResult.Append(' ' + ExtractFileName(myFiles[i]) + ' -> Kurkulated Sum :: ' + sum.ToString +' | ' + KCounter.ToString + ' of ' + length(myFiles).ToString); ProgressBar.Width := ProgressBar.Width + pbv; // индикация процесса вычисления MForm.memoLog.GoToTextEnd; MForm.memoLog.UpdateContentSize; MForm.memoLog.UpdateEffects; Sleep(1); if KCounter = Length(myFiles) then // если последее задание, то вывожу сообщение об окончании begin T := Time; oResult.Append(#13#10+' Kurkulation completed :: '+ TimeToStr(T) +#13#10) ; oResult.Append(#13#10+' '+PChar(XMLSavePath+'\Kurkulator.xml') +#13#10) ; MForm.memoLog.ScrollBy(MForm.memoLog.Lines.Count,0); MForm.memoLog.GoToTextEnd; MForm.memoLog.UpdateContentSize; MForm.memoLog.UpdateEffects; ProgressBar.Width := 0; MForm.FolderBttn.Enabled := true; MForm.runInfoLabel.Text := '-'; MForm.editPath.Text := ''; Sleep(1); fs.Destroy; // Очистка памяти if Length(Files)>0 then begin // SetLength(Files,1); // SetLength(Dirs,1); end; end; end); fs.Destroy; end ); XML := TXMLDocument.Create(nil); XML.Active := true; XML.Options := [doNodeAutoIndent]; XML.Encoding := 'utf-8'; XML.DocumentElement := XML.CreateNode('KurkulatorXML',ntElement); TThread.Synchronize(nil, procedure var k:integer; begin for k := 0 to Length(myFiles)-1 do begin CurNode := XML.DocumentElement.AddChild('File'+k.ToString); PrevNode:= CurNode; CurNode := CurNode.AddChild('Path'); CurNode.Text := myFiles[k]; PrevNode := PrevNode.AddChild('Sum'); PrevNode.Text := sumArray[k].ToString; MForm.findAnim.Enabled := false; MForm.progressLine.Visible := false; end; end ); XML.SaveToFile( PChar(XMLSavePath+'\Kurkulator.xml')); FreeAndNil(XML); FreeAndNil(Kurkulator); end; constructor TMyPseudoThreadPoolKurkulator.Create(Files : TArray<System.string>); begin Inherited Create(); myFiles := Files; end; end.
(* NC通讯操作及解析 原始作者:王云涛 建立时间:2011-12-02 *) unit u_NCAPI; interface uses SysUtils, Classes, xmldom, XMLIntf, msxmldom, XMLDoc, Variants, IdHTTP, BASEXMLAPI, u_ICBCRec; type //签名信息 TSignRec = record RtCode: string; RtStr: string; DataStr: string; end; //验签信息 TVerifySignRec = TSignRec; TNCSvr = class(TComponent) private //安全http协议服务器 FHTTPS_URL: string; //签名端口 FSIGN_URL: string; procedure SetHttpParams(const http: TIdHttp); public function Sign(const DataStr: string; var rtDataStr: string): Boolean; function verify_sign(const DataStr: string; var rtDataStr: string): Boolean; function Request(const pub: TPubRec; const reqData: string; var rtDataStr: string): Boolean; property HTTPS_URL: string read FHTTPS_URL write FHTTPS_URL; property SIGN_URL: string read FSIGN_URL write FSIGN_URL; end; TSign = class(TBASEXMLAPI) private FSR: TSignRec; protected procedure ParserXML(); override; public function GetText: string; property SignRec: TSignRec read FSR; end; TVerifySign = class(TBASEXMLAPI) private FVSR: TVerifySignRec; protected procedure ParserXML(); override; public function GetText: string; property VerifySignRec: TVerifySignRec read FVSR; end; implementation { TSignXML } function TSign.GetText(): string; begin Result := '错误代码:' + FSR.RtCode + #13#10 + '错误说明:' + FSR.RtStr + #13#10 + '返回数据:' + FSR.DataStr; end; procedure TSign.ParserXML; begin inherited; FillChar(FSR, Sizeof(TSignRec), 0); //错误代码 FSR.RtCode := GetSingleNodeValue('/html/head/result'); //错误提示 FSR.RtStr := GetSingleNodeValue('/html/head/title'); //数据 if FSR.RtCode = '0' then FSR.DataStr := GetSingleNodeValue('/html/body/sign') else FSR.DataStr := GetSingleNodeValue('/html/body'); end; { TVerifySignXML } function TVerifySign.GetText: string; begin Result := '错误代码:' + FVSR.RtCode + #13#10 + '错误说明:' + FVSR.RtStr + #13#10 + '返回数据:' + FVSR.DataStr; end; procedure TVerifySign.ParserXML; begin inherited; FillChar(FVSR, Sizeof(TVerifySignRec), 0); //错误代码 FVSR.RtCode := GetSingleNodeValue('/html/head/result'); //错误提示 FVSR.RtStr := GetSingleNodeValue('/html/head/title'); //数据 if FVSR.RtCode = '0' then FVSR.DataStr := GetSingleNodeValue('/html/body/sic') else FVSR.DataStr := GetSingleNodeValue('/html/body'); //还有很多结果数据,见NC安装目录手册说明 end; { TNCSvr } procedure TNCSvr.SetHttpParams(const http: TIdHttp); begin http.Request.Clear; http.Request.Clear; //基本 http.Request.AcceptLanguage := 'zh-cn'; http.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)'; http.Request.Pragma := 'no-cache'; http.Request.CacheControl := 'no-cache'; //超时 http.ReadTimeout := 30000; http.ConnectTimeout:=30000; //使用 1.1 协议 http.HTTPOptions := http.HTTPOptions + [hoKeepOrigProtocol]; //关键这行 http.ProtocolVersion := pv1_1; //支持重定向,不是必要,加上无妨 http.HandleRedirects := True; end; function TNCSvr.Sign(const DataStr: string; var rtDataStr: string): Boolean; var DataSm: TStringStream; http: TIdHTTP; begin Result := False; http := TIdHTTP.Create(self); DataSm := TStringStream.Create(DataStr); try DataSm.Position := 0; //统一设置参数 SetHttpParams(http); //“Content-Type:”后面是需要签名的标记,为INFOSEC_SIGN/1.0。(注意大小写) http.Request.ContentType := 'INFOSEC_SIGN/1.0'; //“Content-Length:”后面是需要签名的二进制数据包的长度 http.Request.ContentLength := DataSm.Size; rtDataStr := http.Post(FSIGN_URL, DataSm); if http.Response.ContentType = 'INFOSEC_SIGN_RESULT/1.0' then begin rtDataStr := '<?xml version="1.0" encoding = "GBK"?>' + #13#10 + rtDataStr; Result := True; end; finally DataSm.Free; http.Free; end; end; function TNCSvr.verify_sign(const DataStr: string; var rtDataStr: string): Boolean; var DataSm: TStringStream; http: TIdHTTP; begin Result := False; http := TIdHTTP.Create(self); DataSm := TStringStream.Create(DataStr); try DataSm.Position := 0; //统一设置参数 SetHttpParams(http); //“Content-Type:”为INFOSEC_VERIFY_SIGN/1.0。(注意大小写) http.Request.ContentType := 'INFOSEC_VERIFY_SIGN/1.0'; //“Content-Length:”后面是需要签名的二进制数据包的长度 http.Request.ContentLength := DataSm.Size; rtDataStr := http.Post(FSIGN_URL, DataSm); if http.Response.ContentType = 'INFOSEC_VERIFY_SIGN_RESULT/1.0' then begin rtDataStr := '<?xml version="1.0" encoding = "GBK"?>' + #13#10 + rtDataStr; Result := True; end; finally DataSm.Free; http.Free; end; end; function TNCSvr.Request(const pub: TPubRec; const reqData: string; var rtDataStr: string): Boolean; var Params: TStrings; HTTPS_URL_Send, RtHtmlSrc: string; Pe: Integer; Pd: Integer; DataLen: Integer; http: TIdHTTP; begin Result := False; http := TIdHTTP.Create(self); Params := TStringList.Create; try //在局域网内通过http协议以POST方式将交易包发送到NC的安全http协议服务器。 //action中的证书ID、PackageID与请求数据格式中的证书ID、PackageID、 //xml包中的证书ID、PackageID的值三者相一致。 HTTPS_URL_Send := Format( '%s/servlet/ICBCCMPAPIReqServlet?userID=%s&PackageID=%s&SendTime=%s', [FHTTPS_URL, pub.ID, pub.fSeqno, FormatDateTime('YYYYMMDDhhnnsszzz', Now)]); //////////////////////请求数据格式////////////////////////////////////////// //版本号(区分版本时间,暂定0.0.0.1) Params.Add('Version=0.0.0.1'); //交易代码(区分交易类型,每个交易固定) //TransCode交易名称应与xml包内标签<TransCode></TransCode>中的值一致 Params.Add(Format('TransCode=%s', [pub.TransCode])); //客户的归属单位 Params.Add(Format('BankCode=%s', [pub.BankCode])); //客户的归属编码 Params.Add(Format('GroupCIS=%s', [pub.CIS])); //客户的证书ID(无证书客户可空) Params.Add(Format('ID=%s', [pub.ID])); //客户的指令包序列号(由客户ERP系统产生,不可重复) Params.Add(Format('PackageID=%s', [pub.fSeqno])); //客户的证书公钥信息(进行BASE64编码;NC客户送空) Params.Add(Format('Cert=%s', [''])); //客户的xml请求数据 Params.Add(Format('reqData=%s', [reqData])); //统一设置参数 SetHttpParams(http); RtHtmlSrc := http.Post(HTTPS_URL_Send, Params); //格式化 Java 返回Base64编码 RtHtmlSrc := StringReplace(RtHtmlSrc, #$A, '', [rfReplaceAll, rfIgnoreCase]); DataLen := Length(RtHtmlSrc); Pe := Pos('errorCode=', RtHtmlSrc); if Pe > 0 then begin rtDataStr := Copy(RtHtmlSrc, Pe + 10, DataLen); end else begin Pd := Pos('reqData=', RtHtmlSrc); if Pd > 0 then begin rtDataStr := Copy(RtHtmlSrc, Pd + 8, DataLen); Result := True; end else begin raise Exception.Create('无法解析返回数据!'); end; end; finally Params.Free; http.Free; end; end; end.
unit Main; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, {$IFDEF ANDROID} AndroidApi.Helpers, FMX.Platform.Android, Androidapi.JNI.Widget, FMX.Helpers.Android, {$ENDIF} FMX.Controls.Presentation, FMX.Colors, FMX.Gestures, FMX.Objects, FMX.Layouts; type TForm1 = class(TForm) ToolBar1: TToolBar; Label1: TLabel; ColorPicker1: TColorPicker; Label2: TLabel; GestureManager1: TGestureManager; Rectangle1: TRectangle; RadioButton1: TRadioButton; Label3: TLabel; RadioButton2: TRadioButton; RadioButton3: TRadioButton; Button2: TButton; PaintBox1: TPaintBox; ToolBar2: TToolBar; Label4: TLabel; Label5: TLabel; Switch1: TSwitch; Layout1: TLayout; procedure FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); procedure FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); procedure FormCreate(Sender: TObject); procedure FormGesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean); procedure Button2Click(Sender: TObject); procedure PaintBox1Paint(Sender: TObject; Canvas: TCanvas); procedure Switch1Switch(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; thickness:integer; ltsel:integer; size:integer; implementation {$R *.fmx} // Подтверждение выхода из приложения procedure ExitConfirm; begin // Вывод диалогового окна MessageDlg('Хотите выйти!', System.UITypes.TMsgDlgType.mtInformation, [ System.UITypes.TMsgDlgBtn.mbYes, System.UITypes.TMsgDlgBtn.mbNo ], 0, procedure(const AResult: TModalResult) begin case AResult of mrYES: begin {$IFDEF ANDROID} MainActivity.finish; // Выход из приложения {$ENDIF} {$IFDEF MSWINDOWS} Application.Terminate; // Выход из приложения {$ENDIF} end; mrNo: begin end; end; end ) end; // Изменение толщины линии procedure ThicknessInc(var l:Tlabel); begin thickness:=thickness+1; if thickness>10 then thickness:=10; l.Text:='Толщина линии: '+inttostr(thickness); end; procedure ThicknessDec(var l:Tlabel); begin thickness:=thickness-1; if thickness<1 then thickness:=1; l.Text:='Толщина линии: '+inttostr(thickness) end; // Выбор типа линии procedure TForm1.Button2Click(Sender: TObject); begin if radiobutton1.IsChecked then ltsel:=1; if radiobutton2.IsChecked then ltsel:=2; if radiobutton3.IsChecked then ltsel:=3; Layout1.Visible:=false; end; procedure TForm1.FormCreate(Sender: TObject); begin thickness:=1; size:=40; ltsel:=1; Label2.Text:='Толщина линии: '+inttostr(thickness); end; procedure TForm1.FormGesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean); begin // Определяем доступный жест и обрабатываем его case EventInfo.GestureID of // Движение влево (увеличиваем толщину линии выводимой графики) sgiLeft: begin ThicknessInc(Label2); PaintBox1.Repaint; end; // Движение вправо (уменьшаем толщину линии выводимой графики) sgiRight: begin ThicknessDec(Label2); PaintBox1.Repaint; end; // При прорисовке круга // Показываем интерфейс настройки типа линии и ее цвета sgiCircle: begin // показываем настройки Layout1.Visible:=true; // перерисовываем PaintBox (он служит для вывода графики) PaintBox1.Repaint; end; end; end; // Нажатие клавиши procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); begin {$IFDEF ANDROID} //*************************************************// if Key = vkVolumeUp then begin Key:=0; size:=size-5; if size<5 then size:=5; PaintBox1.Repaint; end; //**************************************************// //*************************************************// if Key = vkVolumeDown then begin Key:=0; size:=size+5; if size>150 then size:=150; PaintBox1.Repaint; end; //**************************************************// //*************************************************// if Key = vkHardwareBack then begin Key:=0; ExitConfirm; end; //**************************************************// {$ENDIF} {$IFDEF MSWINDOWS} //*************************************************// if Key = vkUp then begin Key:=0; size:=size-5; if size<5 then size:=5; PaintBox1.Repaint; end; //**************************************************// //*************************************************// if Key = vkDown then begin Key:=0; size:=size+5; if size>150 then size:=150; PaintBox1.Repaint; end; //**************************************************// //*************************************************// if Key = vkEscape then begin Key:=0; ExitConfirm; end; //**************************************************// //*************************************************// if Key = vkRight then begin ThicknessDec(Label2); PaintBox1.Repaint; end; //**************************************************// //*************************************************// if Key = vkLeft then begin ThicknessInc(Label2); PaintBox1.Repaint; end; //**************************************************// //*************************************************// if Key = vkInsert then begin // показываем настройки Layout1.Visible:=true; // перерисовываем PaintBox (он служит для вывода графики) PaintBox1.Repaint; end; //**************************************************// {$ENDIF} end; // Отпускание клавиши procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); begin {$IFDEF ANDROID} //*************************************************// if Key = vkVolumeUp then begin Key:=0; end; //**************************************************// //*************************************************// if Key = vkVolumeDown then begin Key:=0; end; //**************************************************// //*************************************************// if Key = vkHardwareBack then begin Key:=0; end; //**************************************************// {$ENDIF} {$IFDEF MSWINDOWS} //*************************************************// if Key = vkUp then begin Key:=0; end; //**************************************************// //*************************************************// if Key = vkDown then begin Key:=0; end; //**************************************************// //*************************************************// if Key = vkEscape then begin Key:=0; end; //**************************************************// //*************************************************// if Key = vkRight then begin Key:=0; end; //**************************************************// //*************************************************// if Key = vkLeft then begin Key:=0; end; //**************************************************// //*************************************************// if Key = vkInsert then begin Key:=0; end; //**************************************************// {$ENDIF} end; procedure TForm1.PaintBox1Paint(Sender: TObject; Canvas: TCanvas); var p1,p2:tpoint; // точки р1 и р2 x0,y0:integer; // координаты центра begin // Цвет формы PaintBox1.Canvas.Stroke.Color:=ColorPicker1.Color; // Выбор типа линии case ltsel of 1: PaintBox1.Canvas.Stroke.Dash:=TStrokeDash.Solid; // Сполшная 2: PaintBox1.Canvas.Stroke.Dash:=TStrokeDash.Dot; // Точечная 3: PaintBox1.Canvas.Stroke.Dash:=TStrokeDash.Dash; // Штриховая end; PaintBox1.Canvas.Stroke.Thickness:=thickness; // Толщина линии // Рисовать графику следует между блоками BeginScene и EndScene PaintBox1.Canvas.BeginScene; // Координаты центра формы (div деление нацело) x0:=Round(PaintBox1.Width/2); y0:=Round(PaintBox1.Height/2); // Первая линия p1.X:=x0+size; p1.Y:=y0+size; p2.X:=x0+size; p2.Y:=y0-size; PaintBox1.Canvas.DrawLine(p1,p2,1.0); // Вторая линия p1.X:=x0+size; p1.Y:=y0+size; p2.X:=x0-size; p2.Y:=y0+size; PaintBox1.Canvas.DrawLine(p1,p2,1.0); // Третья линия p1.X:=x0-size; p1.Y:=y0+size; p2.X:=x0-size; p2.Y:=y0-size; PaintBox1.Canvas.DrawLine(p1,p2,1.0); // Четвертая линия p1.X:=x0-size; p1.Y:=y0-size; p2.X:=x0+size; p2.Y:=y0-size; PaintBox1.Canvas.DrawLine(p1,p2,1.0); // Перекрестная 1 p1.X:=x0-size; p1.Y:=y0-size; p2.X:=x0+size; p2.Y:=y0+size; PaintBox1.Canvas.DrawLine(p1,p2,1.0); // Перекрестная 2 p1.X:=x0-size; p1.Y:=y0+size; p2.X:=x0+size; p2.Y:=y0-size; PaintBox1.Canvas.DrawLine(p1,p2,1.0); PaintBox1.Canvas.EndScene; end; // Подтверждение віхода из приложения при переключении Switch procedure TForm1.Switch1Switch(Sender: TObject); begin if Switch1.IsChecked then begin ExitConfirm; switch1.IsChecked:=false; end; end; end.
unit uEmprestimoDao; interface uses FireDAC.Comp.Client, uConexao, uEmprestimoModel, System.SysUtils; type TEmprestimoDao = class private FConexao: TConexao; VQry: TFDQuery; public constructor Create; function Incluir(EmprestimoModel: TEmprestimoModel): Boolean; function Excluir(EmprestimoModel: TEmprestimoModel): Boolean; function Renovar(EmprestimoModel: TEmprestimoModel): Boolean; function ObterSelecionadas(IdUsuario: string): TFDQuery; function Obter: TFDQuery; end; implementation { TEmprestimoDao } uses uSistemaControl, uUnidadeModel, uUsuarioModel, Vcl.Dialogs, FireDAC.Phys.MSSQL; constructor TEmprestimoDao.Create; begin FConexao := TSistemaControl.GetInstance().Conexao; end; function TEmprestimoDao.Excluir(EmprestimoModel: TEmprestimoModel): Boolean; begin VQry := FConexao.CriarQuery(); try try VQry.ExecSQL(' DELETE FROM Emprestimo WHERE (Codigo = :codigo) ', [EmprestimoModel.Codigo]); VQry.ExecSQL(' UPDATE Livro SET Disponivel = 1 WHERE (Codigo = :codigo) ', [EmprestimoModel.IdLivro]); Result := True; except on E : EMSSQLNativeException do MessageDlg('Há uma multa para este empréstimo. Favor realizar o pagamento.', mtWarning, [mbOK], 0); end; finally VQry.Free; end; end; function TEmprestimoDao.Renovar(EmprestimoModel: TEmprestimoModel): Boolean; begin VQry := FConexao.CriarQuery(); try try VQry.ExecSQL(' UPDATE Emprestimo SET Vencimento = :vencimento, Renovacoes = :renovacoes WHERE (Codigo = :codigo) ', [EmprestimoModel.Vencimento, EmprestimoModel.Renovacoes, EmprestimoModel.Codigo]); Result := True; except on E : EMSSQLNativeException do MessageDlg('Ocorreu erro ao renovar o empréstimo.', mtWarning, [mbOK], 0); end; finally VQry.Free; end; end; function TEmprestimoDao.Incluir(EmprestimoModel: TEmprestimoModel): Boolean; begin VQry := FConexao.CriarQuery(); try try VQry.ExecSQL(' INSERT INTO Emprestimo VALUES (:inicio, :vencimento, :renovacoes, :idUsuario, :idLivro ) ', [EmprestimoModel.Inicio, EmprestimoModel.Vencimento, EmprestimoModel.Renovacoes, EmprestimoModel.IdUsuario, EmprestimoModel.IdLivro]); Result := True; except on E : EMSSQLNativeException do MessageDlg('Ocorreu um erro ao realizar o empréstimo.', mtWarning, [mbOK], 0); end; finally VQry.Free; end; end; function TEmprestimoDao.Obter: TFDQuery; begin VQry := FConexao.CriarQuery(); VQry.Open(' SELECT e.Codigo AS Codigo, e.Vencimento AS Vencimento, e.Id_Livro AS Id_Livro, e.Id_Usuario AS Id_Usuario, l.Titulo AS Titulo FROM Emprestimo e INNER JOIN Livro l ON (e.Id_Livro = l.Codigo) '); Result := VQry; end; function TEmprestimoDao.ObterSelecionadas(IdUsuario: string): TFDQuery; begin VQry := FConexao.CriarQuery(); VQry.Open(' SELECT e.Codigo AS Codigo, e.Inicio AS Inicio, e.Vencimento AS Vencimento, e.Renovacoes AS Renovacoes, e.Id_Livro AS Id_Livro, l.Titulo AS Titulo FROM Emprestimo e, Livro l WHERE (e.Id_Usuario = :idUsuario) AND (e.Id_Livro = l.Codigo) ', [IdUsuario]); Result := VQry; end; end.
{ *********************************************************************** } { } { Delphi Runtime Library } { } { Copyright (c) 1995-2001 Borland Software Corporation } { } { *********************************************************************** } {*******************************************************} { Date/time Utilities Unit } {*******************************************************} { The following unit is ISO 8601 compliant. What that means is this unit considers Monday the first day of the week (5.2.3). Additionally ISO 8601 dictates the following "the first calendar week of the year is the one that includes the first Thursday of that year" (3.17). In other words the first week of the week is the first one that has four or more days. For more information about ISO 8601 see: http://www.iso.ch/markete/8601.pdf The functions most impacted by ISO 8601 are marked as such in the interface section. The functions marked with "ISO 8601x" are not directly covered by ISO 8601 but their functionality is a logical extension to the standard. Some of the functions, concepts or constants in this unit were provided by Jeroen W. Pluimers (http://www.all-im.com), Glenn Crouch, Rune Moberg and Ray Lischner (http://www.tempest-sw.com). The Julian Date and Modified Julian Date functions are based on code from NASA's SOHO site (http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/time) in which they credit the underlying algorithms as by Fliegel and Van Flandern (1968) which was reprinted in the Explanatory Supplement to the Astronomical Almanac, 1992. Julian Date and Modified Julian Date is discussed in some detail on the US Naval Observatory Time Service site (http://tycho.usno.navy.mil/mjd.html). Additional information can be found at (http://www.treasure-troves.com/astro). } unit DateUtils; interface uses SysUtils, Math, Types; { Simple trimming functions } function DateOf(const AValue: TDateTime): TDateTime; function TimeOf(const AValue: TDateTime): TDateTime; { Misc functions } function IsInLeapYear(const AValue: TDateTime): Boolean; function IsPM(const AValue: TDateTime): Boolean; function IsValidDate(const AYear, AMonth, ADay: Word): Boolean; function IsValidTime(const AHour, AMinute, ASecond, AMilliSecond: Word): Boolean; function IsValidDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): Boolean; function IsValidDateDay(const AYear, ADayOfYear: Word): Boolean; function IsValidDateWeek(const AYear, AWeekOfYear, {ISO 8601} ADayOfWeek: Word): Boolean; function IsValidDateMonthWeek(const AYear, AMonth, AWeekOfMonth, {ISO 8601x} ADayOfWeek: Word): Boolean; function WeeksInYear(const AValue: TDateTime): Word; {ISO 8601} function WeeksInAYear(const AYear: Word): Word; {ISO 8601} function DaysInYear(const AValue: TDateTime): Word; function DaysInAYear(const AYear: Word): Word; function DaysInMonth(const AValue: TDateTime): Word; function DaysInAMonth(const AYear, AMonth: Word): Word; function Today: TDateTime; function Yesterday: TDateTime; function Tomorrow: TDateTime; function IsToday(const AValue: TDateTime): Boolean; function IsSameDay(const AValue, ABasis: TDateTime): Boolean; { Pick-a-field functions } function YearOf(const AValue: TDateTime): Word; function MonthOf(const AValue: TDateTime): Word; function WeekOf(const AValue: TDateTime): Word; {ISO 8601} function DayOf(const AValue: TDateTime): Word; function HourOf(const AValue: TDateTime): Word; function MinuteOf(const AValue: TDateTime): Word; function SecondOf(const AValue: TDateTime): Word; function MilliSecondOf(const AValue: TDateTime): Word; { Start/End functions } function StartOfTheYear(const AValue: TDateTime): TDateTime; function EndOfTheYear(const AValue: TDateTime): TDateTime; function StartOfAYear(const AYear: Word): TDateTime; function EndOfAYear(const AYear: Word): TDateTime; function StartOfTheMonth(const AValue: TDateTime): TDateTime; function EndOfTheMonth(const AValue: TDateTime): TDateTime; function StartOfAMonth(const AYear, AMonth: Word): TDateTime; function EndOfAMonth(const AYear, AMonth: Word): TDateTime; function StartOfTheWeek(const AValue: TDateTime): TDateTime; {ISO 8601} function EndOfTheWeek(const AValue: TDateTime): TDateTime; {ISO 8601} function StartOfAWeek(const AYear, AWeekOfYear: Word; {ISO 8601} const ADayOfWeek: Word = 1): TDateTime; function EndOfAWeek(const AYear, AWeekOfYear: Word; {ISO 8601} const ADayOfWeek: Word = 7): TDateTime; function StartOfTheDay(const AValue: TDateTime): TDateTime; function EndOfTheDay(const AValue: TDateTime): TDateTime; function StartOfADay(const AYear, AMonth, ADay: Word): TDateTime; overload; function EndOfADay(const AYear, AMonth, ADay: Word): TDateTime; overload; function StartOfADay(const AYear, ADayOfYear: Word): TDateTime; overload; function EndOfADay(const AYear, ADayOfYear: Word): TDateTime; overload; { This of that functions } function MonthOfTheYear(const AValue: TDateTime): Word; function WeekOfTheYear(const AValue: TDateTime): Word; overload; {ISO 8601} function WeekOfTheYear(const AValue: TDateTime; {ISO 8601} var AYear: Word): Word; overload; function DayOfTheYear(const AValue: TDateTime): Word; function HourOfTheYear(const AValue: TDateTime): Word; function MinuteOfTheYear(const AValue: TDateTime): LongWord; function SecondOfTheYear(const AValue: TDateTime): LongWord; function MilliSecondOfTheYear(const AValue: TDateTime): Int64; function WeekOfTheMonth(const AValue: TDateTime): Word; overload; {ISO 8601x} function WeekOfTheMonth(const AValue: TDateTime; var AYear, {ISO 8601x} AMonth: Word): Word; overload; function DayOfTheMonth(const AValue: TDateTime): Word; function HourOfTheMonth(const AValue: TDateTime): Word; function MinuteOfTheMonth(const AValue: TDateTime): Word; function SecondOfTheMonth(const AValue: TDateTime): LongWord; function MilliSecondOfTheMonth(const AValue: TDateTime): LongWord; function DayOfTheWeek(const AValue: TDateTime): Word; {ISO 8601} function HourOfTheWeek(const AValue: TDateTime): Word; {ISO 8601} function MinuteOfTheWeek(const AValue: TDateTime): Word; {ISO 8601} function SecondOfTheWeek(const AValue: TDateTime): LongWord; {ISO 8601} function MilliSecondOfTheWeek(const AValue: TDateTime): LongWord; {ISO 8601} function HourOfTheDay(const AValue: TDateTime): Word; function MinuteOfTheDay(const AValue: TDateTime): Word; function SecondOfTheDay(const AValue: TDateTime): LongWord; function MilliSecondOfTheDay(const AValue: TDateTime): LongWord; function MinuteOfTheHour(const AValue: TDateTime): Word; function SecondOfTheHour(const AValue: TDateTime): Word; function MilliSecondOfTheHour(const AValue: TDateTime): LongWord; function SecondOfTheMinute(const AValue: TDateTime): Word; function MilliSecondOfTheMinute(const AValue: TDateTime): LongWord; function MilliSecondOfTheSecond(const AValue: TDateTime): Word; { Range checking functions } function WithinPastYears(const ANow, AThen: TDateTime; const AYears: Integer): Boolean; function WithinPastMonths(const ANow, AThen: TDateTime; const AMonths: Integer): Boolean; function WithinPastWeeks(const ANow, AThen: TDateTime; const AWeeks: Integer): Boolean; function WithinPastDays(const ANow, AThen: TDateTime; const ADays: Integer): Boolean; function WithinPastHours(const ANow, AThen: TDateTime; const AHours: Int64): Boolean; function WithinPastMinutes(const ANow, AThen: TDateTime; const AMinutes: Int64): Boolean; function WithinPastSeconds(const ANow, AThen: TDateTime; const ASeconds: Int64): Boolean; function WithinPastMilliSeconds(const ANow, AThen: TDateTime; const AMilliSeconds: Int64): Boolean; { Range query functions } function YearsBetween(const ANow, AThen: TDateTime): Integer; function MonthsBetween(const ANow, AThen: TDateTime): Integer; function WeeksBetween(const ANow, AThen: TDateTime): Integer; function DaysBetween(const ANow, AThen: TDateTime): Integer; function HoursBetween(const ANow, AThen: TDateTime): Int64; function MinutesBetween(const ANow, AThen: TDateTime): Int64; function SecondsBetween(const ANow, AThen: TDateTime): Int64; function MilliSecondsBetween(const ANow, AThen: TDateTime): Int64; { Range spanning functions } { YearSpan and MonthSpan are approximates, not exact but pretty darn close } function YearSpan(const ANow, AThen: TDateTime): Double; function MonthSpan(const ANow, AThen: TDateTime): Double; function WeekSpan(const ANow, AThen: TDateTime): Double; function DaySpan(const ANow, AThen: TDateTime): Double; function HourSpan(const ANow, AThen: TDateTime): Double; function MinuteSpan(const ANow, AThen: TDateTime): Double; function SecondSpan(const ANow, AThen: TDateTime): Double; function MilliSecondSpan(const ANow, AThen: TDateTime): Double; { Increment/decrement datetime fields } function IncYear(const AValue: TDateTime; const ANumberOfYears: Integer = 1): TDateTime; // function IncMonth is in SysUtils function IncWeek(const AValue: TDateTime; const ANumberOfWeeks: Integer = 1): TDateTime; function IncDay(const AValue: TDateTime; const ANumberOfDays: Integer = 1): TDateTime; function IncHour(const AValue: TDateTime; const ANumberOfHours: Int64 = 1): TDateTime; function IncMinute(const AValue: TDateTime; const ANumberOfMinutes: Int64 = 1): TDateTime; function IncSecond(const AValue: TDateTime; const ANumberOfSeconds: Int64 = 1): TDateTime; function IncMilliSecond(const AValue: TDateTime; const ANumberOfMilliSeconds: Int64 = 1): TDateTime; { Unified encode/decode functions that deal with all datetime fields at once } function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime; procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word); { Encode/decode functions that work with week of year and day of week } function EncodeDateWeek(const AYear, AWeekOfYear: Word; {ISO 8601} const ADayOfWeek: Word = 1): TDateTime; procedure DecodeDateWeek(const AValue: TDateTime; out AYear, {ISO 8601} AWeekOfYear, ADayOfWeek: Word); { Encode/decode functions that work with day of year } function EncodeDateDay(const AYear, ADayOfYear: Word): TDateTime; procedure DecodeDateDay(const AValue: TDateTime; out AYear, ADayOfYear: Word); { Encode/decode functions that work with week of month } function EncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth, {ISO 8601x} ADayOfWeek: Word): TDateTime; procedure DecodeDateMonthWeek(const AValue: TDateTime; {ISO 8601x} out AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word); { The following functions are similar to the above ones except these don't generated exceptions on failure, they return false instead } function TryEncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; out AValue: TDateTime): Boolean; function TryEncodeDateWeek(const AYear, AWeekOfYear: Word; {ISO 8601} out AValue: TDateTime; const ADayOfWeek: Word = 1): Boolean; function TryEncodeDateDay(const AYear, ADayOfYear: Word; out AValue: TDateTime): Boolean; function TryEncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth, {ISO 8601x} ADayOfWeek: Word; var AValue: TDateTime): Boolean; { Recode functions for datetime fields } function RecodeYear(const AValue: TDateTime; const AYear: Word): TDateTime; function RecodeMonth(const AValue: TDateTime; const AMonth: Word): TDateTime; function RecodeDay(const AValue: TDateTime; const ADay: Word): TDateTime; function RecodeHour(const AValue: TDateTime; const AHour: Word): TDateTime; function RecodeMinute(const AValue: TDateTime; const AMinute: Word): TDateTime; function RecodeSecond(const AValue: TDateTime; const ASecond: Word): TDateTime; function RecodeMilliSecond(const AValue: TDateTime; const AMilliSecond: Word): TDateTime; function RecodeDate(const AValue: TDateTime; const AYear, AMonth, ADay: Word): TDateTime; function RecodeTime(const AValue: TDateTime; const AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime; function RecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime; { The following function is similar to the above one except it doesn't generated an exception on failure, it return false instead } function TryRecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; out AResult: TDateTime): Boolean; { Fuzzy comparison } function CompareDateTime(const A, B: TDateTime): TValueRelationship; function SameDateTime(const A, B: TDateTime): Boolean; function CompareDate(const A, B: TDateTime): TValueRelationship; function SameDate(const A, B: TDateTime): Boolean; function CompareTime(const A, B: TDateTime): TValueRelationship; function SameTime(const A, B: TDateTime): Boolean; { For a given date these functions tell you the which day of the week of the month (or year). If its a Thursday, they will tell you if its the first, second, etc Thursday of the month (or year). Remember, even though its the first Thursday of the year it doesn't mean its the first week of the year. See ISO 8601 above for more information. } function NthDayOfWeek(const AValue: TDateTime): Word; procedure DecodeDayOfWeekInMonth(const AValue: TDateTime; out AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word); function EncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word): TDateTime; function TryEncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word; out AValue: TDateTime): Boolean; { Error reporting } procedure InvalidDateTimeError(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; const ABaseDate: TDateTime = 0); procedure InvalidDateWeekError(const AYear, AWeekOfYear, ADayOfWeek: Word); procedure InvalidDateDayError(const AYear, ADayOfYear: Word); procedure InvalidDateMonthWeekError(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word); procedure InvalidDayOfWeekInMonthError(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word); { Julian and Modified Julian Date conversion support } { Be aware that not all Julian Dates (or MJD) are encodable as a TDateTime } function DateTimeToJulianDate(const AValue: TDateTime): Double; function JulianDateToDateTime(const AValue: Double): TDateTime; function TryJulianDateToDateTime(const AValue: Double; out ADateTime: TDateTime): Boolean; function DateTimeToModifiedJulianDate(const AValue: TDateTime): Double; function ModifiedJulianDateToDateTime(const AValue: Double): TDateTime; function TryModifiedJulianDateToDateTime(const AValue: Double; out ADateTime: TDateTime): Boolean; { Unix date conversion support } function DateTimeToUnix(const AValue: TDateTime): Int64; function UnixToDateTime(const AValue: Int64): TDateTime; { Constants used in this unit } const DaysPerWeek = 7; WeeksPerFortnight = 2; MonthsPerYear = 12; YearsPerDecade = 10; YearsPerCentury = 100; YearsPerMillennium = 1000; DayMonday = 1; DayTuesday = 2; DayWednesday = 3; DayThursday = 4; DayFriday = 5; DaySaturday = 6; DaySunday = 7; OneHour = 1 / HoursPerDay; OneMinute = 1 / MinsPerDay; OneSecond = 1 / SecsPerDay; OneMillisecond = 1 / MSecsPerDay; { This is actual days per year but you need to know if it's a leap year} DaysPerYear: array [Boolean] of Word = (365, 366); { Used in RecodeDate, RecodeTime and RecodeDateTime for those datetime } { fields you want to leave alone } RecodeLeaveFieldAsIs = High(Word); { Global variable used in this unit } var { average over a 4 year span } ApproxDaysPerMonth: Double = 30.4375; ApproxDaysPerYear: Double = 365.25; { The above are the average days per month/year over a normal 4 year period. } { We use these approximations because they are more accurate for the next } { century or so. After that you may want to switch over to these 400 year } { approximations... } { ApproxDaysPerMonth = 30.436875 } { ApproxDaysPerYear = 365.2425 } implementation uses RTLConsts; function DateOf(const AValue: TDateTime): TDateTime; begin Result := Trunc(AValue); end; function TimeOf(const AValue: TDateTime): TDateTime; begin Result := Frac(AValue); end; function IsInLeapYear(const AValue: TDateTime): Boolean; begin Result := IsLeapYear(YearOf(AValue)); end; function IsPM(const AValue: TDateTime): Boolean; begin Result := HourOf(AValue) >= 12; end; function IsValidDate(const AYear, AMonth, ADay: Word): Boolean; begin Result := (AYear >= 1) and (AYear <= 9999) and (AMonth >= 1) and (AMonth <= 12) and (ADay >= 1) and (ADay <= DaysInAMonth(AYear, AMonth)); end; function IsValidTime(const AHour, AMinute, ASecond, AMilliSecond: Word): Boolean; begin Result := ((AHour < HoursPerDay) and (AMinute < MinsPerHour) and (ASecond < SecsPerMin) and (AMilliSecond < MSecsPerSec)) or ((AHour = 24) and (AMinute = 0) and // midnight early next day (ASecond = 0) and (AMilliSecond = 0)); end; function IsValidDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): Boolean; begin Result := IsValidDate(AYear, AMonth, ADay) and IsValidTime(AHour, AMinute, ASecond, AMilliSecond); end; function IsValidDateMonthWeek(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word): Boolean; begin Result := (AYear >= 1) and (AYear <= 9999) and (AMonth >= 1) and (AMonth <= 12) and (AWeekOfMonth >= 1) and (AWeekOfMonth <= 5) and (ADayOfWeek >= DayMonday) and (ADayOfWeek <= DaySunday); end; function IsValidDateDay(const AYear, ADayOfYear: Word): Boolean; begin Result := (AYear >= 1) and (AYear <= 9999) and (ADayOfYear >= 1) and (ADayOfYear <= DaysInAYear(AYear)); end; function IsValidDateWeek(const AYear, AWeekOfYear, ADayOfWeek: Word): Boolean; begin Result := (AYear >= 1) and (AYear <= 9999) and (AWeekOfYear >= 1) and (AWeekOfYear <= WeeksInAYear(AYear)) and (ADayOfWeek >= DayMonday) and (ADayOfWeek <= DaySunday); end; function DaysInYear(const AValue: TDateTime): Word; begin Result := DaysInAYear(YearOf(AValue)); end; function DaysInAYear(const AYear: Word): Word; begin Result := DaysPerYear[IsLeapYear(AYear)]; end; function DaysInMonth(const AValue: TDateTime): Word; var LYear, LMonth, LDay: Word; begin DecodeDate(AValue, LYear, LMonth, LDay); Result := DaysInAMonth(LYear, LMonth); end; function DaysInAMonth(const AYear, AMonth: Word): Word; begin Result := MonthDays[(AMonth = 2) and IsLeapYear(AYear), AMonth]; end; function WeeksInYear(const AValue: TDateTime): Word; begin Result := WeeksInAYear(YearOf(AValue)); end; function WeeksInAYear(const AYear: Word): Word; var LDayOfWeek: Word; begin Result := 52; LDayOfWeek := DayOfTheWeek(EncodeDate(AYear, 1, 1)); if (LDayOfWeek = DayThursday) or ((LDayOfWeek = DayWednesday) and IsLeapYear(AYear)) then Inc(Result); end; function Today: TDateTime; begin Result := Date; end; function Yesterday: TDateTime; begin Result := Date - 1; end; function Tomorrow: TDateTime; begin Result := Date + 1; end; function IsToday(const AValue: TDateTime): Boolean; begin Result := IsSameDay(AValue, Date); end; function IsSameDay(const AValue, ABasis: TDateTime): Boolean; begin Result := (AValue >= Trunc(ABasis)) and (AValue < Trunc(ABasis) + 1); end; function YearOf(const AValue: TDateTime): Word; var LMonth, LDay: Word; begin DecodeDate(AValue, Result, LMonth, LDay); end; function MonthOf(const AValue: TDateTime): Word; var LYear, LDay: Word; begin DecodeDate(AValue, LYear, Result, LDay); end; function WeekOf(const AValue: TDateTime): Word; begin Result := WeekOfTheYear(AValue); end; function DayOf(const AValue: TDateTime): Word; var LYear, LMonth: Word; begin DecodeDate(AValue, LYear, LMonth, Result); end; function HourOf(const AValue: TDateTime): Word; var LMinute, LSecond, LMilliSecond: Word; begin DecodeTime(AValue, Result, LMinute, LSecond, LMilliSecond); end; function MinuteOf(const AValue: TDateTime): Word; var LHour, LSecond, LMilliSecond: Word; begin DecodeTime(AValue, LHour, Result, LSecond, LMilliSecond); end; function SecondOf(const AValue: TDateTime): Word; var LHour, LMinute, LMilliSecond: Word; begin DecodeTime(AValue, LHour, LMinute, Result, LMilliSecond); end; function MilliSecondOf(const AValue: TDateTime): Word; var LHour, LMinute, LSecond: Word; begin DecodeTime(AValue, LHour, LMinute, LSecond, Result); end; function StartOfTheYear(const AValue: TDateTime): TDateTime; begin Result := EncodeDate(YearOf(AValue), 1, 1); end; function EndOfTheYear(const AValue: TDateTime): TDateTime; begin Result := EndOfTheDay(EncodeDate(YearOf(AValue), 12, 31)); end; function StartOfTheMonth(const AValue: TDateTime): TDateTime; var LYear, LMonth, LDay: Word; begin DecodeDate(AValue, LYear, LMonth, LDay); Result := EncodeDate(LYear, LMonth, 1); end; function EndOfTheMonth(const AValue: TDateTime): TDateTime; var LYear, LMonth, LDay: Word; begin DecodeDate(AValue, LYear, LMonth, LDay); Result := EndOfTheDay(EncodeDate(LYear, LMonth, DaysInAMonth(LYear, LMonth))); end; function StartOfTheWeek(const AValue: TDateTime): TDateTime; begin Result := Trunc(AValue) - (DayOfTheWeek(AValue) - 1); end; function EndOfTheWeek(const AValue: TDateTime): TDateTime; begin Result := EndOfTheDay(StartOfTheWeek(AValue) + 6); end; function StartOfTheDay(const AValue: TDateTime): TDateTime; begin Result := Trunc(AValue); end; function EndOfTheDay(const AValue: TDateTime): TDateTime; begin Result := RecodeTime(AValue, 23, 59, 59, 999); end; function StartOfAYear(const AYear: Word): TDateTime; begin Result := EncodeDate(AYear, 1, 1); end; function EndOfAYear(const AYear: Word): TDateTime; begin Result := EndOfTheDay(EncodeDate(AYear, 12, 31)); end; function StartOfAMonth(const AYear, AMonth: Word): TDateTime; begin Result := EncodeDate(AYear, AMonth, 1); end; function EndOfAMonth(const AYear, AMonth: Word): TDateTime; begin Result := EndOfTheDay(EncodeDate(AYear, AMonth, DaysInAMonth(AYear, AMonth))); end; function StartOfAWeek(const AYear, AWeekOfYear, ADayOfWeek: Word): TDateTime; begin Result := EncodeDateWeek(AYear, AWeekOfYear, ADayOfWeek); end; function EndOfAWeek(const AYear, AWeekOfYear, ADayOfWeek: Word): TDateTime; begin Result := EndOfTheDay(EncodeDateWeek(AYear, AWeekOfYear, ADayOfWeek)); end; function StartOfADay(const AYear, ADayOfYear: Word): TDateTime; begin Result := EncodeDateDay(AYear, ADayOfYear); end; function EndOfADay(const AYear, ADayOfYear: Word): TDateTime; begin Result := EndOfTheDay(EncodeDateDay(AYear, ADayOfYear)); end; function StartOfADay(const AYear, AMonth, ADay: Word): TDateTime; begin Result := StartOfAMonth(AYear, AMonth) + ADay - 1; end; function EndOfADay(const AYear, AMonth, ADay: Word): TDateTime; begin Result := EndOfAMonth(AYear, AMonth) + ADay - 1; end; function MonthOfTheYear(const AValue: TDateTime): Word; begin Result := MonthOf(AValue); end; function WeekOfTheYear(const AValue: TDateTime): Word; var LYear, LDOW: Word; begin DecodeDateWeek(AValue, LYear, Result, LDOW); end; function WeekOfTheYear(const AValue: TDateTime; var AYear: Word): Word; var LDOW: Word; begin DecodeDateWeek(AValue, AYear, Result, LDOW); end; function DayOfTheYear(const AValue: TDateTime): Word; begin Result := Trunc(AValue - StartOfTheYear(AValue)) + 1; end; function HourOfTheYear(const AValue: TDateTime): Word; begin Result := HourOf(AValue) + (DayOfTheYear(AValue) - 1) * HoursPerDay; end; function MinuteOfTheYear(const AValue: TDateTime): LongWord; begin Result := MinuteOf(AValue) + HourOfTheYear(AValue) * MinsPerHour; end; function SecondOfTheYear(const AValue: TDateTime): LongWord; begin Result := SecondOf(AValue) + MinuteOfTheYear(AValue) * SecsPerMin; end; function MilliSecondOfTheYear(const AValue: TDateTime): Int64; begin Result := MilliSecondOf(AValue) + SecondOfTheYear(AValue) * MSecsPerSec; end; function WeekOfTheMonth(const AValue: TDateTime): Word; var LYear, LMonth, LDayOfWeek: Word; begin DecodeDateMonthWeek(AValue, LYear, LMonth, Result, LDayOfWeek); end; function WeekOfTheMonth(const AValue: TDateTime; var AYear, AMonth: Word): Word; var LDayOfWeek: Word; begin DecodeDateMonthWeek(AValue, AYear, AMonth, Result, LDayOfWeek); end; function DayOfTheMonth(const AValue: TDateTime): Word; begin Result := DayOf(AValue); end; function HourOfTheMonth(const AValue: TDateTime): Word; begin Result := HourOf(AValue) + (DayOfTheMonth(AValue) - 1) * HoursPerDay; end; function MinuteOfTheMonth(const AValue: TDateTime): Word; begin Result := MinuteOf(AValue) + HourOfTheMonth(AValue) * MinsPerHour; end; function SecondOfTheMonth(const AValue: TDateTime): LongWord; begin Result := SecondOf(AValue) + MinuteOfTheMonth(AValue) * SecsPerMin; end; function MilliSecondOfTheMonth(const AValue: TDateTime): LongWord; begin Result := MilliSecondOf(AValue) + SecondOfTheMonth(AValue) * MSecsPerSec; end; function DayOfTheWeek(const AValue: TDateTime): Word; begin Result := (DateTimeToTimeStamp(AValue).Date - 1) mod 7 + 1; end; function HourOfTheWeek(const AValue: TDateTime): Word; begin Result := HourOf(AValue) + (DayOfTheWeek(AValue) - 1) * HoursPerDay; end; function MinuteOfTheWeek(const AValue: TDateTime): Word; begin Result := MinuteOf(AValue) + HourOfTheWeek(AValue) * MinsPerHour; end; function SecondOfTheWeek(const AValue: TDateTime): LongWord; begin Result := SecondOf(AValue) + MinuteOfTheWeek(AValue) * SecsPerMin; end; function MilliSecondOfTheWeek(const AValue: TDateTime): LongWord; begin Result := MilliSecondOf(AValue) + SecondOfTheWeek(AValue) * MSecsPerSec; end; function HourOfTheDay(const AValue: TDateTime): Word; begin Result := HourOf(AValue); end; function MinuteOfTheDay(const AValue: TDateTime): Word; var LHours, LMinutes, LSeconds, LMilliSeconds: Word; begin DecodeTime(AValue, LHours, LMinutes, LSeconds, LMilliSeconds); Result := LMinutes + LHours * MinsPerHour; end; function SecondOfTheDay(const AValue: TDateTime): LongWord; var LHours, LMinutes, LSeconds, LMilliSeconds: Word; begin DecodeTime(AValue, LHours, LMinutes, LSeconds, LMilliSeconds); Result := LSeconds + (LMinutes + LHours * MinsPerHour) * SecsPerMin; end; function MilliSecondOfTheDay(const AValue: TDateTime): LongWord; var LHours, LMinutes, LSeconds, LMilliSeconds: Word; begin DecodeTime(AValue, LHours, LMinutes, LSeconds, LMilliSeconds); Result := LMilliSeconds + (LSeconds + (LMinutes + LHours * MinsPerHour) * SecsPerMin) * MSecsPerSec; end; function MinuteOfTheHour(const AValue: TDateTime): Word; begin Result := MinuteOf(AValue); end; function SecondOfTheHour(const AValue: TDateTime): Word; var LHours, LMinutes, LSeconds, LMilliSeconds: Word; begin DecodeTime(AValue, LHours, LMinutes, LSeconds, LMilliSeconds); Result := LSeconds + (LMinutes * SecsPerMin); end; function MilliSecondOfTheHour(const AValue: TDateTime): LongWord; var LHours, LMinutes, LSeconds, LMilliSeconds: Word; begin DecodeTime(AValue, LHours, LMinutes, LSeconds, LMilliSeconds); Result := LMilliSeconds + (LSeconds + LMinutes * SecsPerMin) * MSecsPerSec; end; function SecondOfTheMinute(const AValue: TDateTime): Word; begin Result := SecondOf(AValue); end; function MilliSecondOfTheMinute(const AValue: TDateTime): LongWord; var LHours, LMinutes, LSeconds, LMilliSeconds: Word; begin DecodeTime(AValue, LHours, LMinutes, LSeconds, LMilliSeconds); Result := LMilliSeconds + LSeconds * MSecsPerSec; end; function MilliSecondOfTheSecond(const AValue: TDateTime): Word; begin Result := MilliSecondOf(AValue); end; function WithinPastYears(const ANow, AThen: TDateTime; const AYears: Integer): Boolean; begin Result := YearsBetween(ANow, AThen) <= AYears; end; function WithinPastMonths(const ANow, AThen: TDateTime; const AMonths: Integer): Boolean; begin Result := MonthsBetween(ANow, AThen) <= AMonths; end; function WithinPastWeeks(const ANow, AThen: TDateTime; const AWeeks: Integer): Boolean; begin Result := WeeksBetween(ANow, AThen) <= AWeeks; end; function WithinPastDays(const ANow, AThen: TDateTime; const ADays: Integer): Boolean; begin Result := DaysBetween(ANow, AThen) <= ADays; end; function WithinPastHours(const ANow, AThen: TDateTime; const AHours: Int64): Boolean; begin Result := HoursBetween(ANow, AThen) <= AHours; end; function WithinPastMinutes(const ANow, AThen: TDateTime; const AMinutes: Int64): Boolean; begin Result := MinutesBetween(ANow, AThen) <= AMinutes; end; function WithinPastSeconds(const ANow, AThen: TDateTime; const ASeconds: Int64): Boolean; begin Result := SecondsBetween(ANow, AThen) <= ASeconds; end; function WithinPastMilliSeconds(const ANow, AThen: TDateTime; const AMilliSeconds: Int64): Boolean; begin Result := MilliSecondsBetween(ANow, AThen) <= AMilliSeconds; end; function YearsBetween(const ANow, AThen: TDateTime): Integer; begin Result := Trunc(YearSpan(ANow, AThen)); end; function MonthsBetween(const ANow, AThen: TDateTime): Integer; begin Result := Trunc(MonthSpan(ANow, AThen)); end; function WeeksBetween(const ANow, AThen: TDateTime): Integer; begin Result := Trunc(WeekSpan(ANow, AThen)); end; function DaysBetween(const ANow, AThen: TDateTime): Integer; begin Result := Trunc(DaySpan(ANow, AThen)); end; function HoursBetween(const ANow, AThen: TDateTime): Int64; begin Result := Trunc(HourSpan(ANow, AThen)); end; function MinutesBetween(const ANow, AThen: TDateTime): Int64; begin Result := Trunc(MinuteSpan(ANow, AThen)); end; function SecondsBetween(const ANow, AThen: TDateTime): Int64; begin Result := Trunc(SecondSpan(ANow, AThen)); end; function MilliSecondsBetween(const ANow, AThen: TDateTime): Int64; begin Result := Trunc(MilliSecondSpan(ANow, AThen)); end; function SpanOfNowAndThen(const ANow, AThen: TDateTime): TDateTime; begin if ANow < AThen then Result := AThen - ANow else Result := ANow - AThen; end; function YearSpan(const ANow, AThen: TDateTime): Double; begin Result := DaySpan(ANow, AThen) / ApproxDaysPerYear; end; function MonthSpan(const ANow, AThen: TDateTime): Double; begin Result := DaySpan(ANow, AThen) / ApproxDaysPerMonth; end; function WeekSpan(const ANow, AThen: TDateTime): Double; begin Result := DaySpan(ANow, AThen) / DaysPerWeek; end; function DaySpan(const ANow, AThen: TDateTime): Double; begin Result := SpanOfNowAndThen(ANow, AThen); end; function HourSpan(const ANow, AThen: TDateTime): Double; begin Result := HoursPerDay * SpanOfNowAndThen(ANow, AThen); end; function MinuteSpan(const ANow, AThen: TDateTime): Double; begin Result := MinsPerDay * SpanOfNowAndThen(ANow, AThen); end; function SecondSpan(const ANow, AThen: TDateTime): Double; begin Result := SecsPerDay * SpanOfNowAndThen(ANow, AThen); end; function MilliSecondSpan(const ANow, AThen: TDateTime): Double; begin Result := MSecsPerDay * SpanOfNowAndThen(ANow, AThen); end; function IncYear(const AValue: TDateTime; const ANumberOfYears: Integer): TDateTime; begin Result := IncMonth(AValue, ANumberOfYears * MonthsPerYear); end; function IncWeek(const AValue: TDateTime; const ANumberOfWeeks: Integer): TDateTime; begin Result := AValue + ANumberOfWeeks * DaysPerWeek; end; function IncDay(const AValue: TDateTime; const ANumberOfDays: Integer): TDateTime; begin Result := AValue + ANumberOfDays; end; function IncHour(const AValue: TDateTime; const ANumberOfHours: Int64): TDateTime; begin Result := ((AValue * HoursPerDay) + ANumberOfHours) / HoursPerDay; end; function IncMinute(const AValue: TDateTime; const ANumberOfMinutes: Int64): TDateTime; begin Result := ((AValue * MinsPerDay) + ANumberOfMinutes) / MinsPerDay; end; function IncSecond(const AValue: TDateTime; const ANumberOfSeconds: Int64): TDateTime; begin Result := ((AValue * SecsPerDay) + ANumberOfSeconds) / SecsPerDay; end; function IncMilliSecond(const AValue: TDateTime; const ANumberOfMilliSeconds: Int64): TDateTime; begin Result := ((AValue * MSecsPerDay) + ANumberOfMilliSeconds) / MSecsPerDay; end; function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime; begin if not TryEncodeDateTime(AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond, Result) then InvalidDateTimeError(AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond); end; procedure DecodeDateTime(const AValue: TDateTime; out AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word); begin DecodeDate(AValue, AYear, AMonth, ADay); DecodeTime(AValue, AHour, AMinute, ASecond, AMilliSecond); end; function EncodeDateWeek(const AYear, AWeekOfYear, ADayOfWeek: Word): TDateTime; begin if not TryEncodeDateWeek(AYear, AWeekOfYear, Result, ADayOfWeek) then InvalidDateWeekError(AYear, AWeekOfYear, ADayOfWeek); end; const CDayMap: array [1..7] of Word = (7, 1, 2, 3, 4, 5, 6); procedure DecodeDateWeek(const AValue: TDateTime; out AYear, AWeekOfYear, ADayOfWeek: Word); var LDayOfYear: Integer; LMonth, LDay: Word; LStart: TDateTime; LStartDayOfWeek, LEndDayOfWeek: Word; LLeap: Boolean; begin LLeap := DecodeDateFully(AValue, AYear, LMonth, LDay, ADayOfWeek); ADayOfWeek := CDayMap[ADayOfWeek]; LStart := EncodeDate(AYear, 1, 1); LDayOfYear := Trunc(AValue - LStart + 1); LStartDayOfWeek := DayOfTheWeek(LStart); if LStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then Dec(LDayOfYear, 8 - LStartDayOfWeek) else Inc(LDayOfYear, LStartDayOfWeek - 1); if LDayOfYear <= 0 then DecodeDateWeek(LStart - 1, AYear, AWeekOfYear, LDay) else begin AWeekOfYear := LDayOfYear div 7; if LDayOfYear mod 7 <> 0 then Inc(AWeekOfYear); if AWeekOfYear > 52 then begin LEndDayOfWeek := LStartDayOfWeek; if LLeap then begin if LEndDayOfWeek = DaySunday then LEndDayOfWeek := DayMonday else Inc(LEndDayOfWeek); end; if LEndDayOfWeek in [DayMonday, DayTuesday, DayWednesday] then begin Inc(AYear); AWeekOfYear := 1; end; end; end; end; function EncodeDateDay(const AYear, ADayOfYear: Word): TDateTime; begin if not TryEncodeDateDay(AYear, ADayOfYear, Result) then InvalidDateDayError(AYear, ADayOfYear); end; procedure DecodeDateDay(const AValue: TDateTime; out AYear, ADayOfYear: Word); begin AYear := YearOf(AValue); ADayOfYear := DayOfTheYear(AValue); end; function EncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word): TDateTime; begin if not TryEncodeDateMonthWeek(AYear, AMonth, AWeekOfMonth, ADayOfWeek, Result) then InvalidDateMonthWeekError(AYear, AMonth, AWeekOfMonth, ADayOfWeek); end; procedure DecodeDateMonthWeek(const AValue: TDateTime; out AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word); var LDay, LDaysInMonth: Word; LDayOfMonth: Integer; LStart: TDateTime; LStartDayOfWeek, LEndOfMonthDayOfWeek: Word; begin DecodeDateFully(AValue, AYear, AMonth, LDay, ADayOfWeek); ADayOfWeek := CDayMap[ADayOfWeek]; LStart := EncodeDate(AYear, AMonth, 1); LStartDayOfWeek := DayOfTheWeek(LStart); LDayOfMonth := LDay; if LStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then Dec(LDayOfMonth, 8 - LStartDayOfWeek) else Inc(LDayOfMonth, LStartDayOfWeek - 1); if LDayOfMonth <= 0 then DecodeDateMonthWeek(LStart - 1, AYear, AMonth, AWeekOfMonth, LDay) else begin AWeekOfMonth := LDayOfMonth div 7; if LDayOfMonth mod 7 <> 0 then Inc(AWeekOfMonth); LDaysInMonth := DaysInAMonth(AYear, AMonth); LEndOfMonthDayOfWeek := DayOfTheWeek(EncodeDate(AYear, AMonth, LDaysInMonth)); if (LEndOfMonthDayOfWeek in [DayMonday, DayTuesday, DayWednesday]) and (LDaysInMonth - LDay < LEndOfMonthDayOfWeek) then begin Inc(AMonth); if AMonth = 13 then begin AMonth := 1; Inc(AYear); end; AWeekOfMonth := 1; end; end; end; function TryEncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; out AValue: TDateTime): Boolean; var LTime: TDateTime; begin Result := TryEncodeDate(AYear, AMonth, ADay, AValue); if Result then begin Result := TryEncodeTime(AHour, AMinute, ASecond, AMilliSecond, LTime); if Result then AValue := AValue + LTime; end; end; function TryEncodeDateWeek(const AYear, AWeekOfYear: Word; out AValue: TDateTime; const ADayOfWeek: Word): Boolean; var LDayOfYear: Integer; LStartDayOfWeek: Word; begin Result := IsValidDateWeek(AYear, AWeekOfYear, ADayOfWeek); if Result then begin AValue := EncodeDate(AYear, 1, 1); LStartDayOfWeek := DayOfTheWeek(AValue); LDayOfYear := (AWeekOfYear - 1) * 7 + ADayOfWeek - 1; if LStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then Inc(LDayOfYear, 8 - LStartDayOfWeek) else Dec(LDayOfYear, LStartDayOfWeek - 1); AValue := AValue + LDayOfYear; end; end; function TryEncodeDateDay(const AYear, ADayOfYear: Word; out AValue: TDateTime): Boolean; begin Result := IsValidDateDay(AYear, ADayOfYear); if Result then AValue := StartOfAYear(AYear) + ADayOfYear - 1; end; function TryEncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word; var AValue: TDateTime): Boolean; var LStartDayOfWeek: Word; LDayOfMonth: Integer; begin Result := IsValidDateMonthWeek(AYear, AMonth, AWeekOfMonth, ADayOfWeek); if Result then begin AValue := EncodeDate(AYear, AMonth, 1); LStartDayOfWeek := DayOfTheWeek(AValue); LDayOfMonth := (AWeekOfMonth - 1) * 7 + ADayOfWeek - 1; if LStartDayOfWeek in [DayFriday, DaySaturday, DaySunday] then Inc(LDayOfMonth, 8 - LStartDayOfWeek) else Dec(LDayOfMonth, LStartDayOfWeek - 1); AValue := AValue + LDayOfMonth; end; end; function RecodeYear(const AValue: TDateTime; const AYear: Word): TDateTime; begin Result := RecodeDateTime(AValue, AYear, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs); end; function RecodeMonth(const AValue: TDateTime; const AMonth: Word): TDateTime; begin Result := RecodeDateTime(AValue, RecodeLeaveFieldAsIs, AMonth, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs); end; function RecodeDay(const AValue: TDateTime; const ADay: Word): TDateTime; begin Result := RecodeDateTime(AValue, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, ADay, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs); end; function RecodeHour(const AValue: TDateTime; const AHour: Word): TDateTime; begin Result := RecodeDateTime(AValue, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, AHour, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs); end; function RecodeMinute(const AValue: TDateTime; const AMinute: Word): TDateTime; begin Result := RecodeDateTime(AValue, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, AMinute, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs); end; function RecodeSecond(const AValue: TDateTime; const ASecond: Word): TDateTime; begin Result := RecodeDateTime(AValue, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, ASecond, RecodeLeaveFieldAsIs); end; function RecodeMilliSecond(const AValue: TDateTime; const AMilliSecond: Word): TDateTime; begin Result := RecodeDateTime(AValue, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, AMilliSecond); end; function RecodeDate(const AValue: TDateTime; const AYear, AMonth, ADay: Word): TDateTime; begin Result := RecodeDateTime(AValue, AYear, AMonth, ADay, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs); end; function RecodeTime(const AValue: TDateTime; const AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime; begin Result := RecodeDateTime(AValue, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, RecodeLeaveFieldAsIs, AHour, AMinute, ASecond, AMilliSecond); end; function RecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): TDateTime; begin if not TryRecodeDateTime(AValue, AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond, Result) then InvalidDateTimeError(AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond, AValue); end; function TryRecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; out AResult: TDateTime): Boolean; var LYear, LMonth, LDay, LHour, LMinute, LSecond, LMilliSecond: Word; begin DecodeDateTime(AValue, LYear, LMonth, LDay, LHour, LMinute, LSecond, LMilliSecond); if AYear <> RecodeLeaveFieldAsIs then LYear := AYear; if AMonth <> RecodeLeaveFieldAsIs then LMonth := AMonth; if ADay <> RecodeLeaveFieldAsIs then LDay := ADay; if AHour <> RecodeLeaveFieldAsIs then LHour := AHour; if AMinute <> RecodeLeaveFieldAsIs then LMinute := AMinute; if ASecond <> RecodeLeaveFieldAsIs then LSecond := ASecond; if AMilliSecond <> RecodeLeaveFieldAsIs then LMilliSecond := AMilliSecond; Result := TryEncodeDateTime(LYear, LMonth, LDay, LHour, LMinute, LSecond, LMilliSecond, AResult); end; { Fuzzy comparison } function CompareDateTime(const A, B: TDateTime): TValueRelationship; begin if Abs(A - B) < OneMillisecond then Result := EqualsValue else if A < B then Result := LessThanValue else Result := GreaterThanValue; end; function SameDateTime(const A, B: TDateTime): Boolean; begin Result := Abs(A - B) < OneMillisecond; end; function CompareDate(const A, B: TDateTime): TValueRelationship; begin if Trunc(A) = Trunc(B) then Result := EqualsValue else if A < B then Result := LessThanValue else Result := GreaterThanValue; end; function SameDate(const A, B: TDateTime): Boolean; begin Result := Trunc(A) = Trunc(B); end; function CompareTime(const A, B: TDateTime): TValueRelationship; begin if Abs(Frac(A) - Frac(B)) < OneMillisecond then Result := EqualsValue else if Frac(A) < Frac(B) then Result := LessThanValue else Result := GreaterThanValue; end; function SameTime(const A, B: TDateTime): Boolean; begin Result := Abs(Frac(A) - Frac(B)) < OneMillisecond; end; { NthDayOfWeek conversion } function NthDayOfWeek(const AValue: TDateTime): Word; begin Result := (DayOfTheMonth(AValue) - 1) div 7 + 1; end; procedure DecodeDayOfWeekInMonth(const AValue: TDateTime; out AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word); var ADay: Word; begin DecodeDate(AValue, AYear, AMonth, ADay); ANthDayOfWeek := (ADay - 1) div 7 + 1; ADayOfWeek := DayOfTheWeek(AValue); end; function EncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word): TDateTime; begin if not TryEncodeDayOfWeekInMonth(AYear, AMonth, ANthDayOfWeek, ADayOfWeek, Result) then InvalidDayOfWeekInMonthError(AYear, AMonth, ANthDayOfWeek, ADayOfWeek); end; function TryEncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word; out AValue: TDateTime): Boolean; var LStartOfMonth, LDay: Word; begin LStartOfMonth := DayOfTheWeek(StartOfAMonth(AYear, AMonth)); if LStartOfMonth <= ADayOfWeek then LDay := (ADayOfWeek - LStartOfMonth + 1) + 7 * (ANthDayOfWeek - 1) else LDay := (7 - LStartOfMonth + 1) + ADayOfWeek + 7 * (ANthDayOfWeek - 1); Result := TryEncodeDate(AYear, AMonth, LDay, AValue); end; { Julian and Modified Julian Date conversion support } function DateTimeToJulianDate(const AValue: TDateTime): Double; var LYear, LMonth, LDay: Word; begin DecodeDate(AValue, LYear, LMonth, LDay); Result := (1461 * (LYear + 4800 + (LMonth - 14) div 12)) div 4 + (367 * (LMonth - 2 - 12 * ((LMonth - 14) div 12))) div 12 - (3 * ((LYear + 4900 + (LMonth - 14) div 12) div 100)) div 4 + LDay - 32075.5 + Frac(AValue); end; function JulianDateToDateTime(const AValue: Double): TDateTime; begin if not TryJulianDateToDateTime(AValue, Result) then raise EConvertError.CreateFmt(SInvalidJulianDate, [AValue]); end; function TryJulianDateToDateTime(const AValue: Double; out ADateTime: TDateTime): Boolean; var L, N, LYear, LMonth, LDay: Integer; begin L := Trunc(AValue) + 68570; N := 4 * L div 146097; L := L - (146097 * N + 3) div 4; LYear := 4000 * (L + 1) div 1461001; L := L - 1461 * LYear div 4 + 31; LMonth := 80 * L div 2447; LDay := L - 2447 * LMonth div 80; L := LMonth div 11; LMonth := LMonth + 2 - 12 * L; LYear := 100 * (N - 49) + LYear + L; Result := TryEncodeDate(LYear, LMonth, LDay, ADateTime); if Result then ADateTime := ADateTime + Frac(AValue) - 0.5; end; const CJDToMJDOffset: TDateTime = 2400000.5; function DateTimeToModifiedJulianDate(const AValue: TDateTime): Double; begin Result := DateTimeToJulianDate(AValue) - CJDToMJDOffset; end; function ModifiedJulianDateToDateTime(const AValue: Double): TDateTime; begin Result := JulianDateToDateTime(AValue + CJDToMJDOffset); end; function TryModifiedJulianDateToDateTime(const AValue: Double; out ADateTime: TDateTime): Boolean; begin Result := TryJulianDateToDateTime(AValue + CJDToMJDOffset, ADateTime); end; { Unix date conversion support } function DateTimeToUnix(const AValue: TDateTime): Int64; begin Result := Round((AValue - UnixDateDelta) * SecsPerDay); end; function UnixToDateTime(const AValue: Int64): TDateTime; begin Result := AValue / SecsPerDay + UnixDateDelta; end; { Error reporting } procedure InvalidDateTimeError(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word; const ABaseDate: TDateTime); function Translate(AOrig, AValue: Word): string; begin if AValue = RecodeLeaveFieldAsIs then if ABaseDate = 0 then Result := SMissingDateTimeField else Result := IntToStr(AOrig) else Result := IntToStr(AValue); end; var LYear, LMonth, LDay, LHour, LMinute, LSecond, LMilliSecond: Word; begin DecodeDate(ABaseDate, LYear, LMonth, LDay); DecodeTime(ABaseDate, LHour, LMinute, LSecond, LMilliSecond); raise EConvertError.CreateFmt(SInvalidDateTime, [Translate(LYear, AYear) + DateSeparator + Translate(LMonth, AMonth) + DateSeparator + Translate(LDay, ADay) + ' ' + Translate(LHour, AHour) + TimeSeparator + Translate(LMinute, AMinute) + TimeSeparator + Translate(LSecond, ASecond) + DecimalSeparator + Translate(LMilliSecond, AMilliSecond)]); end; procedure InvalidDateWeekError(const AYear, AWeekOfYear, ADayOfWeek: Word); begin raise EConvertError.CreateFmt(SInvalidDateWeek, [AYear, AWeekOfYear, ADayOfWeek]); end; procedure InvalidDateDayError(const AYear, ADayOfYear: Word); begin raise EConvertError.CreateFmt(SInvalidDateDay, [AYear, ADayOfYear]); end; procedure InvalidDateMonthWeekError(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word); begin raise EConvertError.CreateFmt(SInvalidDateMonthWeek, [AYear, AMonth, AWeekOfMonth, ADayOfWeek]); end; procedure InvalidDayOfWeekInMonthError(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: Word); begin raise EConvertError.CreateFmt(SInvalidDayOfWeekInMonth, [AYear, AMonth, ANthDayOfWeek, ADayOfWeek]); end; end.
#skip unit using_2; interface implementation uses System; // const еквивалентно ref type TArray<T> = record private FData: array of T; public procedure Add(const Value: T); function GetItem(Index: Integer): T; end; // обьявление массива с not null элементами: // 1 - var A: array of !TObject; // 1 - var A: array of TObject not nil; // в случае, если массив обьявлен таким образом, то // процедура SetLength не допустима, допустима только // добавлять элементы по одному или группой через // процедуру AppendNN(Array, Item) // также допустимо вызов метода SetCapacity(Array, ItemCount) procedure TArray.Add(const Value: TObject); begin // AppendNN(FData, Value); end; function TArray.GetItem(Index: Integer): TObject; begin using FData[Index] Val do Result := Val else Assert(False); // Result := ExtractNN(FData, Index); end; var A: array of TObject; procedure Test; begin end; initialization Test(); finalization end.
unit Ths.Erp.Database.Connection; interface uses System.SysUtils, Forms, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Stan.Async, FireDAC.DApt, FireDAC.UI.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Phys, FireDAC.Phys.PG, FireDAC.VCLUI.Wait, Data.DB, FireDAC.Comp.Client, FireDAC.Comp.DataSet, Ths.Erp.Database.Connection.Settings; type TConnection = class strict private class var FConn: TFDConnection; private FConnSetting: TConnSettings; procedure ConnAfterCommit(Sender: TObject); procedure ConnAfterRollback(Sender: TObject); procedure ConnAfterStartTransaction(Sender: TObject); procedure ConnBeforeCommit(Sender: TObject); procedure ConnBeforeRollback(Sender: TObject); procedure ConnBeforeStartTransaction(Sender: TObject); procedure ConfigureConnection(); public property ConnSetting: TConnSettings read FConnSetting write FConnSetting; constructor Create(); destructor Destroy; override; function GetConn: TFDConnection; function NewQuery: TFDQuery; end; implementation { TConnection } procedure TConnection.ConfigureConnection(); var vLanguage, vSQLServer, vDatabaseName, vDBUserName, vDBUserPassword, vDBPortNo: string; begin FConn.AfterStartTransaction := ConnAfterStartTransaction; FConn.AfterCommit := ConnAfterCommit; FConn.AfterRollback := ConnAfterRollback; FConn.BeforeStartTransaction := ConnBeforeStartTransaction; FConn.BeforeCommit := ConnBeforeCommit; FConn.BeforeRollback := ConnBeforeRollback; Self.ConnSetting.ReadFromFile( ExtractFilePath(Application.ExeName) + 'Settings' + '\' + 'GlobalSettings.ini', vLanguage, vSQLServer, vDatabaseName, vDBUserName, vDBUserPassword, vDBPortNo ); Self.ConnSetting.Language := vLanguage; Self.ConnSetting.SQLServer := vSQLServer; Self.ConnSetting.DatabaseName := vDatabaseName; Self.ConnSetting.DBUserName := vDBUserName; Self.ConnSetting.DBUserPassword := vDBUserPassword; Self.ConnSetting.DBPortNo := vDBPortNo.ToInteger; Self.ConnSetting.AppName := ''; FConn.Name := 'Connection'; FConn.Params.Add('DriverID=PG'); FConn.Params.Add('CharacterSet=UTF8'); FConn.Params.Add('Server=' + vSQLServer); FConn.Params.Add('Database=' + vDatabaseName); FConn.Params.Add('User_Name=' + vDBUserName); FConn.Params.Add('Password=' + vDBUserPassword); FConn.Params.Add('Port=' + vDBPortNo); FConn.Params.Add('ApplicationName=' + 'strAppName'); FConn.LoginPrompt := False; end; procedure TConnection.ConnAfterCommit(Sender: TObject); begin TranscationIsStarted := False; end; procedure TConnection.ConnAfterRollback(Sender: TObject); begin TranscationIsStarted := False; end; procedure TConnection.ConnAfterStartTransaction(Sender: TObject); begin // end; procedure TConnection.ConnBeforeCommit(Sender: TObject); begin // end; procedure TConnection.ConnBeforeRollback(Sender: TObject); begin // end; procedure TConnection.ConnBeforeStartTransaction(Sender: TObject); begin TranscationIsStarted := True; end; constructor TConnection.Create(); begin if Self.FConn <> nil then Abort else begin inherited; Self.FConn := TFDConnection.Create(nil); Self.ConnSetting := TConnSettings.Create; Self.ConfigureConnection; end; end; destructor TConnection.Destroy; begin FreeAndNil(Self); inherited; end; function TConnection.GetConn: TFDConnection; begin Result := Self.FConn; end; function TConnection.NewQuery: TFDQuery; begin Result := TFDQuery.Create(nil); Result.Connection := Self.FConn; end; end.
unit fOMSet; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, CheckLst, rOrders, uConst, ORFn, rODMeds, fODBase,uCore,fOrders, fframe, fBase508Form, VA508AccessibilityManager; type TSetItem = class public DialogIEN: Integer; DialogType: Char; OIIEN: string; InPkg: string; OwnedBy: TComponent; RefNum: Integer; MenuActive: Boolean; end; TfrmOMSet = class(TfrmBase508Form) lstSet: TCheckListBox; cmdInterupt: TButton; procedure cmdInteruptClick(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure FormCreate(Sender: TObject); private DoingNextItem : Boolean; CloseRequested : Boolean; FromInterrupt: Boolean; FDelayEvent: TOrderDelayEvent; FClosing: Boolean; FRefNum: Integer; FActiveMenus: Integer; FClosebyDeaCheck: Boolean; function IsCreatedByMenu(ASetItem: TSetItem): boolean; function DeaCheckPassed(OIIens: string; APkg: string; AnEventType: Char): string; procedure DoNextItem; procedure UMDestroy(var Message: TMessage); message UM_DESTROY; procedure UMDelayEvent(var Message: TMessage); message UM_DELAYEVENT; function GetActiveMenus: integer; public procedure InsertList(SetList: TStringList; AnOwner: TComponent; ARefNum: Integer; const KeyVarStr: string; AnEventType:Char =#0); procedure SetEventDelay(AnEvent: TOrderDelayEvent); property RefNum: Integer read FRefNum write FRefNum; property ActiveMenus: Integer read GetActiveMenus write FActiveMenus; end; var frmOMSet: TfrmOMSet; implementation {$R *.DFM} uses uOrders, fOMNavA, rMisc, uODBase; const TX_STOP = 'Do you want to stop entering the current set of orders?'; TC_STOP = 'Interrupt Order Set'; procedure TfrmOMSet.SetEventDelay(AnEvent: TOrderDelayEvent); begin FDelayEvent := AnEvent; end; procedure TfrmOMSet.InsertList(SetList: TStringList; AnOwner: TComponent; ARefNum: Integer; const KeyVarStr: string; AnEventType: Char); { expects SetList to be strings of DlgIEN^DlgType^DisplayName^OrderableItemIens } const TXT_DEAFAIL1 = 'Order for controlled substance '; TXT_DEAFAIL2 = CRLF + 'could not be completed. Provider does not have a' + CRLF + 'current, valid DEA# on record and is ineligible' + CRLF + 'to sign the order.'; TXT_SCHFAIL = CRLF + 'could not be completed. Provider is not authorized' + CRLF + 'to prescribe medications in Federal Schedule '; TXT_SCH_ONE = ' could not be completed.' + CRLF + 'Electronic prescription of medications in Federal Schedule 1 is prohibited.' + CRLF + CRLF + 'Valid Schedule 1 investigational medications require paper prescription.'; TXT_NO_DETOX = CRLF + 'could not be completed. Provider does not have a' + CRLF + 'valid Detoxification/Maintenance ID number on' + CRLF + 'record and is ineligible to sign the order.'; TXT_EXP_DETOX1 = CRLF + 'could not be completed. Provider''s Detoxification/Maintenance' + CRLF + 'ID number expired due to an expired DEA# on '; TXT_EXP_DETOX2 = '.' + CRLF + 'Provider is ineligible to sign the order.'; TXT_EXP_DEA1 = CRLF + 'could not be completed. Provider''s DEA# expired on '; TXT_EXP_DEA2 = CRLF + 'and no VA# is assigned. Provider is ineligible to sign the order.'; TXT_INSTRUCT = CRLF + CRLF + 'Click RETRY to select another provider.' + CRLF + 'Click CANCEL to cancel the current order process.'; TC_DEAFAIL = 'Order not completed'; var i, InsertAt, InsHold: Integer; SetItem: TSetItem; DEAFailStr, TX_INFO: string; begin //SMT If we are not inserting at the beginning of the orderset, we are inserting // an orderset into an order set and want to insert above our current menu so that // we don't automatically skip the menu when selecting the order set. InsertAt := 0; if lstSet.ItemIndex > -1 then begin //Get the current order set SetItem := TSetItem(lstSet.Items.Objects[lstSet.ItemIndex]); if assigned(SetItem) then begin //If the current orderset is using a menu then add the order set items above if SetItem.MenuActive then InsertAt := lstSet.ItemIndex else InsertAt := lstSet.ItemIndex + 1; end else InsertAt := lstSet.ItemIndex + 1; end; InsHold := InsertAt; with SetList do for i := 0 to Count - 1 do begin SetItem := TSetItem.Create; SetItem.DialogIEN := StrToIntDef(Piece(SetList[i], U, 1), 0); SetItem.DialogType := CharAt(Piece(SetList[i], U, 2), 1); SetItem.OIIEN := Piece(SetList[i], U, 4); SetItem.InPkg := Piece(SetList[i], U, 5); // put the Owner form and reference number in the last item if i = Count - 1 then begin SetItem.OwnedBy := AnOwner; SetItem.RefNum := ARefNum; end; DEAFailStr := ''; DEAFailStr := DeaCheckPassed(SetItem.OIIEN, SetItem.InPkg, AnEventType); if DEAFailStr <> '' then begin case StrToIntDef(Piece(DEAFailStr,U,1),0) of 1: TX_INFO := TXT_DEAFAIL1 + Piece(SetList[i], U, 3) + TXT_DEAFAIL2; //prescriber has an invalid or no DEA# 2: TX_INFO := TXT_DEAFAIL1 + Piece(SetList[i], U, 3) + TXT_SCHFAIL + Piece(DEAFailStr,U,2) + '.'; //prescriber has no schedule privileges in 2,2N,3,3N,4, or 5 3: TX_INFO := TXT_DEAFAIL1 + Piece(SetList[i], U, 3) + TXT_NO_DETOX; //prescriber has an invalid or no Detox# 4: TX_INFO := TXT_DEAFAIL1 + Piece(SetList[i], U, 3) + TXT_EXP_DEA1 + Piece(DEAFailStr,U,2) + TXT_EXP_DEA2; //prescriber's DEA# expired and no VA# is assigned 5: TX_INFO := TXT_DEAFAIL1 + Piece(SetList[i], U, 3) + TXT_EXP_DETOX1 + Piece(DEAFailStr,U,2) + TXT_EXP_DETOX2; //valid detox#, but expired DEA# 6: TX_INFO := TXT_DEAFAIL1 + Piece(SetList[i], U, 3) + TXT_SCH_ONE; //schedule 1's are prohibited from electronic prescription end; if StrToIntDef(Piece(DEAFailStr,U,1),0) in [1..6] then begin if StrToIntDef(Piece(DEAFailStr,U,1),0)=6 then begin InfoBox(TX_INFO, TC_DEAFAIL, MB_OK); FClosebyDeaCheck := True; Continue; end; if InfoBox(TX_INFO + TXT_INSTRUCT, TC_DEAFAIL, MB_RETRYCANCEL or MB_ICONERROR) = IDRETRY then begin DEAContext := True; fFrame.frmFrame.mnuFileEncounterClick(Self); DEAFailStr := ''; DEAFailStr := DeaCheckPassed(SetItem.OIIEN, SetItem.InPkg, AnEventType); if StrToIntDef(Piece(DEAFailStr,U,1),0) in [1..5] then Continue end else begin FClosebyDeaCheck := True; Close; Exit; end; end; end; lstSet.Items.InsertObject(InsertAt, Piece(SetList[i], U, 3), SetItem); Inc(InsertAt); end; PushKeyVars(KeyVarStr); //SMT reset the index after addition. lstSet.ItemIndex := InsHold -1; DoNextItem; end; procedure TfrmOMSet.DoNextItem; var SetItem: TSetItem; theOwner: TComponent; ok: boolean; procedure SkipToNext; begin if FClosing then Exit; lstSet.Checked[lstSet.ItemIndex] := True; DoNextItem; end; begin DoingNextItem := true; try //frmFrame.UpdatePtInfoOnRefresh; if FClosing then Exit; if frmOrders <> nil then begin if (frmOrders.TheCurrentView<>nil) and (frmOrders.TheCurrentView.EventDelay.PtEventIFN>0) and IsCompletedPtEvt(frmOrders.TheCurrentView.EventDelay.PtEventIFN) then begin FDelayEvent.EventType := #0; FDelayEvent.EventIFN := 0; FDelayEvent.TheParent := TParentEvent.Create; FDelayEvent.EventName := ''; FDelayEvent.PtEventIFN := 0; end; end; with lstSet do begin if ItemIndex >= Items.Count - 1 then begin Close; Exit; end; ItemIndex := ItemIndex + 1; SetItem := TSetItem(Items.Objects[ItemIndex]); case SetItem.DialogType of 'A': if not ActivateAction(IntToStr(SetItem.DialogIEN), Self, ItemIndex) then begin if Not FClosing then begin if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then lstSet.Checked[lstSet.ItemIndex] := True else SkipToNext; end; end; 'D', 'Q': if not ActivateOrderDialog(IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex) then begin if Not FClosing then begin if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then lstSet.Checked[lstSet.ItemIndex] := True else SkipToNext; end; end; 'M': begin ok := ActivateOrderMenu(IntToStr(SetItem.DialogIEN), FDelayEvent, Self, ItemIndex); if not FClosing then begin if ok then SetItem.MenuActive := true // Inc(FActiveMenus) else begin if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then lstSet.Checked[lstSet.ItemIndex] := True else SkipToNext; end; end; end; 'O': begin if (Self.Owner.Name = 'frmOMNavA') then theOwner := Self.Owner else theOwner := self; if not ActivateOrderSet( IntToStr(SetItem.DialogIEN), FDelayEvent, theOwner, ItemIndex) then begin if Not FClosing then begin if IsCreatedByMenu(SetItem) and (lstSet.ItemIndex < lstSet.Items.Count - 1) then lstSet.Checked[lstSet.ItemIndex] := True else SkipToNext; end; end; end; else begin InfoBox('Unsupported dialog type: ' + SetItem.DialogType, 'Error', MB_OK); SkipToNext; end; end; {case} end; {with lstSet} finally DoingNextItem := false; end; end; procedure TfrmOMSet.UMDelayEvent(var Message: TMessage); begin if CloseRequested then begin Close; if Not FClosing then begin CloseRequested := False; FClosing := False; DoNextItem; end else Exit; end; // ignore if delay from other than current itemindex // (prevents completion of an order set from calling DoNextItem) if Integer(Message.WParam) = lstSet.ItemIndex then if lstSet.ItemIndex < lstSet.Items.Count - 1 then DoNextItem else Close; end; procedure TfrmOMSet.UMDestroy(var Message: TMessage); { Received whenever activated item is finished. Posts to Owner if last item in the set. } var SetItem: TSetItem; RefNum: Integer; begin RefNum := Message.WParam; lstSet.Checked[RefNum] := True; SetItem := TSetItem(lstSet.Items.Objects[RefNum]); if SetItem.DialogType = 'M' then SetItem.MenuActive := false; //Dec(FActiveMenus); if (SetItem.OwnedBy <> nil) and (SetItem.DialogType <> 'O') then begin PopKeyVars; if ((lstSet.ItemIndex = lstSet.Count - 1) and (lstSet.Checked[lstSet.ItemIndex] = True)) then Close; if {(SetItem.OwnedBy <> Self) and} (SetItem.OwnedBy is TWinControl) then begin SendMessage(TWinControl(SetItem.OwnedBy).Handle, UM_DESTROY, SetItem.RefNum, 0); //Exit; end; end; // let menu or dialog finish closing before going on to next item in the order set While RefNum <= lstSet.Items.Count - 2 do begin if not (lstSet.Checked[RefNum+1]) then Break else begin RefNum := RefNum + 1; lstSet.ItemIndex := RefNum; end; end; PostMessage(Handle, UM_DELAYEVENT, RefNum, 0); end; function TfrmOMSet.GetActiveMenus: integer; var SetItem: TSetItem; i: integer; begin Result := 0; for I := 0 to lstSet.Items.Count - 1 do begin if Assigned(lstSet.Items.Objects[I]) then begin SetItem := TSetItem(lstSet.Items.Objects[I]); if (SetItem.DialogType = 'M') and (SetItem.MenuActive) then Inc(Result); end; end; end; procedure TfrmOMSet.FormCreate(Sender: TObject); begin FActiveMenus := 0; FClosing:= False; FromInterrupt := False; FClosebyDeaCheck := False; NoFresh := True; CloseRequested := false; DoingNextItem := false; end; procedure TfrmOMSet.FormDestroy(Sender: TObject); var i: Integer; begin with lstSet do for i := 0 to Items.Count - 1 do TSetItem(Items.Objects[i]).Free; DestroyingOrderSet; end; procedure TfrmOMSet.FormCloseQuery(Sender: TObject; var CanClose: Boolean); { if this is not the last item in the set, prompt whether to interrupt processing } begin if FClosebyDeaCheck then begin CanClose := True; FClosing := CanClose; FromInterrupt := False; end else if lstSet.ItemIndex < (lstSet.Items.Count - 1) then begin if DoingNextItem and (not CloseRequested) and (not FromInterrupt) then begin CloseRequested := True; FClosing := True; CanClose := False; end else begin CanClose := InfoBox(TX_STOP, TC_STOP, MB_YESNO) = IDYES; FClosing := CanClose; FromInterrupt := False; end; end; end; procedure TfrmOMSet.FormClose(Sender: TObject; var Action: TCloseAction); { Notify remaining owners that their item is done (or - really never completed) } var i, TotalActiveMenus: Integer; SetItem: TSetItem; begin // do we need to iterate thru and send messages where OwnedBy <> nil? FClosing := True; TotalActiveMenus := ActiveMenus; for i := 1 to TotalActiveMenus do PopLastMenu; if lstSet.Items.Count > 0 then begin if lstSet.ItemIndex < 0 then lstSet.ItemIndex := 0; with lstSet do for i := ItemIndex to Items.Count - 1 do begin SetItem := TSetItem(lstSet.Items.Objects[i]); if (SetItem.OwnedBy <> nil) and (SetItem.OwnedBy is TWinControl) then SendMessage(TWinControl(SetItem.OwnedBy).Handle, UM_DESTROY, SetItem.RefNum, 0); end; end; SaveUserBounds(Self); NoFresh := False; Action := caFree; end; procedure TfrmOMSet.cmdInteruptClick(Sender: TObject); begin FromInterrupt := True; if DoingNextItem then begin CloseRequested := true; //Fix for CQ: 8297 FClosing := true; end else Close; end; function TfrmOMSet.DeaCheckPassed(OIIens: string; APkg: string; AnEventType: Char): string; var tmpIenList: TStringList; i: integer; InptDlg: boolean; DEAFailstr: string; begin Result := ''; InptDlg := False; if Pos('PS',APkg) <> 1 then Exit; if Length(OIIens)=0 then Exit; tmpIenList := TStringList.Create; PiecesToList(OIIens,';',TStrings(tmpIenList)); (* case AnEventType of 'A','T': isInpt := True; 'D': isInpt := False; else isInpt := Patient.Inpatient; end; *) if APkg = 'PSO' then InptDlg := False else if APkg = 'PSJ' then InptDlg := True; for i := 0 to tmpIenList.Count - 1 do begin DEAFailStr := ''; DEAFailStr := DEACheckFailed(StrToIntDef(tmpIenList[i],0), InptDlg); if StrToIntDef(Piece(DEAFailStr,U,1),0) in [1..6] then begin Result := DEAFailStr; Break; end; end; end; function TfrmOMSet.IsCreatedByMenu(ASetItem: TSetItem): boolean; begin Result := False; if (AsetItem.OwnedBy <> nil) and (ASetItem.OwnedBy.Name = 'frmOMNavA') then Result := True; end; end.
unit uMain; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Controls.Presentation, FMX.ListBox; type TForm3 = class(TForm) ComboBox1: TComboBox; Button1: TButton; CheckBox1: TCheckBox; Label1: TLabel; Lang1: TLang; Button2: TButton; ComboBox2: TComboBox; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure Button2Click(Sender: TObject); procedure ComboBox2Change(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } FLang_tw :TStringList; public { Public declarations } end; TLanguage = class(TFmxObject) private FLang: string; FResources: TStrings; FOriginal: TStrings; FAutoSelect: Boolean; FFileName: string; FStoreInForm: Boolean; function GetLangStr(const Index: string): TStrings; procedure SetLang(const Value: string); // procedure SetLang(const Value: string); // function GetLangStr(const Index: string): TStrings; protected { vcl } // procedure DefineProperties(Filer: TFiler); override; // procedure ReadResources(Stream: TStream); // procedure WriteResources(Stream: TStream); // procedure Loaded; override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure AddLang(const AName: string); // procedure LoadFromFile(const AFileName: string); // procedure SaveToFile(const AFileName: string); // property Original: TStrings read FOriginal; property Resources: TStrings read FResources; property LangStr[const Index: string]: TStrings read GetLangStr; published // property AutoSelect: Boolean read FAutoSelect write FAutoSelect default True; // property FileName: string read FFileName write FFileName; // property StoreInForm: Boolean read FStoreInForm write FStoreInForm default True; property Lang: string read FLang write SetLang; end; var Form3: TForm3; implementation {$R *.fmx} procedure TForm3.Button1Click(Sender: TObject); var sTemp:string; begin // Button1.Text := 'Button'; // CheckBox1.Text := 'CheckBox'; // Label1.Text := 'Test'; // Caption := 'Test'; // ShowMessage(TStrings(Lang1.Resources.Objects[ComboBox1.ItemIndex]).Text); ShowMessage(TStrings(Lang1.Resources.Objects[ComboBox1.ItemIndex]).Text); ShowMessage('MSG_INPUT_ACCT'); // label1.text := 'Button'; sTemp:= Lang1.Resources.Names[0]; InputQuery( 'MSG_INPUT_PWD' , [#1 + sTemp], [''], procedure(const AResult: TModalResult; const AValues: array of string) begin end); end; procedure TForm3.Button2Click(Sender: TObject); var Lang2 : TLanguage; begin Label1.Text := FLang_tw.Values['UI_fmMain_dfAccount']; exit; Lang2 := TLanguage.Create(nil); try Lang2.AddLang('en_US'); Lang2.AddLang('zh_CN'); Lang2.AddLang('zh_TW'); with Lang2.LangStr['en_US'] do begin Values['Label1'] := 'label'; Values['Button1'] := 'Button'; Values['CheckBox1'] := 'Check box'; Values['Test'] := 'Test'; Values['MSG_INPUT_ACCT'] := 'input account'; Values['MSG_INPUT_PWD'] := 'input password'; Values['MSG_EXTRA_FUN_PWD'] := 'function 1'; end; with Lang2.LangStr['zh_CN'] do begin Values['Label1'] := '標題CN'; Values['Button1'] := '按钮'; Values['CheckBox1'] := '复选框'; Values['Test'] := '测试'; Values['MSG_INPUT_ACCT'] := '輸入帳號cn'; Values['MSG_INPUT_PWD'] := '密碼CN'; Values['MSG_EXTRA_FUN_PWD'] := '功能CN'; end; {繁体中文} with Lang2.LangStr['zh_TW'] do begin Values['Label1'] := '標題TW'; Values['Button1'] := '按鈕'; Values['CheckBox1'] := '復選框'; Values['Test'] := '測試'; Values['MSG_INPUT_ACCT'] := '輸入帳號tw'; Values['MSG_INPUT_PWD'] := '密碼TW'; Values['MSG_EXTRA_FUN_PWD'] := '功能TW'; end; Lang2.Lang := 'zh_CN'; finally Lang2.Free; end; end; procedure TForm3.ComboBox1Change(Sender: TObject); begin case ComboBox1.ItemIndex of 0: Lang1.Lang := 'en_US'; 1: Lang1.Lang := 'zh_CN'; 2: Lang1.Lang := 'zh_TW'; 3: Lang1.Lang := ''; end; end; procedure TForm3.ComboBox2Change(Sender: TObject); begin // end; procedure TForm3.FormCreate(Sender: TObject); begin // Button1.Text := 'Button'; // CheckBox1.Text := 'CheckBox'; // Label1.Text := 'Test'; // Caption := 'Test'; Lang1.AddLang('en_US'); Lang1.AddLang('zh_CN'); Lang1.AddLang('zh_TW'); { with Lang1.Original do begin Add('Button'); Add('CheckBox'); Add('Test'); Add('MSG INPUT ACCT'); Add('MSG INPUT PWD'); end; } { with Lang1.LangStr['en'] do begin Add('Button'); Add('CheckBox'); Add('Test'); Add('input account'); Add('input pwd'); end; } with Lang1.LangStr['en_US'] do begin Values['Label1'] := 'label'; Values['Button1'] := 'Button'; Values['CheckBox1'] := 'Check box'; Values['Test'] := 'Test'; Values['MSG_INPUT_ACCT'] := 'input account'; Values['MSG_INPUT_PWD'] := 'input password'; Values['MSG_EXTRA_FUN_PWD'] := 'function 1'; end; with Lang1.LangStr['zh_CN'] do begin Values['Label1'] := '標題CN'; Values['Button1'] := '按钮'; Values['CheckBox1'] := '复选框'; Values['Test'] := '测试'; Values['MSG_INPUT_ACCT'] := '輸入帳號cn'; Values['MSG_INPUT_PWD'] := '密碼CN'; Values['MSG_EXTRA_FUN_PWD'] := '功能CN'; end; {繁体中文} with Lang1.LangStr['zh_TW'] do begin Values['Label1'] := '標題TW'; Values['Button1'] := '按鈕'; Values['CheckBox1'] := '復選框'; Values['Test'] := '測試'; Values['MSG_INPUT_ACCT'] := '輸入帳號tw'; Values['MSG_INPUT_PWD'] := '密碼TW'; Values['MSG_EXTRA_FUN_PWD'] := '功能TW'; end; ComboBox1.ItemIndex := 2; Lang1.Lang := ComboBox1.Items.Strings[ComboBox1.ItemIndex]; FLang_tw := TStringList.Create; FLang_tw.Add('UI_fmMain_dfAccount=帳號 :'); FLang_tw.Add('UI_fmMain_dfPwd=密碼 :'); FLang_tw.Add('UI_fmMain_btnSignIn=登入'); FLang_tw.Add('UI_fmSetup_pbReturn=完成'); FLang_tw.Add('UI_fmSetup_itemHost=主機名稱'); FLang_tw.Add('UI_fmSetup_itemPort=通訊埠'); FLang_tw.Add('UI_fmSetup_itemCompany=公司 ID'); FLang_tw.Add('UI_fmSetup_itemLanguage=語言設定'); FLang_tw.Add('UI_fmSetup_itemClickSensitivity=點擊靈敏度'); FLang_tw.Add('UI_fmSetup_itemDomainName=網域名稱'); end; procedure TForm3.FormDestroy(Sender: TObject); begin FLang_tw.Free; end; { TLanguage } procedure TLanguage.AddLang(const AName: string); var Idx: Integer; Str: TStrings; begin Idx := FResources.IndexOf(AName); if Idx < 0 then begin Str := TStringList.Create; // TStringList(Str).Sorted := True; TStringList(Str).CaseSensitive := True; FResources.AddObject(AName, Str); end; end; constructor TLanguage.Create(AOwner: TComponent); begin inherited; FOriginal := TStringList.Create; FResources := TStringList.Create; FAutoSelect := True; FStoreInForm := True; end; destructor TLanguage.Destroy; var I: Integer; begin for I := 0 to FResources.Count - 1 do TStrings(FResources.Objects[I]).DisposeOf; FreeAndNil(FResources); FreeAndNil(FOriginal); inherited; end; function TLanguage.GetLangStr(const Index: string): TStrings; var Idx: Integer; begin Idx := FResources.IndexOf(Index); if Idx >= 0 then Result := TStrings(FResources.Objects[Idx]) else Result := nil; end; procedure TLanguage.SetLang(const Value: string); begin FLang := Value; if not(csLoading in ComponentState) then begin if FLang = 'en' then ResetLang else LoadLangFromStrings(LangStr[FLang]); end; end; end.
unit Utils; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls, ExtCtrls, ImgList{, ccuDataStringGrid, UniCodeClasses}; const TMyBooleanStringArray: array [Boolean] of String = ('FALSE', 'TRUE'); type PSearchRec = ^TSearchRec; procedure SetStdDirectory(var Dir: String); function GetStdDirectory(const Dir: String): String; procedure FindFiles(APath, AFilter: String; var AList: TList); //AFilter为'*.xxx'格式; procedure FindFileNames(APath, AFilter: String; var AList: TStrings); //得到字符串中的下一部分 function GetNextPart(var str: String; Sep1: char = char(9); Sep2: char = ','; Position: integer = 1): String; //把字符串按某个字符串分隔 procedure DivStrToList(SrcStr, divStr: String; StrList: TStrings; bAllowEmpty: Boolean = False); procedure SetParentPath(var APath: String); function MyBoolToStr(const ABoolean: Boolean): String; //根据文件名读取文件最后修改时间 function GetFileTime(const AFile: string): string; //ProE文件的修订版后缀形如".prt.1"、".prt.2",本方法查找最新修订版 function FindLastFileRevision(APath, AFilter: String; AName: String): string; implementation function GetFileTime(const AFile: string): string; function CovFileDate(FT: _FILETIME): TDateTime; var STTmp: _SYSTEMTIME; FTTmp: _FILETIME; begin FileTimeToLocalFileTime(FT, FTTmp); FileTimeToSystemTime(FTTmp, STTmp); CovFileDate := SystemTimeToDateTime(STTmp); end; const Model = 'yyyy-mm-dd hh:mm:ss'; var SearchRec: TSearchRec; begin FindFirst(AFile, faAnyFile, SearchRec); Result := FormatDateTime(Model, CovFileDate(SearchRec.FindData.ftLastWriteTime)); // CovFileDate(SearchRec.FindData.ftCreationTime)); // CovFileDate(SearchRec.FindData.ftLastAccessTime)); end; function MyBoolToStr(const ABoolean: Boolean): String; begin Result := TMyBooleanStringArray[ABoolean]; end; procedure SetStdDirectory(var Dir: String); begin if Dir[Length(Dir)] <> '\' then Dir := Dir + '\' end; function GetStdDirectory(const Dir: String): String; begin if Dir[Length(Dir)] <> '\' then Result := Dir + '\' else Result := Dir; end; procedure FindFiles(APath, AFilter: String; var AList: TList); var FSearchRec, DsearchRec: TSearchRec; Item: PSearchRec; FindResult: Integer; i: Integer; function IsDirNotation(ADirName: string): Boolean; begin Result := (ADirName = '.') or (ADirName = '..'); end; begin SetStdDirectory(APath); FindResult := FindFirst(APath + AFilter, faAnyFile + faHidden + faSysFile + faReadOnly, FSearchRec); try while FindResult = 0 do begin Item := @FSearchRec; AList.Add(Item); Item := nil; FindResult := FindNext(FSearchRec); end; FindResult := FindFirst(APath + '*.*', faDirectory, DSearchRec); while FindResult = 0 do begin if ((DSearchRec.Attr and faDirectory) = faDirectory) and not IsDirNotation(DsearchRec.Name) then FindFiles(APath + DSearchRec.Name, '*.*', AList); FindResult := FindNext(DsearchRec); end; finally FindClose(FSearchRec); end; end; procedure FindFileNames(APath, AFilter: String; var AList: TStrings); var FSearchRec, DsearchRec: TSearchRec; Item: PSearchRec; FindResult: Integer; i: Integer; function IsDirNotation(ADirName: string): Boolean; begin Result := (ADirName = '.') or (ADirName = '..'); end; begin SetStdDirectory(APath); FindResult := FindFirst(APath + AFilter, faAnyFile + faHidden + faSysFile + faReadOnly, FSearchRec); try while FindResult = 0 do begin AList.Add(APath + FSearchRec.Name); FindResult := FindNext(FSearchRec); end; FindResult := FindFirst(APath + '*.*', faDirectory, DSearchRec); while FindResult = 0 do begin if ((DSearchRec.Attr and faDirectory) = faDirectory) and not IsDirNotation(DsearchRec.Name) then FindFileNames(APath + DSearchRec.Name, '*.*', AList); FindResult := FindNext(DsearchRec); end; finally FindClose(FSearchRec); FindClose(DsearchRec); end; end; //得到字符串中的下一部分 function GetNextPart(var str: String; Sep1: char = char(9); Sep2: char = ','; Position: integer = 1): String; var intPos: integer; begin intPos := pos(Sep1, str); if (intPos = 0) and (Sep2 <> '') then intPos := pos(Sep2, str); if intPos > 0 then begin result := Copy(str, 1, intPos - 1); Delete(str, 1, intPos); end else begin result := str; str := ''; end; if (intPos > 0) and (Position > 1) then result := GetNextPart(str, Sep1, Sep2, Position - 1); end; //把字符串按某个字符串分隔 procedure DivStrToList(SrcStr, divStr: String; StrList: TStrings; bAllowEmpty: Boolean = False); var strTmp: String; iPos, iIndex: Integer; begin if Trim(SrcStr) = '' then Exit; if copy(srcStr, length(srcStr) - length(divStr) + 1, length(divStr)) <> divStr then {if srcStr[length(srcStr)] <> divStr} srcStr := srcStr + divStr; StrList.Clear; iPos := pos(divStr, SrcStr); while iPos <> 0 do begin strTmp := Copy(Srcstr, 1, iPos - 1); iIndex := Length(StrTmp); //得出字符串和有效宽度 if (strTmp = '') and (not bAllowEmpty) then else StrList.Add(strTmp); delete(SrcStr, 1, iIndex + length(divStr)); iPos := pos(divStr, SrcStr); end; end; procedure SetParentPath(var APath: String); var i: Integer; begin if APath[Length(APath)] = '\' then Delete(APath, Length(APath), 1); for i := Length(APath) downto 1 do if APath[i] = '\' then begin Delete(APath, i + 1, Length(APath) - 1); Exit; end; end; //ProE文件的修订版后缀形如".prt.1"、".prt.2",本方法查找最新修订版 function FindLastFileRevision(APath, AFilter: String; AName: String): string; var FSearchRec: TSearchRec; NameTmp, strTmp, upTmp: string; FindResult: Integer; Len, LenTmp, Rev, Max: Integer; procedure SetStdDirectory(var Dir: String); begin if Dir[Length(Dir)] <> '\' then Dir := Dir + '\' end; begin Result := AName; Max := 0; Len := Length(AName); NameTmp := UpperCase(AName); SetStdDirectory(APath); FindResult := FindFirst(APath + AFilter, faAnyFile + faHidden + faSysFile + faReadOnly, FSearchRec); try while FindResult = 0 do begin strTmp := FSearchRec.Name; LenTmp := Length(strTmp); if LenTmp > Len then begin upTmp := UpperCase(strTmp); Rev := pos(NameTmp, upTmp);//Rev只是临时使用 if (Rev = 1)then begin Rev := StrToIntDef(System.Copy(upTmp, Len + 2, LenTmp), 0); if Rev > Max then begin Max := Rev; Result := strTmp; end; end; end; FindResult := FindNext(FSearchRec); end; finally FindClose(FSearchRec); end; end; end.
unit setbit_1; interface implementation var V: array [4] of UInt8; procedure Test; begin setbit(V, 7 + 8*2, True); end; initialization Test(); finalization Assert(V[2] = 128); end.
{*******************************************************} { } { CodeGear Delphi Runtime Library } { Copyright(c) 2012-2018 Embarcadero Technologies, Inc. } { All rights reserved } { } {*******************************************************} unit System.Actions; // This module is taken out of the overall functionality of the module Vcl.ActnList.pas interface uses {$IF DEFINED(CLR)} System.ComponentModel.Design.Serialization, {$ENDIF} System.SysUtils, System.Classes, System.Generics.Collections, System.UITypes; type {$REGION 'Add-ons for future use'} /// <summary> The class of errors that appear when working with actions </summary> EActionError = class(Exception) end; /// <summary> /// Current status of the input field. This value can be used in different /// type-validators on your own. /// </summary> TStatusAction = ( /// <summary> /// Status invisible. The input fields are displayed as well as before the /// new properties. /// </summary> saNone, /// <summary> /// Displays the normal field in the normal state. /// </summary> saTrivial, /// <summary> /// This field contains the default value /// </summary> saDefault, /// <summary> /// Required field that has not yet filled. /// </summary> saRequiredEmpty, /// <summary> /// Required field is already filled. /// </summary> saRequired, /// <summary> /// Field been tested and it contains a valid value. /// </summary> saValid, /// <summary> /// The field has been tested and it contains an invalid value. /// </summary> saInvalid, /// <summary> /// Running some long operation. /// </summary> saWaiting, /// <summary> /// Perhaps the field contains an invalid value. /// </summary> saWarning, /// <summary> /// The field value is not used in this case. /// </summary> saUnused, /// <summary> /// This field value is calculated. /// </summary> saCalculated, /// <summary> /// The field value is incorrect /// </summary> saError, /// <summary> /// Another state (user defined) /// </summary> saOther); {$ENDREGION} TContainedActionList = class; TContainedActionListClass = class of TContainedActionList; ///<summary> This is the base class that implements the operation with /// a list of keyboard shortcuts. Should be established descendants /// of this class (see TContainedAction.CreateShortCutList) for each platform (VCL, FMX), which should be overridden the method Add.</summary> TCustomShortCutList = class(TStringList) private function GetShortCuts(Index: Integer): System.Classes.TShortCut; inline; public function IndexOfShortCut(const ShortCut: System.Classes.TShortCut): Integer; overload; function IndexOfShortCut(const ShortCut: string): Integer; overload; property ShortCuts[Index: Integer]: System.Classes.TShortCut read GetShortCuts; end; /// <summary> The ancestor class of actions, that contained in the TContainedActionList </summary> /// <remarks> It implements to work with common properties for all platforms (FMX, VCL).</remarks> TContainedAction = class(TBasicAction) private FCategory: string; FActionList: TContainedActionList; FSavedEnabledState: Boolean; FDisableIfNoHandler: Boolean; FAutoCheck: Boolean; FCaption: string; FChecked: Boolean; FEnabled: Boolean; FGroupIndex: Integer; FHelpContext: THelpContext; FHelpKeyword: string; FHelpType: THelpType; FHint: string; FVisible: Boolean; FShortCut: System.Classes.TShortCut; FSecondaryShortCuts: TCustomShortCutList; FImageIndex: System.UITypes.TImageIndex; FChecking: Boolean; FStatusAction: TStatusAction; FOnHint: THintEvent; function GetIndex: Integer; procedure SetIndex(Value: Integer); procedure SetCategory(const Value: string); function GetSecondaryShortCuts: TCustomShortCutList; procedure SetSecondaryShortCuts(const Value: TCustomShortCutList); function IsSecondaryShortCutsStored: Boolean; procedure SetActionList(AActionList: TContainedActionList); {$IF DEFINED(CLR)} class constructor Create; {$ENDIF} protected procedure ReadState(Reader: TReader); override; ///<summary>This method should create an instance of a class defined for each platform.</summary> function SecondaryShortCutsCreated: boolean; function CreateShortCutList: TCustomShortCutList; virtual; // This properties moved from TCustomAction property SavedEnabledState: Boolean read FSavedEnabledState write FSavedEnabledState; // This methods moved from TCustomAction procedure AssignTo(Dest: TPersistent); override; function HandleShortCut: Boolean; virtual; procedure SetAutoCheck(Value: Boolean); virtual; procedure SetCaption(const Value: string); virtual; procedure SetName(const Value: TComponentName); override; procedure SetChecked(Value: Boolean); virtual; procedure SetEnabled(Value: Boolean); virtual; procedure SetGroupIndex(const Value: Integer); virtual; procedure SetHelpContext(Value: THelpContext); virtual; procedure SetHelpKeyword(const Value: string); virtual; procedure SetHelpType(Value: THelpType); virtual; procedure SetHint(const Value: string); virtual; procedure SetVisible(Value: Boolean); virtual; procedure SetShortCut(Value: System.Classes.TShortCut); virtual; procedure SetImageIndex(Value: System.UITypes.TImageIndex); virtual; procedure SetStatusAction(const Value: TStatusAction); virtual; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; function GetParentComponent: TComponent; override; function HasParent: Boolean; override; procedure SetParentComponent(AParent: TComponent); override; property ActionList: TContainedActionList read FActionList write SetActionList; function Suspended: Boolean; override; property Index: Integer read GetIndex write SetIndex stored False; // This properties moved from TCustomAction property DisableIfNoHandler: Boolean read FDisableIfNoHandler write FDisableIfNoHandler default True; property AutoCheck: Boolean read FAutoCheck write SetAutoCheck default False; property Caption: string read FCaption write SetCaption; property Checked: Boolean read FChecked write SetChecked default False; property Enabled: Boolean read FEnabled write SetEnabled default True; property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0; property HelpContext: THelpContext read FHelpContext write SetHelpContext default 0; property HelpKeyword: string read FHelpKeyword write SetHelpKeyword; property HelpType: THelpType read FHelpType write SetHelpType default htKeyword; property Hint: string read FHint write SetHint; property Visible: Boolean read FVisible write SetVisible default True; property ShortCut: System.Classes.TShortCut read FShortCut write SetShortCut default 0; property SecondaryShortCuts: TCustomShortCutList read GetSecondaryShortCuts write SetSecondaryShortCuts stored IsSecondaryShortCutsStored; property ImageIndex: System.UITypes.TImageIndex read FImageIndex write SetImageIndex default -1; // This methods moved from TCustomAction function DoHint(var HintStr: string): Boolean; dynamic; property OnHint: THintEvent read FOnHint write FOnHint; /// <summary> /// Current status of the input field. /// </summary> /// <remarks> /// This new proposed property /// </remarks> property StatusAction: TStatusAction read FStatusAction write SetStatusAction; published property Category: string read FCategory write SetCategory; end; /// <summary> This class is designed to communicate with some of the object. </summary> /// <remarks> It implements to work with common properties for all platforms (FMX, VCL).</remarks> TContainedActionLink = class(TBasicActionLink) protected procedure DefaultIsLinked(var Result: Boolean); virtual; function IsCaptionLinked: Boolean; virtual; function IsCheckedLinked: Boolean; virtual; function IsEnabledLinked: Boolean; virtual; function IsGroupIndexLinked: Boolean; virtual; function IsHelpContextLinked: Boolean; virtual; function IsHelpLinked: Boolean; virtual; function IsHintLinked: Boolean; virtual; function IsImageIndexLinked: Boolean; virtual; function IsShortCutLinked: Boolean; virtual; function IsVisibleLinked: Boolean; virtual; function IsStatusActionLinked: Boolean; virtual; procedure SetAutoCheck(Value: Boolean); virtual; procedure SetCaption(const Value: string); virtual; procedure SetChecked(Value: Boolean); virtual; procedure SetEnabled(Value: Boolean); virtual; procedure SetGroupIndex(Value: Integer); virtual; procedure SetHelpContext(Value: THelpContext); virtual; procedure SetHelpKeyword(const Value: string); virtual; procedure SetHelpType(Value: THelpType); virtual; procedure SetHint(const Value: string); virtual; procedure SetImageIndex(Value: Integer); virtual; procedure SetShortCut(Value: System.Classes.TShortCut); virtual; procedure SetVisible(Value: Boolean); virtual; procedure SetStatusAction(const Value: TStatusAction); virtual; end; TContainedActionLinkClass = class of TContainedActionLink; TContainedActionClass = class of TContainedAction; TActionListState = (asNormal, asSuspended, asSuspendedEnabled); /// <summary> /// Auxiliary class for enumeration actions in TContainedActionList /// </summary> TActionListEnumerator = class private FIndex: Integer; FActionList: TContainedActionList; function GetCurrent: TContainedAction; inline; public constructor Create(AActionList: TContainedActionList); function MoveNext: Boolean; inline; property Current: TContainedAction read GetCurrent; end; TEnumActionListEvent = procedure(const Action: TContainedAction; var Done: boolean) of object; TEnumActionListRef = reference to procedure(const Action: TContainedAction; var Done: boolean); /// <summary> The base class for list of actions (without a published properties). /// It implements to work with common properties for all platforms (FMX, VCL). /// </summary> [RootDesignerSerializerAttribute('', '', False)] TContainedActionList = class(TComponent) private FActions: TList<TContainedAction>; FOnChange: TNotifyEvent; FOnExecute: TActionEvent; FOnUpdate: TActionEvent; FState: TActionListState; FOnStateChange: TNotifyEvent; function GetAction(Index: Integer): TContainedAction; procedure SetAction(Index: Integer; Value: TContainedAction); function GetActionCount: Integer; {$IF DEFINED(CLR)} class constructor Create; {$ENDIF} protected function ActionsCreated: Boolean; inline; procedure CheckActionsCreated; inline; procedure AddAction(const Action: TContainedAction); procedure RemoveAction(const Action: TContainedAction); procedure Change; virtual; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure SetChildOrder(Component: TComponent; Order: Integer); override; procedure SetState(const Value: TActionListState); virtual; property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnExecute: TActionEvent read FOnExecute write FOnExecute; property OnUpdate: TActionEvent read FOnUpdate write FOnUpdate; function SameCategory(const Source, Dest: string; const IncludeSubCategory: Boolean = True): Boolean; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; function ExecuteAction(Action: TBasicAction): Boolean; override; procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; function GetEnumerator: TActionListEnumerator; function UpdateAction(Action: TBasicAction): Boolean; override; function EnumByCategory(Proc: TEnumActionListEvent; const Category: string; const IncludeSubCategory: Boolean = True): boolean; overload; function EnumByCategory(Proc: TEnumActionListRef; const Category: string; const IncludeSubCategory: Boolean = True): boolean; overload; property Actions[Index: Integer]: TContainedAction read GetAction write SetAction; default; property ActionCount: Integer read GetActionCount; property State: TActionListState read FState write SetState default asNormal; property OnStateChange: TNotifyEvent read FOnStateChange write FOnStateChange; end; {$REGION 'Action registration. This code moved from Vcl.ActnList'} type {$IF DEFINED(CLR)} TEnumActionProcInfo = TObject; {$ELSE} TEnumActionProcInfo = Pointer; {$ENDIF} TEnumActionProc = procedure(const Category: string; ActionClass: TBasicActionClass; Info: TEnumActionProcInfo) of object; procedure RegisterActions(const CategoryName: string; const AClasses: array of TBasicActionClass; Resource: TComponentClass); procedure UnRegisterActions(const AClasses: array of TBasicActionClass); procedure EnumRegisteredActions(Proc: TEnumActionProc; Info: TEnumActionProcInfo; FrameworkType: string = ''); function CreateAction(AOwner: TComponent; ActionClass: TBasicActionClass; FrameworkType: string = ''): TBasicAction; {$IF DEFINED(CLR)} var vDesignAction: boolean; RegisterActionsProc: procedure(const CategoryName: string; const AClasses: array of TBasicActionClass; Resource: TComponentClass); UnRegisterActionsProc: procedure(const AClasses: array of TBasicActionClass); EnumRegisteredActionsProc: procedure(Proc: TEnumActionProc; Info: TObject; const FrameworkType: string); CreateActionProc: function(AOwner: TComponent; ActionClass: TBasicActionClass; const FrameworkType: string): TBasicAction; {$ELSE} var vDesignAction: boolean; const RegisterActionsProc: procedure(const CategoryName: string; const AClasses: array of TBasicActionClass; Resource: TComponentClass) = nil; UnRegisterActionsProc: procedure(const AClasses: array of TBasicActionClass) = nil; EnumRegisteredActionsProc: procedure(Proc: TEnumActionProc; Info: Pointer; const FrameworkType: string) = nil; CreateActionProc: function(AOwner: TComponent; ActionClass: TBasicActionClass; const FrameworkType: string): TBasicAction = nil; {$ENDIF} {$ENDREGION} {$REGION 'shortcuts registration'} function RegisterShortCut(ShortCut: TShortCut; Index: integer = -1): integer; function UnregisterShortCut(ShortCut: TShortCut): boolean; function RegisteredShortCutCount: integer; function RegisteredShortCut(Index: integer): TShortCut; {$ENDREGION} implementation uses {$IFDEF MACOS} Macapi.CoreFoundation, {$ENDIF MACOS} System.RTLConsts; {$REGION 'Action registration. This code moved from Vcl.ActnList'} procedure RegisterActions(const CategoryName: string; const AClasses: array of TBasicActionClass; Resource: TComponentClass); begin if Assigned(RegisterActionsProc) then RegisterActionsProc(CategoryName, AClasses, Resource) else raise EActionError.CreateRes({$IFNDEF CLR}@{$ENDIF}SInvalidActionRegistration); end; procedure UnRegisterActions(const AClasses: array of TBasicActionClass); begin if Assigned(UnRegisterActionsProc) then UnRegisterActionsProc(AClasses) else raise EActionError.CreateRes({$IFNDEF CLR}@{$ENDIF}SInvalidActionUnregistration); end; procedure EnumRegisteredActions(Proc: TEnumActionProc; Info: TEnumActionProcInfo; FrameworkType: string = ''); begin if Assigned(EnumRegisteredActionsProc) then EnumRegisteredActionsProc(Proc, Info, FrameworkType) else raise EActionError.CreateRes({$IFNDEF CLR}@{$ENDIF}SInvalidActionEnumeration); end; function CreateAction(AOwner: TComponent; ActionClass: TBasicActionClass; FrameworkType: string = ''): TBasicAction; var LDesignAction: boolean; begin if Assigned(CreateActionProc) then begin LDesignAction := vDesignAction; try vDesignAction := True; Result := CreateActionProc(AOwner, ActionClass, FrameworkType) finally vDesignAction := LDesignAction; end; end else raise EActionError.CreateRes({$IFNDEF CLR}@{$ENDIF}SInvalidActionCreation); end; {$ENDREGION} { TCustomShortCutList } function TCustomShortCutList.GetShortCuts(Index: Integer): System.Classes.TShortCut; begin Result := TShortCut(Objects[Index]); end; function TCustomShortCutList.IndexOfShortCut(const ShortCut: System.Classes.TShortCut): Integer; var I: Integer; begin Result := -1; for I := 0 to Count - 1 do if System.Classes.TShortCut(Objects[I]) = ShortCut then begin Result := I; break; end; end; function TCustomShortCutList.IndexOfShortCut(const ShortCut: string): Integer; var S: string; I: Integer; function StripText(S: string): string; begin if Length(S) = 1 then Result := S else Result := UpperCase(StringReplace(S, ' ', '', [rfReplaceAll])); end; begin Result := -1; if ShortCut = '' then Exit; S := StripText(ShortCut); if S <> '' then for I := 0 to Count - 1 do if StripText(Strings[I]) = S then begin Result := I; break; end; end; { TContainedAction } {$IF DEFINED(CLR)} class constructor TContainedAction.Create; begin GroupDescendentsWith(TContainedAction, TControl); end; {$ENDIF} constructor TContainedAction.Create(AOwner: TComponent); begin inherited; FEnabled := True; FVisible := True; FImageIndex := -1; end; destructor TContainedAction.Destroy; begin if Assigned(ActionList) then ActionList.RemoveAction(Self); FreeAndNil(FSecondaryShortCuts); inherited; end; procedure TContainedAction.AssignTo(Dest: TPersistent); begin if Dest is TContainedAction then begin TContainedAction(Dest).AutoCheck := AutoCheck; TContainedAction(Dest).Caption := Caption; TContainedAction(Dest).Checked := Checked; TContainedAction(Dest).Enabled := Enabled; TContainedAction(Dest).GroupIndex := GroupIndex; TContainedAction(Dest).HelpContext := HelpContext; TContainedAction(Dest).HelpKeyword := HelpKeyword; TContainedAction(Dest).HelpType := HelpType; TContainedAction(Dest).Hint := Hint; TContainedAction(Dest).Visible := Visible; TContainedAction(Dest).ShortCut := ShortCut; if TContainedAction(Dest).SecondaryShortCuts <> nil then begin if SecondaryShortCuts = nil then TContainedAction(Dest).SecondaryShortCuts.Clear else TContainedAction(Dest).SecondaryShortCuts := SecondaryShortCuts; end; TContainedAction(Dest).ImageIndex := ImageIndex; TContainedAction(Dest).StatusAction := StatusAction; TContainedAction(Dest).Tag := Tag; TContainedAction(Dest).OnExecute := OnExecute; TContainedAction(Dest).OnHint := OnHint; TContainedAction(Dest).OnUpdate := OnUpdate; TContainedAction(Dest).OnChange := OnChange; end else if Dest = nil then begin raise EActionError.CreateFMT(SParamIsNil, ['Dest']); end else inherited AssignTo(Dest); end; function TContainedAction.GetIndex: Integer; begin if (ActionList <> nil) and (ActionList.FActions <> nil) then Result := ActionList.FActions.IndexOf(Self) else Result := -1; end; procedure TContainedAction.SetIndex(Value: Integer); var CurIndex, Count: Integer; begin CurIndex := GetIndex; if CurIndex >= 0 then begin Count := ActionList.FActions.Count; if Value < 0 then Value := 0; if Value >= Count then Value := Count - 1; if Value <> CurIndex then begin ActionList.FActions.Delete(CurIndex); ActionList.FActions.Insert(Value, Self); end; end; end; function TContainedAction.GetParentComponent: TComponent; begin if ActionList <> nil then Result := ActionList else Result := inherited GetParentComponent; end; procedure TContainedAction.SetParentComponent(AParent: TComponent); begin if not(csLoading in ComponentState) and (AParent is TContainedActionList) then ActionList := TContainedActionList(AParent); end; function TContainedAction.HandleShortCut: Boolean; begin Result := Execute; end; function TContainedAction.HasParent: Boolean; begin if ActionList <> nil then Result := True else Result := inherited HasParent; end; procedure TContainedAction.ReadState(Reader: TReader); begin inherited ReadState(Reader); if Reader.Parent is TContainedActionList then ActionList := TContainedActionList(Reader.Parent); end; procedure TContainedAction.SetActionList(AActionList: TContainedActionList); begin if AActionList <> ActionList then begin if ActionList <> nil then ActionList.RemoveAction(Self); if AActionList <> nil then AActionList.AddAction(Self); end; end; procedure TContainedAction.SetCategory(const Value: string); begin if Value <> Category then begin FCategory := Value; if Assigned(ActionList) then begin ActionList.Change; end; end; end; procedure TContainedAction.SetAutoCheck(Value: Boolean); var I: Integer; begin if Value <> FAutoCheck then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetAutoCheck(Value); FAutoCheck := Value; Change; end; end; procedure TContainedAction.SetCaption(const Value: string); var I: Integer; begin if Value <> FCaption then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetCaption(Value); FCaption := Value; Change; end; end; procedure TContainedAction.SetName(const Value: TComponentName); var ChangeText: Boolean; begin ChangeText := (Name = Caption) and ((Owner = nil) or not(csLoading in Owner.ComponentState)); inherited SetName(Value); { Don't update caption to name if we've got clients connected. } if ChangeText and (ClientCount = 0) then Caption := Value; end; procedure TContainedAction.SetChecked(Value: Boolean); var I: Integer; Action: TContainedAction; begin if FChecking then Exit; FChecking := True; try if Value <> FChecked then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetChecked(Value); FChecked := Value; if (FGroupIndex > 0) and FChecked and (ActionList <> nil) then for I := 0 to ActionList.ActionCount - 1 do begin Action := ActionList.Actions[I]; if (Action <> Self) and (Action.FGroupIndex = FGroupIndex) then Action.Checked := False; end; Change; end; finally FChecking := False; end; end; procedure TContainedAction.SetEnabled(Value: Boolean); var I: Integer; begin if Value <> FEnabled then begin if Assigned(ActionList) then begin if ActionList.State = asSuspended then begin FEnabled := Value; Exit; end else if (ActionList.State = asSuspendedEnabled) then Value := True; end; for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetEnabled(Value); FEnabled := Value; Change; end; end; procedure TContainedAction.SetGroupIndex(const Value: Integer); var I: Integer; Action: TContainedAction; NewChecked: Boolean; begin if Value <> FGroupIndex then begin NewChecked := FChecked; // We carry out checks. If there is Action with the same value GroupIndex, // you must reset the current value of the Checked. if (Value > 0) and NewChecked and (ActionList <> nil) then for I := 0 to ActionList.ActionCount - 1 do begin Action := ActionList.Actions[I]; if (Action <> Self) and (Action.FGroupIndex = Value) and (Action.Checked) then begin NewChecked := False; break; end; end; for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then begin if NewChecked <> FChecked then TContainedActionLink(Clients[I]).SetChecked(NewChecked); TContainedActionLink(Clients[I]).SetGroupIndex(Value); end; FChecked := NewChecked; FGroupIndex := Value; Change; end; end; procedure TContainedAction.SetHelpContext(Value: THelpContext); var I: Integer; begin if Value <> FHelpContext then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetHelpContext(Value); FHelpContext := Value; Change; end; end; procedure TContainedAction.SetHelpKeyword(const Value: string); var I: Integer; begin if Value <> FHelpKeyword then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetHelpKeyword(Value); FHelpKeyword := Value; Change; end; end; procedure TContainedAction.SetHelpType(Value: THelpType); var I: Integer; begin if Value <> FHelpType then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetHelpType(Value); FHelpType := Value; Change; end; end; procedure TContainedAction.SetHint(const Value: string); var I: Integer; begin if Value <> FHint then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetHint(Value); FHint := Value; Change; end; end; procedure TContainedAction.SetVisible(Value: Boolean); var I: Integer; begin if Value <> FVisible then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetVisible(Value); FVisible := Value; Change; end; end; function TContainedAction.Suspended: Boolean; begin Result := (ActionList <> nil) and (ActionList.State <> asNormal); end; procedure TContainedAction.SetShortCut(Value: System.Classes.TShortCut); var I: Integer; begin if Value <> FShortCut then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetShortCut(Value); FShortCut := Value; Change; end; end; function TContainedAction.CreateShortCutList: TCustomShortCutList; begin // This method is implemented in descendant classes. Result := nil; end; function TContainedAction.SecondaryShortCutsCreated: boolean; begin result := FSecondaryShortCuts <> nil; end; function TContainedAction.GetSecondaryShortCuts: TCustomShortCutList; begin if FSecondaryShortCuts = nil then FSecondaryShortCuts := CreateShortCutList; Result := FSecondaryShortCuts; end; procedure TContainedAction.SetSecondaryShortCuts(const Value: TCustomShortCutList); begin if FSecondaryShortCuts = nil then FSecondaryShortCuts := CreateShortCutList; FSecondaryShortCuts.Assign(Value); end; function TContainedAction.IsSecondaryShortCutsStored: Boolean; begin Result := Assigned(FSecondaryShortCuts) and (FSecondaryShortCuts.Count > 0); end; function TContainedAction.DoHint(var HintStr: string): Boolean; begin Result := True; if Assigned(FOnHint) then FOnHint(HintStr, Result); end; procedure TContainedAction.SetImageIndex(Value: System.UITypes.TImageIndex); var I: Integer; begin if Value <> FImageIndex then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetImageIndex(Value); FImageIndex := Value; Change; end; end; procedure TContainedAction.SetStatusAction(const Value: TStatusAction); var I: Integer; begin if Value <> FStatusAction then begin for I := 0 to ClientCount - 1 do if Clients[I] is TContainedActionLink then TContainedActionLink(Clients[I]).SetStatusAction(Value); FStatusAction := Value; Change; end; end; { TActionListEnumerator } constructor TActionListEnumerator.Create(AActionList: TContainedActionList); begin if AActionList = nil then raise EActionError.CreateFMT(SParamIsNil, ['AActionList']); inherited Create; FIndex := -1; FActionList := AActionList; end; function TActionListEnumerator.GetCurrent: TContainedAction; begin Result := FActionList[FIndex]; end; function TActionListEnumerator.MoveNext: Boolean; begin Result := FIndex < FActionList.ActionCount - 1; if Result then Inc(FIndex); end; { TContainedActionList } {$IF DEFINED(CLR)} class constructor TContainedActionList.Create; begin GroupDescendentsWith(TContainedActionList, TControl); end; {$ENDIF} constructor TContainedActionList.Create(AOwner: TComponent); begin inherited Create(AOwner); FActions := TList<TContainedAction>.Create; FState := asNormal; end; destructor TContainedActionList.Destroy; begin if FActions <> nil then while FActions.Count > 0 do {$IF not Defined(AUTOREFCOUNT)} FActions.Last.Free; {$ELSE} FActions.Last.ActionList := nil; {$ENDIF} FreeAndNil(FActions); inherited; end; procedure TContainedActionList.CheckActionsCreated; begin if not ActionsCreated then raise EActionError.CreateFMT(SParamIsNil, ['Actions']); end; function TContainedActionList.ActionsCreated: Boolean; begin Result := FActions <> nil; end; procedure TContainedActionList.AddAction(const Action: TContainedAction); begin CheckActionsCreated; if Action = nil then raise EActionError.CreateFMT(SParamIsNil, ['Action']); FActions.Add(Action); Action.FActionList := Self; Action.FreeNotification(Self); end; procedure TContainedActionList.Change; var I: Integer; begin if ActionsCreated then begin if Assigned(FOnChange) then FOnChange(Self); for I := 0 to FActions.Count - 1 do FActions.List[I].Change; end; end; function TContainedActionList.SameCategory(const Source, Dest: string; const IncludeSubCategory: Boolean = True): Boolean; begin if IncludeSubCategory and (Source.Length < Dest.Length) and (Dest.Chars[Source.Length] = '.') then Result := String.Compare(Source, 0, Dest, 0, Source.Length, True) = 0 else Result := String.Compare(Source, Dest, True) = 0; end; function TContainedActionList.EnumByCategory(Proc: TEnumActionListEvent; const Category: string; const IncludeSubCategory: Boolean = True): boolean; begin Result := False; if Assigned(Proc) then Result := EnumByCategory(procedure(const Action: TContainedAction; var Done: boolean) begin Proc(Action, Done); end, Category, IncludeSubCategory); end; function TContainedActionList.EnumByCategory(Proc: TEnumActionListRef; const Category: string; const IncludeSubCategory: Boolean = True): boolean; var A: TContainedAction; Tmp: TList<TContainedAction>; begin Result := False; if Assigned(Proc) then begin Tmp := TList<TContainedAction>.Create; try for A in self do if SameCategory(Category, A.Category, IncludeSubCategory) then Tmp.Add(A); for A in Tmp do begin Proc(A, Result); if Result then Break; end; finally FreeAndNil(Tmp); end; end; end; function TContainedActionList.ExecuteAction(Action: TBasicAction): Boolean; begin CheckActionsCreated; Result := False; if Assigned(FOnExecute) then FOnExecute(Action, Result); end; function TContainedActionList.UpdateAction(Action: TBasicAction): Boolean; begin CheckActionsCreated; Result := False; if Assigned(FOnUpdate) then FOnUpdate(Action, Result); end; function TContainedActionList.GetAction(Index: Integer): TContainedAction; begin CheckActionsCreated; Result := FActions[Index]; end; procedure TContainedActionList.SetAction(Index: Integer; Value: TContainedAction); begin CheckActionsCreated; FActions[Index].Assign(Value); end; function TContainedActionList.GetActionCount: Integer; begin if FActions <> nil then Result := FActions.Count else Result := 0; end; procedure TContainedActionList.GetChildren(Proc: TGetChildProc; Root: TComponent); var I: Integer; Action: TContainedAction; begin CheckActionsCreated; if @Proc = nil then raise EActionError.CreateFMT(SParamIsNil, ['Proc']); for I := 0 to FActions.Count - 1 do begin Action := FActions.List[I]; if Action.Owner = Root then Proc(Action); end; end; function TContainedActionList.GetEnumerator: TActionListEnumerator; begin Result := TActionListEnumerator.Create(Self); end; procedure TContainedActionList.Notification(AComponent: TComponent; Operation: TOperation); begin inherited Notification(AComponent, Operation); if Operation = opRemove then begin if (AComponent is TContainedAction) then RemoveAction(TContainedAction(AComponent)); end; end; procedure TContainedActionList.RemoveAction(const Action: TContainedAction); begin if (FActions <> nil) and (FActions.Remove(Action) >= 0) then begin Action.RemoveFreeNotification(Self); Action.FActionList := nil; end; end; procedure TContainedActionList.SetChildOrder(Component: TComponent; Order: Integer); begin if (FActions <> nil) and (FActions.IndexOf(TContainedAction(Component)) >= 0) then (Component as TContainedAction).Index := Order; end; procedure TContainedActionList.SetState(const Value: TActionListState); var I: Integer; Action: TContainedAction; OldState: TActionListState; begin if FState <> Value then begin CheckActionsCreated; OldState := FState; FState := Value; try if State <> asSuspended then for I := 0 to FActions.Count - 1 do if FActions.List[I] <> nil then begin Action := FActions.List[I]; case Value of asNormal: begin if OldState = asSuspendedEnabled then Action.Enabled := Action.SavedEnabledState; Action.Update; end; asSuspendedEnabled: begin Action.SavedEnabledState := Action.Enabled; Action.Enabled := True; end; end; end; finally if Assigned(FOnStateChange) then FOnStateChange(Self); end; end; end; {$REGION 'implementation of TActionLink (is simple)'} { TContainedActionLink } procedure TContainedActionLink.DefaultIsLinked(var Result: Boolean); begin Result := Action is TContainedAction; end; function TContainedActionLink.IsCaptionLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsCheckedLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsEnabledLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsGroupIndexLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsHelpContextLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsHelpLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsHintLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsImageIndexLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsShortCutLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsVisibleLinked: Boolean; begin DefaultIsLinked(Result); end; function TContainedActionLink.IsStatusActionLinked: Boolean; begin DefaultIsLinked(Result); end; procedure TContainedActionLink.SetAutoCheck(Value: Boolean); begin end; procedure TContainedActionLink.SetCaption(const Value: string); begin end; procedure TContainedActionLink.SetChecked(Value: Boolean); begin end; procedure TContainedActionLink.SetEnabled(Value: Boolean); begin end; procedure TContainedActionLink.SetGroupIndex(Value: Integer); begin end; procedure TContainedActionLink.SetHelpContext(Value: THelpContext); begin end; procedure TContainedActionLink.SetHelpKeyword(const Value: string); begin end; procedure TContainedActionLink.SetHelpType(Value: THelpType); begin end; procedure TContainedActionLink.SetHint(const Value: string); begin end; procedure TContainedActionLink.SetImageIndex(Value: Integer); begin end; procedure TContainedActionLink.SetShortCut(Value: System.Classes.TShortCut); begin end; procedure TContainedActionLink.SetVisible(Value: Boolean); begin end; procedure TContainedActionLink.SetStatusAction(const Value: TStatusAction); begin end; {$ENDREGION} {$REGION 'shortcuts registration'} var vShortCuts: TList<TShortCut>; function RegisterShortCut(ShortCut: TShortCut; Index: integer = -1): integer; begin Result := -1; if ShortCut > 0 then begin if not Assigned(vShortCuts) then begin vShortCuts := TList<TShortCut>.Create; end; if vShortCuts.IndexOf(ShortCut) < 0 then begin if (Index >= 0) and (Index < vShortCuts.Count) then begin vShortCuts.Insert(Index, ShortCut); Result := Index; end else Result := vShortCuts.Add(ShortCut); end; end; end; function UnregisterShortCut(ShortCut: TShortCut): boolean; var Index: integer; begin Result := False; if (ShortCut > 0) and (Assigned(vShortCuts)) then begin Index := vShortCuts.IndexOf(ShortCut); if Index >= 0 then begin vShortCuts.Delete(Index); if vShortCuts.Count = 0 then FreeAndNil(vShortCuts); Result := True; end; end; end; function RegisteredShortCutCount: integer; begin if (Assigned(vShortCuts)) then Result := vShortCuts.Count else Result := 0; end; function RegisteredShortCut(Index: integer): TShortCut; begin if (Index >= 0) and (Index < RegisteredShortCutCount) then Result := vShortCuts.Items[Index] else raise ERangeError.CreateFmt(SListIndexError, [Index]); end; {$ENDREGION} initialization vShortCuts := nil; vDesignAction := False; finalization FreeAndNil(vShortCuts); end.
{******************************************************************************* * * * TksAppEvents - Application Events Component * * * * https://bitbucket.org/gmurt/kscomponents * * * * Copyright 2017 Graham Murt * * * * email: graham@kernow-software.co.uk * * * * 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 ksAppEvents; interface {$I ksComponents.inc} uses FMX.Types, FMX.Platform, Classes; type [ComponentPlatformsAttribute( pidWin32 or pidWin64 or {$IFDEF XE8_OR_NEWER} pidiOSDevice32 or pidiOSDevice64 {$ELSE} pidiOSDevice {$ENDIF} or {$IFDEF XE10_3_OR_NEWER} pidiOSSimulator32 or pidiOSSimulator64 {$ELSE} pidiOSSimulator {$ENDIF} or {$IFDEF XE10_3_OR_NEWER} pidAndroid32Arm or pidAndroid64Arm {$ELSE} pidAndroid {$ENDIF} )] TksAppEvents = class(TComponent) private FFMXApplicationEventService: IFMXApplicationEventService; FFinishedLaunching: TNotifyEvent; FBecameActive: TNotifyEvent; FEnteredBackground: TNotifyEvent; FWillBecomeForeground: TNotifyEvent; FWillTerminate: TNotifyEvent; FLowMemory: TNotifyEvent; function HandleAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean; public constructor Create(AOwner: TComponent); override; published property OnFinishedLaunching: TNotifyEvent read FFinishedLaunching write FFinishedLaunching; property OnBecameActive: TNotifyEvent read FBecameActive write FBecameActive; property OnEnteredBackground: TNotifyEvent read FEnteredBackground write FEnteredBackground; property WillBecomeForeground: TNotifyEvent read FWillBecomeForeground write FWillBecomeForeground; property WillTerminate: TNotifyEvent read FWillTerminate write FWillTerminate; property OnLowMemory: TNotifyEvent read FLowMemory write FLowMemory; end; //{$R *.dcr} procedure Register; implementation uses SysUtils, ksCommon, System.TypInfo; procedure Register; begin RegisterComponents('Kernow Software FMX', [TksAppEvents]); end; { TksSlideMenuAppearence } constructor TksAppEvents.Create(AOwner: TComponent); begin inherited; if TPlatformServices.Current.SupportsPlatformService(IFMXApplicationEventService, IInterface(FFMXApplicationEventService)) then FFMXApplicationEventService.SetApplicationEventHandler(HandleAppEvent); end; function TksAppEvents.HandleAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean; begin case AAppEvent of TApplicationEvent.FinishedLaunching: if Assigned(FFinishedLaunching) then FFinishedLaunching(Self); TApplicationEvent.BecameActive: if Assigned(FBecameActive) then FBecameActive(Self); TApplicationEvent.EnteredBackground: if Assigned(FEnteredBackground) then FEnteredBackground(Self); TApplicationEvent.WillBecomeForeground: if Assigned(FWillBecomeForeground) then FWillBecomeForeground(Self); TApplicationEvent.WillBecomeInactive: if Assigned(FFinishedLaunching) then FFinishedLaunching(Self); TApplicationEvent.WillTerminate: if Assigned(FWillTerminate) then FWillTerminate(Self); TApplicationEvent.LowMemory: if Assigned(FLowMemory) then FLowMemory(Self); end; Result := True; end; end.
unit UViewImg; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Objects, FMX.Platform, System.Math, FMX.ExtCtrls, FMX.Ani, FMX.Effects, FMX.Layouts, System.IOUtils, Effect; type TViewImage = class(TBitMap) private FileName : string; FileDate : TDateTime; function GetSize(SqSide : Single) : TPointF; function GetRect : TRectF; end; TViewImg = class(TForm) ToolBar: TToolBar; TrackPan: TPanel; ScanAni: TAniIndicator; TrackBar: TTrackBar; Grid: TPanel; sysClose: TButton; sysMax: TButton; sysMin: TButton; ImClose: TImage; ImMax: TImage; ImMin: TImage; StatusBar: TPanel; SizeGrip: TSizeGrip; Shadow: TImage; ViewImage: TImageViewer; BlurEffect: TBlurEffect; Effects: TButton; RotCountClockWise: TCornerButton; RotClockWise: TCornerButton; ImClockWise: TImage; ImCountClockWise: TImage; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormActivate(Sender: TObject); procedure sysCloseClick(Sender: TObject); procedure sysmaxClick(Sender: TObject); procedure sysMinClick(Sender: TObject); procedure GridPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); procedure GridResize(Sender: TObject); procedure GridMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure TrackBarMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure ToolBarMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure StatusBarPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); procedure EffectsClick(Sender: TObject); procedure RotClockWiseClick(Sender: TObject); procedure RotCountClockWiseClick(Sender: TObject); private PicOfs : integer; NewTopOfs : Single; HeadHt, FootHt : Single; ImageWidth : Single; ColWidth : integer; Cols : integer; LastInd : integer; ImgList : TStringList; Selected : integer; SelectedChanged : boolean; TopOfs : Single; LastRow : integer; LastPaintInd : integer; RowHeights : array[0..1000] of Single; BMP : TBitMap; MinSize : integer; DefPageRows : integer; SelectColor : TAlphaColor; FrameColor : TAlphaColor; ViewDir : string; ViewFileName : string; GraphList : TStringList; Handled : boolean; function OutHeight(Ind : integer) : Single; procedure ScanEnd(Sender: TObject); procedure UpdateList(Ind : integer); function ImageExists(I : integer) : boolean; procedure SetHeights(FromInd, ToInd : integer); procedure DrawCell(Ind : Integer; Rect: TRectF); procedure PrepareBMP; procedure TrackChanged(Sender: TObject); procedure PlaceImage; procedure LoadImage(FileName : string); public procedure RunScan; procedure KeyDown(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState); override; procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; end; TScanThread = class(TThread) private MinSize : Int64; ImageWidth: Single; Image : TViewImage; ExtList : TStringList; Form : TViewImg; procedure AddFolder; public constructor Create; destructor Destroy; override; procedure Execute; override; end; procedure DisplayImage(const AFileName : string; AGraphList : TStringList); var ViewImg: TViewImg; implementation {$R *.fmx} var ScanDir : TScanThread = nil; Scanning : boolean = False; procedure DisplayImage(const AFileName : string; AGraphList : TStringList); var F : TCustomForm; Image : TViewImage; begin ViewImg := TViewImg.Create(Application); with ViewImg do try F := TCustomForm(Application.MainForm); SetBounds(F.Left, F.Top, F.Width, F.Height); StyleBook := F.StyleBook; ViewDir := ExtractFileDir(AFileName); ViewFileName := AFileName; Image := TViewImage.Create(0, 0); Image.LoadThumbnailFromFile(AFileName, ImageWidth, ImageWidth); Image.FileName := AFileName; FileAge(AFileName, Image.FileDate); ImgList.AddObject(Image.FileName, Image); Selected := 0; LoadImage(ViewFileName); GraphList := AGraphList; RunScan; ShowModal; finally Free; end; end; procedure TViewImg.LoadImage(FileName : string); begin with ViewImage.Bitmap do begin Handled := False; LoadFromFile(FileName); PlaceImage; end; end; procedure TViewImg.PlaceImage; var MaxHt : Single; ShadSize : Single; begin with ViewImage do begin ShadSize := System.Math.Min(Bitmap.Width, Bitmap.Height) / 4; if ShadSize > 50 then ShadSize := 50; MaxHt := Self.Height - ToolBar.Height - StatusBar.Height; if (Bitmap.Width + ShadSize < Grid.Position.X) and (Bitmap.Height + ShadSize < MaxHt) and not Handled then begin ViewImage.Align := TAlignLayout.alNone; ViewImage.Position.Point := PointF((Grid.Position.X - Bitmap.Width - ShadSize) / 2, (MaxHt - Bitmap.Height - ShadSize) / 2 + ShadSize + ToolBar.Height); ViewImage.Width := Bitmap.Width + 4; ViewImage.Height := Bitmap.Height + 4; ViewImage.HScrollBar.Visible := False; ViewImage.VScrollBar.Visible := False; Shadow.Visible := True; Shadow.BitMap.Assign(ViewImage.Bitmap); Shadow.BitMap.SetSize(Bitmap.Width, Bitmap.Height); Shadow.Width := Bitmap.Width; Shadow.Height := Bitmap.Height; Shadow.Position.Point := PointF(ViewImage.Position.X + ShadSize, ViewImage.Position.Y - ShadSize); end else if (Bitmap.Width < Grid.Position.X) and (Bitmap.Height < MaxHt) and not Handled then begin Shadow.Visible := False; ViewImage.Align := TAlignLayout.alNone; ViewImage.Position.Point := PointF((Grid.Position.X - Bitmap.Width) / 2, (MaxHt - Bitmap.Height) / 2 + ToolBar.Height); ViewImage.Width := Bitmap.Width + 4; ViewImage.Height:= Bitmap.Height + 4; ViewImage.HScrollBar.Visible := False; ViewImage.VScrollBar.Visible := False; end else begin Shadow.Visible := False; ViewImage.HScrollBar.Visible := Bitmap.Width > Grid.Position.X; ViewImage.VScrollBar.Visible := Bitmap.Height > MaxHt; ViewImage.Align := TAlignLayout.alClient; end; end; end; procedure NullCorners(Image : TImage); begin with Image, BitMap do begin Pixels[0,0] := TAlphaColorRec.Null; Pixels[1,0] := TAlphaColorRec.Null; Pixels[0,1] := TAlphaColorRec.Null; Pixels[Width - 1,0] := TAlphaColorRec.Null; Pixels[Width - 1,1] := TAlphaColorRec.Null; Pixels[Width - 2,0] := TAlphaColorRec.Null; Pixels[Width - 1,Height - 1] := TAlphaColorRec.Null; Pixels[Width - 1,Height - 2] := TAlphaColorRec.Null; Pixels[Width - 2,Height - 1] := TAlphaColorRec.Null; Pixels[0,Height - 1] := TAlphaColorRec.Null; Pixels[0,Height - 2] := TAlphaColorRec.Null; Pixels[1,Height - 1] := TAlphaColorRec.Null; BitMapChanged; end; end; function TViewImage.GetSize(SqSide : Single) : TPointF; begin if Height > Width then begin Result.Y := SqSide; Result.X := (SqSide * Width) / Height; end else begin Result.X := SqSide; Result.Y := (SqSide * Height) / Width; end; end; function TViewImage.GetRect : TRectF; begin Result := RectF(0, 0, Width, height); end; { TScanThread } constructor TScanThread.Create; begin inherited Create(True); ExtList := TStringList.Create; FreeOnTerminate := False; Priority := tpNormal; end; destructor TScanThread.Destroy; begin ExtList.Free; inherited; end; procedure TScanThread.AddFolder; var Ind : integer; begin with Form do begin if ImgList.IndexOf(Image.FileName) >= 0 then Exit; Ind := ImgList.AddObject(Image.FileName, Image); UpdateList(Ind); end; end; procedure TScanThread.Execute; procedure Scan(Dir : string); var F : TSearchRec; Ext, FileName : string; begin if FindFirst(Dir + TPath.DirectorySeparatorChar + '*' + TPath.ExtensionSeparatorChar + '*', faAnyFile, F) = 0 then begin repeat if Terminated then Break; if (F.Name = '') or (F.Name[ 1 ] = '.') then Continue; FileName := Dir + TPath.DirectorySeparatorChar + F.Name; if F.Attr and faDirectory <> 0 then else if F.Size > MinSize then begin Ext := LowerCase(ExtractFileExt(F.Name)); if Ext <> '' then Delete(Ext, 1, 1); if ExtList.IndexOf(Ext) <> -1 then begin Image := TViewImage.Create(0, 0); try Image.LoadThumbnailFromFile(FileName, ImageWidth, ImageWidth); Image.FileName := Dir + TPath.DirectorySeparatorChar + F.Name; Image.FileDate := F.TimeStamp; except Image.Free; end; Synchronize(AddFolder); end; end; until FindNext(F) <> 0; FindClose(F); end; end; begin Scan(Form.ViewDir); end; procedure TViewImg.EffectsClick(Sender: TObject); begin ShowEffects(ViewImage.Bitmap); end; procedure TViewImg.FormActivate(Sender: TObject); begin ; end; procedure TViewImg.FormCreate(Sender: TObject); begin BMP := TBitMap.Create(0, 0); LastInd := -1; MinSize := 5000; ImgList := TStringList.Create(True); ImgList.CaseSensitive := False; ScanDir:= TScanThread.Create; ColWidth := 150; PicOfs := 10; ImageWidth := ColWidth - 2 * PicOfs; Selected := -1; LastRow := -1; LastPaintInd := -1; SelectColor := TAlphaColorRec.Lime; FrameColor := TAlphaColorRec.DkGray; TrackBar.OnChange := TrackChanged; FootHt := 3; HeadHt := 3; TopOfs := 0; NewTopOfs := 0; NullCorners(imClose); NullCorners(imMax); NullCorners(imMin); GridResize(nil); end; procedure TViewImg.ScanEnd(Sender: TObject); begin ScanAni.Enabled := False; Scanning := False; UpdateList(ImgList.Count - 1); end; procedure TViewImg.RotClockWiseClick(Sender: TObject); begin if not Handled then begin Handled := True; PlaceImage; end; ViewImage.Bitmap.Rotate(90); end; procedure TViewImg.RotCountClockWiseClick(Sender: TObject); begin if not Handled then begin Handled := True; PlaceImage; end; ViewImage.Bitmap.Rotate(-90); end; procedure TViewImg.RunScan; begin if Scanning then Exit; // ScanAni.Visible := True; ScanAni.Enabled := True; Scanning := True; ScanDir.MinSize := MinSize; ScanDir.ImageWidth := ImageWidth; ScanDir.Form := Self; ScanDir.ExtList.Assign(GraphList); ScanDir.OnTerminate := ScanEnd; ScanDir.Start; end; procedure TViewImg.FormDestroy(Sender: TObject); begin ScanDir.Free; ImgList.Free; BMP.Free; end; procedure TViewImg.DrawCell(Ind : Integer; Rect: TRectF); var Size : TPointF; R : TRectF; Im: TViewImage; begin with BMP.Canvas do begin Im := TViewImage(ImgList.Objects[ Ind ]); Size := Im.GetSize(ImageWidth); R := TRectF.Create(PointF(Rect.Left + (Rect.Width - Size.X) / 2, Rect.Top + HeadHt + (Rect.Height - HeadHt - FootHt - Size.Y) / 2), Size.X, Size.Y); InflateRect(R, 1, 1); DrawRectSides(R, 1, 1, AllCorners, 1, AllSides, TCornerType.ctBevel); InflateRect(R, -1, -1); DrawBitmap(Im, Im.GetRect, R, 1); if Selected = Ind then begin Stroke.Color := SelectColor; InflateRect(Rect, -1, -1); DrawRectSides(Rect, 1, 1, AllCorners, 1, AllSides, TCornerType.ctBevel); Stroke.Color := FrameColor; end; end; end; procedure TViewImg.PrepareBMP; var I, J, Row, DY, Ind, Last, LastCol, ScanSize : integer; Rect, R : TRectF; Size : TPointF; SetMax : boolean; Tp, Ht, RowHeight, OfsTop, OfsBott : Single; begin DY := Round(NewTopOfs - TopOfs); SetMax := False; with BMP, Canvas do begin ScanSize := Width * 4; R := TRectF.Create(PointF(0, 0), Width, Height); if (Abs(DY) < Height) and not SelectedChanged then begin if DY < 0 then begin for I := Height + DY - 1 downto 0 do System.Move(Scanline[ I ][0], Scanline[ I - DY ][0], ScanSize); R := TRectF.Create(PointF(0, 0), Width, -DY); end else if DY > 0 then begin for I := DY to Height - 1 do System.Move(Scanline[ I ][0], Scanline[ I - DY ][0], ScanSize); R := TRectF.Create(PointF(0, Height - DY), Width, DY); end; UpdateHandles; BitmapChanged; end; SelectedChanged := True; SetClipRects([R]); ClearRect(R, TAlphaColorRec.Null); OfsBott := NewTopOfs + R.Bottom; OfsTop := NewTopOfs + R.Top; Ht := 0; Ind := 0; Row := 0; Last := ImgList.Count; while (Ind < Last) and (Ht < OfsBott) do begin if Row < LastRow then begin RowHeight := RowHeights[ Row ]; LastCol := Ind + Cols - 1; end else begin SetMax := True; RowHeight := 0; J := Ind + Cols; I := Ind; LastCol := I - 1; while I < J do begin if I >= Last then Break; if not ImageExists(I) then Dec(Last) else begin Size := TViewImage(ImgList.Objects[ I ]).GetSize(ImageWidth); RowHeight := System.Math.Max(RowHeight, Size.Y); LastCol := I; Inc(I); end; end; RowHeight := RowHeight + FootHt + HeadHt; RowHeights[ Row ] := RowHeight; LastRow := Row; end; Ht := Ht + RowHeight; if Ht > OfsTop then begin Tp := Ht - NewTopOfs - RowHeight; Rect := TRectF.Create(PointF(0, Tp), ColWidth, RowHeight); while Ind <= LastCol do with TViewImage(ImgList.Objects[ Ind ]) do begin DrawCell(Ind, Rect); if Ind > LastPaintInd then LastPaintInd := Ind; Inc(Ind); Rect.Offset(ColWidth, 0); end; end; Inc(Row); Ind := LastCol + 1; end; ExcludeClipRect(R); end; TopOfs := NewTopOfs; if SetMax and not TrackBar.IsTracking then TrackBar.Max := OutHeight(LastRow); end; function TViewImg.OutHeight(Ind : integer) : Single; begin Result := 0; while Ind >= 0 do begin Result := Result + RowHeights[ Ind ]; Dec(Ind); end; end; procedure TViewImg.KeyDown(var Key: Word; var KeyChar: System.WideChar; Shift: TShiftState); var DefPageItems : Integer; procedure NewSel(Sel : integer; Down : boolean); var SelRow, I : integer; R, Res : TRectF; Ht, RowHt : Single; begin if Sel >= ImgList.Count then Sel := ImgList.Count - 1 else if Sel < 0 then Sel := 0; SelectedChanged := Selected <> Sel; Selected := Sel; SelRow := Sel div Cols; Ht := 0; for I := 0 to SelRow - 1 do Ht := Ht + RowHeights[ I ]; RowHt := RowHeights[ SelRow ]; R := TRectF.Create(PointF(Grid.Position.X, Ht - TopOfs), ColWidth, RowHt); Res := TRectF.Intersect(Grid.LocalRect, R); if not (Res = R) then begin if Down then NewTopOfs := Ht + RowHt - Trunc(Grid.Height) else NewTopOfs := Ht; end; end; begin if ImgList.Count = 0 then begin inherited; Exit; end; DefPageItems := DefPageRows * Cols; NewTopOfs := TopOfs; SelectedChanged := True; case Key of VKLEFT : NewSel(Selected - 1, False); VKRIGHT: NewSel(Selected + 1, True); VKUP : begin NewSel(Selected - Cols, False); if SelectedChanged then with TViewImage(ImgList.Objects[ Selected ]) do LoadImage(FileName); end; VKDOWN : begin NewSel(Selected + Cols, True); if SelectedChanged then with TViewImage(ImgList.Objects[ Selected ]) do LoadImage(FileName); end; VKNEXT : NewSel(Selected + DefPageItems, True); VKPRIOR : if Selected >= DefPageItems then NewSel(Selected - DefPageItems, False); VKHOME : begin SelectedChanged := Selected <> 0; Selected := 0; NewTopOfs := 0; end; VKEND : NewSel((ImgList.Count - 1) - (ImgList.Count - 1) mod Cols, True); VKRETURN : if Selected >= 0 then with TViewImage(ImgList.Objects[ Selected ]) do LoadImage(FileName); else SelectedChanged := False; end; if SelectedChanged then Key := 0; inherited; if SelectedChanged then begin TrackBar.Value := Trunc(NewTopOfs); with Grid do InvalidateRect(LocalRect); end; end; procedure TViewImg.GridMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); var I, Ind : integer; Ht, Ofs, RowHeight : Single; begin Ofs := TopOfs + Y; I := 0; Ht := 0; Ind := Trunc(X / ColWidth); while True do begin RowHeight := RowHeights[ I ]; Ht := Ht + RowHeight; if Ind > LastPaintInd then Exit; if Ht > Ofs then begin Selected := Ind; SelectedChanged := True; with TViewImage(ImgList.Objects[ Selected ]) do LoadImage(FileName); NewTopOfs := TopOfs; with Grid do InvalidateRect(LocalRect); Exit; end; Inc(Ind, Cols); Inc(I); end; end; procedure TViewImg.GridPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); begin PrepareBMP; with Grid, Canvas do begin DrawBitmap(BMP, RectF(0, 0, BMP.Width, BMP.Height), ARect, 1); end; end; procedure TViewImg.GridResize(Sender: TObject); begin Cols := 1; Grid.Width := ColWidth; with BMP do begin Width := Trunc(Grid.Width); Height := Trunc(Grid.Height); with Canvas do begin Stroke.Color := FrameColor; Font.Family := 'Verdana'; Font.Size := 11; Font.Style := []; end; end; FillChar(RowHeights, SizeOf(RowHeights), #0); LastRow := -1; LastPaintInd := -1; TopOfs := 0; NewTopOfs := 0; DefPageRows := Trunc(BMP.Height / (ImageWidth + HeadHt + FootHt)); Handled := True; PlaceImage; end; procedure TViewImg.sysCloseClick(Sender: TObject); begin ScanDir.Terminate; ScanDir.WaitFor; Close; end; procedure TViewImg.sysmaxClick(Sender: TObject); begin if WindowState = TWindowState.wsNormal then WindowState := TWindowState.wsMaximized else WindowState := TWindowState.wsNormal; end; procedure TViewImg.sysMinClick(Sender: TObject); begin WindowState := TWindowState.wsMinimized; end; procedure TViewImg.SetBounds(ALeft, ATop, AWidth, AHeight: Integer); var Over : boolean; begin Over := (AWidth < 400) or (AHeight < 400); if Over then begin if AWidth < 400 then AWidth := 400; if AHeight < 400 then AHeight := 400; end; inherited SetBounds(ALeft, ATop, AWidth, AHeight); if Over then Abort; end; procedure TViewImg.SetHeights(FromInd, ToInd : integer); var I, J : integer; Size : TPointF; RowHeight : Single; begin J := FromInd mod Cols; if J = Cols - 1 then I := FromInd + 1 else I := FromInd - J; while I <= ToInd do begin LastRow := I div Cols; RowHeight := 0; J := System.Math.Min(I + Cols - 1, ToInd); while I <= J do with TViewImage(ImgList.Objects[ I ]) do begin Size := GetSize(ImageWidth); RowHeight := System.Math.Max(RowHeight, Size.Y); Inc(I); end; RowHeight := RowHeight + FootHt + HeadHt; RowHeights[ LastRow ] := RowHeight; I := J + 1; end; end; procedure TViewImg.StatusBarPaint(Sender: TObject; Canvas: TCanvas; const ARect: TRectF); var S : string; begin if Selected >= 0 then with Canvas, TViewImage(ImgList.Objects[ Selected ]) do begin Font.Family := 'Verdana'; Font.Size := 11; Font.Style := []; Fill.Color := SelectColor; Fill.Kind := TBrushKind.bkSolid; S := DateToStr(FileDate) + ' ' + FileName; FillText(ARect, S, False, 1, [], TTextAlign.taCenter); end; end; procedure TViewImg.ToolBarMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin StartWindowDrag; end; procedure TViewImg.TrackBarMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin TrackBar.Max := OutHeight(LastRow); end; procedure TViewImg.TrackChanged(Sender: TObject); begin NewTopOfs := TrackBar.Value; with Grid do InvalidateRect(LocalRect); end; function TViewImg.ImageExists(I : integer) : boolean; begin Result := True; with TViewImage(ImgList.Objects[ I ]) do if IsEmpty or (Width = 0) then try LoadThumbnailFromFile(FileName, ImageWidth, ImageWidth); if Width = 0 then Abort; FileAge(FileName, FileDate); except Result := False; ImgList.Delete(I); end; end; procedure TViewImg.UpdateList(Ind : integer); var I : integer; Ht : Single; FullPage, ItemOnGrid : boolean; begin I := LastInd + 1; while I <= Ind do begin if not ImageExists(I) then Dec(Ind) else Inc(I); end; SetHeights(LastInd, Ind); LastInd := Ind; Ht := OutHeight(LastRow); FullPage := (TopOfs = 0) and (Ht > Grid.Height) and (Ind mod Cols = Cols - 1); ItemOnGrid := (TopOfs > 0) and (Ht > TopOfs) and (Ht < TopOfs + Grid.Height); if ItemOnGrid or FullPage or (TopOfs = 0) then with Grid do InvalidateRect(LocalRect); if not TrackBar.IsTracking then TrackBar.Max := Ht; end; end.
unit frm_template; {$i xPL.inc} {$r *.lfm} interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, ActnList, Menus, Buttons, StdCtrls, RTTICtrls, LSControls, u_xPL_Collection, RxAboutDialog, Dlg_Template; type // TFrmTemplate ========================================================== TFrmTemplate = class(TDlgTemplate) acAbout: TAction; acInstalledApps: TAction; acCoreConfigure: TAction; acAppConfigure: TAction; lblLog: TLabel; lblModuleName: TTILabel; AppMenu: TMenuItem; FormMenu: TMainMenu; imgStatus: TLSImage; mnuCoreConfigure: TMenuItem; mnuAppConfigure: TMenuItem; xPLMenu: TMenuItem; mnuConfigure: TMenuItem; mnuAbout: TMenuItem; mnuNull4: TMenuItem; mnuNull3: TMenuItem; mnuClose: TMenuItem; mnuLaunch: TMenuItem; mnuAllApps: TMenuItem; mnuNull2: TMenuItem; AboutDlg: TRxAboutDialog; procedure acAboutExecute(Sender: TObject); procedure acCoreConfigureExecute(Sender: TObject); procedure acInstalledAppsExecute(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); private procedure acCommonToolsExecute(Sender : TObject); procedure AddSubMenuElmt(const aColl : TxPLCustomCollection; const aName : string); public procedure OnJoinedEvent; virtual; procedure OnLogEvent(const aString : string); virtual; end; implementation // ============================================================= uses frm_xplappslauncher , dlg_config , lcltype , u_xpl_gui_resource , u_xpl_custom_listener , u_xpl_application , u_xpl_heart_beater , u_xpl_settings , Process ; // TFrmTemplate =============================================================== procedure TFrmTemplate.FormCreate(Sender: TObject); var sl : TxPLCustomCollection; begin inherited; FormMenu.Images := DlgActions.Images; ImgStatus.Images := DlgActions.Images; ImgStatus.ImageIndex := K_IMG_XPL; lblModuleName.Link.TIObject := xPLApplication.Adresse; lblModuleName.Link.TIPropertyName:= 'RawxPL'; xPLApplication.OnLogEvent := @OnLogEvent; Caption := xPLApplication.AppName; sl := TxPLRegistrySettings(xPLApplication.Settings).GetxPLAppList; AddSubMenuElmt(sl,'basicset'); AddSubMenuElmt(sl,'vendfile'); AddSubMenuElmt(sl,'piedit'); AddSubMenuElmt(sl,'sender'); AddSubMenuElmt(sl,'logger'); sl.Free; acCoreConfigure.Visible := (xPLApplication is TxPLCustomListener); lblModuleName.Visible := acCoreConfigure.Visible; // This control has no meaning for non listener apps if acCoreConfigure.Visible then begin acCoreConfigure.ImageIndex := K_IMG_PREFERENCE; TxPLCustomListener(xPLApplication).OnxPLJoinedNet := @OnJoinedEvent; end; end; procedure TFrmTemplate.FormShow(Sender: TObject); begin inherited; acAppConfigure.Visible := Assigned(acAppConfigure.OnExecute); mnuConfigure.Visible := acAppConfigure.Visible or acCoreConfigure.Visible; end; procedure TFrmTemplate.acAboutExecute(Sender: TObject); const license = 'license.txt'; readme = 'readme.txt'; begin with AboutDlg do begin ApplicationTitle := xPLApplication.AppName; if FileExists(license) then LicenseFileName := license; if FileExists(readme) then AdditionalInfo.LoadFromFile(readme); Picture.Assign(Application.Icon); Execute; end; end; procedure TFrmTemplate.acCommonToolsExecute(Sender: TObject); begin with TProcess.Create(nil) do try Executable := TMenuItem(Sender).Hint; Execute; finally Free; end; end; procedure TFrmTemplate.acInstalledAppsExecute(Sender: TObject); begin ShowFrmAppLauncher; end; procedure TFrmTemplate.acCoreConfigureExecute(Sender: TObject); begin ShowDlgConfig; end; procedure TFrmTemplate.FormCloseQuery(Sender: TObject; var CanClose: boolean); begin CanClose := (Application.MessageBox('Do you want to quit ?', 'Confirm', MB_YESNO) = idYes) end; procedure TFrmTemplate.AddSubMenuElmt(const aColl : TxPLCustomCollection; const aName : string); var item : TxPLCollectionItem; path, version, nicename : string; aMenu : TMenuItem; begin item := aColl.FindItemName(aName); if assigned(item) then begin TxPLRegistrySettings(xPLApplication.Settings).GetAppDetail(item.Value,Item.DisplayName,path,version,nicename); aMenu := NewItem( nicename,0, false, (xPLApplication.Adresse.Device<>aName), @acCommonToolsExecute, 0, ''); aMenu.Hint := path; mnuLaunch.Add(aMenu); end; end; procedure TFrmTemplate.OnJoinedEvent; begin if TxPLCustomListener(xPLApplication).ConnectionStatus = connected then imgStatus.ImageIndex := K_IMG_RECONNECT else imgStatus.ImageIndex := K_IMG_DISCONNECT; end; procedure TFrmTemplate.OnLogEvent(const aString : string); begin LblLog.Caption := aString; end; end.
unit RecursiveTreeQuery; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, BaseQuery, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, Vcl.StdCtrls, TreeExcelDataModule, DSWrap, BaseEventsQuery; type TRecursiveTreeW = class(TDSWrap) private FAdded: TFieldWrap; FDeleted: TFieldWrap; FExternalID: TFieldWrap; FID: TFieldWrap; FParentExternalID: TFieldWrap; FParentID: TFieldWrap; FValue: TFieldWrap; procedure DoAfterOpen(Sender: TObject); public constructor Create(AOwner: TComponent); override; procedure HideNotAdded; procedure HideNotDeleted; function LocateByExternalID(const AExternalID: string; TestResult: Boolean = False): Boolean; overload; function LocateByExternalID(AParentExternalID: Variant; const AExternalID: string): Boolean; overload; function LocateByValue(AParentExternalID: Variant; const AValue: string): Boolean; property Added: TFieldWrap read FAdded; property Deleted: TFieldWrap read FDeleted; property ExternalID: TFieldWrap read FExternalID; property ID: TFieldWrap read FID; property ParentExternalID: TFieldWrap read FParentExternalID; property ParentID: TFieldWrap read FParentID; property Value: TFieldWrap read FValue; end; TQueryRecursiveTree = class(TQueryBaseEvents) FDUpdateSQL: TFDUpdateSQL; private FW: TRecursiveTreeW; procedure MarkAllAsDeleted; { Private declarations } protected function CreateDSWrap: TDSWrap; override; public constructor Create(AOwner: TComponent); override; procedure DeleteAll; procedure LoadDataFromExcelTable(ATreeExcelTable: TTreeExcelTable); property W: TRecursiveTreeW read FW; { Public declarations } end; implementation {$R *.dfm} uses NotifyEvents; constructor TQueryRecursiveTree.Create(AOwner: TComponent); begin inherited; FW := FDSWrap as TRecursiveTreeW; end; function TQueryRecursiveTree.CreateDSWrap: TDSWrap; begin Result := TRecursiveTreeW.Create(FDQuery); end; procedure TQueryRecursiveTree.DeleteAll; begin Assert(FDQuery.Active); if FDQuery.RecordCount = 0 then Exit; FDQuery.First; while not FDQuery.eof do begin try FDQuery.Delete; except FDQuery.Next; end; end; end; procedure TQueryRecursiveTree.LoadDataFromExcelTable(ATreeExcelTable : TTreeExcelTable); var AParentID: Variant; begin // DeleteAll; FDQuery.DisableControls; try // Помечаем все узлы на удаление MarkAllAsDeleted; ATreeExcelTable.First; ATreeExcelTable.CallOnProcessEvent; while not ATreeExcelTable.eof do begin // Если это корневая запись if ATreeExcelTable.ParentExternalID.IsNull then begin if not W.LocateByExternalID(NULL, ATreeExcelTable.ExternalID.AsString) then begin W.TryAppend; W.ExternalID.F.AsString := ATreeExcelTable.ExternalID.AsString; // Помечаем, что запись была добавлена W.Added.F.AsInteger := 1; end else W.TryEdit; end else begin // Ищем дочернюю запись if not W.LocateByExternalID(ATreeExcelTable.ParentExternalID.Value, ATreeExcelTable.ExternalID.AsString) then begin // Ищем родительскую запись по внешнему идентификатору W.LocateByExternalID(ATreeExcelTable.ParentExternalID.AsString, True); AParentID := W.PK.Value; W.TryAppend; W.ExternalID.F.AsString := ATreeExcelTable.ExternalID.AsString; W.ParentID.F.AsInteger := AParentID; W.ParentExternalID.F.AsString := ATreeExcelTable.ParentExternalID.AsString; // Помечаем, что запись была добавлена W.Added.F.AsInteger := 1; end else W.TryEdit; end; // Обновляем наименование W.Value.F.AsString := ATreeExcelTable.Value.AsString; // Помечаем, что эту запись не нужно удалять W.Deleted.F.AsInteger := 0; W.TryPost; ATreeExcelTable.Next; ATreeExcelTable.CallOnProcessEvent; end; finally FDQuery.EnableControls; end; end; procedure TQueryRecursiveTree.MarkAllAsDeleted; begin Assert(FDQuery.Active); // Включаем режим обновления только на клиенте FDQuery.OnUpdateRecord := DoOnQueryUpdateRecord; try FDQuery.First; while not FDQuery.eof do begin W.TryEdit; W.Deleted.F.AsInteger := 1; W.TryPost; FDQuery.Next; end; finally FDQuery.OnUpdateRecord := nil; end; end; constructor TRecursiveTreeW.Create(AOwner: TComponent); begin inherited; FID := TFieldWrap.Create(Self, 'ID', '', True); FAdded := TFieldWrap.Create(Self, 'Added'); FDeleted := TFieldWrap.Create(Self, 'Deleted'); FExternalID := TFieldWrap.Create(Self, 'ExternalID', 'Идентификатор'); FParentExternalID := TFieldWrap.Create(Self, 'ParentExternalID', 'Родительский идентификатор'); FParentID := TFieldWrap.Create(Self, 'ParentID'); FValue := TFieldWrap.Create(Self, 'Value', 'Наименование'); TNotifyEventWrap.Create(AfterOpen, DoAfterOpen, EventList); end; procedure TRecursiveTreeW.DoAfterOpen(Sender: TObject); begin SetFieldsRequired(False); Deleted.F.ReadOnly := False; Added.F.ReadOnly := False; Added.F.Visible := False; Deleted.F.Visible := False; ParentID.F.Visible := False; ID.F.Visible := False; end; procedure TRecursiveTreeW.HideNotAdded; begin DataSet.Filter := Format('%s = 1', [Added.FieldName]); DataSet.Filtered := True; end; procedure TRecursiveTreeW.HideNotDeleted; begin DataSet.Filter := Format('%s = 1', [Deleted.FieldName]); DataSet.Filtered := True; end; function TRecursiveTreeW.LocateByExternalID(const AExternalID: string; TestResult: Boolean = False): Boolean; begin Assert(not AExternalID.IsEmpty); // Ищем в ветви дерева внешний идентификатор Result := FDDataSet.LocateEx(ExternalID.FieldName, AExternalID, []); if TestResult then Assert(Result); end; function TRecursiveTreeW.LocateByExternalID(AParentExternalID: Variant; const AExternalID: string): Boolean; var AKeyFields: string; begin Assert(not AExternalID.IsEmpty); // Ищем в ветви дерева внешний идентификатор AKeyFields := Format('%s;%s', [ParentExternalID.FieldName, ExternalID.FieldName]); Result := FDDataSet.LocateEx(AKeyFields, VarArrayOf([AParentExternalID, AExternalID]), []); end; function TRecursiveTreeW.LocateByValue(AParentExternalID: Variant; const AValue: string): Boolean; var AKeyFields: string; begin Assert(not AValue.IsEmpty); // Ищем в ветви дерева наименование AKeyFields := Format('%s;%s', [ParentExternalID.FieldName, Value.FieldName]); Result := FDDataSet.LocateEx(AKeyFields, VarArrayOf([AParentExternalID, AValue]), [lxoCaseInsensitive]); end; end.
unit LineItemList; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, BaseGridDetail, Data.DB, RzButton, Vcl.StdCtrls, Vcl.Mask, RzEdit, Vcl.Grids, Vcl.DBGrids, RzDBGrid, RzLabel, Vcl.ExtCtrls, RzPanel, Vcl.DBCtrls, RzDBEdit, RzDBCmbo; type TfrmLineItemList = class(TfrmBaseGridDetail) Label2: TLabel; edLineItemName: TRzDBEdit; Label3: TLabel; mmDescription: TRzDBMemo; Label9: TLabel; dbluAccountClass: TRzDBLookupComboBox; procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); private { Private declarations } public { Public declarations } protected function EntryIsValid: boolean; override; function NewIsAllowed: boolean; override; function EditIsAllowed: boolean; override; procedure SearchList; override; procedure BindToObject; override; end; implementation {$R *.dfm} uses AccountingAuxData, IFinanceDialogs; { TfrmAcctGroupList } procedure TfrmLineItemList.BindToObject; begin inherited; end; function TfrmLineItemList.EditIsAllowed: boolean; begin end; function TfrmLineItemList.EntryIsValid: boolean; var error: string; begin if Trim(edLineItemName.Text) = '' then error := 'Please item name.' else if dbluAccountClass.Text = '' then error := 'Please select an account class.'; if error <> '' then ShowErrorBox(error); Result := error = ''; end; procedure TfrmLineItemList.FormClose(Sender: TObject; var Action: TCloseAction); begin inherited; dmAccountingAux.Free; end; procedure TfrmLineItemList.FormCreate(Sender: TObject); begin dmAccountingAux := TdmAccountingAux.Create(self); inherited; end; function TfrmLineItemList.NewIsAllowed: boolean; begin end; procedure TfrmLineItemList.SearchList; begin inherited; grList.DataSource.DataSet.Locate('line_item_name',edSearchKey.Text, [loPartialKey,loCaseInsensitive]); end; end.
{ ID: asiapea1 PROG: starry LANG: PASCAL } program starry; type cluster=array[0..101,0..101]of integer; const d:array[1..8,1..2]of integer=((0,1),(1,1),(1,0),(1,-1), (0,-1),(-1,-1),(-1,0),(-1,1)); var i,j,k,m,n,width,height,ans:longint; p:array[1..300]of cluster; map:array[0..101,0..101]of char; q:array[1..500000,1..2]of integer; h,w:array[1..300]of integer; v:array[0..101,0..101]of boolean; function same(a,b:cluster;ha,wa:longint):boolean; var i,j:longint; begin for i:=1 to ha do for j:=1 to wa do if a[i,j]<>b[i,j] then exit(false); exit(true); end; procedure swap(var a,b:longint); var k:longint; begin k:=a; a:=b; b:=k; end; function max(a,b:longint):longint; begin if a>b then max:=a else max:=b; end; function min(a,b:longint):longint; begin if a<b then min:=a else min:=b; end; procedure turnright(var a:cluster;var ha,wa:longint); var i,j:longint; b:cluster; begin fillchar(b,sizeof(b),0); for i:=1 to ha do for j:=1 to wa do b[j,ha-i+1]:=a[i,j]; a:=b; swap(ha,wa); end; procedure turnopposite(var a:cluster;var ha,wa:longint); var i,j:longint; b:cluster; begin fillchar(b,sizeof(b),0); for i:=1 to ha do for j:=1 to wa do b[i,wa-j+1]:=a[i,j]; a:=b; end; procedure printmap; var i,j:longint; begin for i:=1 to height do begin for j:=1 to width do write(map[i,j]); writeln; end; end; procedure bfs(a,b:longint); var i,j,l,r,x,y,x1,y1,minh,minw,maxh,maxw,nh,nw:longint; nc:cluster; procedure color(x:char); var i:longint; begin for i:=1 to r do map[q[i,1],q[i,2]]:=x; end; begin l:=1; r:=1; q[l,1]:=a; q[l,2]:=b; v[a,b]:=true; while l<=r do begin x:=q[l,1]; y:=q[l,2]; for i:=1 to 8 do begin x1:=x+d[i,1]; y1:=y+d[i,2]; if (map[x1,y1]='1')and(not v[x1,y1]) then begin inc(r); q[r,1]:=x1; q[r,2]:=y1; v[x1,y1]:=true; end; end; inc(l); end; minh:=maxlongint; for i:=1 to r do minh:=min(minh,q[i,1]); minw:=maxlongint; for i:=1 to r do minw:=min(minw,q[i,2]); maxh:=-maxlongint; for i:=1 to r do maxh:=max(maxh,q[i,1]); maxw:=-maxlongint; for i:=1 to r do maxw:=max(maxw,q[i,2]); nh:=maxh-minh+1;//当前连通块的高 nw:=maxw-minw+1;//当前连通块的宽 fillchar(nc,sizeof(nc),0);//当前的连通块 for i:=1 to r do begin x:=q[i,1]-minh+1; y:=q[i,2]-minw+1; nc[x,y]:=1; end; for i:=1 to 4 do begin for j:=1 to ans do if (nh=h[j])and(nw=w[j])and(same(p[j],nc,nh,nw)) then begin color(chr(j+96)); exit; end; turnright(nc,nh,nw);//顺时针转90度 end; turnopposite(nc,nh,nw);//对称反转 for i:=1 to 4 do begin for j:=1 to ans do if (nh=h[j])and(nw=w[j])and(same(p[j],nc,nh,nw)) then begin color(chr(j+96)); exit; end; if i<>4 then turnright(nc,nh,nw); end; inc(ans); p[ans]:=nc;//新的cluster h[ans]:=nh;//新的cluster的高 w[ans]:=nw;//新的cluster的宽 color(chr(ans+96)); end; begin assign(input,'starry.in'); reset(input); assign(output,'starry.out'); rewrite(output); //prepare for i:=0 to 101 do for j:=0 to 101 do map[i,j]:='0'; fillchar(v,sizeof(v),false); ans:=0; //input readln(width); readln(height); for i:=1 to height do begin for j:=1 to width do read(map[i,j]); readln; end; //floodfill for i:=1 to height do for j:=1 to width do if map[i,j]='1' then bfs(i,j); //print printmap; close(input); close(output); end.
{ Mystix Copyright (C) 2005 Piotr Jura 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. You can contact with me by e-mail: pjura@o2.pl } unit uFunctionList; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, JvDockControlForm, JvDockVCStyle, JvComponent, StdCtrls, SynRegExpr, ExtCtrls, ComCtrls, JvDockVSNetStyle, JvDockVIDStyle, JvComponentBase; type TFunctionListForm = class(TForm) JvDockClient: TJvDockClient; lvwFuncList: TListView; procedure lvwFuncListDblClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure lvwFuncListCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); private { Private declarations } fRegExpObj: TRegExpr; fRegExp: String; public { Public declarations } property RegExp: String read fRegExp write fRegExp; procedure UpdateFuncList; procedure Clear; procedure ReadLanguageData; end; var FunctionListForm: TFunctionListForm; implementation uses uDocuments, uMain, uMyIniFiles; {$R *.dfm} { TFunctionListForm } procedure TFunctionListForm.lvwFuncListDblClick(Sender: TObject); begin if lvwFuncList.ItemIndex <> -1 then begin Document.GoToLine(StrToInt(lvwFuncList.Items[lvwFuncList.ItemIndex].SubItems[0])); Document.Editor.SetFocus; end; end; procedure TFunctionListForm.UpdateFuncList; begin lvwFuncList.Items.BeginUpdate; try lvwFuncList.Clear; fRegExpObj.Expression := fRegExp; if (fRegExp <> '') and (fRegExpObj.Exec(Document.Editor.GetUncollapsedStrings.Text)) then repeat with lvwFuncList.Items.Add do begin Caption := fRegExpObj.Match[0]; with Document.Editor do SubItems.Add( IntToStr( GetRealLineNumber( CharIndexToRowCol( fRegExpObj.MatchPos[0] ).Line ) ) ); end; until not fRegExpObj.ExecNext; finally lvwFuncList.Items.EndUpdate; end; end; procedure TFunctionListForm.FormCreate(Sender: TObject); begin ReadLanguageData; fRegExpObj := TRegExpr.Create; fRegExpObj.ModifierM := True; end; procedure TFunctionListForm.FormDestroy(Sender: TObject); begin fRegExpObj.Free; end; procedure TFunctionListForm.Clear; begin lvwFuncList.Clear; end; procedure TFunctionListForm.lvwFuncListCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); begin Compare := CompareText(Item1.Caption, Item2.Caption); end; procedure TFunctionListForm.ReadLanguageData; begin with TMyIniFile.Create(Languages.Values[ActiveLanguage]) do try Caption := ReadString('FunctionListForm', 'Caption', ''); finally Free; end; end; end.
{$N+,E+,H-} unit uFuncoesString; (* Esta "unit" e composta por diversas funcoes de manipulacao de strings. *) interface uses DateUtils, SysUtils; const MaxString = 255; type Str2 = string[2]; Str3 = string[3]; Str4 = string[4]; Str5 = string[5]; Str6 = string[6]; Str8 = string[8]; Str9 = string[9]; Str10 = string[10]; Str11 = string[11]; Str12 = string[12]; Str20 = string[20]; Str40 = string[40]; Str80 = string[80]; Str255 = string[255]; StrMax = string[MaxString]; TArray255 = array [1..255] of char; TExtensao = string[3]; (*function ConstStr (C : Char; N : Integer) : StrMax; function UpcaseStr (S : StrMax) : StrMax; {Substitui as functions: ChaveDescricao e UpChave} function LwcaseStr (S : StrMax) : StrMax; function LimitaStr (campo : StrMax; novolen : integer) : StrMax; {Substitui a function CortaChave} *) function ReplaceString(campo, oldString, newString: String): string; function ColocaBrancoNaDireita(campo: string; tamanho: Integer): string; function ColocaBrancoNaDireitaTamanhoExato(campo: string; tamanho: Integer): string; function ColocaZeroAEsquerda(campo: string; tamanho: Integer): string; function TiraBrancosDaDireita (S : string) : string; function TiraBrancosDaEsquerda (S : string) : string; function TiraZeroDaEsquerda(S: String) : string; function TiraCaracterDaEsquerda (S : string) : string; (* function ComparaInicioStr (StrMenor,StrMaior : StrMax): boolean; {Antiga func. MesmaChaveDono} procedure AtribuiStr ( StrOrigem : string; var StrDestino : string; Indice : Integer); procedure AtribuiNovaStr ( OQue : string; var Onde : string; Posicao : Integer); *) function RealParaStr (Numero : double; Len,Decimais : Integer) : String; function RealParaStrSemZ (Numero : double; Len,MaxDec : Integer) : StrMax; function IntParaStr (Numero : LongInt; Len : Integer ) : StrMax; procedure StrIntParaStrIntSep (var StrA : StrMax); function IntParaStrComZeros (Numero : LongInt; Len : Integer ) : StrMax; function StrParaInt (StrNum : string) : longint; function StrParaReal (StrNum : string) : double; procedure StrParaArray ( StrDeEntrada : string; var ArrayDeSaida); procedure StrParaArrayZeroBin ( StrDeEntrada : string; var ArrayDeSaida); function StrMascaraParaStr (Mascara, StrA : StrMax) : StrMax; procedure MudaExtensao (var NomeDoArquivo : string; NovaExtensao : TExtensao); {----------------------------- Funcoes para SQL -------------------------------} function StrParaSql (StringSQL : StrMax) : StrMax; function StrParaSqlComparacao (StringSQL : StrMax) : StrMax; function IntParaSQL (IntegerSQL : longint) : StrMax; {--------------------- Função Para Limpar Caracteres Especiais ----------------} function limpaCaracteresEspeciais (str: String): String; function ObtemNumericoDaCadeia (str: String): String; function MascaraCPF (cpf : String): String; function MascaraCNPJ(cnpj: String): String; function MascaraCPFCNPJ(documento: String): String; {--------------------- Funções para CNAB Fiscal -------------------------------} function CnabStrParaFloat(S: string; NumDecimais: Integer): Double; function CnabStrParaData(S: string): TDateTime; implementation uses StrUtils; function ReplaceString(campo, oldString, newString: String): string; begin result := StringReplace(campo, oldString, newString, [rfIgnoreCase, rfReplaceAll]); end; function ColocaBrancoNaDireita(campo: string; tamanho: Integer): string; var i : Integer; auxCampo: String; begin auxCampo := campo; for i := Length(auxCampo) to tamanho - 1 do campo := campo + ' '; result := campo; end; function ColocaBrancoNaDireitaTamanhoExato(campo: string; tamanho: Integer): string; begin Result := Copy(ColocaBrancoNaDireita(campo, tamanho), 1, tamanho); end; function ColocaZeroAEsquerda(campo: string; tamanho: Integer): string; var i: Integer; auxCampo: string; begin campo := Trim(campo); auxCampo := campo; for i := Length(auxCampo) to tamanho - 1 do campo := '0' + campo; Result := campo; end; function TiraBrancosDaDireita (S : string) : string; begin while (length(S) > 0) and (S[length(S)]=' ') do delete (S, length(S), 1); TiraBrancosDaDireita := S end; function TiraBrancosDaEsquerda (S : string) : string; begin while (length(S) > 0) and (S[1]=' ') do delete (S, 1, 1); TiraBrancosDaEsquerda := S end; function TiraZeroDaEsquerda(S: string) : string; begin while (length(S) > 0) and (S[1]='0') do delete (S, 1, 1); TiraZeroDaEsquerda := S end; function TiraCaracterDaEsquerda (S : string) : string; begin TiraCaracterDaEsquerda := copy (S, 2, length(S)); end; function RealParaStr (Numero : double; Len,Decimais : Integer) : String; var AuxStr : String; begin Str (Numero:Len:Decimais,AuxStr); RealParaStr:=AuxStr; end; function RealParaStrSemZ(Numero : double; Len,MaxDec : Integer) : StrMax; const SepDec = #46; (* ord('.')=46 ord(',')=44 *) var s : string; begin S:=RealParaStr(Numero,Len+MaxDec+1,MaxDec); if pos(SepDec,s)>0 then begin while s[length(s)]='0' do s:=copy(s,1,length(s)-1); if s[length(s)]=SepDec then s:=copy(s,1,length(s)-1); end; while length(s)>Len do s:=copy(s,2,length(s)-1); RealParaStrSemZ:=s; end; function IntParaStr (Numero : LongInt; Len : Integer ) : StrMax; var AuxStr : StrMax; begin STR(Numero:Len,AuxStr); IntParaStr:=AuxStr; end; procedure StrIntParaStrIntSep (var StrA : StrMax); var StrN : StrMax; n, i, j, k : integer; begin n := length (StrA); j := 1; k := 0; while (j <= n) and (k = 0) do begin if StrA[j] in ['0'..'9'] then k := j; j := j + 1; end; if k > 0 then begin StrN := ''; j := 0; for i := n downto k do begin j := j + 1; StrN := StrN + StrA[i]; if (j = 3) and (i > k) then begin j := 0; StrN := StrN + '.'; end; end; StrA := Copy (StrA, 1, k-1); j := length (StrN); for i := j downto 1 do StrA := StrA + StrN[i]; end; end; function IntParaStrComZeros; var AuxStr: StrMax; i : integer; begin str (Numero:Len , AuxStr); for i:= 1 to Len do if AuxStr[i] = ' ' then AuxStr[i]:= '0'; IntParaStrComZeros:= AuxStr end; function StrParaInt (StrNum : string) : longint; var Num : longint; erro : integer; begin val(StrNum,Num,erro); StrParaInt:=Num; end; function StrParaReal (StrNum : string) : double; var AuxStr : string; Num : double; Erro, i, j, LugarDaVirgula : integer; begin LugarDaVirgula := pos (',', StrNum); if LugarDaVirgula > 0 then begin j := length (StrNum); AuxStr := ''; for i := 1 to j do if StrNum[i] <> '.' then AuxStr := AuxStr + StrNum[i]; StrNum := AuxStr; LugarDaVirgula := pos (',', StrNum); if LugarDaVirgula > 0 then StrNum[LugarDaVirgula] := '.'; end; val(StrNum, Num, Erro); StrParaReal := Num; end; procedure StrParaArray ( StrDeEntrada : string; var ArrayDeSaida); begin move (StrDeEntrada[1], TArray255(ArrayDeSaida)[1], length (StrDeEntrada)); end; procedure StrParaArrayZeroBin ( StrDeEntrada : string; var ArrayDeSaida); begin StrParaArray (StrDeEntrada, ArrayDeSaida); TArray255(ArrayDeSaida) [1+length(StrDeEntrada)] := char (0); end; function StrMascaraParaStr (Mascara, StrA : StrMax) : StrMax; var StrR : StrMax; i : integer; begin StrR := ''; for i := 1 to length (Mascara) do if Mascara[i] in ['#','@','*'] then StrR := StrR + StrA[i]; StrMascaraParaStr := StrR; end; procedure MudaExtensao (var NomeDoArquivo : string; NovaExtensao : TExtensao); var s : string; begin s := copy (NomeDoArquivo, length (NomeDoArquivo) - 3, 4); if pos('.', s) = 0 then NomeDoArquivo := NomeDoArquivo + '.' + NovaExtensao else if NomeDoArquivo [length (NomeDoArquivo)] = '.' then NomeDoArquivo := NomeDoArquivo + NovaExtensao else if NomeDoArquivo [length (NomeDoArquivo) - 1] = '.' then NomeDoArquivo := copy (NomeDoArquivo,1,length (NomeDoArquivo)-1) + NovaExtensao else if NomeDoArquivo [length (NomeDoArquivo) - 2] = '.' then NomeDoArquivo := copy (NomeDoArquivo, 1, length (NomeDoArquivo) - 2) + NovaExtensao else if NomeDoArquivo [length (NomeDoArquivo) - 3] = '.' then NomeDoArquivo := copy (NomeDoArquivo, 1, length (NomeDoArquivo) - 3) + NovaExtensao; end; {----------------------------- Funcoes para SQL -------------------------------} function StrParaSql (StringSQL : StrMax) : StrMax; begin if StringSQL = 'null' then StringSQL := ''; if TiraBrancosDaDireita (StringSQL) > '' then Result := '''' + TiraBrancosDaDireita (StringSQL) + '''' else Result := 'NULL'; end; function StrParaSqlComparacao (StringSQL : StrMax) : StrMax; var AuxStr : StrMax; begin AuxStr := StrParaSql (StringSQL); if AuxStr = 'NULL' then Result := 'IS NULL' else Result := ' = ' + AuxStr; end; function IntParaSQL (IntegerSQL : longint) : StrMax; begin Result := TiraBrancosDaEsquerda(IntParaStr (IntegerSQL, 10)); end; function limpaCaracteresEspeciais (str: String): String; begin str := StringReplace(str, 'À', 'A', [rfReplaceAll]); str := StringReplace(str, 'Á', 'A', [rfReplaceAll]); str := StringReplace(str, 'Â', 'A', [rfReplaceAll]); str := StringReplace(str, 'Ã', 'A', [rfReplaceAll]); str := StringReplace(str, 'Ä', 'A', [rfReplaceAll]); str := StringReplace(str, 'Å', 'A', [rfReplaceAll]); str := StringReplace(str, 'Ç', 'C', [rfReplaceAll]); str := StringReplace(str, 'È', 'E', [rfReplaceAll]); str := StringReplace(str, 'É', 'E', [rfReplaceAll]); str := StringReplace(str, 'Ê', 'E', [rfReplaceAll]); str := StringReplace(str, 'Ë', 'E', [rfReplaceAll]); str := StringReplace(str, 'Ì', 'I', [rfReplaceAll]); str := StringReplace(str, 'Í', 'I', [rfReplaceAll]); str := StringReplace(str, 'Î', 'I', [rfReplaceAll]); str := StringReplace(str, 'Ï', 'I', [rfReplaceAll]); str := StringReplace(str, 'Ñ', 'N', [rfReplaceAll]); str := StringReplace(str, 'Ò', 'O', [rfReplaceAll]); str := StringReplace(str, 'Ó', 'O', [rfReplaceAll]); str := StringReplace(str, 'Ô', 'O', [rfReplaceAll]); str := StringReplace(str, 'Õ', 'O', [rfReplaceAll]); str := StringReplace(str, 'Ö', 'O', [rfReplaceAll]); str := StringReplace(str, 'Ù', 'U', [rfReplaceAll]); str := StringReplace(str, 'Ú', 'U', [rfReplaceAll]); str := StringReplace(str, 'Û', 'U', [rfReplaceAll]); str := StringReplace(str, 'Ü', 'U', [rfReplaceAll]); str := StringReplace(str, 'à', 'a', [rfReplaceAll]); str := StringReplace(str, 'á', 'a', [rfReplaceAll]); str := StringReplace(str, 'â', 'a', [rfReplaceAll]); str := StringReplace(str, 'ã', 'a', [rfReplaceAll]); str := StringReplace(str, 'ä', 'a', [rfReplaceAll]); str := StringReplace(str, 'å', 'a', [rfReplaceAll]); str := StringReplace(str, 'ç', 'c', [rfReplaceAll]); str := StringReplace(str, 'è', 'e', [rfReplaceAll]); str := StringReplace(str, 'é', 'e', [rfReplaceAll]); str := StringReplace(str, 'ê', 'e', [rfReplaceAll]); str := StringReplace(str, 'ë', 'e', [rfReplaceAll]); str := StringReplace(str, 'ì', 'i', [rfReplaceAll]); str := StringReplace(str, 'í', 'i', [rfReplaceAll]); str := StringReplace(str, 'î', 'i', [rfReplaceAll]); str := StringReplace(str, 'ï', 'i', [rfReplaceAll]); str := StringReplace(str, 'ñ', 'n', [rfReplaceAll]); str := StringReplace(str, 'ò', 'o', [rfReplaceAll]); str := StringReplace(str, 'ó', 'o', [rfReplaceAll]); str := StringReplace(str, 'ô', 'o', [rfReplaceAll]); str := StringReplace(str, 'õ', 'o', [rfReplaceAll]); str := StringReplace(str, 'ö', 'o', [rfReplaceAll]); str := StringReplace(str, 'ù', 'u', [rfReplaceAll]); str := StringReplace(str, 'ú', 'u', [rfReplaceAll]); str := StringReplace(str, 'û', 'u', [rfReplaceAll]); str := StringReplace(str, 'ü', 'u', [rfReplaceAll]); str := StringReplace(str, '`', '', [rfReplaceAll]); str := StringReplace(str, '´', '', [rfReplaceAll]); str := StringReplace(str, '^', '', [rfReplaceAll]); str := StringReplace(str, '¨', '', [rfReplaceAll]); str := StringReplace(str, '~', '', [rfReplaceAll]); str := StringReplace(str, 'ª', '', [rfReplaceAll]); str := StringReplace(str, 'º', '', [rfReplaceAll]); str := StringReplace(str, '°', '', [rfReplaceAll]); result := str; end; function ObtemNumericoDaCadeia (str: String): String; var AuxStr : string; i, j : integer; begin i := length (str); if i > 0 then begin AuxStr := ''; for j := 1 to i do begin if Str[j] in ['0'..'9'] then AuxStr := AuxStr + Str [j]; end; end else AuxStr := ''; Result := AuxStr; end; function MascaraCPF (cpf : String): String; begin if Length(cpf) <> 11 then result := cpf else Result := Copy(cpf, 1, 3) + '.' + Copy(cpf, 4, 3) + '.' + Copy(cpf, 7, 3) + '-' + Copy(cpf, 10, 2); end; function MascaraCNPJ(cnpj: String): String; begin if Length(cnpj) <> 14 then result := cnpj else Result := Copy(cnpj, 1, 2) + '.' + Copy(cnpj, 3, 3) + '.' + Copy(cnpj, 6, 3) + '/' + Copy(cnpj, 9, 4) + '-' + Copy(cnpj, 13, 2); end; function MascaraCPFCNPJ(documento: String): String; begin if Length(documento) = 11 then Result := MascaraCPF(documento) else if Length(documento) = 14 then result := MascaraCNPJ(documento) else Result := documento; end; function CnabStrParaFloat(S: string; NumDecimais: Integer): Double; begin s := TiraZeroDaEsquerda(s); s := Copy(s, 1, Length(s) - NumDecimais) + ',' + Copy(s, Length(s) - NumDecimais + 1, NumDecimais); result := StrToFloat(s); end; function CnabStrParaData(S: string): TDateTime; begin if TiraZeroDaEsquerda(s) = '' then Result := 0 else result := StrToDateTime( Copy(s, 1, 2) + '/' + Copy(s, 3, 2) + '/' + Copy(s, 5, 4) ); end; end.
{************************************************************} PROGRAM WhatPortIsTheMouseOn; { Sept 18/93, Greg Estabrooks} TYPE MouseParamTable = RECORD BaudRate :WORD; { Baud Rate Div 100} Emulation :WORD; ReportRate :WORD; { Report Rate. } FirmRev :WORD; ZeroWord :WORD; { Should be zero. } PortLoc :WORD; { Com Port Used. } PhysButtons:WORD; { Physical Buttons.} LogButtons :WORD; { Logical Buttons. } END; VAR MouseInf :MouseParamTable; PROCEDURE GetMouseInf( VAR MouseTable ); ASSEMBLER; { Routine to Get info about mouse. } { NOTE Doesn't check to see if a } { a mouse is installed. } ASM Push AX { Save Registers Used. } Push ES Push DX Mov AX,$246C { Get Mouse Parameters. } LES DX,MouseTable { Point ES:DX to Param Table.} Int $33 { Call Mouse Interrupt. } Pop DX { Restore Registers used. } Pop ES Pop AX END;{GetMouseInf} BEGIN GetMouseInf(MouseInf); { Get mouse info. } Writeln(' ___Mouse Info___'); { Show a title. } Writeln; WITH MouseInf DO { Display Mouse Info. } BEGIN Writeln('Baud Rate : ',BaudRate * 100); Writeln('Emulation : ',Emulation); Writeln('Report Rate : ',ReportRate); Writeln('FirmWare Rev : ',FirmRev); Writeln('Com Port : ',PortLoc); Writeln('Physical Butns: ',PhysButtons); Writeln('Logical Buttns: ',LogButtons); END; Readln; { Wait for user to have a look.} END.{WhatPortIsTheMouseOn} {************************************************************} 
{ **********************************************************************} { } { DeskMetrics DLL - dskMetricsVars.pas } { Copyright (c) 2010-2011 DeskMetrics Limited } { } { http://deskmetrics.com } { http://support.deskmetrics.com } { } { support@deskmetrics.com } { } { This code is provided under the DeskMetrics Modified BSD License } { A copy of this license has been distributed in a file called } { LICENSE with this source code. } { } { **********************************************************************} unit dskMetricsVars; interface uses SyncObjs, SysUtils; var FJSONData: string; FThreadSafe: TCriticalSection; FLastErrorID: Integer; FException: Exception; FStarted: Boolean; FEnabled: Boolean; FDebugMode: Boolean; FDebugData: string; FAppID: string; FAppVersion: string; FNetFramework: string; FNetFrameworkSP: Integer; FUserID: string; FSessionID: string; FFlowNumber: Integer; FPostServer: string; FPostPort: Integer; FPostTimeOut: Integer; FPostAgent: string; FPostWaitResponse: Boolean; FProxyServer: string; FProxyPort: Integer; FProxyUser: string; FProxyPass: string; implementation end.
unit dUtils; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Unix, process; type TExplodeArray = Array of String; const AllowedChars = ['A'..'Z','a'..'z','0'..'9','/',',','.','?','!',' ',':','|','-','=','+','@','#','*', '%','_','(',')','$']; type { TdmUtils } TdmUtils = class(TDataModule) private { private declarations } public function GetDateTime(delta : Currency) : TDateTime; function Explode(const cSeparator, vString: String): TExplodeArray; function UnTarFiles(FileName,TargetDir : String) : Boolean; function MyTrim(text : String) : String; function GetBandFromFreq(freq : string;kHz : Boolean = False): String; function GetModeFromFreq(freq : String;kHz : Boolean = False) : String; function GetRadioRigCtldCommandLine(radio : Word) : String; procedure DebugMsg(what : String; Level : Integer=1); procedure GetRealCoordinates(lat,long : String; var latitude, longitude: Currency); end; var dmUtils: TdmUtils; implementation {$R *.lfm} uses dData, uCfgStorage; function TdmUtils.GetDateTime(delta : Currency) : TDateTime; var tv: ttimeval; res: longint; begin fpgettimeofday(@tv,nil); res := tv.tv_sec; Result := (res / 86400) + 25569.0; // Same line as used in Unixtodatetime if delta <> 0 then Result := Result - (delta/24) end; procedure TdmUtils.DebugMsg(what : String; Level : Integer=1); begin Writeln('DEBUG:',what) end; function TdmUtils.Explode(const cSeparator, vString: String): TExplodeArray; var i: Integer; S: String; begin S := vString; SetLength(Result, 0); i := 0; while Pos(cSeparator, S) > 0 do begin SetLength(Result, Length(Result) +1); Result[i] := Copy(S, 1, Pos(cSeparator, S) -1); Inc(i); S := Copy(S, Pos(cSeparator, S) + Length(cSeparator), Length(S)) end; SetLength(Result, Length(Result) +1); Result[i] := Copy(S, 1, Length(S)) end; function TdmUtils.UnTarFiles(FileName,TargetDir : String) : Boolean; var AProcess : TProcess; dir : String; begin Result := True; dir := GetCurrentDir; SetCurrentDir(TargetDir); AProcess := TProcess.Create(nil); try AProcess.CommandLine := 'tar -xvzf '+FileName; AProcess.Options := [poNoConsole,poNewProcessGroup,poWaitOnExit]; DebugMsg('Command line: '+AProcess.CommandLine); try AProcess.Execute except Result := False end finally SetCurrentDir(dir); AProcess.Free end end; function TdmUtils.MyTrim(text : String) : String; var i : Integer; begin text := Trim(text); Result := ''; for i:=1 to Length(text) do begin if (text[i] in AllowedChars) then Result := Result + text[i] end end; function TdmUtils.GetBandFromFreq(freq : string;kHz : Boolean = False): String; var x: Integer; band : String; f : Currency; begin Result := ''; band := ''; if Pos('.',freq) > 0 then freq[Pos('.',freq)] := DecimalSeparator; if pos(',',freq) > 0 then freq[pos(',',freq)] := DecimalSeparator; Writeln('*freq:',freq); if not TryStrToCurr(freq,f) then exit; if kHz then f := f/1000; x := trunc(f); Writeln('kHz:',khz); Writeln('**freq:',x); case x of 0 : Band := '2190M'; 1 : Band := '160M'; 3 : band := '80M'; 5 : band := '60M'; 7 : band := '40M'; 10 : band := '30M'; 14 : band := '20M'; 18 : Band := '17M'; 21 : Band := '15M'; 24 : Band := '12M'; 28..30 : Band := '10M'; 50..53 : Band := '6M'; 70..72 : Band := '4M'; 144..149 : Band := '2M'; 219..225 : Band := '1.25M'; 430..440 : band := '70CM'; 900..929 : band := '33CM'; 1240..1300 : Band := '23CM'; 2300..2450 : Band := '13CM'; //12 cm 3400..3475 : band := '9CM'; 5650..5850 : Band := '6CM'; 10000..10500 : band := '3CM'; 24000..24250 : band := '1.25CM'; 47000..47200 : band := '6MM'; 76000..84000 : band := '4MM'; end; Result := band end; function TdmUtils.GetModeFromFreq(freq : String;kHz : Boolean = False) : String; //freq in MHz var Band : String; tmp : Extended; begin try Result := ''; band := GetBandFromFreq(freq, kHz); dmData.qBands.Close; dmData.qBands.SQL.Text := 'SELECT * FROM cqrtest_common.bands WHERE band = ' + QuotedStr(band); if dmData.trBands.Active then dmData.trBands.Rollback; dmData.trBands.StartTransaction; try dmData.qBands.Open; tmp := StrToFloat(freq); if kHz then tmp := tmp/1000; if dmData.qBands.RecordCount > 0 then begin if ((tmp >= dmData.qBands.FieldByName('B_BEGIN').AsCurrency) and (tmp <= dmData.qBands.FieldByName('CW').AsCurrency)) then Result := 'CW' else begin if ((tmp > dmData.qBands.FieldByName('RTTY').AsCurrency) and ( tmp <= dmData.qBands.FieldByName('SSB').AsCurrency)) then Result := 'RTTY' else begin if tmp > 10 then Result := 'USB' else Result := 'LSB' end end end finally dmData.qBands.Close; dmData.trBands.Rollback end except on E : Exception do Writeln(E.Message); end end; procedure TdmUtils.GetRealCoordinates(lat,long : String; var latitude, longitude: Currency); var s,d : String; begin s := lat; d := long; if ((Length(s)=0) or (Length(d)=0)) then begin longitude := 0; latitude := 0; exit end; if s[Length(s)] = 'S' then s := '-' +s ; s := copy(s,1,Length(s)-1); if pos('.',s) > 0 then s[pos('.',s)] := DecimalSeparator; if not TryStrToCurr(s,latitude) then latitude := 0; if d[Length(d)] = 'W' then d := '-' + d ; d := copy(d,1,Length(d)-1); if pos('.',d) > 0 then d[pos('.',d)] := DecimalSeparator; if not TryStrToCurr(d,longitude) then longitude := 0 end; function TdmUtils.GetRadioRigCtldCommandLine(radio : Word) : String; var section : ShortString=''; arg : String=''; set_conf : String = ''; begin section := 'TRX'+IntToStr(radio); if iniLocal.ReadString(section,'model','') = '' then begin Result := ''; exit end; Result := '-m '+ iniLocal.ReadString(section,'model','') + ' ' + '-r '+ iniLocal.ReadString(section,'device','') + ' ' + '-t '+ iniLocal.ReadString(section,'RigCtldPort','4532') + ' '; Result := Result + iniLocal.ReadString(section,'ExtraRigCtldArgs','') + ' '; case iniLocal.ReadInteger(section,'SerialSpeed',0) of 0 : arg := ''; 1 : arg := '-s 1200 '; 2 : arg := '-s 2400 '; 3 : arg := '-s 4800 '; 4 : arg := '-s 9600 '; 5 : arg := '-s 144000 '; 6 : arg := '-s 19200 '; 7 : arg := '-s 38400 '; 8 : arg := '-s 57600 '; 9 : arg := '-s 115200 ' else arg := '' end; //case Result := Result + arg; case iniLocal.ReadInteger(section,'DataBits',0) of 0 : arg := ''; 1 : arg := 'data_bits=5'; 2 : arg := 'data_bits=6'; 3 : arg := 'data_bits=7'; 4 : arg := 'data_bits=8'; 5 : arg := 'data_bits=9' else arg := '' end; //case if arg<>'' then set_conf := set_conf+arg+','; if iniLocal.ReadInteger(section,'StopBits',0) > 0 then set_conf := set_conf+'stop_bits='+IntToStr(iniLocal.ReadInteger(section,'StopBits',0)-1)+','; case iniLocal.ReadInteger(section,'Parity',0) of 0 : arg := ''; 1 : arg := 'parity=None'; 2 : arg := 'parity=Odd'; 3 : arg := 'parity=Even'; 4 : arg := 'parity=Mark'; 5 : arg := 'parity=Space' else arg := '' end; //case if arg<>'' then set_conf := set_conf+arg+','; case iniLocal.ReadInteger(section,'HandShake',0) of 0 : arg := ''; 1 : arg := 'serial_handshake=None'; 2 : arg := 'serial_handshake=XONXOFF'; 3 : arg := 'serial_handshake=Hardware'; else arg := '' end; //case if arg<>'' then set_conf := set_conf+arg+','; case iniLocal.ReadInteger(section,'DTR',0) of 0 : arg := ''; 1 : arg := 'dtr_state=Unset'; 2 : arg := 'dtr_state=ON'; 3 : arg := 'dtr_state=OFF'; else arg := '' end; //case if arg<>'' then set_conf := set_conf+arg+','; case iniLocal.ReadInteger(section,'RTS',0) of 0 : arg := ''; 1 : arg := 'rts_state=Unset'; 2 : arg := 'rts_state=ON'; 3 : arg := 'rts_state=OFF'; else arg := '' end; //case if arg<>'' then set_conf := set_conf+arg+','; if (set_conf<>'') then begin set_conf := copy(set_conf,1,Length(set_conf)-1); Result := Result + ' --set-conf='+set_conf end end; end.
object AzBlockBlob: TAzBlockBlob Left = 227 Top = 108 BorderStyle = bsDialog Caption = 'Create Block Blob' ClientHeight = 529 ClientWidth = 512 Color = clBtnFace ParentFont = True OldCreateOrder = True Position = poScreenCenter PixelsPerInch = 96 TextHeight = 13 object Bevel1: TBevel Left = 8 Top = 8 Width = 496 Height = 482 Shape = bsFrame end object lblBlobName: TLabel Left = 24 Top = 24 Width = 54 Height = 13 Caption = 'Blob Name:' end object lblContentLocation: TLabel Left = 24 Top = 137 Width = 86 Height = 13 Caption = 'Content Location:' end object OKBtn: TButton Left = 348 Top = 496 Width = 75 Height = 25 Caption = 'Create' Default = True Enabled = False ModalResult = 1 TabOrder = 7 end object CancelBtn: TButton Left = 429 Top = 496 Width = 75 Height = 25 Cancel = True Caption = 'Cancel' ModalResult = 2 TabOrder = 8 end object edtBlobName: TEdit Left = 93 Top = 21 Width = 396 Height = 21 TabOrder = 0 OnChange = edtBlobNameChange end object GroupBox1: TGroupBox Left = 24 Top = 48 Width = 465 Height = 81 Caption = 'Content (optional)' TabOrder = 1 object Label1: TLabel Left = 16 Top = 24 Width = 28 Height = 13 Caption = 'Type:' end object Label2: TLabel Left = 16 Top = 48 Width = 47 Height = 13 Caption = 'Encoding:' end object Label3: TLabel Left = 240 Top = 51 Width = 25 Height = 13 Caption = 'MD5:' end object Label4: TLabel Left = 240 Top = 24 Width = 51 Height = 13 Caption = 'Language:' end object edtContentType: TEdit Left = 69 Top = 21 Width = 157 Height = 21 TabOrder = 0 Text = 'application/octet-stream' end object edtLanguage: TEdit Left = 297 Top = 21 Width = 152 Height = 21 TabOrder = 1 end object edtMD5: TEdit Left = 297 Top = 48 Width = 152 Height = 21 TabOrder = 3 end object edtEncoding: TEdit Left = 69 Top = 48 Width = 157 Height = 21 TabOrder = 2 end end object edtFilename: TEdit Left = 24 Top = 156 Width = 425 Height = 21 TabOrder = 2 end object btnFile: TButton Left = 455 Top = 154 Width = 35 Height = 25 Caption = '...' TabOrder = 3 OnClick = btnFileClick end object vleMeta: TValueListEditor Left = 24 Top = 183 Width = 465 Height = 298 KeyOptions = [keyEdit, keyAdd, keyDelete, keyUnique] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goEditing, goTabs, goAlwaysShowEditor, goThumbTracking] TabOrder = 4 TitleCaptions.Strings = ( 'Metadata Name' 'Value') ColWidths = ( 150 309) end object btnAddMetadata: TButton Left = 25 Top = 496 Width = 83 Height = 25 Caption = 'Add Metadata' TabOrder = 5 OnClick = btnAddMetadataClick end object btnDelMetadata: TButton Left = 114 Top = 496 Width = 103 Height = 25 Caption = 'Remove Metadata' TabOrder = 6 OnClick = btnDelMetadataClick end end
{ Copyright (C) 1998-2018, written by Shkolnik Mike, Scalabium Software E-Mail: mshkolnik@scalabium.com mshkolnik@yahoo.com WEB: http://www.scalabium.com This component allow translate a number into verbal string. For using you need: - drop it on form - define a desirable number in Value property, which you want translate into verbal string Also you can define in properties: - Currency: currency for translation 1. ukrainian UAH 2. ukrainian karbobanets 3. US dollars 4. russian rubles 5. deutsche marks 6. british pounds 7. euro 8. Rands (South Africa) 9. Belgian Franc 10. Dominican Republic peso 11. Rupiah - Language: language for translation 1. ukrainian 2. russian 3. english 4. german 5. spain 6. Indonesia - Expand: exWholeSum: True - expand in verbal string a whole part of number ('fourty five/45') exWholeCurrency: True - expand in verbal string a currency for whole part of number ('rubles/rub') exFractionSum: True - expand in verbal string a fractioanl part of number ('ten/10') exFractionCurrency: True - expand a currency for fractional part of number ('centes/cnt') - CharCase: ccLower: all characters in result string is lower ccProper: first character is upper, all rest is lower ccUpper: all characters in result string is upper Also you can use it without component creation thought run-time call a function, which will result a verbal string: function GetMoneyStr(Value: Double; Expand: TExpand; Language: TLanguage; Currency: TCurrency; CharCase: TCharCase): string; Big thanks to Lars Paprotny (paprotny@gkss.de, paprotny@gmx.de). Without Lars help I couldn't create a english and german language support. If anybody want to help me in new languages support then send a message to me. But component is freeware and I cann't offer a fee. } unit MoneyStr; interface {$I SMVersion.inc} uses Classes, StdCtrls; type TExpand = set of (exWholeSum, exWholeCurrency, exFractionSum, exFractionCurrency); TCurrency = (tcUAH, tcKarbovanec, tcUSD, tcRUR, tcDM, tcPound, tcEuro, tsRand, tsBelgianFranc, tsPeso, tsRupiah); TLanguage = (tlUkrainian, tlRussian, tlEnglish, tlGerman, tlSpain, tlIndonesia); TCharCase = (ccLower, ccProper, ccUpper); const Thousands: array[TLanguage] of array[1..4, 1..3] of string = ((('тисяча', 'тисячi', 'тисяч'), ('мiльйон', 'мiльйони', 'мiльйонiв'), ('мiлiард', 'мiлiарди', 'мiлiардiв'), ('трилiон', 'трилiони', 'трилiонiв')), (('тысяча', 'тысячи', 'тысяч'), ('миллион', 'миллиона', 'миллионов'), ('миллиард', 'миллиарда', 'миллиардов'), ('триллион', 'триллиона', 'триллионов')), (('thousand', 'thousand', 'thousands'), ('million', 'million', 'millions'), ('billion', 'billion', 'billions'), ('trillion', 'trillion', 'trillions')), (('Tausend', 'Tausend', 'Tausend'), ('Million', 'Million', 'Millionen'), ('Milliarde', 'Milliarde', 'Milliarden'), ('Billion', 'Billion', 'Billionen')), (('mil', 'mil', 'mil'), ('millуn', 'millуn', 'millуn'), ('billуn', 'billуn', 'billуn'), ('trillon', 'trillon', 'trillon')), (('ribu', 'ribu', 'ribu'), ('juta', 'juta', 'juta'), ('milyar', 'milyar', 'milyar'), ('trilyun', 'trilyun', 'trilyun'))); const ShortCurrency: array[TLanguage] of array[0..10, 1..2] of string = ((('грн', 'коп'), ('крб', 'коп'), ('дол', 'цнт'), ('руб', 'коп'), ('мар', 'пфн'), ('фнт', 'пнс'), ('евр', 'цнт'), ('рнд', 'цнт'), ('бф', ''), ('пес', 'сен'), ('Rp.', 'sen')), (('грн', 'коп'), ('крб', 'коп'), ('дол', 'цнт'), ('руб', 'коп'), ('мар', 'пфн'), ('фнт', 'пнс'), ('евр', 'цнт'), ('рнд', 'цнт'), ('бф', ''), ('пес', 'сен'), ('Rp.', 'sen')), (('grn', 'cop'), ('krb', 'cop'), ('$', 'cen'), ('rub', 'cop'), ('dm', 'pfg'), ('pnd', 'p'), ('eur', 'cen'), ('R', 'c'), ('BF', ''), ('RD', 'cts'), ('Rp.', 'sen')), (('grn', 'cop'), ('krb', 'cop'), ('$', 'cen'), ('rub', 'cop'), ('dm', 'pfg'), ('pnd', 'p'), ('eur', 'cen'), ('R', 'c'), ('BF', ''), ('RD', 'cts'), ('Rp.', 'sen')), (('grn', 'cop'), ('krb', 'cop'), ('$', 'cen'), ('rub', 'cop'), ('dm', 'pfg'), ('pnd', 'p'), ('eur', 'cen'), ('R', 'c'), ('BF', ''), ('RD', 'cts'), ('Rp.', 'sen')), (('grn', 'cop'), ('krb', 'cop'), ('$', 'cen'), ('rub', 'cop'), ('dm', 'pfg'), ('pnd', 'p'), ('eur', 'cen'), ('R', 'c'), ('BF', ''), ('RD', 'cts'), ('Rp.', 'sen'))); const FullCurrency: array[TLanguage] of array[0..10, 1..6] of string = ((('гривня', 'гривнi', 'гривень', 'копiйка', 'копiйки', 'копiйок'), ('карбованець', 'карбованця', 'карбованцев', 'копiйка', 'копiйки', 'копiйок'), ('долар', 'долара', 'доларiв', 'цент', 'цента', 'центiв'), ('рубль', 'рубля', 'рублiв', 'копiйка', 'копiйки', 'копiйок'), ('марка', 'марки', 'марок', 'пфенiг', 'пфенiга', 'пфенiгов'), ('фунт', 'фунта', 'фунтiв', 'пенс', 'пенса', 'пенсiв'), ('евро', 'евро', 'евро', 'цент', 'цента', 'центiв'), ('ренд', 'ренда', 'рендов', 'цент', 'цента', 'центiв'), ('франк', 'франка', 'франков', '', '', ''), ('песо', 'песо', 'песо', 'сентаво', 'сентаво', 'сентаво'), ('rupiah', 'rupiah', 'rupiah', 'sen', 'sen', 'sen')), (('гривня', 'гривни', 'гривен', 'копейка', 'копейки', 'копеек'), ('карбованец', 'карбованца', 'карбованцев', 'копейка', 'копейки', 'копеек'), ('доллар', 'доллара', 'долларов', 'цент', 'цента', 'центов'), ('рубль', 'рубля', 'рублей', 'копейка', 'копейки', 'копеек'), ('марка', 'марки', 'марок', 'пфениг', 'пфенига', 'пфенигов'), ('фунт', 'фунта', 'фунтов', 'пенс', 'пенса', 'пенсов'), ('евро', 'евро', 'евро', 'цент', 'цента', 'центов'), ('ренд', 'ренда', 'рендов', 'цент', 'цента', 'центiв'), ('франк', 'франка', 'франков', '', '', ''), ('песо', 'песо', 'песо', 'сентаво', 'сентаво', 'сентаво'), ('rupiah', 'rupiah', 'rupiah', 'sen', 'sen', 'sen')), (('gruvnya', 'gruvnya', 'gruvnies', 'kopeck', 'kopeck', 'kopecks'), ('karbovanec', 'karbovanec', 'karbovanecs', 'kopeck', 'kopeck', 'kopecks'), ('dollar', 'dollar', 'dollars', 'cent', 'cent', 'cents'), ('ruble', 'ruble', 'rubles', 'kopeck', 'kopeck', 'kopecks'), ('deutsche mark', 'deutsche mark', 'deutsche marks', 'pfennig', 'pfennig', 'pfennigs'), ('pound', 'pound', 'pounds', 'penny', 'penny', 'pence'), ('euro', 'euro', 'euros', 'cent', 'cent', 'cents'), ('Rand', 'Rand', 'Rand', 'cent', 'cent', 'cents'), ('Belgian Franc', 'Belgian Franc', 'Belgian Francs', '', '', ''), ('peso', 'peso', 'pesos', 'centavo', 'centavo', 'centavos'), ('rupiah', 'rupiah', 'rupiahs', 'sen', 'sen', 'sens')), (('gruvnya', 'gruvnya', 'gruvnies', 'kopeck', 'kopeck', 'kopecks'), ('karbovanec', 'karbovanec', 'karbovanecs', 'kopeck', 'kopeck', 'kopecks'), ('dollar', 'dollar', 'dollars', 'cent', 'cent', 'cents'), ('ruble', 'ruble', 'rubles', 'kopeck', 'kopeck', 'kopecks'), ('Deutsche Mark', 'Deutsche Mark', 'Deutsche Marks', 'Pfennig', 'Pfennig', 'Pfennige'), ('pound', 'pound', 'pounds', 'penny', 'penny', 'pence'), ('euro', 'euro', 'euros', 'cent', 'cent', 'cents'), ('Rand', 'Rand', 'Rand', 'cent', 'cent', 'cents'), ('Belgian Franc', 'Belgian Franc', 'Belgian Francs', '', '', ''), ('peso', 'peso', 'pesos', 'centavo', 'centavo', 'centavos'), ('rupiah', 'rupiah', 'rupiah', 'sen', 'sen', 'sen')), (('gruvnya', 'gruvnya', 'gruvnies', 'kopeck', 'kopeck', 'kopecks'), ('karbovanec', 'karbovanec', 'karbovanecs', 'kopeck', 'kopeck', 'kopecks'), ('dollar', 'dollar', 'dollars', 'cent', 'cent', 'cents'), ('ruble', 'ruble', 'rubles', 'kopeck', 'kopeck', 'kopecks'), ('deutsche mark', 'deutsche mark', 'deutsche marks', 'pfennig', 'pfennig', 'pfennigs'), ('pound', 'pound', 'pounds', 'pence', 'pence', 'pences'), ('euro', 'euro', 'euros', 'cent', 'cent', 'cents'), ('Rand', 'Rand', 'Rand', 'cent', 'cent', 'cents'), ('Belgian Franc', 'Belgian Franc', 'Belgian Francs', '', '', ''), ('peso', 'peso', 'pesos', 'centavo', 'centavo', 'centavos'), ('rupiah', 'rupiah', 'rupiah', 'sen', 'sen', 'sen')), (('gruvnya', 'gruvnya', 'gruvnies', 'kopeck', 'kopeck', 'kopecks'), ('karbovanec', 'karbovanec', 'karbovanecs', 'kopeck', 'kopeck', 'kopecks'), ('dollar', 'dollar', 'dollars', 'cent', 'cent', 'cents'), ('ruble', 'ruble', 'rubles', 'kopeck', 'kopeck', 'kopecks'), ('deutsche mark', 'deutsche mark', 'deutsche marks', 'pfennig', 'pfennig', 'pfennigs'), ('pound', 'pound', 'pounds', 'penny', 'penny', 'pence'), ('euro', 'euro', 'euros', 'cent', 'cent', 'cents'), ('Rand', 'Rand', 'Rand', 'cent', 'cent', 'cents'), ('Belgian Franc', 'Belgian Franc', 'Belgian Francs', '', '', ''), ('peso', 'peso', 'pesos', 'centavo', 'centavo', 'centavos'), ('rupiah', 'rupiah', 'rupiahs', 'sen', 'sen', 'sens'))); const Literal: array[TLanguage] of array[0..19, 1..4] of string = ((('', '', '', 'нуль'), ('одна', 'один', '', 'сто'), ('двi', 'два', 'двадцять', 'двiстi'), ('три', 'три', 'тридцять', 'триста'), ('чотири', 'чотири', 'сорок', 'чотиреста'), ('п''ять', 'п''ять', 'п''ятдесят', 'п''ятсот'), ('шiсть', 'шiсть', 'шiстдесят', 'шiстьсот'), ('сiм', 'сiм', 'сiмдесят', 'сiмсот'), ('вiсiм', 'вiсiм', 'вiсiмдесят', 'вiсiмсот'), ('дев''ять', 'дев''ять', 'девяносто', 'дев''ятсот'), ('десять', 'десять', '', ''), ('одинадцять', 'одинадцять', '', ''), ('дванадцять', 'дванадцять', '', ''), ('тринадцять', 'тринадцять', '', ''), ('чотирнадцять', 'чотирнадцять', '', ''), ('п''ятнадцять', 'п''ятнадцять', '', ''), ('шiстнадцять', 'шiстнадцять', '', ''), ('сiмнадцять', 'сiмнадцять', '', ''), ('вiсiмнадцять', 'вiсiмнадцять', '', ''), ('дев''ятнадцять', 'дев''ятнадцять', '', '')), (('', '', '', 'ноль'), ('одна', 'один', '', 'сто'), ('две', 'два', 'двадцать', 'двести'), ('три', 'три', 'тридцать', 'триста'), ('четыре', 'четыре', 'сорок', 'четыреста'), ('пять', 'пять', 'пятьдесят', 'пятьсот'), ('шесть', 'шесть', 'шестьдесят', 'шестьсот'), ('семь', 'семь', 'семьдесят', 'семьсот'), ('восемь', 'восемь', 'восемьдесят', 'восемьсот'), ('девять', 'девять', 'девяносто', 'девятьсот'), ('десять', 'десять', '', ''), ('одинадцать', 'одинадцать', '', ''), ('двенадцать', 'двенадцать', '', ''), ('тринадцать', 'тринадцать', '', ''), ('четырнадцать', 'четырнадцать', '', ''), ('пятнадцать', 'пятнадцать', '', ''), ('шестнадцать', 'шестнадцать', '', ''), ('семнадцать', 'семнадцать', '', ''), ('восемнадцать', 'восемнадцать', '', ''), ('девятнадцать', 'девятнадцать', '', '')), (('', '', '', 'zero'), ('one', 'one', '', 'one hundred'), ('two', 'two', 'twenty', 'two hundred'), ('three', 'three', 'thirty', 'three hundred'), ('four', 'four', 'forty', 'four hundred'), ('five', 'five', 'fifty', 'five hundred'), ('six', 'six', 'sixty', 'six hundred'), ('seven', 'seven', 'seventy', 'seven hundred'), ('eight', 'eight', 'eighty', 'eight hundred'), ('nine', 'nine', 'ninety', 'nine hundred'), ('ten', 'ten', '', ''), ('eleven', 'eleven', '', ''), ('twelve', 'tweleve', '', ''), ('thirteen', 'thirteen', '', ''), ('fourteen', 'fourteen', '', ''), ('fifteen', 'fifteen', '', ''), ('sixteen', 'sixteen', '', ''), ('seventeen', 'seventeen', '', ''), ('eighteen', 'eighteen', '', ''), ('nineteen', 'nineteen', '', '')), (('', '', '', 'null'), ('eins', 'ein', '', 'einhundert'), ('zwei', 'zwei', 'zwanzig', 'zweihundert'), ('drei', 'drei', 'dreissig', 'dreihundert'), ('vier', 'vier', 'vierzig', 'vierhundert'), ('fuenf', 'fuenf', 'fuenfzig', 'fuenfhundert'), ('sechs', 'sechs', 'sechzig', 'sechshundert'), ('sieben', 'sieben', 'siebzig', 'siebenhundert'), ('acht', 'acht', 'achtzig', 'achthundert'), ('neun', 'neun', 'neunzig', 'neunhundert'), ('zehn', 'zehn', '', ''), ('elf', 'elf', '', ''), ('zwoelf', 'zwoelf', '', ''), ('dreizehn', 'dreizehn', '', ''), ('vierzehn', 'vierzehn', '', ''), ('fuenfzehn', 'fuenfzehn', '', ''), ('sechzehn', 'sechzehn', '', ''), ('siebzehn', 'siebzehn', '', ''), ('achtzehn', 'achtzehn', '', ''), ('neunzehn', 'neunzehn', '', '')), (('', '', '', 'cero'), ('uno', 'una', '', 'cien'), ('dos', 'dos', 'veinte', 'doscientos'), ('tres', 'tres', 'treinta', 'trescientos'), ('cuatro', 'cuatro', 'cuarenta', 'cuatrocientos'), ('cinco', 'cinco', 'cincuenta', 'quinientos'), ('seis', 'seis', 'sesenta', 'seiscientos'), ('siete', 'siete', 'setenta', 'setecientos'), ('ocho', 'ocho', 'ochenta', 'ochocientos'), ('nueve', 'nueve', 'noventa', 'novecientos'), ('diez', 'diez', '', ''), ('once', 'once', '', ''), ('doce', 'doce', '', ''), ('trece', 'trece', '', ''), ('catorce', 'catorce', '', ''), ('quince', 'quince', '', ''), ('diecisйis', 'diecisйis', '', ''), ('diecisiete', 'diecisiete', '', ''), ('dieciocho', 'dieciocho', '', ''), ('diecinueve', 'diecinueve', '', '')), (('', '', '', 'nol'), ('satu', 'satu', '', 'seratus'), ('dua', 'dua', 'dua puluh', 'dua ratus'), ('tiga', 'tiga', 'tiga puluh', 'tiga ratus'), ('empat', 'empat', 'empat puluh', 'empat ratus'), ('lima', 'lima', 'lima puluh', 'lima ratus'), ('enam', 'enam', 'enam puluh', 'enam ratus'), ('tujuh', 'tujuh', 'tujuh puluh', 'tujuh ratus'), ('delapan', 'delapan', 'delapan puluh', 'delapan ratus'), ('sembilan', 'sembilan', 'sembilan puluh', 'sembilan ratus'), ('sepuluh', 'sepuluh', '', ''), ('sebelas', 'sebelas', '', ''), ('dua belas', 'dua belas', '', ''), ('tiga belas', 'tiga belas', '', ''), ('empat belas', 'empat belas', '', ''), ('lima belas', 'lima belas', '', ''), ('enam belas', 'enam belas', '', ''), ('tujuh belas', 'tujuh belas', '', ''), ('delapan belas', 'delapan belas', '', ''), ('sembilan belas', 'sembilan belas', '', ''))); type {$IFDEF SM_ADD_ComponentPlatformsAttribute} [ComponentPlatformsAttribute(pidWin32 or pidWin64)] {$ENDIF} TMoneyString = class(TCustomLabel) private { Private declarations } FCharCase: TCharCase; FValue: Double; FCurrency: TCurrency; FLanguage: TLanguage; FExpand: TExpand; procedure BuildMoneyString; protected { Protected declarations } procedure SetCharCase(Val: TCharCase); procedure SetValue(Val: Double); procedure SetCurrency(Val: TCurrency); procedure SetLanguage(Val: TLanguage); procedure SetExpand(Val: TExpand); public { Public declarations } constructor Create(AOwner: TComponent); override; published { Published declarations } property Value: Double read FValue write SetValue; property Currency: TCurrency read FCurrency write SetCurrency default tcUSD; property Language: TLanguage read FLanguage write SetLanguage default tlEnglish; property Expand: TExpand read FExpand write SetExpand; property CharCase: TCharCase read FCharCase write SetCharCase; property Align; property Alignment; // property AutoSize; property Color; property DragCursor; property DragMode; property Enabled; property FocusControl; property Font; property ParentColor; property ParentFont; property ParentShowHint; property PopupMenu; property ShowHint; property Transparent; property Layout; property Visible; property OnClick; property OnDblClick; property OnDragDrop; property OnDragOver; property OnEndDrag; property OnMouseDown; property OnMouseMove; property OnMouseUp; property OnStartDrag; end; function GetMoneyStr(Value: Double; Expand: TExpand; Language: TLanguage; Currency: TCurrency; CharCase: TCharCase): string; implementation uses SysUtils; function GetDeclension(Digit: Char): Integer; begin Result := 3; if (Digit = '1') then Result := 1 else if {$IFDEF SMForDelphi2009}CharInSet{$ENDIF}(Digit {$IFDEF SMForDelphi2009},{$ELSE} in {$ENDIF}['2', '3', '4']) then Result := 2 end; function AddSpaces(s1, s2, s3, s4: string): string; begin Result := ''; if s1 <> '' then Result := Result + s1 + ' '; if s2 <> '' then Result := Result + s2 + ' '; if s3 <> '' then Result := Result + s3 + ' '; if s4 <> '' then Result := Result + s4 + ' '; end; function GetMoneyString(IntPart: Boolean; strValue: string; Expand: TExpand; Language: TLanguage; Currency: TCurrency): string; var strRevert, PP: string; PK: array[1..3] of string; DL, k, PG: Integer; N: Double; begin strRevert := '000000000000000'; DL := Length(strValue); // claculate amount of triads in number if (DL mod 3 = 0) then N := DL/3 else N := DL/3 + 1; N := Int(N); // create a reverse string with additional '0' in right (up to 15 characters) k := 1; while (k <= 255) do begin if (k <= DL) then strRevert[k] := strValue[DL - k + 1] else strRevert[k] := '0'; Inc(k) end; Result := ''; if ((IntPart = True) and (exWholeSum in Expand)) or ((IntPart = False) and (exFractionSum in Expand)) then begin { if number is zero } if (StrToInt(strValue) = 0) then Result := Literal[Language][0, 4] + ' ' else begin k := 0; while (k < N) do begin PP := ''; PK[1] := ''; PK[2] := ''; PK[3] := ''; if (strRevert[3 + 3*k] <> '0') then PK[1] := Literal[Language][StrToInt(strRevert[3+3*k]), 4] else PK[1] := ''; if (strRevert[2 + 3*k] <> '0') then begin if (strRevert[2 + 3*k] = '1') then begin PK[2] := Literal[Language][StrToInt(strRevert[1+3*k])+10, 2]; PK[3] := ''; end else begin PK[2] := Literal[Language][StrToInt(strRevert[2+3*k]), 3]; if ((k = 0) or (k = 1)) and (Currency in [tcUAH, tcDM, tcEuro]) then PK[3] := Literal[Language][StrToInt(strRevert[1+3*k]), 1] else PK[3] := Literal[Language][StrToInt(strRevert[1+3*k]), 2] end end else begin PK[2] := ''; if (strRevert[1+3*k] = '0') then PK[3] := '' else if ((k = 0) or (k = 1)) and (Currency in [tcUAH, tcDM, tcEuro]) then PK[3] := Literal[Language][StrToInt(strRevert[1+3*k]), 1] else PK[3] := Literal[Language][StrToInt(strRevert[1+3*k]), 2]; end; if (Language = tlGerman) and (strRevert[2 + 3*k] > '1') then begin PK[2] := PK[3] + 'und' + PK[2]; PK[3] := '' end; if k > 0 then begin if (strRevert[1 + 3*k] <> '0') or (strRevert[2 + 3*k] <> '0') or (strRevert[3 + 3*k] <> '0') then begin { if it isn't a first tens (11..19) } if (strRevert[2 + 3*k] <> '1') then PP := Thousands[Language][k, GetDeclension(strRevert[1 + 3*k])] else PP := Thousands[Language][k, 3]; end end; Result := AddSpaces(PK[1], PK[2], PK[3], PP) + Result; Inc(k) end end end else Result := strValue + ' '; { add a currency } if strValue[DL - 1] = '1' then PG := 3 else PG := GetDeclension(strValue[DL]); if (IntPart = True) then begin if (exWholeCurrency in Expand) then Result := Result + FullCurrency[Language][Ord(Currency), PG] else Result := Result + ShortCurrency[Language][Ord(Currency), 1] + '.'; end else begin if (exFractionCurrency in Expand) then Result := Result + FullCurrency[Language][Ord(Currency), 3+PG] else Result := Result + ShortCurrency[Language][Ord(Currency), 2] + '.'; end; end; function GetMoneyStr(Value: Double; Expand: TExpand; Language: TLanguage; Currency: TCurrency; CharCase: TCharCase): string; var s: string; begin s := GetMoneyString(True, IntToStr(Trunc(Value)), Expand, Language, Currency) + ' ' + GetMoneyString(False, IntToStr(Round(Frac(Value)*100)), Expand, Language, Currency); case CharCase of ccProper: s[1] := AnsiUpperCase(s[1])[1]; ccUpper: s := AnsiUpperCase(s); end; Result := s; end; { TMoneyString } constructor TMoneyString.Create(AOwner: TComponent); begin inherited Create(AOwner); FCurrency := tcUSD; FLanguage := tlEnglish; WordWrap := True; AutoSize := False; FExpand := [exWholeSum, exWholeCurrency, exFractionSum, exFractionCurrency]; Value := 1; end; procedure TMoneyString.BuildMoneyString; begin Caption := GetMoneyStr(FValue, Expand, FLanguage, FCurrency, FCharCase); end; procedure TMoneyString.SetValue(Val: Double); begin if (FValue <> Val) then begin FValue := Val; BuildMoneyString; end; end; procedure TMoneyString.SetCurrency(Val: TCurrency); begin if (FCurrency <> Val) then begin FCurrency := Val; BuildMoneyString; end; end; procedure TMoneyString.SetLanguage(Val: TLanguage); begin if (FLanguage <> Val) then begin FLanguage := Val; BuildMoneyString; end; end; procedure TMoneyString.SetExpand(Val: TExpand); begin if (FExpand <> Val) then begin FExpand := Val; BuildMoneyString; end; end; procedure TMoneyString.SetCharCase(Val: TCharCase); begin if (FCharCase <> Val) then begin FCharCase := Val; BuildMoneyString; end; end; end.
unit ca8087; {$INCLUDE ca.inc} interface uses // Standard Delphi units  Windows, SysUtils, Classes, // ca units  caClasses, caTimer, caUtils; type Tca8087ExceptionFlag = (efInvalid, efDenormalized, efZeroDivide, efOverflow, efUnderflow, efPrecision); Tca8087ExceptionFlags = set of Tca8087ExceptionFlag; Tca8087Precision = (prSingle, prDouble, prReserved, prExtended); Tca8087RoundingMode = (rmNearestEven, rmNegInfinity, rmPosInfinity, rmZero); //--------------------------------------------------------------------------- // Tca8087   //--------------------------------------------------------------------------- Tca8087 = class(TComponent) private // Private fields  FTimer: TcaTimer; // Property fields  FExceptionFlags: Tca8087ExceptionFlags; FPrecision: Tca8087Precision; FRoundingMode: Tca8087RoundingMode; // Property methods  function GetActive: Boolean; function GetExceptionFlags: Tca8087ExceptionFlags; function GetPrecision: Tca8087Precision; function GetRoundingMode: Tca8087RoundingMode; function GetStatusAsString: String; procedure SetActive(const Value: Boolean); procedure SetExceptionFlags(const Value: Tca8087ExceptionFlags); procedure SetPrecision(const Value: Tca8087Precision); procedure SetRoundingMode(const Value: Tca8087RoundingMode); // Event handlers  procedure TimerEvent(Sender: TObject); // Private methods  procedure UpdateStatus; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; // Public methods  procedure Update; // Properties  property StatusAsString: String read GetStatusAsString; published // Properties  property Active: Boolean read GetActive write SetActive; property ExceptionFlags: Tca8087ExceptionFlags read GetExceptionFlags write SetExceptionFlags; property Precision: Tca8087Precision read GetPrecision write SetPrecision; property RoundingMode: Tca8087RoundingMode read GetRoundingMode write SetRoundingMode; end; implementation //--------------------------------------------------------------------------- // Tca8087   //--------------------------------------------------------------------------- constructor Tca8087.Create(AOwner: TComponent); begin inherited; FTimer := TcaTimer.Create(nil); FTimer.Enabled := False; FTimer.OnTimer := TimerEvent; end; destructor Tca8087.Destroy; begin FTimer.Free; inherited; end; // Public methods  procedure Tca8087.Update; begin UpdateStatus; end; // Private methods  procedure Tca8087.UpdateStatus; var StatusWord: Word; ExcFlag: Tca8087ExceptionFlag; ExcMask: Word; MathUtils: IcaMathUtils; PrecFlags: Word; RoundFlags: Word; begin MathUtils := Utils as IcaMathUtils; StatusWord := MathUtils.Get8087ControlWord; //--------------------------------------------------------------------------- // EXCEPTION-FLAG MASKS 0-5   //    // 0 -> IM Invalid Operation    // 1 -> DM Denormalized Operand    // 2 -> ZM Zero Divide    // 3 -> OM Overflow    // 4 -> UM Underflow    // 5 -> PM Precision    //--------------------------------------------------------------------------- FExceptionFlags := []; for ExcFlag := Low(Tca8087ExceptionFlag) to High(Tca8087ExceptionFlag) do begin ExcMask := 1 shl Ord(ExcFlag); if (StatusWord and ExcMask) <> 0 then Include(FExceptionFlags, ExcFlag); end; //--------------------------------------------------------------------------- // PRECISION CONTROL FIELD   //    // 8,9 PC -> Single Precision (24-bit) = $00B    // Double Precision (53-bit) = $10B    // Extended Precision (64-bit) = $11B    // Reserved    //--------------------------------------------------------------------------- PrecFlags := (StatusWord and $300) shr 8; FPrecision := Tca8087Precision(PrecFlags); //--------------------------------------------------------------------------- // ROUNDING MODE   //    // 10,11 RC -> Round to nearest even = $00B    // Round down toward -ve infinity = $01B    // Round up toward +ve infinity = $10B    // Round toward zero (trunc) = $11B    //--------------------------------------------------------------------------- RoundFlags := (StatusWord and $C00) shr 10; FRoundingMode := Tca8087RoundingMode(RoundFlags); end; // Event handlers  procedure Tca8087.TimerEvent(Sender: TObject); begin UpdateStatus; end; // Property methods  function Tca8087.GetActive: Boolean; begin Result := FTimer.Enabled; end; function Tca8087.GetExceptionFlags: Tca8087ExceptionFlags; begin Result := FExceptionFlags; end; function Tca8087.GetPrecision: Tca8087Precision; begin Result := FPrecision; end; function Tca8087.GetRoundingMode: Tca8087RoundingMode; begin Result := FRoundingMode; end; // Tca8087ExceptionFlag = (efInvalid, efDenormalized, efZeroDivide, efOverflow, efUnderflow, efPrecision); // // Tca8087ExceptionFlags = set of Tca8087ExceptionFlag; // // Tca8087Precision = (prSingle, prDouble, prReserved, prExtended); // // Tca8087RoundingMode = (rmNearestEven, rmNegInfinity, rmPosInfinity, rmZero); // function Tca8087.GetStatusAsString: String; var StatusStrings: TStringList; begin UpdateStatus; StatusStrings := Auto(TStringList.Create).Instance; // Exception Flags  StatusStrings.Add('Exception Flags'); if efInvalid in FExceptionFlags then StatusStrings.Add(' Invalid'); if efDenormalized in FExceptionFlags then StatusStrings.Add(' Denormalized'); if efZeroDivide in FExceptionFlags then StatusStrings.Add(' ZeroDivide'); if efOverflow in FExceptionFlags then StatusStrings.Add(' Overflow'); if efUnderflow in FExceptionFlags then StatusStrings.Add(' Underflow'); if efPrecision in FExceptionFlags then StatusStrings.Add(' Precision'); if StatusStrings.Count = 1 then StatusStrings.Clear; // Precision  StatusStrings.Add(''); case FPrecision of prSingle: StatusStrings.Add('Precision = Single'); prDouble: StatusStrings.Add('Precision = Double'); prReserved: StatusStrings.Add('Precision = Reserved'); prExtended: StatusStrings.Add('Precision = Extended'); end; // Rounding Mode  StatusStrings.Add(''); case FRoundingMode of rmNearestEven: StatusStrings.Add('Rounding Mode = Nearest Even'); rmNegInfinity: StatusStrings.Add('Rounding Mode = Neg Infinity'); rmPosInfinity: StatusStrings.Add('Rounding Mode = Pos Infinity'); rmZero: StatusStrings.Add('Rounding Mode = Zero'); end; Result := StatusStrings.Text; end; procedure Tca8087.SetActive(const Value: Boolean); begin FTimer.Enabled := Value; end; procedure Tca8087.SetExceptionFlags(const Value: Tca8087ExceptionFlags); begin FExceptionFlags := Value; end; procedure Tca8087.SetPrecision(const Value: Tca8087Precision); begin FPrecision := Value; end; procedure Tca8087.SetRoundingMode(const Value: Tca8087RoundingMode); begin FRoundingMode := Value; end; end.
{*******************************************************} { } { Delphi DBX Framework } { } { Copyright(c) 1995-2011 Embarcadero Technologies, Inc. } { } {*******************************************************} unit Data.DBXSybaseASEMetaDataWriter; interface uses Data.DBXCommonTable, Data.DBXMetaDataWriter, Data.DBXPlatform; type TDBXSybaseASECustomMetaDataWriter = class(TDBXBaseMetaDataWriter) public procedure MakeSqlCreate(const Buffer: TDBXStringBuffer; const Item: TDBXTableRow; const Parts: TDBXTable); override; procedure MakeSqlAlter(const Buffer: TDBXStringBuffer; const Item: TDBXTableRow; const Parts: TDBXTable); override; procedure MakeSqlDrop(const Buffer: TDBXStringBuffer; const Item: TDBXTableRow); override; protected procedure MakeSqlColumnTypeCast(const Buffer: TDBXStringBuffer; const Column: TDBXTable); override; procedure MakeSqlDropSecondaryIndex(const Buffer: TDBXStringBuffer; const Index: TDBXTableRow); override; private const SetQuotedIdentifiersOn = 'SET QUOTED_IDENTIFIER ON;'#$a; end; TDBXSybaseASEMetaDataWriter = class(TDBXSybaseASECustomMetaDataWriter) public constructor Create; procedure Open; override; protected function GetSqlAutoIncrementKeyword: UnicodeString; override; function GetSqlAutoIncrementInserts: UnicodeString; override; function IsCatalogsSupported: Boolean; override; function IsSchemasSupported: Boolean; override; function IsSerializedIsolationSupported: Boolean; override; function IsMultipleStatementsSupported: Boolean; override; function IsDDLTransactionsSupported: Boolean; override; function GetSqlRenameTable: UnicodeString; override; end; implementation uses Data.DBXMetaDataNames, Data.DBXSybaseASEMetaDataReader; procedure TDBXSybaseASECustomMetaDataWriter.MakeSqlCreate(const Buffer: TDBXStringBuffer; const Item: TDBXTableRow; const Parts: TDBXTable); begin Buffer.Append(SetQuotedIdentifiersOn); inherited MakeSqlCreate(Buffer, Item, Parts); end; procedure TDBXSybaseASECustomMetaDataWriter.MakeSqlAlter(const Buffer: TDBXStringBuffer; const Item: TDBXTableRow; const Parts: TDBXTable); begin Buffer.Append(SetQuotedIdentifiersOn); inherited MakeSqlAlter(Buffer, Item, Parts); end; procedure TDBXSybaseASECustomMetaDataWriter.MakeSqlDrop(const Buffer: TDBXStringBuffer; const Item: TDBXTableRow); begin Buffer.Append(SetQuotedIdentifiersOn); inherited MakeSqlDrop(Buffer, Item); end; procedure TDBXSybaseASECustomMetaDataWriter.MakeSqlColumnTypeCast(const Buffer: TDBXStringBuffer; const Column: TDBXTable); var Original: TDBXTableRow; begin Original := Column.OriginalRow; Buffer.Append(TDBXSQL.Convert); Buffer.Append(TDBXSQL.OpenParen); MakeSqlDataType(Buffer, Column.Value[TDBXColumnsIndex.TypeName].AsString, Column); Buffer.Append(TDBXSQL.Comma); Buffer.Append(TDBXSQL.Space); MakeSqlIdentifier(Buffer, Original.Value[TDBXColumnsIndex.ColumnName].GetWideString(NullString)); Buffer.Append(TDBXSQL.CloseParen); end; procedure TDBXSybaseASECustomMetaDataWriter.MakeSqlDropSecondaryIndex(const Buffer: TDBXStringBuffer; const Index: TDBXTableRow); var Original: TDBXTableRow; begin Original := Index.OriginalRow; Buffer.Append(TDBXSQL.Drop); Buffer.Append(TDBXSQL.Space); Buffer.Append(TDBXSQL.Index); Buffer.Append(TDBXSQL.Space); MakeSqlIdentifier(Buffer, Original.Value[TDBXIndexesIndex.TableName].GetWideString(NullString)); Buffer.Append(TDBXSQL.Dot); MakeSqlIdentifier(Buffer, Original.Value[TDBXIndexesIndex.IndexName].GetWideString(NullString)); Buffer.Append(TDBXSQL.Semicolon); Buffer.Append(TDBXSQL.Nl); end; constructor TDBXSybaseASEMetaDataWriter.Create; begin inherited Create; Open; end; procedure TDBXSybaseASEMetaDataWriter.Open; begin if FReader = nil then FReader := TDBXSybaseASEMetaDataReader.Create; end; function TDBXSybaseASEMetaDataWriter.GetSqlAutoIncrementKeyword: UnicodeString; begin Result := 'IDENTITY'; end; function TDBXSybaseASEMetaDataWriter.GetSqlAutoIncrementInserts: UnicodeString; begin Result := 'IDENTITY_INSERT'; end; function TDBXSybaseASEMetaDataWriter.IsCatalogsSupported: Boolean; begin Result := False; end; function TDBXSybaseASEMetaDataWriter.IsSchemasSupported: Boolean; begin Result := True; end; function TDBXSybaseASEMetaDataWriter.IsSerializedIsolationSupported: Boolean; begin Result := False; end; function TDBXSybaseASEMetaDataWriter.IsMultipleStatementsSupported: Boolean; begin Result := False; end; function TDBXSybaseASEMetaDataWriter.IsDDLTransactionsSupported: Boolean; begin Result := False; end; function TDBXSybaseASEMetaDataWriter.GetSqlRenameTable: UnicodeString; begin Result := 'EXEC sp_rename '':SCHEMA_NAME.:TABLE_NAME'', '':NEW_TABLE_NAME'', ''OBJECT'''; end; end.
unit NtUtils.Objects.Snapshots; interface uses Ntapi.ntexapi, NtUtils.Objects, NtUtils.Exceptions, Ntapi.ntpsapi; type TProcessHandleEntry = Ntapi.ntpsapi.TProcessHandleTableEntryInfo; TSystemHandleEntry = Ntapi.ntexapi.TSystemHandleTableEntryInfoEx; TObjectEntry = record ObjectName: String; Other: TSystemObjectInformation; end; PObjectEntry = ^TObjectEntry; TObjectTypeEntry = record TypeName: String; Other: TSystemObjectTypeInformation; Objects: TArray<TObjectEntry>; end; TFilterAction = (ftInclude, ftExclude); { Process handles } // Snapshot handles of a specific process (NOTE: only Windows 8+) function NtxEnumerateHandlesProcess(hProcess: THandle; out Handles: TArray<TProcessHandleEntry>): TNtxStatus; // Snapshot handles of a specific process (older systems) function NtxEnumerateHandlesProcessLegacy(PID: NativeUInt; out Handles: TArray<TProcessHandleEntry>): TNtxStatus; { System Handles } // Snapshot all handles on the system function NtxEnumerateHandles(out Handles: TArray<TSystemHandleEntry>): TNtxStatus; // Find a handle entry function NtxFindHandleEntry(Handles: TArray<TSystemHandleEntry>; PID: NativeUInt; Handle: THandle; out Entry: TSystemHandleEntry): Boolean; // Filter handles that reference the same object as a local handle procedure NtxFilterHandlesByHandle(var Handles: TArray<TSystemHandleEntry>; Handle: THandle); { System objects } // Check if object snapshoting is supported function NtxObjectEnumerationSupported: Boolean; // Snapshot objects on the system function NtxEnumerateObjects(out Types: TArray<TObjectTypeEntry>): TNtxStatus; // Find object entry by a object's address function NtxFindObjectByAddress(Types: TArray<TObjectTypeEntry>; Address: Pointer): PObjectEntry; { Types } // Enumerate kernel object types on the system function NtxEnumerateTypes(out Types: TArray<TObjectTypeInfo>): TNtxStatus; { Filtration routines } // Process handles function FilterByType(const HandleEntry: TProcessHandleEntry; TypeIndex: NativeUInt): Boolean; overload; function FilterByAccess(const HandleEntry: TProcessHandleEntry; AccessMask: NativeUInt): Boolean; overload; // System handles function FilterByProcess(const HandleEntry: TSystemHandleEntry; PID: NativeUInt): Boolean; function FilterByAddress(const HandleEntry: TSystemHandleEntry; ObjectAddress: NativeUInt): Boolean; function FilterByType(const HandleEntry: TSystemHandleEntry; TypeIndex: NativeUInt): Boolean; overload; function FilterByAccess(const HandleEntry: TSystemHandleEntry; AccessMask: NativeUInt): Boolean; overload; implementation uses Winapi.WinNt, Ntapi.ntdef, Ntapi.ntstatus, Ntapi.ntrtl, Ntapi.ntobapi, NtUtils.Processes, DelphiUtils.Arrays; { Process Handles } function NtxEnumerateHandlesProcess(hProcess: THandle; out Handles: TArray<TProcessHandleEntry>): TNtxStatus; var xMemory: IMemory; Buffer: PProcessHandleSnapshotInformation; i: Integer; begin Result := NtxQueryProcess(hProcess, ProcessHandleInformation, xMemory); if Result.IsSuccess then begin Buffer := xMemory.Address; SetLength(Handles, Buffer.NumberOfHandles); for i := 0 to High(Handles) do Handles[i] := Buffer.Handles{$R-}[i]{$R+}; end; end; function SystemToProcessEntry(const Entry: TSystemHandleEntry; out ConvertedEntry: TProcessHandleEntry): Boolean; begin Result := True; ConvertedEntry.HandleValue := Entry.HandleValue; ConvertedEntry.HandleCount := 0; // unavailable, query it manually ConvertedEntry.PointerCount := 0; // unavailable, query it manually ConvertedEntry.GrantedAccess := Entry.GrantedAccess; ConvertedEntry.ObjectTypeIndex := Entry.ObjectTypeIndex; ConvertedEntry.HandleAttributes := Entry.HandleAttributes; end; function NtxEnumerateHandlesProcessLegacy(PID: NativeUInt; out Handles: TArray<TProcessHandleEntry>): TNtxStatus; var AllHandles: TArray<TSystemHandleEntry>; begin Result := NtxEnumerateHandles(AllHandles); if Result.IsSuccess then begin // Filter only specific process TArrayHelper.Filter<TSystemHandleEntry>(AllHandles, FilterByProcess, PID); // Convert system handle entries to process handle entries TArrayHelper.Convert<TSystemHandleEntry, TProcessHandleEntry>(AllHandles, Handles, SystemToProcessEntry); end; end; { System Handles } function NtxEnumerateHandles(out Handles: TArray<TSystemHandleEntry>): TNtxStatus; var BufferSize, ReturnLength: Cardinal; Buffer: PSystemHandleInformationEx; i: Integer; begin Result.Location := 'NtQuerySystemInformation'; Result.LastCall.CallType := lcQuerySetCall; Result.LastCall.InfoClass := Cardinal(SystemExtendedHandleInformation); Result.LastCall.InfoClassType := TypeInfo(TSystemInformationClass); // On my system it is usually about 60k handles, so it's about 2.5 MB of data. // // We don't want to use a huge initial buffer since system spends // more time probing it rather than coollecting the handles. BufferSize := 4 * 1024 * 1024; repeat Buffer := AllocMem(BufferSize); ReturnLength := 0; Result.Status := NtQuerySystemInformation(SystemExtendedHandleInformation, Buffer, BufferSize, @ReturnLength); if not Result.IsSuccess then FreeMem(Buffer); until not NtxExpandBuffer(Result, BufferSize, ReturnLength, True); if not Result.IsSuccess then Exit; SetLength(Handles, Buffer.NumberOfHandles); for i := 0 to High(Handles) do Handles[i] := Buffer.Handles{$R-}[i]{$R+}; FreeMem(Buffer); end; function NtxFindHandleEntry(Handles: TArray<TSystemHandleEntry>; PID: NativeUInt; Handle: THandle; out Entry: TSystemHandleEntry): Boolean; var i: Integer; begin for i := 0 to High(Handles) do if (Handles[i].UniqueProcessId = PID) and (Handles[i].HandleValue = Handle) then begin Entry := Handles[i]; Exit(True); end; Result := False; end; procedure NtxFilterHandlesByHandle(var Handles: TArray<TSystemHandleEntry>; Handle: THandle); var Entry: TSystemHandleEntry; begin if NtxFindHandleEntry(Handles, NtCurrentProcessId, Handle, Entry) then TArrayHelper.Filter<TSystemHandleEntry>(Handles, FilterByAddress, NativeUInt(Entry.PObject)) else SetLength(Handles, 0); end; { Objects } function NtxObjectEnumerationSupported: Boolean; begin Result := (RtlGetNtGlobalFlags and FLG_MAINTAIN_OBJECT_TYPELIST <> 0); end; function NtxEnumerateObjects(out Types: TArray<TObjectTypeEntry>): TNtxStatus; var BufferSize, Required: Cardinal; Buffer, pTypeEntry: PSystemObjectTypeInformation; pObjEntry: PSystemObjectInformation; Count, i, j: Integer; begin Result.Location := 'NtQuerySystemInformation'; Result.LastCall.CallType := lcQuerySetCall; Result.LastCall.InfoClass := Cardinal(SystemObjectInformation); Result.LastCall.InfoClassType := TypeInfo(TSystemInformationClass); // On my system it is usually about 22k objects, so about 2 MB of data. // We don't want to use a huge initial buffer since system spends more time // probing it rather than collecting the objects BufferSize := 3 * 1024 * 1024; repeat Buffer := AllocMem(BufferSize); Required := 0; Result.Status := NtQuerySystemInformation(SystemObjectInformation, Buffer, BufferSize, @Required); if not Result.IsSuccess then FreeMem(Buffer); // The call usually does not calculate the required // size in one pass, we need to speed it up. Required := Required shl 1 + 64 * 1024 // x2 + 64 kB until not NtxExpandBuffer(Result, BufferSize, Required); if not Result.IsSuccess then Exit; // Count returned types Count := 0; pTypeEntry := Buffer; repeat Inc(Count); if pTypeEntry.NextEntryOffset = 0 then Break else pTypeEntry := Offset(Buffer, pTypeEntry.NextEntryOffset); until False; SetLength(Types, Count); // Iterarate through each type j := 0; pTypeEntry := Buffer; repeat // Copy type information Types[j].TypeName := pTypeEntry.TypeName.ToString; Types[j].Other := pTypeEntry^; Types[j].Other.TypeName.Buffer := PWideChar(Types[j].TypeName); // Count objects of this type Count := 0; pObjEntry := Offset(pTypeEntry, SizeOf(TSystemObjectTypeInformation) + pTypeEntry.TypeName.MaximumLength); repeat Inc(Count); if pObjEntry.NextEntryOffset = 0 then Break else pObjEntry := Offset(Buffer, pObjEntry.NextEntryOffset); until False; SetLength(Types[j].Objects, Count); // Iterate trough objects i := 0; pObjEntry := Offset(pTypeEntry, SizeOf(TSystemObjectTypeInformation) + pTypeEntry.TypeName.MaximumLength); repeat // Copy object information Types[j].Objects[i].ObjectName := pObjEntry.NameInfo.ToString; Types[j].Objects[i].Other := pObjEntry^; Types[j].Objects[i].Other.NameInfo.Buffer := PWideChar(Types[j].Objects[i].ObjectName); if pObjEntry.NextEntryOffset = 0 then Break else pObjEntry := Offset(Buffer, pObjEntry.NextEntryOffset); Inc(i); until False; // Skip to the next type if pTypeEntry.NextEntryOffset = 0 then Break else pTypeEntry := Offset(Buffer, pTypeEntry.NextEntryOffset); Inc(j); until False; FreeMem(Buffer); end; function NtxFindObjectByAddress(Types: TArray<TObjectTypeEntry>; Address: Pointer): PObjectEntry; var i, j: Integer; begin for i := 0 to High(Types) do for j := 0 to High(Types[i].Objects) do if Types[i].Objects[j].Other.ObjectAddress = Address then Exit(@Types[i].Objects[j]); Result := nil; end; { Types } function NtxEnumerateTypes(out Types: TArray<TObjectTypeInfo>): TNtxStatus; var Buffer: PObjectTypesInformation; pType: PObjectTypeInformation; BufferSize, Required: Cardinal; i: Integer; begin Result.Location := 'NtQueryObject'; Result.LastCall.CallType := lcQuerySetCall; Result.LastCall.InfoClass := Cardinal(ObjectTypesInformation); Result.LastCall.InfoClassType := TypeInfo(TObjectInformationClass); BufferSize := SizeOf(TObjectTypesInformation); repeat Buffer := AllocMem(BufferSize); Required := 0; Result.Status := NtQueryObject(0, ObjectTypesInformation, Buffer, BufferSize, @Required); if not Result.IsSuccess then FreeMem(Buffer); until not NtxExpandBuffer(Result, BufferSize, Required, True); if not Result.IsSuccess then Exit; SetLength(Types, Buffer.NumberOfTypes); i := 0; pType := Offset(Buffer, SizeOf(NativeUInt)); repeat Types[i].Other := pType^; Types[i].TypeName := pType.TypeName.ToString; Types[i].Other.TypeName.Buffer := PWideChar(Types[i].TypeName); // Until Win 8.1 ObQueryTypeInfo didn't write anything to TypeIndex field. // Fix it by manually calculating this value. // Note: NtQueryObject iterates through ObpObjectTypes which is zero-based; // but TypeIndex is an index in ObTypeIndexTable which starts with 2. if Types[i].Other.TypeIndex = 0 then Types[i].Other.TypeIndex := OB_TYPE_INDEX_TABLE_TYPE_OFFSET + i; pType := Offset(pType, AlighUp(SizeOf(TObjectTypeInformation)) + AlighUp(pType.TypeName.MaximumLength)); Inc(i); until i > High(Types); FreeMem(Buffer); end; { Filtration routines} // Process handles function FilterByType(const HandleEntry: TProcessHandleEntry; TypeIndex: NativeUInt): Boolean; overload; begin Result := (HandleEntry.ObjectTypeIndex = Cardinal(TypeIndex)); end; function FilterByAccess(const HandleEntry: TProcessHandleEntry; AccessMask: NativeUInt): Boolean; overload; begin Result := (HandleEntry.GrantedAccess = TAccessMask(AccessMask)); end; // System handles function FilterByProcess(const HandleEntry: TSystemHandleEntry; PID: NativeUInt): Boolean; begin Result := (HandleEntry.UniqueProcessId = PID); end; function FilterByAddress(const HandleEntry: TSystemHandleEntry; ObjectAddress: NativeUInt): Boolean; begin Result := (HandleEntry.PObject = Pointer(ObjectAddress)); end; function FilterByType(const HandleEntry: TSystemHandleEntry; TypeIndex: NativeUInt): Boolean; begin Result := (HandleEntry.ObjectTypeIndex = Word(TypeIndex)); end; function FilterByAccess(const HandleEntry: TSystemHandleEntry; AccessMask: NativeUInt): Boolean; begin Result := (HandleEntry.GrantedAccess = TAccessMask(AccessMask)); end; end.
unit uoclidata; interface uses SysUtils; // TCstDB provides constants for all other classes depending on the client. // Constants can be locations of client variables, delta values between blocks // of memory, addresses that point to code (for events) or flags for enabling // new features in later clients. type TCstDB = class(TObject) public /// VARIABLES //////////// BLOCKINFO : Cardinal; CLILOGGED : Cardinal; CLIXRES : Cardinal; ENEMYID : Cardinal; SHARDPOS : Cardinal; NEXTCPOS : Cardinal; SYSMSG : Cardinal; CONTPOS : Cardinal; ENEMYHITS : Cardinal; LHANDID : Cardinal; CHARDIR : Cardinal; TARGETCNT : Cardinal; CURSORKIND : Cardinal; TARGETCURS : Cardinal; CLILEFT : Cardinal; CHARPTR : Cardinal; LLIFTEDID : Cardinal; LSHARD : Cardinal; POPUPID : Cardinal; JOURNALPTR : Cardinal; SKILLCAPS : Cardinal; SKILLLOCK : Cardinal; SKILLSPOS : Cardinal; /// BASE CONSTANTS /////// BTARGPROC : Cardinal; BCHARSTATUS : Cardinal; BITEMID : Cardinal; BITEMTYPE : Cardinal; BITEMSTACK : Cardinal; BSTATNAME : Cardinal; BSTATWEIGHT : Cardinal; BSTATAR : Cardinal; BSTATML : Cardinal; BCONTSIZEX : Cardinal; BCONTX : Cardinal; BCONTITEM : Cardinal; BCONTNEXT : Cardinal; BENEMYHPVAL : Cardinal; BSHOPCURRENT : Cardinal; BSHOPNEXT : Cardinal; BBILLFIRST : Cardinal; BSKILLDIST : Cardinal; BSYSMSGSTR : Cardinal; BEVSKILLPAR : Cardinal; BLLIFTEDTYPE : Cardinal; BLLIFTEDKIND : Cardinal; BLANG : Cardinal; BTITHE : Cardinal; BFINDREP : Cardinal; BSHOPPRICE : Cardinal; BGUMPPTR : Cardinal; BITEMSLOT : Cardinal; BPACKETVER : Cardinal; BLTARGTILE : Cardinal; BLTARGX : Cardinal; BSTAT1 : Cardinal; /// EVENTS /////////////// EREDIR : Cardinal; EOLDDIR : Cardinal; EEXMSGADDR : Cardinal; EITEMPROPID : Cardinal; EITEMNAMEADDR : Cardinal; EITEMPROPADDR : Cardinal; EITEMCHECKADDR : Cardinal; EITEMREQADDR : Cardinal; EPATHFINDADDR : Cardinal; ESLEEPADDR : Cardinal; EDRAGADDR : Cardinal; ESYSMSGADDR : Cardinal; EMACROADDR : Cardinal; ESKILLLOCKADDR : Cardinal; ESENDPACKET : Cardinal; ESENDLEN : Cardinal; ESENDECX : Cardinal; ECONTTOP : Cardinal; ESTATBAR : Cardinal; /// FEATURES ///////////// FEXTSTAT : Cardinal; FEVPROPERTY : Cardinal; FMACROMAP : Cardinal; FEXCHARSTATC : Cardinal; FPACKETVER : Cardinal; FPATHFINDVER : Cardinal; FFLAGS : Cardinal; ////////////////////////// constructor Create; procedure Update(CliVer : AnsiString); end; var SupportedCli : AnsiString; implementation //////////////////////////////////////////////////////////////////////////////// type TConstantNames = ( /// VARIABLES ///////// C_BLOCKINFO,C_CLILOGGED,C_CLIXRES,C_ENEMYID,C_SHARDPOS,C_NEXTCPOS, C_SYSMSG,C_CONTPOS,C_ENEMYHITS,C_LHANDID,C_CHARDIR,C_TARGETCNT, C_CURSORKIND,C_TARGETCURS,C_CLILEFT,C_CHARPTR,C_LLIFTEDID, C_LSHARD,C_POPUPID,C_JOURNALPTR,C_SKILLCAPS,C_SKILLLOCK,C_SKILLSPOS, /// BASE CONSTANTS //// B_TARGPROC,B_CHARSTATUS,B_ITEMID,B_ITEMTYPE, B_ITEMSTACK,B_STATNAME,B_STATWEIGHT,B_STATAR,B_STATML,B_CONTSIZEX, B_CONTX,B_CONTITEM,B_CONTNEXT,B_ENEMYHPVAL,B_SHOPCURRENT, B_SHOPNEXT,B_BILLFIRST,B_SKILLDIST,B_SYSMSGSTR,B_EVSKILLPAR, B_LLIFTEDTYPE,B_LLIFTEDKIND,B_LANG,B_TITHE,B_FINDREP, B_SHOPPRICE,B_GUMPPTR,B_ITEMSLOT,B_PACKETVER,B_LTARGTILE, B_LTARGX,B_STAT1, /// EVENTS //////////// E_REDIR,E_OLDDIR,E_EXMSGADDR, E_ITEMPROPID,E_ITEMNAMEADDR,E_ITEMPROPADDR,E_ITEMCHECKADDR, E_ITEMREQADDR,E_PATHFINDADDR,E_SLEEPADDR,E_DRAGADDR, E_SYSMSGADDR,E_MACROADDR,E_SKILLLOCKADDR,E_SENDPACKET, E_SENDLEN,E_SENDECX,E_CONTTOP,E_STATBAR, /// FEATURES ////////// F_EXTSTAT,F_EVPROPERTY,F_MACROMAP,F_EXCHARSTATC, F_PACKETVER, F_PATHFINDVER,F_FLAGS, /// END /////////////// LISTEND ); TSysVar = packed record Expr : TConstantNames; Val : Cardinal; end; TSysVarList = array[0..1023] of TSysVar; PSysVarList = ^TSysVarList; TClientList = packed record Cli : AnsiString; List : PSysVarList; end; const //////////////////////////////////////////////////////////////////////////////// SysVar70520 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590A50), (Expr: C_CLILOGGED ; Val: $006F7C6C), (Expr: C_CLIXRES ; Val: $006F8214), (Expr: C_ENEMYID ; Val: $0096F094), (Expr: C_SHARDPOS ; Val: $00974EE8), (Expr: C_NEXTCPOS ; Val: $00975084), (Expr: C_SYSMSG ; Val: $00975B14), (Expr: C_CONTPOS ; Val: $00975B34), (Expr: C_ENEMYHITS ; Val: $00A3DD1C), (Expr: C_LHANDID ; Val: $00A9A29C), (Expr: C_CHARDIR ; Val: $00A9B058), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9F77D), (Expr: C_TARGETCURS ; Val: $00A9F7DC), (Expr: C_CLILEFT ; Val: $00A9F808), (Expr: C_CHARPTR ; Val: $00AE049C), (Expr: C_LLIFTEDID ; Val: $00AE04E8), (Expr: C_LSHARD ; Val: $00AE4B34), (Expr: C_POPUPID ; Val: $00AE4CA4), (Expr: C_JOURNALPTR ; Val: $00B1CE38), (Expr: C_SKILLCAPS ; Val: $00B5F128), (Expr: C_SKILLLOCK ; Val: $00B5F0EC), (Expr: C_SKILLSPOS ; Val: $00B5F1A0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005994DD), (Expr: E_OLDDIR ; Val: $0061EB00), (Expr: E_EXMSGADDR ; Val: $005A66F0), (Expr: E_ITEMPROPID ; Val: $00A9220C), (Expr: E_ITEMNAMEADDR ; Val: $00577310), (Expr: E_ITEMPROPADDR ; Val: $00577210), (Expr: E_ITEMCHECKADDR ; Val: $0043DAE0), (Expr: E_ITEMREQADDR ; Val: $0043EE40), (Expr: E_PATHFINDADDR ; Val: $00503869), (Expr: E_SLEEPADDR ; Val: $006820EC), (Expr: E_DRAGADDR ; Val: $005A7E40), (Expr: E_SYSMSGADDR ; Val: $005D3E70), (Expr: E_MACROADDR ; Val: $0057F610), (Expr: E_SENDPACKET ; Val: $0045CD70), (Expr: E_CONTTOP ; Val: $004DC960), (Expr: E_STATBAR ; Val: $00546EC0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70511 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00591A70), (Expr: C_CLILOGGED ; Val: $006F8CA4), (Expr: C_CLIXRES ; Val: $006F924C), (Expr: C_ENEMYID ; Val: $00970094), (Expr: C_SHARDPOS ; Val: $00975EE8), (Expr: C_NEXTCPOS ; Val: $00976084), (Expr: C_SYSMSG ; Val: $00976B14), (Expr: C_CONTPOS ; Val: $00976B34), (Expr: C_ENEMYHITS ; Val: $00A3ED1C), (Expr: C_LHANDID ; Val: $00A9729C), (Expr: C_CHARDIR ; Val: $00A98058), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9C77D), (Expr: C_TARGETCURS ; Val: $00A9C7DC), (Expr: C_CLILEFT ; Val: $00A9C808), (Expr: C_CHARPTR ; Val: $00ADD49C), (Expr: C_LLIFTEDID ; Val: $00ADD4E8), (Expr: C_LSHARD ; Val: $00AE1B34), (Expr: C_POPUPID ; Val: $00AE1CA4), (Expr: C_JOURNALPTR ; Val: $00B19E38), (Expr: C_SKILLCAPS ; Val: $00B5C128), (Expr: C_SKILLLOCK ; Val: $00B5C0EC), (Expr: C_SKILLSPOS ; Val: $00B5C1A0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059A4FD), (Expr: E_OLDDIR ; Val: $0061F800), (Expr: E_EXMSGADDR ; Val: $005A7710), (Expr: E_ITEMPROPID ; Val: $00A9320C), (Expr: E_ITEMNAMEADDR ; Val: $00578330), (Expr: E_ITEMPROPADDR ; Val: $00578230), (Expr: E_ITEMCHECKADDR ; Val: $0043DAE0), (Expr: E_ITEMREQADDR ; Val: $0043EE40), (Expr: E_PATHFINDADDR ; Val: $00504919), (Expr: E_SLEEPADDR ; Val: $006830EC), (Expr: E_DRAGADDR ; Val: $005A8E60), (Expr: E_SYSMSGADDR ; Val: $005D4B70), (Expr: E_MACROADDR ; Val: $00580630), (Expr: E_SENDPACKET ; Val: $0045CD70), (Expr: E_CONTTOP ; Val: $004DDA10), (Expr: E_STATBAR ; Val: $00547F70), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar704962 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590350), (Expr: C_CLILOGGED ; Val: $006F7C4C), (Expr: C_CLIXRES ; Val: $006F81F4), (Expr: C_ENEMYID ; Val: $0096F074), (Expr: C_SHARDPOS ; Val: $00974EC8), (Expr: C_NEXTCPOS ; Val: $00975064), (Expr: C_SYSMSG ; Val: $00975AEC), (Expr: C_CONTPOS ; Val: $00975B0C), (Expr: C_ENEMYHITS ; Val: $00A3DCF4), (Expr: C_LHANDID ; Val: $00A96274), (Expr: C_CHARDIR ; Val: $00A97030), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9B755), (Expr: C_TARGETCURS ; Val: $00A9B7B4), (Expr: C_CLILEFT ; Val: $00A9B7E0), (Expr: C_CHARPTR ; Val: $00ADC474), (Expr: C_LLIFTEDID ; Val: $00ADC4C0), (Expr: C_LSHARD ; Val: $00AE0B0C), (Expr: C_POPUPID ; Val: $00AE0C7C), (Expr: C_JOURNALPTR ; Val: $00B18E10), (Expr: C_SKILLCAPS ; Val: $00B5B100), (Expr: C_SKILLLOCK ; Val: $00B5B0C4), (Expr: C_SKILLSPOS ; Val: $00B5B178), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598DDD), (Expr: E_OLDDIR ; Val: $0061E150), (Expr: E_EXMSGADDR ; Val: $005A5D50), (Expr: E_ITEMPROPID ; Val: $00A921E4), (Expr: E_ITEMNAMEADDR ; Val: $00576C10), (Expr: E_ITEMPROPADDR ; Val: $00576B10), (Expr: E_ITEMCHECKADDR ; Val: $0043DAE0), (Expr: E_ITEMREQADDR ; Val: $0043EE40), (Expr: E_PATHFINDADDR ; Val: $00503259), (Expr: E_SLEEPADDR ; Val: $006820EC), (Expr: E_DRAGADDR ; Val: $005A7490), (Expr: E_SYSMSGADDR ; Val: $005D34C0), (Expr: E_MACROADDR ; Val: $0057EF10), (Expr: E_SENDPACKET ; Val: $0045CD70), (Expr: E_CONTTOP ; Val: $004DC350), (Expr: E_STATBAR ; Val: $005467C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar704762 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590320), (Expr: C_CLILOGGED ; Val: $006F7C4C), (Expr: C_CLIXRES ; Val: $006F81F4), (Expr: C_ENEMYID ; Val: $0096F074), (Expr: C_SHARDPOS ; Val: $00974EC8), (Expr: C_NEXTCPOS ; Val: $00975064), (Expr: C_SYSMSG ; Val: $00975AEC), (Expr: C_CONTPOS ; Val: $00975B0C), (Expr: C_ENEMYHITS ; Val: $00A3DCF4), (Expr: C_LHANDID ; Val: $00A96274), (Expr: C_CHARDIR ; Val: $00A97030), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9B755), (Expr: C_TARGETCURS ; Val: $00A9B7B4), (Expr: C_CLILEFT ; Val: $00A9B7E0), (Expr: C_CHARPTR ; Val: $00ADC474), (Expr: C_LLIFTEDID ; Val: $00ADC4C0), (Expr: C_LSHARD ; Val: $00AE0B0C), (Expr: C_POPUPID ; Val: $00AE0C7C), (Expr: C_JOURNALPTR ; Val: $00B18E10), (Expr: C_SKILLCAPS ; Val: $00B5B100), (Expr: C_SKILLLOCK ; Val: $00B5B0C4), (Expr: C_SKILLSPOS ; Val: $00B5B178), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598DAD), (Expr: E_OLDDIR ; Val: $0061E120), (Expr: E_EXMSGADDR ; Val: $005A5D20), (Expr: E_ITEMPROPID ; Val: $00A921E4), (Expr: E_ITEMNAMEADDR ; Val: $00576BE0), (Expr: E_ITEMPROPADDR ; Val: $00576AE0), (Expr: E_ITEMCHECKADDR ; Val: $0043DAE0), (Expr: E_ITEMREQADDR ; Val: $0043EE40), (Expr: E_PATHFINDADDR ; Val: $00503229), (Expr: E_SLEEPADDR ; Val: $006820EC), (Expr: E_DRAGADDR ; Val: $005A7460), (Expr: E_SYSMSGADDR ; Val: $005D3490), (Expr: E_MACROADDR ; Val: $0057EEE0), (Expr: E_SENDPACKET ; Val: $0045CD70), (Expr: E_CONTTOP ; Val: $004DC320), (Expr: E_STATBAR ; Val: $00546790), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70470 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005901B0), (Expr: C_CLILOGGED ; Val: $006F7C4C), (Expr: C_CLIXRES ; Val: $006F81F4), (Expr: C_ENEMYID ; Val: $0096EEF4), (Expr: C_SHARDPOS ; Val: $00974D48), (Expr: C_NEXTCPOS ; Val: $00974EE4), (Expr: C_SYSMSG ; Val: $0097596C), (Expr: C_CONTPOS ; Val: $0097598C), (Expr: C_ENEMYHITS ; Val: $00A3DB74), (Expr: C_LHANDID ; Val: $00A960BC), (Expr: C_CHARDIR ; Val: $00A96E78), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9B59D), (Expr: C_TARGETCURS ; Val: $00A9B5FC), (Expr: C_CLILEFT ; Val: $00A9B628), (Expr: C_CHARPTR ; Val: $00ADC2BC), (Expr: C_LLIFTEDID ; Val: $00ADC308), (Expr: C_LSHARD ; Val: $00AE0954), (Expr: C_POPUPID ; Val: $00AE0AC4), (Expr: C_JOURNALPTR ; Val: $00B18C58), (Expr: C_SKILLCAPS ; Val: $00B5AF48), (Expr: C_SKILLLOCK ; Val: $00B5AF0C), (Expr: C_SKILLSPOS ; Val: $00B5AFC0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598C3D), (Expr: E_OLDDIR ; Val: $0061DFB0), (Expr: E_EXMSGADDR ; Val: $005A5BB0), (Expr: E_ITEMPROPID ; Val: $00A9202C), (Expr: E_ITEMNAMEADDR ; Val: $00576A70), (Expr: E_ITEMPROPADDR ; Val: $00576970), (Expr: E_ITEMCHECKADDR ; Val: $0043D990), (Expr: E_ITEMREQADDR ; Val: $0043ECF0), (Expr: E_PATHFINDADDR ; Val: $005030D9), (Expr: E_SLEEPADDR ; Val: $006820EC), (Expr: E_DRAGADDR ; Val: $005A72F0), (Expr: E_SYSMSGADDR ; Val: $005D3320), (Expr: E_MACROADDR ; Val: $0057ED70), (Expr: E_SENDPACKET ; Val: $0045CC20), (Expr: E_CONTTOP ; Val: $004DC1D0), (Expr: E_STATBAR ; Val: $00546640), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar704624 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590160), (Expr: C_CLILOGGED ; Val: $006F7C4C), (Expr: C_CLIXRES ; Val: $006F81F4), (Expr: C_ENEMYID ; Val: $0096EEF4), (Expr: C_SHARDPOS ; Val: $00974D48), (Expr: C_NEXTCPOS ; Val: $00974EE4), (Expr: C_SYSMSG ; Val: $0097596C), (Expr: C_CONTPOS ; Val: $0097598C), (Expr: C_ENEMYHITS ; Val: $00A3DB74), (Expr: C_LHANDID ; Val: $00A960BC), (Expr: C_CHARDIR ; Val: $00A96E78), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9B59D), (Expr: C_TARGETCURS ; Val: $00A9B5FC), (Expr: C_CLILEFT ; Val: $00A9B628), (Expr: C_CHARPTR ; Val: $00ADC2BC), (Expr: C_LLIFTEDID ; Val: $00ADC308), (Expr: C_LSHARD ; Val: $00AE0954), (Expr: C_POPUPID ; Val: $00AE0AC4), (Expr: C_JOURNALPTR ; Val: $00B18C58), (Expr: C_SKILLCAPS ; Val: $00B5AF48), (Expr: C_SKILLLOCK ; Val: $00B5AF0C), (Expr: C_SKILLSPOS ; Val: $00B5AFC0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598BED), (Expr: E_OLDDIR ; Val: $0061DF60), (Expr: E_EXMSGADDR ; Val: $005A5B60), (Expr: E_ITEMPROPID ; Val: $00A9202C), (Expr: E_ITEMNAMEADDR ; Val: $00576A20), (Expr: E_ITEMPROPADDR ; Val: $00576920), (Expr: E_ITEMCHECKADDR ; Val: $0043D990), (Expr: E_ITEMREQADDR ; Val: $0043ECF0), (Expr: E_PATHFINDADDR ; Val: $00503089), (Expr: E_SLEEPADDR ; Val: $006820EC), (Expr: E_DRAGADDR ; Val: $005A72A0), (Expr: E_SYSMSGADDR ; Val: $005D32D0), (Expr: E_MACROADDR ; Val: $0057ED20), (Expr: E_SENDPACKET ; Val: $0045CC20), (Expr: E_CONTTOP ; Val: $004DC1D0), (Expr: E_STATBAR ; Val: $005465F0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70460 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005900C0), (Expr: C_CLILOGGED ; Val: $006F6C4C), (Expr: C_CLIXRES ; Val: $006F71F4), (Expr: C_ENEMYID ; Val: $0096DEF4), (Expr: C_SHARDPOS ; Val: $00973D48), (Expr: C_NEXTCPOS ; Val: $00973EE4), (Expr: C_SYSMSG ; Val: $0097496C), (Expr: C_CONTPOS ; Val: $0097498C), (Expr: C_ENEMYHITS ; Val: $00A3CB74), (Expr: C_LHANDID ; Val: $00A950BC), (Expr: C_CHARDIR ; Val: $00A95E78), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9A59D), (Expr: C_TARGETCURS ; Val: $00A9A5FC), (Expr: C_CLILEFT ; Val: $00A9A628), (Expr: C_CHARPTR ; Val: $00ADB2BC), (Expr: C_LLIFTEDID ; Val: $00ADB308), (Expr: C_LSHARD ; Val: $00ADF954), (Expr: C_POPUPID ; Val: $00ADFAC4), (Expr: C_JOURNALPTR ; Val: $00B17C58), (Expr: C_SKILLCAPS ; Val: $00B59F48), (Expr: C_SKILLLOCK ; Val: $00B59F0C), (Expr: C_SKILLSPOS ; Val: $00B59FC0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598B4D), (Expr: E_OLDDIR ; Val: $0061DE70), (Expr: E_EXMSGADDR ; Val: $005A5AC0), (Expr: E_ITEMPROPID ; Val: $00A9102C), (Expr: E_ITEMNAMEADDR ; Val: $00576980), (Expr: E_ITEMPROPADDR ; Val: $00576880), (Expr: E_ITEMCHECKADDR ; Val: $0043D990), (Expr: E_ITEMREQADDR ; Val: $0043ECF0), (Expr: E_PATHFINDADDR ; Val: $00502FE9), (Expr: E_SLEEPADDR ; Val: $006810EC), (Expr: E_DRAGADDR ; Val: $005A7200), (Expr: E_SYSMSGADDR ; Val: $005D31E0), (Expr: E_MACROADDR ; Val: $0057EC80), (Expr: E_SENDPACKET ; Val: $0045CC20), (Expr: E_CONTTOP ; Val: $004DC130), (Expr: E_STATBAR ; Val: $00546550), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar704589 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005900C0), (Expr: C_CLILOGGED ; Val: $006F6C4C), (Expr: C_CLIXRES ; Val: $006F71F4), (Expr: C_ENEMYID ; Val: $0096DEF4), (Expr: C_SHARDPOS ; Val: $00973D48), (Expr: C_NEXTCPOS ; Val: $00973EE4), (Expr: C_SYSMSG ; Val: $0097496C), (Expr: C_CONTPOS ; Val: $0097498C), (Expr: C_ENEMYHITS ; Val: $00A3CB74), (Expr: C_LHANDID ; Val: $00A950BC), (Expr: C_CHARDIR ; Val: $00A95E78), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9A59D), (Expr: C_TARGETCURS ; Val: $00A9A5FC), (Expr: C_CLILEFT ; Val: $00A9A628), (Expr: C_CHARPTR ; Val: $00ADB2BC), (Expr: C_LLIFTEDID ; Val: $00ADB308), (Expr: C_LSHARD ; Val: $00ADF954), (Expr: C_POPUPID ; Val: $00ADFAC4), (Expr: C_JOURNALPTR ; Val: $00B17C58), (Expr: C_SKILLCAPS ; Val: $00B59F48), (Expr: C_SKILLLOCK ; Val: $00B59F0C), (Expr: C_SKILLSPOS ; Val: $00B59FC0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598B4D), (Expr: E_OLDDIR ; Val: $0061DE40), (Expr: E_EXMSGADDR ; Val: $005A5AC0), (Expr: E_ITEMPROPID ; Val: $00A9102C), (Expr: E_ITEMNAMEADDR ; Val: $00576980), (Expr: E_ITEMPROPADDR ; Val: $00576880), (Expr: E_ITEMCHECKADDR ; Val: $0043D990), (Expr: E_ITEMREQADDR ; Val: $0043ECF0), (Expr: E_PATHFINDADDR ; Val: $00502FE9), (Expr: E_SLEEPADDR ; Val: $006810EC), (Expr: E_DRAGADDR ; Val: $005A7200), (Expr: E_SYSMSGADDR ; Val: $005D31E0), (Expr: E_MACROADDR ; Val: $0057EC80), (Expr: E_SENDPACKET ; Val: $0045CC20), (Expr: E_CONTTOP ; Val: $004DC130), (Expr: E_STATBAR ; Val: $00546550), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar704577 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590040), (Expr: C_CLILOGGED ; Val: $006F6C4C), (Expr: C_CLIXRES ; Val: $006F71F4), (Expr: C_ENEMYID ; Val: $0096DEF4), (Expr: C_SHARDPOS ; Val: $00973D48), (Expr: C_NEXTCPOS ; Val: $00973EE4), (Expr: C_SYSMSG ; Val: $0097496C), (Expr: C_CONTPOS ; Val: $0097498C), (Expr: C_ENEMYHITS ; Val: $00A3CB74), (Expr: C_LHANDID ; Val: $00A950BC), (Expr: C_CHARDIR ; Val: $00A95E78), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9A59D), (Expr: C_TARGETCURS ; Val: $00A9A5FC), (Expr: C_CLILEFT ; Val: $00A9A628), (Expr: C_CHARPTR ; Val: $00ADB2BC), (Expr: C_LLIFTEDID ; Val: $00ADB308), (Expr: C_LSHARD ; Val: $00ADF954), (Expr: C_POPUPID ; Val: $00ADFAC4), (Expr: C_JOURNALPTR ; Val: $00B17C58), (Expr: C_SKILLCAPS ; Val: $00B59F48), (Expr: C_SKILLLOCK ; Val: $00B59F0C), (Expr: C_SKILLSPOS ; Val: $00B59FC0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598ACD), (Expr: E_OLDDIR ; Val: $0061DDC0), (Expr: E_EXMSGADDR ; Val: $005A5A40), (Expr: E_ITEMPROPID ; Val: $00A9102C), (Expr: E_ITEMNAMEADDR ; Val: $00576900), (Expr: E_ITEMPROPADDR ; Val: $00576800), (Expr: E_ITEMCHECKADDR ; Val: $0043D990), (Expr: E_ITEMREQADDR ; Val: $0043ECF0), (Expr: E_PATHFINDADDR ; Val: $00502F69), (Expr: E_SLEEPADDR ; Val: $006810EC), (Expr: E_DRAGADDR ; Val: $005A7180), (Expr: E_SYSMSGADDR ; Val: $005D3160), (Expr: E_MACROADDR ; Val: $0057EC00), (Expr: E_SENDPACKET ; Val: $0045CC20), (Expr: E_CONTTOP ; Val: $004DC130), (Expr: E_STATBAR ; Val: $005464D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar704565 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $0058FFF0), (Expr: C_CLILOGGED ; Val: $006F6C4C), (Expr: C_CLIXRES ; Val: $006F71F4), (Expr: C_ENEMYID ; Val: $0096DEF4), (Expr: C_SHARDPOS ; Val: $00973D48), (Expr: C_NEXTCPOS ; Val: $00973EE4), (Expr: C_SYSMSG ; Val: $0097496C), (Expr: C_CONTPOS ; Val: $0097498C), (Expr: C_ENEMYHITS ; Val: $00A3CB74), (Expr: C_LHANDID ; Val: $00A950BC), (Expr: C_CHARDIR ; Val: $00A95E78), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A9A59D), (Expr: C_TARGETCURS ; Val: $00A9A5FC), (Expr: C_CLILEFT ; Val: $00A9A628), (Expr: C_CHARPTR ; Val: $00ADB2BC), (Expr: C_LLIFTEDID ; Val: $00ADB308), (Expr: C_LSHARD ; Val: $00ADF954), (Expr: C_POPUPID ; Val: $00ADFAC4), (Expr: C_JOURNALPTR ; Val: $00B17C58), (Expr: C_SKILLCAPS ; Val: $00B59F48), (Expr: C_SKILLLOCK ; Val: $00B59F0C), (Expr: C_SKILLSPOS ; Val: $00B59FC0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598A7D), (Expr: E_OLDDIR ; Val: $0061DD60), (Expr: E_EXMSGADDR ; Val: $005A59F0), (Expr: E_ITEMPROPID ; Val: $00A9102C), (Expr: E_ITEMNAMEADDR ; Val: $005768B0), (Expr: E_ITEMPROPADDR ; Val: $005767B0), (Expr: E_ITEMCHECKADDR ; Val: $0043D990), (Expr: E_ITEMREQADDR ; Val: $0043ECF0), (Expr: E_PATHFINDADDR ; Val: $00502F19), (Expr: E_SLEEPADDR ; Val: $006810EC), (Expr: E_DRAGADDR ; Val: $005A7130), (Expr: E_SYSMSGADDR ; Val: $005D3100), (Expr: E_MACROADDR ; Val: $0057EBB0), (Expr: E_SENDPACKET ; Val: $0045CC20), (Expr: E_CONTTOP ; Val: $004DC0E0), (Expr: E_STATBAR ; Val: $00546480), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar704010 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $0058DD20), (Expr: C_CLILOGGED ; Val: $006D8BDC), (Expr: C_CLIXRES ; Val: $006D9184), (Expr: C_ENEMYID ; Val: $0094F514), (Expr: C_SHARDPOS ; Val: $00955368), (Expr: C_NEXTCPOS ; Val: $00955504), (Expr: C_SYSMSG ; Val: $00955F8C), (Expr: C_CONTPOS ; Val: $00955FAC), (Expr: C_ENEMYHITS ; Val: $00A1E194), (Expr: C_LHANDID ; Val: $00A76704), (Expr: C_CHARDIR ; Val: $00A774C0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBE5), (Expr: C_TARGETCURS ; Val: $00A7BC44), (Expr: C_CLILEFT ; Val: $00A7BC70), (Expr: C_CHARPTR ; Val: $00ABC8F4), (Expr: C_LLIFTEDID ; Val: $00ABC940), (Expr: C_LSHARD ; Val: $00AC0F8C), (Expr: C_POPUPID ; Val: $00AC10FC), (Expr: C_JOURNALPTR ; Val: $00AF9290), (Expr: C_SKILLCAPS ; Val: $00B3B580), (Expr: C_SKILLLOCK ; Val: $00B3B544), (Expr: C_SKILLSPOS ; Val: $00B3B5F8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005967AD), (Expr: E_OLDDIR ; Val: $00607900), (Expr: E_EXMSGADDR ; Val: $005A1F50), (Expr: E_ITEMPROPID ; Val: $00A72674), (Expr: E_ITEMNAMEADDR ; Val: $005745E0), (Expr: E_ITEMPROPADDR ; Val: $005744E0), (Expr: E_ITEMCHECKADDR ; Val: $0043CD90), (Expr: E_ITEMREQADDR ; Val: $0043DFB0), (Expr: E_PATHFINDADDR ; Val: $00500E79), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A36B0), (Expr: E_SYSMSGADDR ; Val: $005CE900), (Expr: E_MACROADDR ; Val: $0057C8E0), (Expr: E_SENDPACKET ; Val: $0045BF50), (Expr: E_CONTTOP ; Val: $004DA040), (Expr: E_STATBAR ; Val: $00544340), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70380 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $0058DDB0), (Expr: C_CLILOGGED ; Val: $006D8BDC), (Expr: C_CLIXRES ; Val: $006D9184), (Expr: C_ENEMYID ; Val: $0094F4F4), (Expr: C_SHARDPOS ; Val: $00955348), (Expr: C_NEXTCPOS ; Val: $009554E4), (Expr: C_SYSMSG ; Val: $00955F6C), (Expr: C_CONTPOS ; Val: $00955F8C), (Expr: C_ENEMYHITS ; Val: $00A1E174), (Expr: C_LHANDID ; Val: $00A766E4), (Expr: C_CHARDIR ; Val: $00A774A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBC5), (Expr: C_TARGETCURS ; Val: $00A7BC24), (Expr: C_CLILEFT ; Val: $00A7BC50), (Expr: C_CHARPTR ; Val: $00ABC8D4), (Expr: C_LLIFTEDID ; Val: $00ABC920), (Expr: C_LSHARD ; Val: $00AC0F6C), (Expr: C_POPUPID ; Val: $00AC10DC), (Expr: C_JOURNALPTR ; Val: $00AF9270), (Expr: C_SKILLCAPS ; Val: $00B3B560), (Expr: C_SKILLLOCK ; Val: $00B3B524), (Expr: C_SKILLSPOS ; Val: $00B3B5D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059683D), (Expr: E_OLDDIR ; Val: $00607950), (Expr: E_EXMSGADDR ; Val: $005A1FE0), (Expr: E_ITEMPROPID ; Val: $00A72654), (Expr: E_ITEMNAMEADDR ; Val: $00574670), (Expr: E_ITEMPROPADDR ; Val: $00574570), (Expr: E_ITEMCHECKADDR ; Val: $0043CD90), (Expr: E_ITEMREQADDR ; Val: $0043DFB0), (Expr: E_PATHFINDADDR ; Val: $00500F09), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A3740), (Expr: E_SYSMSGADDR ; Val: $005CE950), (Expr: E_MACROADDR ; Val: $0057C970), (Expr: E_SENDPACKET ; Val: $0045BF50), (Expr: E_CONTTOP ; Val: $004DA0D0), (Expr: E_STATBAR ; Val: $005443D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar703523 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $0058DD60), (Expr: C_CLILOGGED ; Val: $006D8BDC), (Expr: C_CLIXRES ; Val: $006D9184), (Expr: C_ENEMYID ; Val: $0094F4F4), (Expr: C_SHARDPOS ; Val: $00955348), (Expr: C_NEXTCPOS ; Val: $009554E4), (Expr: C_SYSMSG ; Val: $00955F6C), (Expr: C_CONTPOS ; Val: $00955F8C), (Expr: C_ENEMYHITS ; Val: $00A1E174), (Expr: C_LHANDID ; Val: $00A766E4), (Expr: C_CHARDIR ; Val: $00A774A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBC5), (Expr: C_TARGETCURS ; Val: $00A7BC24), (Expr: C_CLILEFT ; Val: $00A7BC50), (Expr: C_CHARPTR ; Val: $00ABC8D4), (Expr: C_LLIFTEDID ; Val: $00ABC920), (Expr: C_LSHARD ; Val: $00AC0F6C), (Expr: C_POPUPID ; Val: $00AC10DC), (Expr: C_JOURNALPTR ; Val: $00AF9270), (Expr: C_SKILLCAPS ; Val: $00B3B560), (Expr: C_SKILLLOCK ; Val: $00B3B524), (Expr: C_SKILLSPOS ; Val: $00B3B5D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005967ED), (Expr: E_OLDDIR ; Val: $00607900), (Expr: E_EXMSGADDR ; Val: $005A1F90), (Expr: E_ITEMPROPID ; Val: $00A72654), (Expr: E_ITEMNAMEADDR ; Val: $00574620), (Expr: E_ITEMPROPADDR ; Val: $00574520), (Expr: E_ITEMCHECKADDR ; Val: $0043CD90), (Expr: E_ITEMREQADDR ; Val: $0043DFB0), (Expr: E_PATHFINDADDR ; Val: $00500EB9), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A36F0), (Expr: E_SYSMSGADDR ; Val: $005CE900), (Expr: E_MACROADDR ; Val: $0057C920), (Expr: E_SENDPACKET ; Val: $0045BF50), (Expr: E_CONTTOP ; Val: $004DA080), (Expr: E_STATBAR ; Val: $00544380), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70353 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $0058DC30), (Expr: C_CLILOGGED ; Val: $006D8BDC), (Expr: C_CLIXRES ; Val: $006D9184), (Expr: C_ENEMYID ; Val: $0094F4F4), (Expr: C_SHARDPOS ; Val: $00955348), (Expr: C_NEXTCPOS ; Val: $009554E4), (Expr: C_SYSMSG ; Val: $00955F6C), (Expr: C_CONTPOS ; Val: $00955F8C), (Expr: C_ENEMYHITS ; Val: $00A1E174), (Expr: C_LHANDID ; Val: $00A766E4), (Expr: C_CHARDIR ; Val: $00A774A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBC5), (Expr: C_TARGETCURS ; Val: $00A7BC24), (Expr: C_CLILEFT ; Val: $00A7BC50), (Expr: C_CHARPTR ; Val: $00ABC8D4), (Expr: C_LLIFTEDID ; Val: $00ABC920), (Expr: C_LSHARD ; Val: $00AC0F6C), (Expr: C_POPUPID ; Val: $00AC10DC), (Expr: C_JOURNALPTR ; Val: $00AF9270), (Expr: C_SKILLCAPS ; Val: $00B3B560), (Expr: C_SKILLLOCK ; Val: $00B3B524), (Expr: C_SKILLSPOS ; Val: $00B3B5D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005966BD), (Expr: E_OLDDIR ; Val: $00607740), (Expr: E_EXMSGADDR ; Val: $005A1E60), (Expr: E_ITEMPROPID ; Val: $00A72654), (Expr: E_ITEMNAMEADDR ; Val: $005744F0), (Expr: E_ITEMPROPADDR ; Val: $005743F0), (Expr: E_ITEMCHECKADDR ; Val: $0043CD90), (Expr: E_ITEMREQADDR ; Val: $0043DFB0), (Expr: E_PATHFINDADDR ; Val: $00500D89), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A35C0), (Expr: E_SYSMSGADDR ; Val: $005CE740), (Expr: E_MACROADDR ; Val: $0057C7F0), (Expr: E_SENDPACKET ; Val: $0045BF50), (Expr: E_CONTTOP ; Val: $004D9F90), (Expr: E_STATBAR ; Val: $00544250), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar703423 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00591210), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F4F4), (Expr: C_SHARDPOS ; Val: $00955348), (Expr: C_NEXTCPOS ; Val: $009554E4), (Expr: C_SYSMSG ; Val: $00955F6C), (Expr: C_CONTPOS ; Val: $00955F8C), (Expr: C_ENEMYHITS ; Val: $00A1E174), (Expr: C_LHANDID ; Val: $00A766E4), (Expr: C_CHARDIR ; Val: $00A774A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBC5), (Expr: C_TARGETCURS ; Val: $00A7BC24), (Expr: C_CLILEFT ; Val: $00A7BC50), (Expr: C_CHARPTR ; Val: $00ABC8D4), (Expr: C_LLIFTEDID ; Val: $00ABC920), (Expr: C_LSHARD ; Val: $00AC0F6C), (Expr: C_POPUPID ; Val: $00AC10DC), (Expr: C_JOURNALPTR ; Val: $00AF9270), (Expr: C_SKILLCAPS ; Val: $00B3B560), (Expr: C_SKILLLOCK ; Val: $00B3B524), (Expr: C_SKILLSPOS ; Val: $00B3B5D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00599C9D), (Expr: E_OLDDIR ; Val: $00607720), (Expr: E_EXMSGADDR ; Val: $005A5440), (Expr: E_ITEMPROPID ; Val: $00A72654), (Expr: E_ITEMNAMEADDR ; Val: $00577AD0), (Expr: E_ITEMPROPADDR ; Val: $005779D0), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00504369), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A6BA0), (Expr: E_SYSMSGADDR ; Val: $005D1D20), (Expr: E_MACROADDR ; Val: $0057FDD0), (Expr: E_SENDPACKET ; Val: $0045F530), (Expr: E_CONTTOP ; Val: $004DD570), (Expr: E_STATBAR ; Val: $00547830), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar703415 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005911D0), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F4F4), (Expr: C_SHARDPOS ; Val: $00955348), (Expr: C_NEXTCPOS ; Val: $009554E4), (Expr: C_SYSMSG ; Val: $00955F6C), (Expr: C_CONTPOS ; Val: $00955F8C), (Expr: C_ENEMYHITS ; Val: $00A1E174), (Expr: C_LHANDID ; Val: $00A766E4), (Expr: C_CHARDIR ; Val: $00A774A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBC5), (Expr: C_TARGETCURS ; Val: $00A7BC24), (Expr: C_CLILEFT ; Val: $00A7BC50), (Expr: C_CHARPTR ; Val: $00ABC8D4), (Expr: C_LLIFTEDID ; Val: $00ABC920), (Expr: C_LSHARD ; Val: $00AC0F6C), (Expr: C_POPUPID ; Val: $00AC10DC), (Expr: C_JOURNALPTR ; Val: $00AF9270), (Expr: C_SKILLCAPS ; Val: $00B3B560), (Expr: C_SKILLLOCK ; Val: $00B3B524), (Expr: C_SKILLSPOS ; Val: $00B3B5D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00599C5D), (Expr: E_OLDDIR ; Val: $006076E0), (Expr: E_EXMSGADDR ; Val: $005A5400), (Expr: E_ITEMPROPID ; Val: $00A72654), (Expr: E_ITEMNAMEADDR ; Val: $00577A70), (Expr: E_ITEMPROPADDR ; Val: $00577970), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $005042E9), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A6B60), (Expr: E_SYSMSGADDR ; Val: $005D1CE0), (Expr: E_MACROADDR ; Val: $0057FD70), (Expr: E_SENDPACKET ; Val: $0045F530), (Expr: E_CONTTOP ; Val: $004DD4F0), (Expr: E_STATBAR ; Val: $005477D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70346 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00591170), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F4F4), (Expr: C_SHARDPOS ; Val: $00955348), (Expr: C_NEXTCPOS ; Val: $009554E4), (Expr: C_SYSMSG ; Val: $00955F6C), (Expr: C_CONTPOS ; Val: $00955F8C), (Expr: C_ENEMYHITS ; Val: $00A1E174), (Expr: C_LHANDID ; Val: $00A766E4), (Expr: C_CHARDIR ; Val: $00A774A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBC5), (Expr: C_TARGETCURS ; Val: $00A7BC24), (Expr: C_CLILEFT ; Val: $00A7BC50), (Expr: C_CHARPTR ; Val: $00ABC8D4), (Expr: C_LLIFTEDID ; Val: $00ABC920), (Expr: C_LSHARD ; Val: $00AC0F6C), (Expr: C_POPUPID ; Val: $00AC10DC), (Expr: C_JOURNALPTR ; Val: $00AF9270), (Expr: C_SKILLCAPS ; Val: $00B3B560), (Expr: C_SKILLLOCK ; Val: $00B3B524), (Expr: C_SKILLSPOS ; Val: $00B3B5D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00599BFD), (Expr: E_OLDDIR ; Val: $00607680), (Expr: E_EXMSGADDR ; Val: $005A53A0), (Expr: E_ITEMPROPID ; Val: $00A72654), (Expr: E_ITEMNAMEADDR ; Val: $00577A10), (Expr: E_ITEMPROPADDR ; Val: $00577910), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00504289), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A6B00), (Expr: E_SYSMSGADDR ; Val: $005D1C80), (Expr: E_MACROADDR ; Val: $0057FD10), (Expr: E_SENDPACKET ; Val: $0045F530), (Expr: E_CONTTOP ; Val: $004DD490), (Expr: E_STATBAR ; Val: $00547770), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70342 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00591120), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F4F4), (Expr: C_SHARDPOS ; Val: $00955348), (Expr: C_NEXTCPOS ; Val: $009554E4), (Expr: C_SYSMSG ; Val: $00955F6C), (Expr: C_CONTPOS ; Val: $00955F8C), (Expr: C_ENEMYHITS ; Val: $00A1E174), (Expr: C_LHANDID ; Val: $00A766E4), (Expr: C_CHARDIR ; Val: $00A774A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BBC5), (Expr: C_TARGETCURS ; Val: $00A7BC24), (Expr: C_CLILEFT ; Val: $00A7BC50), (Expr: C_CHARPTR ; Val: $00ABC8D4), (Expr: C_LLIFTEDID ; Val: $00ABC920), (Expr: C_LSHARD ; Val: $00AC0F6C), (Expr: C_POPUPID ; Val: $00AC10DC), (Expr: C_JOURNALPTR ; Val: $00AF9270), (Expr: C_SKILLCAPS ; Val: $00B3B560), (Expr: C_SKILLLOCK ; Val: $00B3B524), (Expr: C_SKILLSPOS ; Val: $00B3B5D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00599BAD), (Expr: E_OLDDIR ; Val: $00607630), (Expr: E_EXMSGADDR ; Val: $005A5350), (Expr: E_ITEMPROPID ; Val: $00A72654), (Expr: E_ITEMNAMEADDR ; Val: $005779C0), (Expr: E_ITEMPROPADDR ; Val: $005778C0), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00504239), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A6AB0), (Expr: E_SYSMSGADDR ; Val: $005D1C30), (Expr: E_MACROADDR ; Val: $0057FCC0), (Expr: E_SENDPACKET ; Val: $0045F530), (Expr: E_CONTTOP ; Val: $004DD440), (Expr: E_STATBAR ; Val: $00547720), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70331 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005910C0), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F454), (Expr: C_SHARDPOS ; Val: $009552A8), (Expr: C_NEXTCPOS ; Val: $00955444), (Expr: C_SYSMSG ; Val: $00955ECC), (Expr: C_CONTPOS ; Val: $00955EEC), (Expr: C_ENEMYHITS ; Val: $00A1E0D4), (Expr: C_LHANDID ; Val: $00A76644), (Expr: C_CHARDIR ; Val: $00A77400), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BB25), (Expr: C_TARGETCURS ; Val: $00A7BB84), (Expr: C_CLILEFT ; Val: $00A7BBB0), (Expr: C_CHARPTR ; Val: $00ABC834), (Expr: C_LLIFTEDID ; Val: $00ABC880), (Expr: C_LSHARD ; Val: $00AC0ECC), (Expr: C_POPUPID ; Val: $00AC103C), (Expr: C_JOURNALPTR ; Val: $00AF91D0), (Expr: C_SKILLCAPS ; Val: $00B3B4C0), (Expr: C_SKILLLOCK ; Val: $00B3B484), (Expr: C_SKILLSPOS ; Val: $00B3B538), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00599B4D), (Expr: E_OLDDIR ; Val: $006075D0), (Expr: E_EXMSGADDR ; Val: $005A52F0), (Expr: E_ITEMPROPID ; Val: $00A725B4), (Expr: E_ITEMNAMEADDR ; Val: $00577980), (Expr: E_ITEMPROPADDR ; Val: $00577880), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00504219), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A6A50), (Expr: E_SYSMSGADDR ; Val: $005D1BD0), (Expr: E_MACROADDR ; Val: $0057FC80), (Expr: E_SENDPACKET ; Val: $0045F510), (Expr: E_CONTTOP ; Val: $004DD420), (Expr: E_STATBAR ; Val: $005476E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar703211 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00591060), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F454), (Expr: C_SHARDPOS ; Val: $009552A8), (Expr: C_NEXTCPOS ; Val: $00955444), (Expr: C_SYSMSG ; Val: $00955ECC), (Expr: C_CONTPOS ; Val: $00955EEC), (Expr: C_ENEMYHITS ; Val: $00A1E0D4), (Expr: C_LHANDID ; Val: $00A76644), (Expr: C_CHARDIR ; Val: $00A77400), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BB25), (Expr: C_TARGETCURS ; Val: $00A7BB84), (Expr: C_CLILEFT ; Val: $00A7BBB0), (Expr: C_CHARPTR ; Val: $00ABC834), (Expr: C_LLIFTEDID ; Val: $00ABC880), (Expr: C_LSHARD ; Val: $00AC0ECC), (Expr: C_POPUPID ; Val: $00AC103C), (Expr: C_JOURNALPTR ; Val: $00AF91D0), (Expr: C_SKILLCAPS ; Val: $00B3B4C0), (Expr: C_SKILLLOCK ; Val: $00B3B484), (Expr: C_SKILLSPOS ; Val: $00B3B538), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00599AED), (Expr: E_OLDDIR ; Val: $00607570), (Expr: E_EXMSGADDR ; Val: $005A5290), (Expr: E_ITEMPROPID ; Val: $00A725B4), (Expr: E_ITEMNAMEADDR ; Val: $00577920), (Expr: E_ITEMPROPADDR ; Val: $00577820), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $005041B9), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A69F0), (Expr: E_SYSMSGADDR ; Val: $005D1B70), (Expr: E_MACROADDR ; Val: $0057FC20), (Expr: E_SENDPACKET ; Val: $0045F4E0), (Expr: E_CONTTOP ; Val: $004DD410), (Expr: E_STATBAR ; Val: $00547680), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70310 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00591050), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F434), (Expr: C_SHARDPOS ; Val: $00955288), (Expr: C_NEXTCPOS ; Val: $00955424), (Expr: C_SYSMSG ; Val: $00955EAC), (Expr: C_CONTPOS ; Val: $00955ECC), (Expr: C_ENEMYHITS ; Val: $00A1E0B4), (Expr: C_LHANDID ; Val: $00A76624), (Expr: C_CHARDIR ; Val: $00A773E0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7BB05), (Expr: C_TARGETCURS ; Val: $00A7BB64), (Expr: C_CLILEFT ; Val: $00A7BB90), (Expr: C_CHARPTR ; Val: $00ABC814), (Expr: C_LLIFTEDID ; Val: $00ABC860), (Expr: C_LSHARD ; Val: $00AC0EAC), (Expr: C_POPUPID ; Val: $00AC101C), (Expr: C_JOURNALPTR ; Val: $00AF91B0), (Expr: C_SKILLCAPS ; Val: $00B3B4A0), (Expr: C_SKILLLOCK ; Val: $00B3B464), (Expr: C_SKILLSPOS ; Val: $00B3B518), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00599ADD), (Expr: E_OLDDIR ; Val: $00607450), (Expr: E_EXMSGADDR ; Val: $005A5280), (Expr: E_ITEMPROPID ; Val: $00A72594), (Expr: E_ITEMNAMEADDR ; Val: $00577900), (Expr: E_ITEMPROPADDR ; Val: $00577800), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00504199), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A69E0), (Expr: E_SYSMSGADDR ; Val: $005D1A50), (Expr: E_MACROADDR ; Val: $0057FC10), (Expr: E_SENDPACKET ; Val: $0045F4C0), (Expr: E_CONTTOP ; Val: $004DD3F0), (Expr: E_STATBAR ; Val: $00547660), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70301 : array[0..78] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590E60), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F2F4), (Expr: C_SHARDPOS ; Val: $00955148), (Expr: C_NEXTCPOS ; Val: $009552E4), (Expr: C_SYSMSG ; Val: $00955D6C), (Expr: C_CONTPOS ; Val: $00955D8C), (Expr: C_ENEMYHITS ; Val: $00A1DF74), (Expr: C_LHANDID ; Val: $00A764E4), (Expr: C_CHARDIR ; Val: $00A772A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7B9C5), (Expr: C_TARGETCURS ; Val: $00A7BA24), (Expr: C_CLILEFT ; Val: $00A7BA50), (Expr: C_CHARPTR ; Val: $00ABC6D4), (Expr: C_LLIFTEDID ; Val: $00ABC720), (Expr: C_LSHARD ; Val: $00AC0D6C), (Expr: C_POPUPID ; Val: $00AC0EDC), (Expr: C_JOURNALPTR ; Val: $00AF9070), (Expr: C_SKILLCAPS ; Val: $00B3B360), (Expr: C_SKILLLOCK ; Val: $00B3B324), (Expr: C_SKILLSPOS ; Val: $00B3B3D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $00000038), (Expr: B_STATML ; Val: $00000004), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000084), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), (Expr: B_STAT1 ; Val: $0000001C), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005998ED), (Expr: E_OLDDIR ; Val: $00607260), (Expr: E_EXMSGADDR ; Val: $005A5090), (Expr: E_ITEMPROPID ; Val: $00A72454), (Expr: E_ITEMNAMEADDR ; Val: $00577710), (Expr: E_ITEMPROPADDR ; Val: $00577610), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $005040F9), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A67F0), (Expr: E_SYSMSGADDR ; Val: $005D1860), (Expr: E_MACROADDR ; Val: $0057FA20), (Expr: E_SENDPACKET ; Val: $0045F4C0), (Expr: E_CONTTOP ; Val: $004DD350), (Expr: E_STATBAR ; Val: $00547470), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70292 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005907E0), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F2F4), (Expr: C_SHARDPOS ; Val: $00955148), (Expr: C_NEXTCPOS ; Val: $009552E4), (Expr: C_SYSMSG ; Val: $00955D4C), (Expr: C_CONTPOS ; Val: $00955D6C), (Expr: C_ENEMYHITS ; Val: $00A1DF54), (Expr: C_LHANDID ; Val: $00A764C4), (Expr: C_CHARDIR ; Val: $00A77280), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7B9A5), (Expr: C_TARGETCURS ; Val: $00A7BA04), (Expr: C_CLILEFT ; Val: $00A7BA30), (Expr: C_CHARPTR ; Val: $00ABC6B4), (Expr: C_LLIFTEDID ; Val: $00ABC700), (Expr: C_LSHARD ; Val: $00AC0D4C), (Expr: C_POPUPID ; Val: $00AC0EBC), (Expr: C_JOURNALPTR ; Val: $00AF9050), (Expr: C_SKILLCAPS ; Val: $00B3B340), (Expr: C_SKILLLOCK ; Val: $00B3B304), (Expr: C_SKILLSPOS ; Val: $00B3B3B8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059926D), (Expr: E_OLDDIR ; Val: $00606BE0), (Expr: E_EXMSGADDR ; Val: $005A4A10), (Expr: E_ITEMPROPID ; Val: $00A72434), (Expr: E_ITEMNAMEADDR ; Val: $00577090), (Expr: E_ITEMPROPADDR ; Val: $00576F90), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00503F29), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A6170), (Expr: E_SYSMSGADDR ; Val: $005D11E0), (Expr: E_MACROADDR ; Val: $0057F3A0), (Expr: E_SENDPACKET ; Val: $0045F4C0), (Expr: E_CONTTOP ; Val: $004DD180), (Expr: E_STATBAR ; Val: $00546DF0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar702766 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590630), (Expr: C_CLILOGGED ; Val: $006DA24C), (Expr: C_CLIXRES ; Val: $006DA7F4), (Expr: C_ENEMYID ; Val: $0094F2F4), (Expr: C_SHARDPOS ; Val: $00955148), (Expr: C_NEXTCPOS ; Val: $009552E4), (Expr: C_SYSMSG ; Val: $00955D4C), (Expr: C_CONTPOS ; Val: $00955D6C), (Expr: C_ENEMYHITS ; Val: $00A1DF54), (Expr: C_LHANDID ; Val: $00A764C4), (Expr: C_CHARDIR ; Val: $00A77280), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7B9A5), (Expr: C_TARGETCURS ; Val: $00A7BA04), (Expr: C_CLILEFT ; Val: $00A7BA30), (Expr: C_CHARPTR ; Val: $00ABC6B4), (Expr: C_LLIFTEDID ; Val: $00ABC700), (Expr: C_LSHARD ; Val: $00AC0D4C), (Expr: C_POPUPID ; Val: $00AC0EBC), (Expr: C_JOURNALPTR ; Val: $00AF9050), (Expr: C_SKILLCAPS ; Val: $00B3B340), (Expr: C_SKILLLOCK ; Val: $00B3B304), (Expr: C_SKILLSPOS ; Val: $00B3B3B8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005990BD), (Expr: E_OLDDIR ; Val: $00606A30), (Expr: E_EXMSGADDR ; Val: $005A4860), (Expr: E_ITEMPROPID ; Val: $00A72434), (Expr: E_ITEMNAMEADDR ; Val: $00576EE0), (Expr: E_ITEMPROPADDR ; Val: $00576DE0), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00503D79), (Expr: E_SLEEPADDR ; Val: $006680EC), (Expr: E_DRAGADDR ; Val: $005A5FC0), (Expr: E_SYSMSGADDR ; Val: $005D1030), (Expr: E_MACROADDR ; Val: $0057F1F0), (Expr: E_SENDPACKET ; Val: $0045F4C0), (Expr: E_CONTTOP ; Val: $004DCFD0), (Expr: E_STATBAR ; Val: $00546C40), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70279 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590440), (Expr: C_CLILOGGED ; Val: $006D924C), (Expr: C_CLIXRES ; Val: $006D97F4), (Expr: C_ENEMYID ; Val: $0094E2F4), (Expr: C_SHARDPOS ; Val: $00954148), (Expr: C_NEXTCPOS ; Val: $009542E4), (Expr: C_SYSMSG ; Val: $00954D4C), (Expr: C_CONTPOS ; Val: $00954D6C), (Expr: C_ENEMYHITS ; Val: $00A1CF54), (Expr: C_LHANDID ; Val: $00A754C4), (Expr: C_CHARDIR ; Val: $00A76280), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7A9A5), (Expr: C_TARGETCURS ; Val: $00A7AA04), (Expr: C_CLILEFT ; Val: $00A7AA30), (Expr: C_CHARPTR ; Val: $00ABB6B4), (Expr: C_LLIFTEDID ; Val: $00ABB700), (Expr: C_LSHARD ; Val: $00ABFD4C), (Expr: C_POPUPID ; Val: $00ABFEBC), (Expr: C_JOURNALPTR ; Val: $00AF8050), (Expr: C_SKILLCAPS ; Val: $00B3A340), (Expr: C_SKILLLOCK ; Val: $00B3A304), (Expr: C_SKILLSPOS ; Val: $00B3A3B8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598ECD), (Expr: E_OLDDIR ; Val: $00606820), (Expr: E_EXMSGADDR ; Val: $005A4650), (Expr: E_ITEMPROPID ; Val: $00A71434), (Expr: E_ITEMNAMEADDR ; Val: $00576CF0), (Expr: E_ITEMPROPADDR ; Val: $00576BF0), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00503D59), (Expr: E_SLEEPADDR ; Val: $006670EC), (Expr: E_DRAGADDR ; Val: $005A5DB0), (Expr: E_SYSMSGADDR ; Val: $005D0E20), (Expr: E_MACROADDR ; Val: $0057F000), (Expr: E_SENDPACKET ; Val: $0045F4C0), (Expr: E_CONTTOP ; Val: $004DCFB0), (Expr: E_STATBAR ; Val: $00546C20), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70277 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590440), (Expr: C_CLILOGGED ; Val: $006D924C), (Expr: C_CLIXRES ; Val: $006D97F4), (Expr: C_ENEMYID ; Val: $0094E2B4), (Expr: C_SHARDPOS ; Val: $00954108), (Expr: C_NEXTCPOS ; Val: $009542A4), (Expr: C_SYSMSG ; Val: $00954D0C), (Expr: C_CONTPOS ; Val: $00954D2C), (Expr: C_ENEMYHITS ; Val: $00A1CF14), (Expr: C_LHANDID ; Val: $00A75484), (Expr: C_CHARDIR ; Val: $00A76240), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7A965), (Expr: C_TARGETCURS ; Val: $00A7A9C4), (Expr: C_CLILEFT ; Val: $00A7A9F0), (Expr: C_CHARPTR ; Val: $00ABB674), (Expr: C_LLIFTEDID ; Val: $00ABB6C0), (Expr: C_LSHARD ; Val: $00ABFD0C), (Expr: C_POPUPID ; Val: $00ABFE7C), (Expr: C_JOURNALPTR ; Val: $00AF8010), (Expr: C_SKILLCAPS ; Val: $00B3A300), (Expr: C_SKILLLOCK ; Val: $00B3A2C4), (Expr: C_SKILLSPOS ; Val: $00B3A378), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598ECD), (Expr: E_OLDDIR ; Val: $00606820), (Expr: E_EXMSGADDR ; Val: $005A4650), (Expr: E_ITEMPROPID ; Val: $00A713F4), (Expr: E_ITEMNAMEADDR ; Val: $00576CF0), (Expr: E_ITEMPROPADDR ; Val: $00576BF0), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00503D59), (Expr: E_SLEEPADDR ; Val: $006670EC), (Expr: E_DRAGADDR ; Val: $005A5DB0), (Expr: E_SYSMSGADDR ; Val: $005D0E20), (Expr: E_MACROADDR ; Val: $0057F000), (Expr: E_SENDPACKET ; Val: $0045F4C0), (Expr: E_CONTTOP ; Val: $004DCFB0), (Expr: E_STATBAR ; Val: $00546C20), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70275 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005903F0), (Expr: C_CLILOGGED ; Val: $006D924C), (Expr: C_CLIXRES ; Val: $006D97F4), (Expr: C_ENEMYID ; Val: $0094E2B4), (Expr: C_SHARDPOS ; Val: $00954108), (Expr: C_NEXTCPOS ; Val: $009542A4), (Expr: C_SYSMSG ; Val: $00954D0C), (Expr: C_CONTPOS ; Val: $00954D2C), (Expr: C_ENEMYHITS ; Val: $00A1CF14), (Expr: C_LHANDID ; Val: $00A75484), (Expr: C_CHARDIR ; Val: $00A76240), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7A965), (Expr: C_TARGETCURS ; Val: $00A7A9C4), (Expr: C_CLILEFT ; Val: $00A7A9F0), (Expr: C_CHARPTR ; Val: $00ABB674), (Expr: C_LLIFTEDID ; Val: $00ABB6C0), (Expr: C_LSHARD ; Val: $00ABFD0C), (Expr: C_POPUPID ; Val: $00ABFE7C), (Expr: C_JOURNALPTR ; Val: $00AF8010), (Expr: C_SKILLCAPS ; Val: $00B3A300), (Expr: C_SKILLLOCK ; Val: $00B3A2C4), (Expr: C_SKILLSPOS ; Val: $00B3A378), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598E7D), (Expr: E_OLDDIR ; Val: $006067B0), (Expr: E_EXMSGADDR ; Val: $005A4600), (Expr: E_ITEMPROPID ; Val: $00A713F4), (Expr: E_ITEMNAMEADDR ; Val: $00576CA0), (Expr: E_ITEMPROPADDR ; Val: $00576BA0), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00503D29), (Expr: E_SLEEPADDR ; Val: $006670EC), (Expr: E_DRAGADDR ; Val: $005A5D60), (Expr: E_SYSMSGADDR ; Val: $005D0DB0), (Expr: E_MACROADDR ; Val: $0057EFB0), (Expr: E_SENDPACKET ; Val: $0045F4A0), (Expr: E_CONTTOP ; Val: $004DCF90), (Expr: E_STATBAR ; Val: $00546BD0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70264 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590420), (Expr: C_CLILOGGED ; Val: $006D924C), (Expr: C_CLIXRES ; Val: $006D97F4), (Expr: C_ENEMYID ; Val: $0094E2B4), (Expr: C_SHARDPOS ; Val: $00954108), (Expr: C_NEXTCPOS ; Val: $009542A4), (Expr: C_SYSMSG ; Val: $00954D0C), (Expr: C_CONTPOS ; Val: $00954D2C), (Expr: C_ENEMYHITS ; Val: $00A1CF14), (Expr: C_LHANDID ; Val: $00A75484), (Expr: C_CHARDIR ; Val: $00A76240), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7A965), (Expr: C_TARGETCURS ; Val: $00A7A9C4), (Expr: C_CLILEFT ; Val: $00A7A9F0), (Expr: C_CHARPTR ; Val: $00ABB674), (Expr: C_LLIFTEDID ; Val: $00ABB6C0), (Expr: C_LSHARD ; Val: $00ABFD0C), (Expr: C_POPUPID ; Val: $00ABFE7C), (Expr: C_JOURNALPTR ; Val: $00AF8010), (Expr: C_SKILLCAPS ; Val: $00B3A300), (Expr: C_SKILLLOCK ; Val: $00B3A2C4), (Expr: C_SKILLSPOS ; Val: $00B3A378), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598EAD), (Expr: E_OLDDIR ; Val: $006067D0), (Expr: E_EXMSGADDR ; Val: $005A4630), (Expr: E_ITEMPROPID ; Val: $00A713F4), (Expr: E_ITEMNAMEADDR ; Val: $00576CD0), (Expr: E_ITEMPROPADDR ; Val: $00576BD0), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00503D29), (Expr: E_SLEEPADDR ; Val: $006670EC), (Expr: E_DRAGADDR ; Val: $005A5D90), (Expr: E_SYSMSGADDR ; Val: $005D0DD0), (Expr: E_MACROADDR ; Val: $0057EFE0), (Expr: E_SENDPACKET ; Val: $0045F4A0), (Expr: E_CONTTOP ; Val: $004DCF90), (Expr: E_STATBAR ; Val: $00546C00), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70256 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $00590560), (Expr: C_CLILOGGED ; Val: $006D924C), (Expr: C_CLIXRES ; Val: $006D97F4), (Expr: C_ENEMYID ; Val: $0094E214), (Expr: C_SHARDPOS ; Val: $00954068), (Expr: C_NEXTCPOS ; Val: $00954204), (Expr: C_SYSMSG ; Val: $00954C6C), (Expr: C_CONTPOS ; Val: $00954C8C), (Expr: C_ENEMYHITS ; Val: $00A1CE74), (Expr: C_LHANDID ; Val: $00A753E4), (Expr: C_CHARDIR ; Val: $00A761A0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7A8C5), (Expr: C_TARGETCURS ; Val: $00A7A924), (Expr: C_CLILEFT ; Val: $00A7A950), (Expr: C_CHARPTR ; Val: $00ABB5D4), (Expr: C_LLIFTEDID ; Val: $00ABB620), (Expr: C_LSHARD ; Val: $00ABFC6C), (Expr: C_POPUPID ; Val: $00ABFDDC), (Expr: C_JOURNALPTR ; Val: $00AF7F70), (Expr: C_SKILLCAPS ; Val: $00B3A260), (Expr: C_SKILLLOCK ; Val: $00B3A224), (Expr: C_SKILLSPOS ; Val: $00B3A2D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A8), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598F5D), (Expr: E_OLDDIR ; Val: $00606880), (Expr: E_EXMSGADDR ; Val: $005A46E0), (Expr: E_ITEMPROPID ; Val: $00A71354), (Expr: E_ITEMNAMEADDR ; Val: $00576E10), (Expr: E_ITEMPROPADDR ; Val: $00576D10), (Expr: E_ITEMCHECKADDR ; Val: $00440370), (Expr: E_ITEMREQADDR ; Val: $00441590), (Expr: E_PATHFINDADDR ; Val: $00503D29), (Expr: E_SLEEPADDR ; Val: $006670EC), (Expr: E_DRAGADDR ; Val: $005A5E40), (Expr: E_SYSMSGADDR ; Val: $005D0E80), (Expr: E_MACROADDR ; Val: $0057F120), (Expr: E_SENDPACKET ; Val: $0045F4A0), (Expr: E_CONTTOP ; Val: $004DCF90), (Expr: E_STATBAR ; Val: $00546BE0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70243 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $005902F0), (Expr: C_CLILOGGED ; Val: $006D924C), (Expr: C_CLIXRES ; Val: $006D97F4), (Expr: C_ENEMYID ; Val: $0094E174), (Expr: C_SHARDPOS ; Val: $00953FC8), (Expr: C_NEXTCPOS ; Val: $00954164), (Expr: C_SYSMSG ; Val: $00954BCC), (Expr: C_CONTPOS ; Val: $00954BEC), (Expr: C_ENEMYHITS ; Val: $00A1CDD4), (Expr: C_LHANDID ; Val: $00A75304), (Expr: C_CHARDIR ; Val: $00A760C0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7A7E5), (Expr: C_TARGETCURS ; Val: $00A7A844), (Expr: C_CLILEFT ; Val: $00A7A870), (Expr: C_CHARPTR ; Val: $00ABB4F4), (Expr: C_LLIFTEDID ; Val: $00ABB540), (Expr: C_LSHARD ; Val: $00ABFB8C), (Expr: C_POPUPID ; Val: $00ABFCFC), (Expr: C_JOURNALPTR ; Val: $00AF7E90), (Expr: C_SKILLCAPS ; Val: $00B3A180), (Expr: C_SKILLLOCK ; Val: $00B3A144), (Expr: C_SKILLSPOS ; Val: $00B3A1F8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000068), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00598CED), (Expr: E_OLDDIR ; Val: $00606620), (Expr: E_EXMSGADDR ; Val: $005A4460), (Expr: E_ITEMPROPID ; Val: $00A71274), (Expr: E_ITEMNAMEADDR ; Val: $00576BA0), (Expr: E_ITEMPROPADDR ; Val: $00576AA0), (Expr: E_ITEMCHECKADDR ; Val: $00440220), (Expr: E_ITEMREQADDR ; Val: $00441440), (Expr: E_PATHFINDADDR ; Val: $00503D29), (Expr: E_SLEEPADDR ; Val: $006670EC), (Expr: E_DRAGADDR ; Val: $005A5BB0), (Expr: E_SYSMSGADDR ; Val: $005D0C20), (Expr: E_MACROADDR ; Val: $0057EEB0), (Expr: E_SENDPACKET ; Val: $0045F350), (Expr: E_CONTTOP ; Val: $004DCDE0), (Expr: E_STATBAR ; Val: $00546970), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70220 : array[0..77] of TSysVar = ( /// VARIABLES ///////// (Expr: C_BLOCKINFO ; Val: $0058DCE0), (Expr: C_CLILOGGED ; Val: $006D724C), (Expr: C_CLIXRES ; Val: $006D77F4), (Expr: C_ENEMYID ; Val: $0094C054), (Expr: C_SHARDPOS ; Val: $00951EA8), (Expr: C_NEXTCPOS ; Val: $00952044), (Expr: C_SYSMSG ; Val: $00952AAC), (Expr: C_CONTPOS ; Val: $00952ACC), (Expr: C_ENEMYHITS ; Val: $00A1ACB4), (Expr: C_LHANDID ; Val: $00A72EAC), (Expr: C_CHARDIR ; Val: $00A73C68), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A7838D), (Expr: C_TARGETCURS ; Val: $00A783EC), (Expr: C_CLILEFT ; Val: $00A78418), (Expr: C_CHARPTR ; Val: $00AB909C), (Expr: C_LLIFTEDID ; Val: $00AB90E8), (Expr: C_LSHARD ; Val: $00ABD734), (Expr: C_POPUPID ; Val: $00ABD8A4), (Expr: C_JOURNALPTR ; Val: $00AF5A38), (Expr: C_SKILLCAPS ; Val: $00B37D28), (Expr: C_SKILLLOCK ; Val: $00B37CEC), (Expr: C_SKILLSPOS ; Val: $00B37DA0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059673D), (Expr: E_OLDDIR ; Val: $00603FD0), (Expr: E_EXMSGADDR ; Val: $005A1EC0), (Expr: E_ITEMPROPID ; Val: $00A6EE1C), (Expr: E_ITEMNAMEADDR ; Val: $00574C50), (Expr: E_ITEMPROPADDR ; Val: $00574B50), (Expr: E_ITEMCHECKADDR ; Val: $0043FE30), (Expr: E_ITEMREQADDR ; Val: $00441050), (Expr: E_PATHFINDADDR ; Val: $005038D9), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A3610), (Expr: E_SYSMSGADDR ; Val: $005CE690), (Expr: E_MACROADDR ; Val: $0057CF60), (Expr: E_SENDPACKET ; Val: $0045EF70), (Expr: E_CONTTOP ; Val: $004DC990), (Expr: E_STATBAR ; Val: $00546560), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70212 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D721C), (Expr: C_CLIXRES ; Val: $006D77C4), (Expr: C_ENEMYID ; Val: $0094BFB4), (Expr: C_SHARDPOS ; Val: $00951E08), (Expr: C_NEXTCPOS ; Val: $00951FA4), (Expr: C_SYSMSG ; Val: $00952A0C), (Expr: C_CONTPOS ; Val: $00952A2C), (Expr: C_ENEMYHITS ; Val: $00A1AC14), (Expr: C_LHANDID ; Val: $00A72E0C), (Expr: C_CHARDIR ; Val: $00A73BC8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A782ED), (Expr: C_TARGETCURS ; Val: $00A7834C), (Expr: C_CLILEFT ; Val: $00A78378), (Expr: C_CHARPTR ; Val: $00AB8FFC), (Expr: C_LLIFTEDID ; Val: $00AB9048), (Expr: C_LSHARD ; Val: $00ABD694), (Expr: C_POPUPID ; Val: $00ABD804), (Expr: C_JOURNALPTR ; Val: $00AF5998), (Expr: C_SKILLCAPS ; Val: $00B37C88), (Expr: C_SKILLLOCK ; Val: $00B37C4C), (Expr: C_SKILLSPOS ; Val: $00B37D00), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059658D), (Expr: E_OLDDIR ; Val: $00603E20), (Expr: E_EXMSGADDR ; Val: $005A1D10), (Expr: E_ITEMPROPID ; Val: $00A6ED7C), (Expr: E_ITEMNAMEADDR ; Val: $00574AB0), (Expr: E_ITEMPROPADDR ; Val: $005749B0), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00503739), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A3460), (Expr: E_SYSMSGADDR ; Val: $005CE4E0), (Expr: E_MACROADDR ; Val: $0057CDB0), (Expr: E_SENDPACKET ; Val: $0045EDD0), (Expr: E_CONTTOP ; Val: $004DC7F0), (Expr: E_STATBAR ; Val: $005463C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70211 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D721C), (Expr: C_CLIXRES ; Val: $006D77C4), (Expr: C_ENEMYID ; Val: $0094BFB4), (Expr: C_SHARDPOS ; Val: $00951E08), (Expr: C_NEXTCPOS ; Val: $00951FA4), (Expr: C_SYSMSG ; Val: $00952A0C), (Expr: C_CONTPOS ; Val: $00952A2C), (Expr: C_ENEMYHITS ; Val: $00A1AC14), (Expr: C_LHANDID ; Val: $00A72E0C), (Expr: C_CHARDIR ; Val: $00A73BC8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A782ED), (Expr: C_TARGETCURS ; Val: $00A7834C), (Expr: C_CLILEFT ; Val: $00A78378), (Expr: C_CHARPTR ; Val: $00AB8FFC), (Expr: C_LLIFTEDID ; Val: $00AB9048), (Expr: C_LSHARD ; Val: $00ABD694), (Expr: C_POPUPID ; Val: $00ABD804), (Expr: C_JOURNALPTR ; Val: $00AF5998), (Expr: C_SKILLCAPS ; Val: $00B37C88), (Expr: C_SKILLLOCK ; Val: $00B37C4C), (Expr: C_SKILLSPOS ; Val: $00B37D00), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059654D), (Expr: E_OLDDIR ; Val: $00603DE0), (Expr: E_EXMSGADDR ; Val: $005A1CD0), (Expr: E_ITEMPROPID ; Val: $00A6ED7C), (Expr: E_ITEMNAMEADDR ; Val: $00574A90), (Expr: E_ITEMPROPADDR ; Val: $00574990), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00503739), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A3420), (Expr: E_SYSMSGADDR ; Val: $005CE4A0), (Expr: E_MACROADDR ; Val: $0057CD90), (Expr: E_SENDPACKET ; Val: $0045EDD0), (Expr: E_CONTTOP ; Val: $004DC7F0), (Expr: E_STATBAR ; Val: $005463A0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70200 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D721C), (Expr: C_CLIXRES ; Val: $006D77C4), (Expr: C_ENEMYID ; Val: $0094BFB4), (Expr: C_SHARDPOS ; Val: $00951E08), (Expr: C_NEXTCPOS ; Val: $00951FA4), (Expr: C_SYSMSG ; Val: $00952A0C), (Expr: C_CONTPOS ; Val: $00952A2C), (Expr: C_ENEMYHITS ; Val: $00A1AC14), (Expr: C_LHANDID ; Val: $00A72E0C), (Expr: C_CHARDIR ; Val: $00A73BC8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A782ED), (Expr: C_TARGETCURS ; Val: $00A7834C), (Expr: C_CLILEFT ; Val: $00A78378), (Expr: C_CHARPTR ; Val: $00AB8FFC), (Expr: C_LLIFTEDID ; Val: $00AB9048), (Expr: C_LSHARD ; Val: $00ABD694), (Expr: C_POPUPID ; Val: $00ABD804), (Expr: C_JOURNALPTR ; Val: $00AF5998), (Expr: C_SKILLCAPS ; Val: $00B37C88), (Expr: C_SKILLLOCK ; Val: $00B37C4C), (Expr: C_SKILLSPOS ; Val: $00B37D00), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059653D), (Expr: E_OLDDIR ; Val: $00603DD0), (Expr: E_EXMSGADDR ; Val: $005A1CC0), (Expr: E_ITEMPROPID ; Val: $00A6ED7C), (Expr: E_ITEMNAMEADDR ; Val: $00574A80), (Expr: E_ITEMPROPADDR ; Val: $00574980), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00503729), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A3410), (Expr: E_SYSMSGADDR ; Val: $005CE490), (Expr: E_MACROADDR ; Val: $0057CD80), (Expr: E_SENDPACKET ; Val: $0045EDD0), (Expr: E_CONTTOP ; Val: $004DC7F0), (Expr: E_STATBAR ; Val: $00546390), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70191 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D721C), (Expr: C_CLIXRES ; Val: $006D77C4), (Expr: C_ENEMYID ; Val: $0094BFB4), (Expr: C_SHARDPOS ; Val: $00951E08), (Expr: C_NEXTCPOS ; Val: $00951FAC), (Expr: C_SYSMSG ; Val: $00952A14), (Expr: C_CONTPOS ; Val: $00952A34), (Expr: C_ENEMYHITS ; Val: $00A1AC1C), (Expr: C_LHANDID ; Val: $00A72E14), (Expr: C_CHARDIR ; Val: $00A73BD0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A782F5), (Expr: C_TARGETCURS ; Val: $00A78354), (Expr: C_CLILEFT ; Val: $00A78380), (Expr: C_CHARPTR ; Val: $00AB9004), (Expr: C_LLIFTEDID ; Val: $00AB9050), (Expr: C_LSHARD ; Val: $00ABD69C), (Expr: C_POPUPID ; Val: $00ABD80C), (Expr: C_JOURNALPTR ; Val: $00AF59A0), (Expr: C_SKILLCAPS ; Val: $00B37C90), (Expr: C_SKILLLOCK ; Val: $00B37C54), (Expr: C_SKILLSPOS ; Val: $00B37D08), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059652D), (Expr: E_OLDDIR ; Val: $00603DD0), (Expr: E_EXMSGADDR ; Val: $005A1CB0), (Expr: E_ITEMPROPID ; Val: $00A6ED84), (Expr: E_ITEMNAMEADDR ; Val: $00574A70), (Expr: E_ITEMPROPADDR ; Val: $00574970), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00503729), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A3420), (Expr: E_SYSMSGADDR ; Val: $005CE490), (Expr: E_MACROADDR ; Val: $0057CD70), (Expr: E_SENDPACKET ; Val: $0045EDD0), (Expr: E_CONTTOP ; Val: $004DC7F0), (Expr: E_STATBAR ; Val: $00546370), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70190 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D721C), (Expr: C_CLIXRES ; Val: $006D77C4), (Expr: C_ENEMYID ; Val: $0094BFB4), (Expr: C_SHARDPOS ; Val: $00951E08), (Expr: C_NEXTCPOS ; Val: $00951FAC), (Expr: C_SYSMSG ; Val: $00952A14), (Expr: C_CONTPOS ; Val: $00952A34), (Expr: C_ENEMYHITS ; Val: $00A1AC1C), (Expr: C_LHANDID ; Val: $00A72E14), (Expr: C_CHARDIR ; Val: $00A73BD0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A782F5), (Expr: C_TARGETCURS ; Val: $00A78354), (Expr: C_CLILEFT ; Val: $00A78380), (Expr: C_CHARPTR ; Val: $00AB9004), (Expr: C_LLIFTEDID ; Val: $00AB9050), (Expr: C_LSHARD ; Val: $00ABD69C), (Expr: C_POPUPID ; Val: $00ABD80C), (Expr: C_JOURNALPTR ; Val: $00AF59A0), (Expr: C_SKILLCAPS ; Val: $00B37C90), (Expr: C_SKILLLOCK ; Val: $00B37C54), (Expr: C_SKILLSPOS ; Val: $00B37D08), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059654D), (Expr: E_OLDDIR ; Val: $00603DF0), (Expr: E_EXMSGADDR ; Val: $005A1CD0), (Expr: E_ITEMPROPID ; Val: $00A6ED84), (Expr: E_ITEMNAMEADDR ; Val: $00574A90), (Expr: E_ITEMPROPADDR ; Val: $00574990), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00503749), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A3440), (Expr: E_SYSMSGADDR ; Val: $005CE4B0), (Expr: E_MACROADDR ; Val: $0057CD90), (Expr: E_SENDPACKET ; Val: $0045EDD0), (Expr: E_CONTTOP ; Val: $004DC810), (Expr: E_STATBAR ; Val: $00546390), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70170 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D721C), (Expr: C_CLIXRES ; Val: $006D77C4), (Expr: C_ENEMYID ; Val: $0094BFB4), (Expr: C_SHARDPOS ; Val: $00951E08), (Expr: C_NEXTCPOS ; Val: $00951FA4), (Expr: C_SYSMSG ; Val: $00952A0C), (Expr: C_CONTPOS ; Val: $00952A2C), (Expr: C_ENEMYHITS ; Val: $00A1AC14), (Expr: C_LHANDID ; Val: $00A72E0C), (Expr: C_CHARDIR ; Val: $00A73BC8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A78045), (Expr: C_TARGETCURS ; Val: $00A780A4), (Expr: C_CLILEFT ; Val: $00A780D0), (Expr: C_CHARPTR ; Val: $00AB8D54), (Expr: C_LLIFTEDID ; Val: $00AB8DA0), (Expr: C_LSHARD ; Val: $00ABD3EC), (Expr: C_POPUPID ; Val: $00ABD55C), (Expr: C_JOURNALPTR ; Val: $00AF56F0), (Expr: C_SKILLCAPS ; Val: $00B379E0), (Expr: C_SKILLLOCK ; Val: $00B379A4), (Expr: C_SKILLSPOS ; Val: $00B37A58), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001B4), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00596E9D), (Expr: E_OLDDIR ; Val: $006045B0), (Expr: E_EXMSGADDR ; Val: $005A2620), (Expr: E_ITEMPROPID ; Val: $00A6ED7C), (Expr: E_ITEMNAMEADDR ; Val: $005753F0), (Expr: E_ITEMPROPADDR ; Val: $005752F0), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $005041C9), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A3C40), (Expr: E_SYSMSGADDR ; Val: $005CEC70), (Expr: E_MACROADDR ; Val: $0057D830), (Expr: E_SENDPACKET ; Val: $0045EDD0), (Expr: E_CONTTOP ; Val: $004DD2B0), (Expr: E_STATBAR ; Val: $00546CF0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70160 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D721C), (Expr: C_CLIXRES ; Val: $006D77C4), (Expr: C_ENEMYID ; Val: $0094BFD4), (Expr: C_SHARDPOS ; Val: $00951E28), (Expr: C_NEXTCPOS ; Val: $00951FC4), (Expr: C_SYSMSG ; Val: $00952A2C), (Expr: C_CONTPOS ; Val: $00952A4C), (Expr: C_ENEMYHITS ; Val: $00A1AC34), (Expr: C_LHANDID ; Val: $00A72E2C), (Expr: C_CHARDIR ; Val: $00A73BE8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A78065), (Expr: C_TARGETCURS ; Val: $00A780C4), (Expr: C_CLILEFT ; Val: $00A780F0), (Expr: C_CHARPTR ; Val: $00AB8D74), (Expr: C_LLIFTEDID ; Val: $00AB8DC0), (Expr: C_LSHARD ; Val: $00ABD40C), (Expr: C_POPUPID ; Val: $00ABD57C), (Expr: C_JOURNALPTR ; Val: $00AF5710), (Expr: C_SKILLCAPS ; Val: $00B37A00), (Expr: C_SKILLLOCK ; Val: $00B379C4), (Expr: C_SKILLSPOS ; Val: $00B37A78), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005970CD), (Expr: E_OLDDIR ; Val: $00604070), (Expr: E_EXMSGADDR ; Val: $005A2850), (Expr: E_ITEMPROPID ; Val: $00A6ED9C), (Expr: E_ITEMNAMEADDR ; Val: $00575620), (Expr: E_ITEMPROPADDR ; Val: $00575520), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00504379), (Expr: E_SLEEPADDR ; Val: $006650EC), (Expr: E_DRAGADDR ; Val: $005A4050), (Expr: E_SYSMSGADDR ; Val: $005CE730), (Expr: E_MACROADDR ; Val: $0057DA60), (Expr: E_SENDPACKET ; Val: $0045EF80), (Expr: E_CONTTOP ; Val: $004DD460), (Expr: E_STATBAR ; Val: $00546F20), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70144 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D6214), (Expr: C_CLIXRES ; Val: $006D67BC), (Expr: C_ENEMYID ; Val: $0094AFB4), (Expr: C_SHARDPOS ; Val: $00950E08), (Expr: C_NEXTCPOS ; Val: $00950FA4), (Expr: C_SYSMSG ; Val: $00951A0C), (Expr: C_CONTPOS ; Val: $00951A2C), (Expr: C_ENEMYHITS ; Val: $00A19C14), (Expr: C_LHANDID ; Val: $00A71E0C), (Expr: C_CHARDIR ; Val: $00A72BC8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A77045), (Expr: C_TARGETCURS ; Val: $00A770A4), (Expr: C_CLILEFT ; Val: $00A770D0), (Expr: C_CHARPTR ; Val: $00AB7D54), (Expr: C_LLIFTEDID ; Val: $00AB7DA0), (Expr: C_LSHARD ; Val: $00ABC3EC), (Expr: C_POPUPID ; Val: $00ABC55C), (Expr: C_JOURNALPTR ; Val: $00AF46F0), (Expr: C_SKILLCAPS ; Val: $00B369E0), (Expr: C_SKILLLOCK ; Val: $00B369A4), (Expr: C_SKILLSPOS ; Val: $00B36A58), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005965DD), (Expr: E_OLDDIR ; Val: $00603580), (Expr: E_EXMSGADDR ; Val: $005A1D60), (Expr: E_ITEMPROPID ; Val: $00A6DD7C), (Expr: E_ITEMNAMEADDR ; Val: $00574B40), (Expr: E_ITEMPROPADDR ; Val: $00574A40), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00503FB9), (Expr: E_SLEEPADDR ; Val: $006640EC), (Expr: E_DRAGADDR ; Val: $005A3560), (Expr: E_SYSMSGADDR ; Val: $005CDC40), (Expr: E_MACROADDR ; Val: $0057CF80), (Expr: E_SENDPACKET ; Val: $0045EF80), (Expr: E_CONTTOP ; Val: $004DD0A0), (Expr: E_STATBAR ; Val: $00546480), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70143 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D6214), (Expr: C_CLIXRES ; Val: $006D67BC), (Expr: C_ENEMYID ; Val: $0094AFB4), (Expr: C_SHARDPOS ; Val: $00950E08), (Expr: C_NEXTCPOS ; Val: $00950FA4), (Expr: C_SYSMSG ; Val: $00951A0C), (Expr: C_CONTPOS ; Val: $00951A2C), (Expr: C_ENEMYHITS ; Val: $00A19C14), (Expr: C_LHANDID ; Val: $00A71E0C), (Expr: C_CHARDIR ; Val: $00A72BC8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A77045), (Expr: C_TARGETCURS ; Val: $00A770A4), (Expr: C_CLILEFT ; Val: $00A770D0), (Expr: C_CHARPTR ; Val: $00AB7D54), (Expr: C_LLIFTEDID ; Val: $00AB7DA0), (Expr: C_LSHARD ; Val: $00ABC3EC), (Expr: C_POPUPID ; Val: $00ABC55C), (Expr: C_JOURNALPTR ; Val: $00AF46F0), (Expr: C_SKILLCAPS ; Val: $00B369E0), (Expr: C_SKILLLOCK ; Val: $00B369A4), (Expr: C_SKILLSPOS ; Val: $00B36A58), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059661D), (Expr: E_OLDDIR ; Val: $006035C0), (Expr: E_EXMSGADDR ; Val: $005A1DA0), (Expr: E_ITEMPROPID ; Val: $00A6DD7C), (Expr: E_ITEMNAMEADDR ; Val: $00574B70), (Expr: E_ITEMPROPADDR ; Val: $00574A70), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440ED0), (Expr: E_PATHFINDADDR ; Val: $00503FD9), (Expr: E_SLEEPADDR ; Val: $006640EC), (Expr: E_DRAGADDR ; Val: $005A35A0), (Expr: E_SYSMSGADDR ; Val: $005CDC80), (Expr: E_MACROADDR ; Val: $0057CFC0), (Expr: E_SENDPACKET ; Val: $0045EFA0), (Expr: E_CONTTOP ; Val: $004DD0C0), (Expr: E_STATBAR ; Val: $005464B0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70140 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D6214), (Expr: C_CLIXRES ; Val: $006D67BC), (Expr: C_ENEMYID ; Val: $0094AFB4), (Expr: C_SHARDPOS ; Val: $00950E08), (Expr: C_NEXTCPOS ; Val: $00950FA4), (Expr: C_SYSMSG ; Val: $00951A0C), (Expr: C_CONTPOS ; Val: $00951A2C), (Expr: C_ENEMYHITS ; Val: $00A19C14), (Expr: C_LHANDID ; Val: $00A71E0C), (Expr: C_CHARDIR ; Val: $00A72BC8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A77045), (Expr: C_TARGETCURS ; Val: $00A770A4), (Expr: C_CLILEFT ; Val: $00A770D0), (Expr: C_CHARPTR ; Val: $00AB7D54), (Expr: C_LLIFTEDID ; Val: $00AB7DA0), (Expr: C_LSHARD ; Val: $00ABC3EC), (Expr: C_POPUPID ; Val: $00ABC55C), (Expr: C_JOURNALPTR ; Val: $00AF46F0), (Expr: C_SKILLCAPS ; Val: $00B369E0), (Expr: C_SKILLLOCK ; Val: $00B369A4), (Expr: C_SKILLSPOS ; Val: $00B36A58), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005965DD), (Expr: E_OLDDIR ; Val: $00603580), (Expr: E_EXMSGADDR ; Val: $005A1D60), (Expr: E_ITEMPROPID ; Val: $00A6DD7C), (Expr: E_ITEMNAMEADDR ; Val: $00574B40), (Expr: E_ITEMPROPADDR ; Val: $00574A40), (Expr: E_ITEMCHECKADDR ; Val: $0043FC90), (Expr: E_ITEMREQADDR ; Val: $00440EB0), (Expr: E_PATHFINDADDR ; Val: $00503FB9), (Expr: E_SLEEPADDR ; Val: $006640EC), (Expr: E_DRAGADDR ; Val: $005A3560), (Expr: E_SYSMSGADDR ; Val: $005CDC40), (Expr: E_MACROADDR ; Val: $0057CF80), (Expr: E_SENDPACKET ; Val: $0045EF80), (Expr: E_CONTTOP ; Val: $004DD0A0), (Expr: E_STATBAR ; Val: $00546480), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70131 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D6214), (Expr: C_CLIXRES ; Val: $006D67BC), (Expr: C_ENEMYID ; Val: $0094AF74), (Expr: C_SHARDPOS ; Val: $00950DC8), (Expr: C_NEXTCPOS ; Val: $00950F64), (Expr: C_SYSMSG ; Val: $009519CC), (Expr: C_CONTPOS ; Val: $009519EC), (Expr: C_ENEMYHITS ; Val: $00A19BD4), (Expr: C_LHANDID ; Val: $00A71DCC), (Expr: C_CHARDIR ; Val: $00A72B88), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A77005), (Expr: C_TARGETCURS ; Val: $00A77064), (Expr: C_CLILEFT ; Val: $00A77090), (Expr: C_CHARPTR ; Val: $00AB7D14), (Expr: C_LLIFTEDID ; Val: $00AB7D60), (Expr: C_LSHARD ; Val: $00ABC3AC), (Expr: C_POPUPID ; Val: $00ABC51C), (Expr: C_JOURNALPTR ; Val: $00AF46B0), (Expr: C_SKILLCAPS ; Val: $00B369A0), (Expr: C_SKILLLOCK ; Val: $00B36964), (Expr: C_SKILLSPOS ; Val: $00B36A18), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059650D), (Expr: E_OLDDIR ; Val: $006034B0), (Expr: E_EXMSGADDR ; Val: $005A1C90), (Expr: E_ITEMPROPID ; Val: $00A6DD3C), (Expr: E_ITEMNAMEADDR ; Val: $00574A70), (Expr: E_ITEMPROPADDR ; Val: $00574970), (Expr: E_ITEMCHECKADDR ; Val: $0043FC30), (Expr: E_ITEMREQADDR ; Val: $00440E50), (Expr: E_PATHFINDADDR ; Val: $00503EE9), (Expr: E_SLEEPADDR ; Val: $006640EC), (Expr: E_DRAGADDR ; Val: $005A3490), (Expr: E_SYSMSGADDR ; Val: $005CDB70), (Expr: E_MACROADDR ; Val: $0057CEB0), (Expr: E_SENDPACKET ; Val: $0045EF20), (Expr: E_CONTTOP ; Val: $004DCFD0), (Expr: E_STATBAR ; Val: $005463B0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70130 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D6214), (Expr: C_CLIXRES ; Val: $006D67BC), (Expr: C_ENEMYID ; Val: $0094AF74), (Expr: C_SHARDPOS ; Val: $00950DC8), (Expr: C_NEXTCPOS ; Val: $00950F64), (Expr: C_SYSMSG ; Val: $009519CC), (Expr: C_CONTPOS ; Val: $009519EC), (Expr: C_ENEMYHITS ; Val: $00A19BD4), (Expr: C_LHANDID ; Val: $00A71DCC), (Expr: C_CHARDIR ; Val: $00A72B88), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A77005), (Expr: C_TARGETCURS ; Val: $00A77064), (Expr: C_CLILEFT ; Val: $00A77090), (Expr: C_CHARPTR ; Val: $00AB7D14), (Expr: C_LLIFTEDID ; Val: $00AB7D60), (Expr: C_LSHARD ; Val: $00ABC3AC), (Expr: C_POPUPID ; Val: $00ABC51C), (Expr: C_JOURNALPTR ; Val: $00AF46B0), (Expr: C_SKILLCAPS ; Val: $00B369A0), (Expr: C_SKILLLOCK ; Val: $00B36964), (Expr: C_SKILLSPOS ; Val: $00B36A18), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005963AD), (Expr: E_OLDDIR ; Val: $00603350), (Expr: E_EXMSGADDR ; Val: $005A1B30), (Expr: E_ITEMPROPID ; Val: $00A6DD3C), (Expr: E_ITEMNAMEADDR ; Val: $00574910), (Expr: E_ITEMPROPADDR ; Val: $00574810), (Expr: E_ITEMCHECKADDR ; Val: $0043FAE0), (Expr: E_ITEMREQADDR ; Val: $00440D00), (Expr: E_PATHFINDADDR ; Val: $00503D89), (Expr: E_SLEEPADDR ; Val: $006640EC), (Expr: E_DRAGADDR ; Val: $005A3330), (Expr: E_SYSMSGADDR ; Val: $005CDA10), (Expr: E_MACROADDR ; Val: $0057CD50), (Expr: E_SENDPACKET ; Val: $0045EDD0), (Expr: E_CONTTOP ; Val: $004DCE80), (Expr: E_STATBAR ; Val: $00546250), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70120 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D3F24), (Expr: C_CLIXRES ; Val: $006D44CC), (Expr: C_ENEMYID ; Val: $00948BD4), (Expr: C_SHARDPOS ; Val: $0094EA20), (Expr: C_NEXTCPOS ; Val: $0094EBBC), (Expr: C_SYSMSG ; Val: $0094F624), (Expr: C_CONTPOS ; Val: $0094F644), (Expr: C_ENEMYHITS ; Val: $00A1782C), (Expr: C_LHANDID ; Val: $00A6FA04), (Expr: C_CHARDIR ; Val: $00A707C0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A74C35), (Expr: C_TARGETCURS ; Val: $00A74C94), (Expr: C_CLILEFT ; Val: $00A74CC0), (Expr: C_CHARPTR ; Val: $00AB5944), (Expr: C_LLIFTEDID ; Val: $00AB5990), (Expr: C_LSHARD ; Val: $00AB9FDC), (Expr: C_POPUPID ; Val: $00ABA14C), (Expr: C_JOURNALPTR ; Val: $00AF22E0), (Expr: C_SKILLCAPS ; Val: $00B345D0), (Expr: C_SKILLLOCK ; Val: $00B34594), (Expr: C_SKILLSPOS ; Val: $00B34648), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00594D9D), (Expr: E_OLDDIR ; Val: $00601D40), (Expr: E_EXMSGADDR ; Val: $005A0520), (Expr: E_ITEMPROPID ; Val: $00A6B974), (Expr: E_ITEMNAMEADDR ; Val: $00573300), (Expr: E_ITEMPROPADDR ; Val: $00573200), (Expr: E_ITEMCHECKADDR ; Val: $0043FAE0), (Expr: E_ITEMREQADDR ; Val: $00440D00), (Expr: E_PATHFINDADDR ; Val: $00502369), (Expr: E_SLEEPADDR ; Val: $006620EC), (Expr: E_DRAGADDR ; Val: $005A1D20), (Expr: E_SYSMSGADDR ; Val: $005CC400), (Expr: E_MACROADDR ; Val: $0057B740), (Expr: E_SENDPACKET ; Val: $0045EDC0), (Expr: E_CONTTOP ; Val: $004DBAB0), (Expr: E_STATBAR ; Val: $00544B30), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70112 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D3F24), (Expr: C_CLIXRES ; Val: $006D44CC), (Expr: C_ENEMYID ; Val: $00948BD4), (Expr: C_SHARDPOS ; Val: $0094EA20), (Expr: C_NEXTCPOS ; Val: $0094EBBC), (Expr: C_SYSMSG ; Val: $0094F624), (Expr: C_CONTPOS ; Val: $0094F644), (Expr: C_ENEMYHITS ; Val: $00A1782C), (Expr: C_LHANDID ; Val: $00A6FA04), (Expr: C_CHARDIR ; Val: $00A707C0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A74C35), (Expr: C_TARGETCURS ; Val: $00A74C94), (Expr: C_CLILEFT ; Val: $00A74CC0), (Expr: C_CHARPTR ; Val: $00AB5944), (Expr: C_LLIFTEDID ; Val: $00AB5990), (Expr: C_LSHARD ; Val: $00AB9FDC), (Expr: C_POPUPID ; Val: $00ABA14C), (Expr: C_JOURNALPTR ; Val: $00AF22E0), (Expr: C_SKILLCAPS ; Val: $00B345D0), (Expr: C_SKILLLOCK ; Val: $00B34594), (Expr: C_SKILLSPOS ; Val: $00B34648), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00594DDD), (Expr: E_OLDDIR ; Val: $00601D80), (Expr: E_EXMSGADDR ; Val: $005A0560), (Expr: E_ITEMPROPID ; Val: $00A6B974), (Expr: E_ITEMNAMEADDR ; Val: $00573320), (Expr: E_ITEMPROPADDR ; Val: $00573220), (Expr: E_ITEMCHECKADDR ; Val: $0043FAE0), (Expr: E_ITEMREQADDR ; Val: $00440D00), (Expr: E_PATHFINDADDR ; Val: $00502369), (Expr: E_SLEEPADDR ; Val: $006620EC), (Expr: E_DRAGADDR ; Val: $005A1D60), (Expr: E_SYSMSGADDR ; Val: $005CC440), (Expr: E_MACROADDR ; Val: $0057B760), (Expr: E_SENDPACKET ; Val: $0045EDC0), (Expr: E_CONTTOP ; Val: $004DBAB0), (Expr: E_STATBAR ; Val: $00544B50), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70110 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D3F24), (Expr: C_CLIXRES ; Val: $006D44CC), (Expr: C_ENEMYID ; Val: $00948BD4), (Expr: C_SHARDPOS ; Val: $0094EA20), (Expr: C_NEXTCPOS ; Val: $0094EBBC), (Expr: C_SYSMSG ; Val: $0094F624), (Expr: C_CONTPOS ; Val: $0094F644), (Expr: C_ENEMYHITS ; Val: $00A1782C), (Expr: C_LHANDID ; Val: $00A6FA04), (Expr: C_CHARDIR ; Val: $00A707C0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A74C35), (Expr: C_TARGETCURS ; Val: $00A74C94), (Expr: C_CLILEFT ; Val: $00A74CC0), (Expr: C_CHARPTR ; Val: $00AB5944), (Expr: C_LLIFTEDID ; Val: $00AB5990), (Expr: C_LSHARD ; Val: $00AB9FDC), (Expr: C_POPUPID ; Val: $00ABA14C), (Expr: C_JOURNALPTR ; Val: $00AF22E0), (Expr: C_SKILLCAPS ; Val: $00B345D0), (Expr: C_SKILLLOCK ; Val: $00B34594), (Expr: C_SKILLSPOS ; Val: $00B34648), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00594CAD), (Expr: E_OLDDIR ; Val: $00601C50), (Expr: E_EXMSGADDR ; Val: $005A0430), (Expr: E_ITEMPROPID ; Val: $00A6B974), (Expr: E_ITEMNAMEADDR ; Val: $005731F0), (Expr: E_ITEMPROPADDR ; Val: $005730F0), (Expr: E_ITEMCHECKADDR ; Val: $0043FAE0), (Expr: E_ITEMREQADDR ; Val: $00440D00), (Expr: E_PATHFINDADDR ; Val: $00502239), (Expr: E_SLEEPADDR ; Val: $006620EC), (Expr: E_DRAGADDR ; Val: $005A1C30), (Expr: E_SYSMSGADDR ; Val: $005CC310), (Expr: E_MACROADDR ; Val: $0057B630), (Expr: E_SENDPACKET ; Val: $0045EDC0), (Expr: E_CONTTOP ; Val: $004DB980), (Expr: E_STATBAR ; Val: $00544A20), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70102 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D2F24), (Expr: C_CLIXRES ; Val: $006D34CC), (Expr: C_ENEMYID ; Val: $00947B74), (Expr: C_SHARDPOS ; Val: $0094D9C0), (Expr: C_NEXTCPOS ; Val: $0094DB5C), (Expr: C_SYSMSG ; Val: $0094E5C4), (Expr: C_CONTPOS ; Val: $0094E5E4), (Expr: C_ENEMYHITS ; Val: $00A167CC), (Expr: C_LHANDID ; Val: $00A6E9A4), (Expr: C_CHARDIR ; Val: $00A6F760), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A73BD5), (Expr: C_TARGETCURS ; Val: $00A73C34), (Expr: C_CLILEFT ; Val: $00A73C60), (Expr: C_CHARPTR ; Val: $00AB48E4), (Expr: C_LLIFTEDID ; Val: $00AB4930), (Expr: C_LSHARD ; Val: $00AB8F7C), (Expr: C_POPUPID ; Val: $00AB90EC), (Expr: C_JOURNALPTR ; Val: $00AF1280), (Expr: C_SKILLCAPS ; Val: $00B33570), (Expr: C_SKILLLOCK ; Val: $00B33534), (Expr: C_SKILLSPOS ; Val: $00B335E8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005938AD), (Expr: E_OLDDIR ; Val: $00600240), (Expr: E_EXMSGADDR ; Val: $0059F030), (Expr: E_ITEMPROPID ; Val: $00A6A914), (Expr: E_ITEMNAMEADDR ; Val: $00571E50), (Expr: E_ITEMPROPADDR ; Val: $00571D50), (Expr: E_ITEMCHECKADDR ; Val: $0043F970), (Expr: E_ITEMREQADDR ; Val: $00440B90), (Expr: E_PATHFINDADDR ; Val: $00500FA9), (Expr: E_SLEEPADDR ; Val: $006610EC), (Expr: E_DRAGADDR ; Val: $005A0810), (Expr: E_SYSMSGADDR ; Val: $005CA900), (Expr: E_MACROADDR ; Val: $0057A290), (Expr: E_SENDPACKET ; Val: $0045DBE0), (Expr: E_CONTTOP ; Val: $004DA6F0), (Expr: E_STATBAR ; Val: $00543670), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar70101 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D2F24), (Expr: C_CLIXRES ; Val: $006D34CC), (Expr: C_ENEMYID ; Val: $00947B74), (Expr: C_SHARDPOS ; Val: $0094D9C0), (Expr: C_NEXTCPOS ; Val: $0094DB5C), (Expr: C_SYSMSG ; Val: $0094E5C4), (Expr: C_CONTPOS ; Val: $0094E5E4), (Expr: C_ENEMYHITS ; Val: $00A167CC), (Expr: C_LHANDID ; Val: $00A6E9A4), (Expr: C_CHARDIR ; Val: $00A6F760), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A73BD5), (Expr: C_TARGETCURS ; Val: $00A73C34), (Expr: C_CLILEFT ; Val: $00A73C60), (Expr: C_CHARPTR ; Val: $00AB48E4), (Expr: C_LLIFTEDID ; Val: $00AB4930), (Expr: C_LSHARD ; Val: $00AB8F7C), (Expr: C_POPUPID ; Val: $00AB90EC), (Expr: C_JOURNALPTR ; Val: $00AF1280), (Expr: C_SKILLCAPS ; Val: $00B33570), (Expr: C_SKILLLOCK ; Val: $00B33534), (Expr: C_SKILLSPOS ; Val: $00B335E8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0059388D), (Expr: E_OLDDIR ; Val: $00600220), (Expr: E_EXMSGADDR ; Val: $0059F010), (Expr: E_ITEMPROPID ; Val: $00A6A914), (Expr: E_ITEMNAMEADDR ; Val: $00571E30), (Expr: E_ITEMPROPADDR ; Val: $00571D30), (Expr: E_ITEMCHECKADDR ; Val: $0043F970), (Expr: E_ITEMREQADDR ; Val: $00440B90), (Expr: E_PATHFINDADDR ; Val: $00500F89), (Expr: E_SLEEPADDR ; Val: $006610EC), (Expr: E_DRAGADDR ; Val: $005A07F0), (Expr: E_SYSMSGADDR ; Val: $005CA8E0), (Expr: E_MACROADDR ; Val: $0057A270), (Expr: E_SENDPACKET ; Val: $0045DBE0), (Expr: E_CONTTOP ; Val: $004DA6F0), (Expr: E_STATBAR ; Val: $00543650), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7090 : array[0..76] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006D2F24), (Expr: C_CLIXRES ; Val: $006D34CC), (Expr: C_ENEMYID ; Val: $00947B74), (Expr: C_SHARDPOS ; Val: $0094D9C0), (Expr: C_NEXTCPOS ; Val: $0094DB5C), (Expr: C_SYSMSG ; Val: $0094E5C4), (Expr: C_CONTPOS ; Val: $0094E5E4), (Expr: C_ENEMYHITS ; Val: $00A167CC), (Expr: C_LHANDID ; Val: $00A6E9A4), (Expr: C_CHARDIR ; Val: $00A6F760), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00A73BD5), (Expr: C_TARGETCURS ; Val: $00A73C34), (Expr: C_CLILEFT ; Val: $00A73C60), (Expr: C_CHARPTR ; Val: $00AB48E4), (Expr: C_LLIFTEDID ; Val: $00AB4930), (Expr: C_LSHARD ; Val: $00AB8F7C), (Expr: C_POPUPID ; Val: $00AB90EC), (Expr: C_JOURNALPTR ; Val: $00AF1280), (Expr: C_SKILLCAPS ; Val: $00B33570), (Expr: C_SKILLLOCK ; Val: $00B33534), (Expr: C_SKILLSPOS ; Val: $00B335E8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $000000A0), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001AC), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005938DD), (Expr: E_OLDDIR ; Val: $00600270), (Expr: E_EXMSGADDR ; Val: $0059F060), (Expr: E_ITEMPROPID ; Val: $00A6A914), (Expr: E_ITEMNAMEADDR ; Val: $00571E80), (Expr: E_ITEMPROPADDR ; Val: $00571D80), (Expr: E_ITEMCHECKADDR ; Val: $0043F970), (Expr: E_ITEMREQADDR ; Val: $00440B90), (Expr: E_PATHFINDADDR ; Val: $00500F79), (Expr: E_SLEEPADDR ; Val: $006610EC), (Expr: E_DRAGADDR ; Val: $005A0840), (Expr: E_SYSMSGADDR ; Val: $005CA930), (Expr: E_MACROADDR ; Val: $0057A2C0), (Expr: E_SENDPACKET ; Val: $0045DBD0), (Expr: E_CONTTOP ; Val: $004DA6E0), (Expr: E_STATBAR ; Val: $00543640), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), (Expr: F_FLAGS ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7082 : array[0..75] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006CD094), (Expr: C_CLIXRES ; Val: $006CD63C), (Expr: C_ENEMYID ; Val: $00841E34), (Expr: C_SHARDPOS ; Val: $00847C80), (Expr: C_NEXTCPOS ; Val: $00847E1C), (Expr: C_SYSMSG ; Val: $00848888), (Expr: C_CONTPOS ; Val: $008488A8), (Expr: C_ENEMYHITS ; Val: $00910A74), (Expr: C_LHANDID ; Val: $00968C4C), (Expr: C_CHARDIR ; Val: $00969A08), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0096DE85), (Expr: C_TARGETCURS ; Val: $0096DEE4), (Expr: C_CLILEFT ; Val: $0096DF10), (Expr: C_CHARPTR ; Val: $009AEB94), (Expr: C_LLIFTEDID ; Val: $009AEBE0), (Expr: C_LSHARD ; Val: $009B322C), (Expr: C_POPUPID ; Val: $009B339C), (Expr: C_JOURNALPTR ; Val: $009EB530), (Expr: C_SKILLCAPS ; Val: $00A2D820), (Expr: C_SKILLLOCK ; Val: $00A2D7E4), (Expr: C_SKILLSPOS ; Val: $00A2D898), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058F3DD), (Expr: E_OLDDIR ; Val: $005FB260), (Expr: E_EXMSGADDR ; Val: $0059A8F0), (Expr: E_ITEMPROPID ; Val: $00964BBC), (Expr: E_ITEMNAMEADDR ; Val: $0056DAF0), (Expr: E_ITEMPROPADDR ; Val: $0056D9F0), (Expr: E_ITEMCHECKADDR ; Val: $0043F970), (Expr: E_ITEMREQADDR ; Val: $00440B90), (Expr: E_PATHFINDADDR ; Val: $004FF529), (Expr: E_SLEEPADDR ; Val: $0065C0EC), (Expr: E_DRAGADDR ; Val: $0059C0A0), (Expr: E_SYSMSGADDR ; Val: $005C5960), (Expr: E_MACROADDR ; Val: $00575F30), (Expr: E_SENDPACKET ; Val: $0045E000), (Expr: E_CONTTOP ; Val: $004D9E00), (Expr: E_STATBAR ; Val: $00541990), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7080 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006CD094), (Expr: C_CLIXRES ; Val: $006CD63C), (Expr: C_ENEMYID ; Val: $00841E34), (Expr: C_SHARDPOS ; Val: $00847C80), (Expr: C_NEXTCPOS ; Val: $00847E1C), (Expr: C_SYSMSG ; Val: $00848888), (Expr: C_CONTPOS ; Val: $008488A8), (Expr: C_ENEMYHITS ; Val: $00910A74), (Expr: C_LHANDID ; Val: $00968C4C), (Expr: C_CHARDIR ; Val: $00969A08), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0096DE85), (Expr: C_TARGETCURS ; Val: $0096DEE4), (Expr: C_CLILEFT ; Val: $0096DF10), (Expr: C_CHARPTR ; Val: $009AEB94), (Expr: C_LLIFTEDID ; Val: $009AEBE0), (Expr: C_LSHARD ; Val: $009B322C), (Expr: C_POPUPID ; Val: $009B339C), (Expr: C_JOURNALPTR ; Val: $009EB530), (Expr: C_SKILLCAPS ; Val: $00A2D820), (Expr: C_SKILLLOCK ; Val: $00A2D7E4), (Expr: C_SKILLSPOS ; Val: $00A2D898), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058F3BD), (Expr: E_OLDDIR ; Val: $005FB210), (Expr: E_EXMSGADDR ; Val: $0059A8D0), (Expr: E_ITEMPROPID ; Val: $00964BBC), (Expr: E_ITEMNAMEADDR ; Val: $0056DAD0), (Expr: E_ITEMPROPADDR ; Val: $0056D9D0), (Expr: E_ITEMCHECKADDR ; Val: $0043F970), (Expr: E_ITEMREQADDR ; Val: $00440B90), (Expr: E_PATHFINDADDR ; Val: $004FF509), (Expr: E_SLEEPADDR ; Val: $0065C0EC), (Expr: E_DRAGADDR ; Val: $0059C080), (Expr: E_SYSMSGADDR ; Val: $005C5940), (Expr: E_MACROADDR ; Val: $00575F10), (Expr: E_SENDPACKET ; Val: $0045E000), (Expr: E_CONTTOP ; Val: $004D9DE0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7071 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006CB07C), (Expr: C_CLIXRES ; Val: $006CB61C), (Expr: C_ENEMYID ; Val: $0083FCB0), (Expr: C_SHARDPOS ; Val: $00845AB0), (Expr: C_NEXTCPOS ; Val: $00845C4C), (Expr: C_SYSMSG ; Val: $008466B8), (Expr: C_CONTPOS ; Val: $008466D8), (Expr: C_ENEMYHITS ; Val: $0090E8A4), (Expr: C_LHANDID ; Val: $00966A44), (Expr: C_CHARDIR ; Val: $00967800), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0096BC7D), (Expr: C_TARGETCURS ; Val: $0096BCDC), (Expr: C_CLILEFT ; Val: $0096BD08), (Expr: C_CHARPTR ; Val: $009AC98C), (Expr: C_LLIFTEDID ; Val: $009AC9D8), (Expr: C_LSHARD ; Val: $009B1020), (Expr: C_POPUPID ; Val: $009B1194), (Expr: C_JOURNALPTR ; Val: $009E9328), (Expr: C_SKILLCAPS ; Val: $00A2B618), (Expr: C_SKILLLOCK ; Val: $00A2B5DC), (Expr: C_SKILLSPOS ; Val: $00A2B690), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058E40D), (Expr: E_OLDDIR ; Val: $005F9790), (Expr: E_EXMSGADDR ; Val: $00599920), (Expr: E_ITEMPROPID ; Val: $009629BC), (Expr: E_ITEMNAMEADDR ; Val: $0056D010), (Expr: E_ITEMPROPADDR ; Val: $0056CF10), (Expr: E_ITEMCHECKADDR ; Val: $0043F920), (Expr: E_ITEMREQADDR ; Val: $00440B20), (Expr: E_PATHFINDADDR ; Val: $004FE929), (Expr: E_SLEEPADDR ; Val: $0065A0EC), (Expr: E_DRAGADDR ; Val: $0059B0D0), (Expr: E_SYSMSGADDR ; Val: $005C4990), (Expr: E_MACROADDR ; Val: $00575270), (Expr: E_SENDPACKET ; Val: $0045DF90), (Expr: E_CONTTOP ; Val: $004D92D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7070 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006CB07C), (Expr: C_CLIXRES ; Val: $006CB61C), (Expr: C_ENEMYID ; Val: $0083FC90), (Expr: C_SHARDPOS ; Val: $00845A90), (Expr: C_NEXTCPOS ; Val: $00845C2C), (Expr: C_SYSMSG ; Val: $00846698), (Expr: C_CONTPOS ; Val: $008466B8), (Expr: C_ENEMYHITS ; Val: $0090E884), (Expr: C_LHANDID ; Val: $00966A24), (Expr: C_CHARDIR ; Val: $009677E0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0096BC5D), (Expr: C_TARGETCURS ; Val: $0096BCBC), (Expr: C_CLILEFT ; Val: $0096BCE8), (Expr: C_CHARPTR ; Val: $009AC96C), (Expr: C_LLIFTEDID ; Val: $009AC9B8), (Expr: C_LSHARD ; Val: $009B1000), (Expr: C_POPUPID ; Val: $009B1174), (Expr: C_JOURNALPTR ; Val: $009E9308), (Expr: C_SKILLCAPS ; Val: $00A2B5F8), (Expr: C_SKILLLOCK ; Val: $00A2B5BC), (Expr: C_SKILLSPOS ; Val: $00A2B670), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058E3AD), (Expr: E_OLDDIR ; Val: $005F9730), (Expr: E_EXMSGADDR ; Val: $005998C0), (Expr: E_ITEMPROPID ; Val: $0096299C), (Expr: E_ITEMNAMEADDR ; Val: $0056D010), (Expr: E_ITEMPROPADDR ; Val: $0056CF10), (Expr: E_ITEMCHECKADDR ; Val: $0043F920), (Expr: E_ITEMREQADDR ; Val: $00440B20), (Expr: E_PATHFINDADDR ; Val: $004FE929), (Expr: E_SLEEPADDR ; Val: $0065A0EC), (Expr: E_DRAGADDR ; Val: $0059B070), (Expr: E_SYSMSGADDR ; Val: $005C4930), (Expr: E_MACROADDR ; Val: $00575270), (Expr: E_SENDPACKET ; Val: $0045DF90), (Expr: E_CONTTOP ; Val: $004D92D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7064 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006CA07C), (Expr: C_CLIXRES ; Val: $006CA614), (Expr: C_ENEMYID ; Val: $0083EC90), (Expr: C_SHARDPOS ; Val: $00844A90), (Expr: C_NEXTCPOS ; Val: $00844C2C), (Expr: C_SYSMSG ; Val: $00845698), (Expr: C_CONTPOS ; Val: $008456B8), (Expr: C_ENEMYHITS ; Val: $0090D884), (Expr: C_LHANDID ; Val: $00965A24), (Expr: C_CHARDIR ; Val: $009667E0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0096AC4D), (Expr: C_TARGETCURS ; Val: $0096ACA4), (Expr: C_CLILEFT ; Val: $0096ACD0), (Expr: C_CHARPTR ; Val: $009AB954), (Expr: C_LLIFTEDID ; Val: $009AB9A0), (Expr: C_LSHARD ; Val: $009AFFE8), (Expr: C_POPUPID ; Val: $009B015C), (Expr: C_JOURNALPTR ; Val: $009E82F0), (Expr: C_SKILLCAPS ; Val: $00A2A5E0), (Expr: C_SKILLLOCK ; Val: $00A2A5A4), (Expr: C_SKILLSPOS ; Val: $00A2A658), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058DE5D), (Expr: E_OLDDIR ; Val: $005F8B10), (Expr: E_EXMSGADDR ; Val: $00599210), (Expr: E_ITEMPROPID ; Val: $0096199C), (Expr: E_ITEMNAMEADDR ; Val: $0056CB80), (Expr: E_ITEMPROPADDR ; Val: $0056CA80), (Expr: E_ITEMCHECKADDR ; Val: $0043F920), (Expr: E_ITEMREQADDR ; Val: $00440B20), (Expr: E_PATHFINDADDR ; Val: $004FE669), (Expr: E_SLEEPADDR ; Val: $006590EC), (Expr: E_DRAGADDR ; Val: $0059A9C0), (Expr: E_SYSMSGADDR ; Val: $005C3B20), (Expr: E_MACROADDR ; Val: $00574D90), (Expr: E_SENDPACKET ; Val: $0045DF90), (Expr: E_CONTTOP ; Val: $004D9010), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7063 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006CA07C), (Expr: C_CLIXRES ; Val: $006CA614), (Expr: C_ENEMYID ; Val: $0083EC90), (Expr: C_SHARDPOS ; Val: $00844A90), (Expr: C_NEXTCPOS ; Val: $00844C2C), (Expr: C_SYSMSG ; Val: $00845698), (Expr: C_CONTPOS ; Val: $008456B8), (Expr: C_ENEMYHITS ; Val: $0090D884), (Expr: C_LHANDID ; Val: $00965A24), (Expr: C_CHARDIR ; Val: $009667E0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0096AC4D), (Expr: C_TARGETCURS ; Val: $0096ACA4), (Expr: C_CLILEFT ; Val: $0096ACD0), (Expr: C_CHARPTR ; Val: $009AB954), (Expr: C_LLIFTEDID ; Val: $009AB9A0), (Expr: C_LSHARD ; Val: $009AFFE8), (Expr: C_POPUPID ; Val: $009B015C), (Expr: C_JOURNALPTR ; Val: $009E82F0), (Expr: C_SKILLCAPS ; Val: $00A2A5E0), (Expr: C_SKILLLOCK ; Val: $00A2A5A4), (Expr: C_SKILLSPOS ; Val: $00A2A658), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058DE5D), (Expr: E_OLDDIR ; Val: $005F8B50), (Expr: E_EXMSGADDR ; Val: $00599250), (Expr: E_ITEMPROPID ; Val: $0096199C), (Expr: E_ITEMNAMEADDR ; Val: $0056CB80), (Expr: E_ITEMPROPADDR ; Val: $0056CA80), (Expr: E_ITEMCHECKADDR ; Val: $0043F920), (Expr: E_ITEMREQADDR ; Val: $00440B20), (Expr: E_PATHFINDADDR ; Val: $004FE669), (Expr: E_SLEEPADDR ; Val: $006590EC), (Expr: E_DRAGADDR ; Val: $0059AA00), (Expr: E_SYSMSGADDR ; Val: $005C3B60), (Expr: E_MACROADDR ; Val: $00574D90), (Expr: E_SENDPACKET ; Val: $0045DF90), (Expr: E_CONTTOP ; Val: $004D9010), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7050 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C907C), (Expr: C_CLIXRES ; Val: $006C9614), (Expr: C_ENEMYID ; Val: $0083BC90), (Expr: C_SHARDPOS ; Val: $00841A90), (Expr: C_NEXTCPOS ; Val: $00841C2C), (Expr: C_SYSMSG ; Val: $00842698), (Expr: C_CONTPOS ; Val: $008426B8), (Expr: C_ENEMYHITS ; Val: $0090A884), (Expr: C_LHANDID ; Val: $00962A24), (Expr: C_CHARDIR ; Val: $009637E0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00966B3D), (Expr: C_TARGETCURS ; Val: $00966B94), (Expr: C_CLILEFT ; Val: $00966BC0), (Expr: C_CHARPTR ; Val: $009A7844), (Expr: C_LLIFTEDID ; Val: $009A7890), (Expr: C_LSHARD ; Val: $009ABED8), (Expr: C_POPUPID ; Val: $009AC04C), (Expr: C_JOURNALPTR ; Val: $009E41E0), (Expr: C_SKILLCAPS ; Val: $00A264D0), (Expr: C_SKILLLOCK ; Val: $00A26494), (Expr: C_SKILLSPOS ; Val: $00A26548), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058DA6D), (Expr: E_OLDDIR ; Val: $005F85A0), (Expr: E_EXMSGADDR ; Val: $00598E00), (Expr: E_ITEMPROPID ; Val: $0095E99C), (Expr: E_ITEMNAMEADDR ; Val: $0056C8B0), (Expr: E_ITEMPROPADDR ; Val: $0056C7B0), (Expr: E_ITEMCHECKADDR ; Val: $0043F920), (Expr: E_ITEMREQADDR ; Val: $00440B20), (Expr: E_PATHFINDADDR ; Val: $004FE399), (Expr: E_SLEEPADDR ; Val: $006580EC), (Expr: E_DRAGADDR ; Val: $0059A570), (Expr: E_SYSMSGADDR ; Val: $005C36B0), (Expr: E_MACROADDR ; Val: $00574AC0), (Expr: E_SENDPACKET ; Val: $0045DCD0), (Expr: E_CONTTOP ; Val: $004D8D40), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7045 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C607C), (Expr: C_CLIXRES ; Val: $006C660C), (Expr: C_ENEMYID ; Val: $00838BD0), (Expr: C_SHARDPOS ; Val: $0083E9D0), (Expr: C_NEXTCPOS ; Val: $0083EB5C), (Expr: C_SYSMSG ; Val: $0083F5C8), (Expr: C_CONTPOS ; Val: $0083F5E8), (Expr: C_ENEMYHITS ; Val: $009077B4), (Expr: C_LHANDID ; Val: $0095F944), (Expr: C_CHARDIR ; Val: $00960700), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00963A5D), (Expr: C_TARGETCURS ; Val: $00963AB4), (Expr: C_CLILEFT ; Val: $00963AE0), (Expr: C_CHARPTR ; Val: $009A4764), (Expr: C_LLIFTEDID ; Val: $009A47B0), (Expr: C_LSHARD ; Val: $009A8DF8), (Expr: C_POPUPID ; Val: $009A8F6C), (Expr: C_JOURNALPTR ; Val: $009E1100), (Expr: C_SKILLCAPS ; Val: $00A233F0), (Expr: C_SKILLLOCK ; Val: $00A233B4), (Expr: C_SKILLSPOS ; Val: $00A23468), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058AF5D), (Expr: E_OLDDIR ; Val: $005F5940), (Expr: E_EXMSGADDR ; Val: $005962F0), (Expr: E_ITEMPROPID ; Val: $0095B8BC), (Expr: E_ITEMNAMEADDR ; Val: $00569690), (Expr: E_ITEMPROPADDR ; Val: $00569590), (Expr: E_ITEMCHECKADDR ; Val: $0043F680), (Expr: E_ITEMREQADDR ; Val: $00440880), (Expr: E_PATHFINDADDR ; Val: $004FBE99), (Expr: E_SLEEPADDR ; Val: $006560EC), (Expr: E_DRAGADDR ; Val: $0597A60), (Expr: E_SYSMSGADDR ; Val: $005C0AD0), (Expr: E_MACROADDR ; Val: $005718A0), (Expr: E_SENDPACKET ; Val: $0045DA20), (Expr: E_CONTTOP ; Val: $004D6840), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7044 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C507C), (Expr: C_CLIXRES ; Val: $006C560C), (Expr: C_ENEMYID ; Val: $00837BD0), (Expr: C_SHARDPOS ; Val: $0083D9D0), (Expr: C_NEXTCPOS ; Val: $0083DB5C), (Expr: C_SYSMSG ; Val: $0083E5C8), (Expr: C_CONTPOS ; Val: $0083E5E8), (Expr: C_ENEMYHITS ; Val: $009067B4), (Expr: C_LHANDID ; Val: $0095E944), (Expr: C_CHARDIR ; Val: $0095F700), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00962A5D), (Expr: C_TARGETCURS ; Val: $00962AB4), (Expr: C_CLILEFT ; Val: $00962AE0), (Expr: C_CHARPTR ; Val: $009A3764), (Expr: C_LLIFTEDID ; Val: $009A37B0), (Expr: C_LSHARD ; Val: $009A7DF8), (Expr: C_POPUPID ; Val: $009A7F6C), (Expr: C_JOURNALPTR ; Val: $009E0100), (Expr: C_SKILLCAPS ; Val: $00A223F0), (Expr: C_SKILLLOCK ; Val: $00A223B4), (Expr: C_SKILLSPOS ; Val: $00A22468), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058AE4D), (Expr: E_OLDDIR ; Val: $005F5830), (Expr: E_EXMSGADDR ; Val: $005961E0), (Expr: E_ITEMPROPID ; Val: $0095A8BC), (Expr: E_ITEMNAMEADDR ; Val: $00569580), (Expr: E_ITEMPROPADDR ; Val: $00569490), (Expr: E_ITEMCHECKADDR ; Val: $0043F650), (Expr: E_ITEMREQADDR ; Val: $00440850), (Expr: E_PATHFINDADDR ; Val: $004FBD99), (Expr: E_SLEEPADDR ; Val: $006550EC), (Expr: E_DRAGADDR ; Val: $00597950), (Expr: E_SYSMSGADDR ; Val: $005C09C0), (Expr: E_MACROADDR ; Val: $00571790), (Expr: E_SENDPACKET ; Val: $0045D9B0), (Expr: E_CONTTOP ; Val: $004D6740), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7043 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C607C), (Expr: C_CLIXRES ; Val: $006C660C), (Expr: C_ENEMYID ; Val: $00838BD0), (Expr: C_SHARDPOS ; Val: $0083E9D0), (Expr: C_NEXTCPOS ; Val: $0083EB5C), (Expr: C_SYSMSG ; Val: $0083F5C8), (Expr: C_CONTPOS ; Val: $0083F5E8), (Expr: C_ENEMYHITS ; Val: $009077B4), (Expr: C_LHANDID ; Val: $0095F944), (Expr: C_CHARDIR ; Val: $00960700), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00963A5D), (Expr: C_TARGETCURS ; Val: $00963AB4), (Expr: C_CLILEFT ; Val: $00963AE0), (Expr: C_CHARPTR ; Val: $009A4764), (Expr: C_LLIFTEDID ; Val: $009A47B0), (Expr: C_LSHARD ; Val: $009A8DF8), (Expr: C_POPUPID ; Val: $009A8F6C), (Expr: C_JOURNALPTR ; Val: $009E1100), (Expr: C_SKILLCAPS ; Val: $00A233F0), (Expr: C_SKILLLOCK ; Val: $00A233B4), (Expr: C_SKILLSPOS ; Val: $00A23468), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058B88D), (Expr: E_OLDDIR ; Val: $005F6270), (Expr: E_EXMSGADDR ; Val: $00596C20), (Expr: E_ITEMPROPID ; Val: $0095B8BC), (Expr: E_ITEMNAMEADDR ; Val: $005695A0), (Expr: E_ITEMPROPADDR ; Val: $005694B0), (Expr: E_ITEMCHECKADDR ; Val: $0043F650), (Expr: E_ITEMREQADDR ; Val: $00440850), (Expr: E_PATHFINDADDR ; Val: $004FBD99), (Expr: E_SLEEPADDR ; Val: $006560EC), (Expr: E_DRAGADDR ; Val: $00598390), (Expr: E_SYSMSGADDR ; Val: $005C1400), (Expr: E_MACROADDR ; Val: $005717B0), (Expr: E_SENDPACKET ; Val: $0045D9B0), (Expr: E_CONTTOP ; Val: $004D6740), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7042 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C507C), (Expr: C_CLIXRES ; Val: $006C560C), (Expr: C_ENEMYID ; Val: $00837BD0), (Expr: C_SHARDPOS ; Val: $0083D9D0), (Expr: C_NEXTCPOS ; Val: $0083DB5C), (Expr: C_SYSMSG ; Val: $0083E5C8), (Expr: C_CONTPOS ; Val: $0083E5E8), (Expr: C_ENEMYHITS ; Val: $009067B4), (Expr: C_LHANDID ; Val: $0095E944), (Expr: C_CHARDIR ; Val: $0095F700), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00962A5D), (Expr: C_TARGETCURS ; Val: $00962AB4), (Expr: C_CLILEFT ; Val: $00962AE0), (Expr: C_CHARPTR ; Val: $009A3764), (Expr: C_LLIFTEDID ; Val: $009A37B0), (Expr: C_LSHARD ; Val: $009A7DF8), (Expr: C_POPUPID ; Val: $009A7F6C), (Expr: C_JOURNALPTR ; Val: $009E0100), (Expr: C_SKILLCAPS ; Val: $00A223F0), (Expr: C_SKILLLOCK ; Val: $00A223B4), (Expr: C_SKILLSPOS ; Val: $00A22468), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058AE4D), (Expr: E_OLDDIR ; Val: $005F5830), (Expr: E_EXMSGADDR ; Val: $005961E0), (Expr: E_ITEMPROPID ; Val: $0095A8BC), (Expr: E_ITEMNAMEADDR ; Val: $00569580), (Expr: E_ITEMPROPADDR ; Val: $00569490), (Expr: E_ITEMCHECKADDR ; Val: $0043F650), (Expr: E_ITEMREQADDR ; Val: $00440850), (Expr: E_PATHFINDADDR ; Val: $004FBD99), (Expr: E_SLEEPADDR ; Val: $006550EC), (Expr: E_DRAGADDR ; Val: $00597950), (Expr: E_SYSMSGADDR ; Val: $005C09C0), (Expr: E_MACROADDR ; Val: $00571790), (Expr: E_SENDPACKET ; Val: $0045D9B0), (Expr: E_CONTTOP ; Val: $004D6740), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7041 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C507C), (Expr: C_CLIXRES ; Val: $006C560C), (Expr: C_ENEMYID ; Val: $00837BD0), (Expr: C_SHARDPOS ; Val: $0083D9D0), (Expr: C_NEXTCPOS ; Val: $0083DB5C), (Expr: C_SYSMSG ; Val: $0083E5C8), (Expr: C_CONTPOS ; Val: $0083E5E8), (Expr: C_ENEMYHITS ; Val: $009067B4), (Expr: C_LHANDID ; Val: $0095E944), (Expr: C_CHARDIR ; Val: $0095F700), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00962A5D), (Expr: C_TARGETCURS ; Val: $00962AB4), (Expr: C_CLILEFT ; Val: $00962AE0), (Expr: C_CHARPTR ; Val: $009A3764), (Expr: C_LLIFTEDID ; Val: $009A37B0), (Expr: C_LSHARD ; Val: $009A7DF8), (Expr: C_POPUPID ; Val: $009A7F6C), (Expr: C_JOURNALPTR ; Val: $009E0100), (Expr: C_SKILLCAPS ; Val: $00A223F0), (Expr: C_SKILLLOCK ; Val: $00A223B4), (Expr: C_SKILLSPOS ; Val: $00A22468), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058AD3D), (Expr: E_OLDDIR ; Val: $005F5720), (Expr: E_EXMSGADDR ; Val: $005960D0), (Expr: E_ITEMPROPID ; Val: $0095A8BC), (Expr: E_ITEMNAMEADDR ; Val: $00569470), (Expr: E_ITEMPROPADDR ; Val: $00569380), (Expr: E_ITEMCHECKADDR ; Val: $0043F650), (Expr: E_ITEMREQADDR ; Val: $00440850), (Expr: E_PATHFINDADDR ; Val: $004FBC89), (Expr: E_SLEEPADDR ; Val: $006550EC), (Expr: E_DRAGADDR ; Val: $00597840), (Expr: E_SYSMSGADDR ; Val: $005C08B0), (Expr: E_MACROADDR ; Val: $00571680), (Expr: E_SENDPACKET ; Val: $0045D9B0), (Expr: E_CONTTOP ; Val: $004D6630), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7040 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C507C), (Expr: C_CLIXRES ; Val: $006C560C), (Expr: C_ENEMYID ; Val: $00837BD0), (Expr: C_SHARDPOS ; Val: $0083D9D0), (Expr: C_NEXTCPOS ; Val: $0083DB5C), (Expr: C_SYSMSG ; Val: $0083E5C8), (Expr: C_CONTPOS ; Val: $0083E5E8), (Expr: C_ENEMYHITS ; Val: $009067B4), (Expr: C_LHANDID ; Val: $0095E944), (Expr: C_CHARDIR ; Val: $0095F700), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $00962A5D), (Expr: C_TARGETCURS ; Val: $00962AB4), (Expr: C_CLILEFT ; Val: $00962AE0), (Expr: C_CHARPTR ; Val: $009A3764), (Expr: C_LLIFTEDID ; Val: $009A37B0), (Expr: C_LSHARD ; Val: $009A7DF8), (Expr: C_POPUPID ; Val: $009A7F6C), (Expr: C_JOURNALPTR ; Val: $009E0100), (Expr: C_SKILLCAPS ; Val: $00A223F0), (Expr: C_SKILLLOCK ; Val: $00A223B4), (Expr: C_SKILLSPOS ; Val: $00A22468), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058AD2D), (Expr: E_OLDDIR ; Val: $005F5710), (Expr: E_EXMSGADDR ; Val: $005960C0), (Expr: E_ITEMPROPID ; Val: $0095A8BC), (Expr: E_ITEMNAMEADDR ; Val: $00569460), (Expr: E_ITEMPROPADDR ; Val: $00569370), (Expr: E_ITEMCHECKADDR ; Val: $0043F650), (Expr: E_ITEMREQADDR ; Val: $00440850), (Expr: E_PATHFINDADDR ; Val: $004FBC79), (Expr: E_SLEEPADDR ; Val: $006550EC), (Expr: E_DRAGADDR ; Val: $00597830), (Expr: E_SYSMSGADDR ; Val: $005C08A0), (Expr: E_MACROADDR ; Val: $00571670), (Expr: E_SENDPACKET ; Val: $0045D9B0), (Expr: E_CONTTOP ; Val: $004D6620), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7030 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C205C), (Expr: C_CLIXRES ; Val: $006C25E4), (Expr: C_ENEMYID ; Val: $00834990), (Expr: C_SHARDPOS ; Val: $0083A790), (Expr: C_NEXTCPOS ; Val: $0083A88C), (Expr: C_SYSMSG ; Val: $0083B2F4), (Expr: C_CONTPOS ; Val: $0083B314), (Expr: C_ENEMYHITS ; Val: $009034DC), (Expr: C_LHANDID ; Val: $0095B66C), (Expr: C_CHARDIR ; Val: $0095C3C8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0095F5FD), (Expr: C_TARGETCURS ; Val: $0095F654), (Expr: C_CLILEFT ; Val: $0095F680), (Expr: C_CHARPTR ; Val: $009A0304), (Expr: C_LLIFTEDID ; Val: $009A0350), (Expr: C_LSHARD ; Val: $009A4998), (Expr: C_POPUPID ; Val: $009A4B0C), (Expr: C_JOURNALPTR ; Val: $009DCCA0), (Expr: C_SKILLCAPS ; Val: $00A1EF90), (Expr: C_SKILLLOCK ; Val: $00A1EF54), (Expr: C_SKILLSPOS ; Val: $00A1F008), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058823C), (Expr: E_OLDDIR ; Val: $005F4890), (Expr: E_EXMSGADDR ; Val: $005935D0), (Expr: E_ITEMPROPID ; Val: $009575E4), (Expr: E_ITEMNAMEADDR ; Val: $005676E0), (Expr: E_ITEMPROPADDR ; Val: $005675F0), (Expr: E_ITEMCHECKADDR ; Val: $0043F650), (Expr: E_ITEMREQADDR ; Val: $00440850), (Expr: E_PATHFINDADDR ; Val: $004FA3F9), (Expr: E_SLEEPADDR ; Val: $006530EC), (Expr: E_DRAGADDR ; Val: $00594D40), (Expr: E_SYSMSGADDR ; Val: $005BDDB0), (Expr: E_MACROADDR ; Val: $0056F8F0), (Expr: E_SENDPACKET ; Val: $0045D9A0), (Expr: E_CONTTOP ; Val: $004D4D30), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7021 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006C105C), (Expr: C_CLIXRES ; Val: $006C15E4), (Expr: C_ENEMYID ; Val: $00833990), (Expr: C_SHARDPOS ; Val: $00839790), (Expr: C_NEXTCPOS ; Val: $0083988C), (Expr: C_SYSMSG ; Val: $0083A2F4), (Expr: C_CONTPOS ; Val: $0083A314), (Expr: C_ENEMYHITS ; Val: $009024DC), (Expr: C_LHANDID ; Val: $0095A66C), (Expr: C_CHARDIR ; Val: $0095B3C8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0095E5FD), (Expr: C_TARGETCURS ; Val: $0095E654), (Expr: C_CLILEFT ; Val: $0095E680), (Expr: C_CHARPTR ; Val: $0099F304), (Expr: C_LLIFTEDID ; Val: $0099F350), (Expr: C_LSHARD ; Val: $009A3998), (Expr: C_POPUPID ; Val: $009A3B0C), (Expr: C_JOURNALPTR ; Val: $009DBCA0), (Expr: C_SKILLCAPS ; Val: $00A1DF90), (Expr: C_SKILLLOCK ; Val: $00A1DF54), (Expr: C_SKILLSPOS ; Val: $00A1E008), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005875DC), (Expr: E_OLDDIR ; Val: $005F3C50), (Expr: E_EXMSGADDR ; Val: $005929A0), (Expr: E_ITEMPROPID ; Val: $009565E4), (Expr: E_ITEMNAMEADDR ; Val: $00566A80), (Expr: E_ITEMPROPADDR ; Val: $00566990), (Expr: E_ITEMCHECKADDR ; Val: $0043EA40), (Expr: E_ITEMREQADDR ; Val: $0043FC40), (Expr: E_PATHFINDADDR ; Val: $004F97B9), (Expr: E_SLEEPADDR ; Val: $006520EC), (Expr: E_DRAGADDR ; Val: $00594110), (Expr: E_SYSMSGADDR ; Val: $005BD170), (Expr: E_MACROADDR ; Val: $0056EC90), (Expr: E_SENDPACKET ; Val: $0045CD90), (Expr: E_CONTTOP ; Val: $004D4120), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7011 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006BE05C), (Expr: C_CLIXRES ; Val: $006BE5E4), (Expr: C_ENEMYID ; Val: $00830990), (Expr: C_SHARDPOS ; Val: $00836790), (Expr: C_NEXTCPOS ; Val: $0083688C), (Expr: C_SYSMSG ; Val: $008372F4), (Expr: C_CONTPOS ; Val: $00837314), (Expr: C_ENEMYHITS ; Val: $008FF4DC), (Expr: C_LHANDID ; Val: $00956E9C), (Expr: C_CHARDIR ; Val: $00957BF8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0095AE2D), (Expr: C_TARGETCURS ; Val: $0095AE84), (Expr: C_CLILEFT ; Val: $0095AEB0), (Expr: C_CHARPTR ; Val: $0099BB34), (Expr: C_LLIFTEDID ; Val: $0099BB80), (Expr: C_LSHARD ; Val: $009A01C8), (Expr: C_POPUPID ; Val: $009A033C), (Expr: C_JOURNALPTR ; Val: $009D84D0), (Expr: C_SKILLCAPS ; Val: $00A1A7C0), (Expr: C_SKILLLOCK ; Val: $00A1A784), (Expr: C_SKILLSPOS ; Val: $00A1A838), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005863BC), (Expr: E_OLDDIR ; Val: $005F27C0), (Expr: E_EXMSGADDR ; Val: $00591780), (Expr: E_ITEMPROPID ; Val: $00952E14), (Expr: E_ITEMNAMEADDR ; Val: $00565860), (Expr: E_ITEMPROPADDR ; Val: $00565770), (Expr: E_ITEMCHECKADDR ; Val: $0043D810), (Expr: E_ITEMREQADDR ; Val: $0043EA10), (Expr: E_PATHFINDADDR ; Val: $004F8599), (Expr: E_SLEEPADDR ; Val: $006500EC), (Expr: E_DRAGADDR ; Val: $00592EF0), (Expr: E_SYSMSGADDR ; Val: $005BBF10), (Expr: E_MACROADDR ; Val: $0056DA70), (Expr: E_SENDPACKET ; Val: $0045BB60), (Expr: E_CONTTOP ; Val: $004D2F00), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7004 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006BE05C), (Expr: C_CLIXRES ; Val: $006BE5E4), (Expr: C_ENEMYID ; Val: $00830990), (Expr: C_SHARDPOS ; Val: $00836790), (Expr: C_NEXTCPOS ; Val: $0083688C), (Expr: C_SYSMSG ; Val: $008372F4), (Expr: C_CONTPOS ; Val: $00837314), (Expr: C_ENEMYHITS ; Val: $008FF4DC), (Expr: C_LHANDID ; Val: $00956E9C), (Expr: C_CHARDIR ; Val: $00957BF8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0095AE2D), (Expr: C_TARGETCURS ; Val: $0095AE84), (Expr: C_CLILEFT ; Val: $0095AEB0), (Expr: C_CHARPTR ; Val: $0099BB34), (Expr: C_LLIFTEDID ; Val: $0099BB80), (Expr: C_LSHARD ; Val: $009A01C8), (Expr: C_POPUPID ; Val: $009A033C), (Expr: C_JOURNALPTR ; Val: $009D84D0), (Expr: C_SKILLCAPS ; Val: $00A1A7C0), (Expr: C_SKILLLOCK ; Val: $00A1A784), (Expr: C_SKILLSPOS ; Val: $00A1A838), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058630C), (Expr: E_OLDDIR ; Val: $005F2710), (Expr: E_EXMSGADDR ; Val: $005916D0), (Expr: E_ITEMPROPID ; Val: $00952E14), (Expr: E_ITEMNAMEADDR ; Val: $005657B0), (Expr: E_ITEMPROPADDR ; Val: $005656C0), (Expr: E_ITEMCHECKADDR ; Val: $0043D810), (Expr: E_ITEMREQADDR ; Val: $0043EA10), (Expr: E_PATHFINDADDR ; Val: $004F8499), (Expr: E_SLEEPADDR ; Val: $006500EC), (Expr: E_DRAGADDR ; Val: $00592E40), (Expr: E_SYSMSGADDR ; Val: $005BBE60), (Expr: E_MACROADDR ; Val: $0056D9C0), (Expr: E_SENDPACKET ; Val: $0045BB60), (Expr: E_CONTTOP ; Val: $004D2E00), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7003 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006BE05C), (Expr: C_CLIXRES ; Val: $006BE5E4), (Expr: C_ENEMYID ; Val: $00830990), (Expr: C_SHARDPOS ; Val: $00836790), (Expr: C_NEXTCPOS ; Val: $0083688C), (Expr: C_SYSMSG ; Val: $008372F4), (Expr: C_CONTPOS ; Val: $00837314), (Expr: C_ENEMYHITS ; Val: $008FF4DC), (Expr: C_LHANDID ; Val: $00956E9C), (Expr: C_CHARDIR ; Val: $00957BF8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0095AE2D), (Expr: C_TARGETCURS ; Val: $0095AE84), (Expr: C_CLILEFT ; Val: $0095AEB0), (Expr: C_CHARPTR ; Val: $0099BB34), (Expr: C_LLIFTEDID ; Val: $0099BB80), (Expr: C_LSHARD ; Val: $009A01C8), (Expr: C_POPUPID ; Val: $009A033C), (Expr: C_JOURNALPTR ; Val: $009D84D0), (Expr: C_SKILLCAPS ; Val: $00A1A7C0), (Expr: C_SKILLLOCK ; Val: $00A1A784), (Expr: C_SKILLSPOS ; Val: $00A1A838), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005862BC), (Expr: E_OLDDIR ; Val: $005F26C0), (Expr: E_EXMSGADDR ; Val: $00591680), (Expr: E_ITEMPROPID ; Val: $00952E14), (Expr: E_ITEMNAMEADDR ; Val: $00565760), (Expr: E_ITEMPROPADDR ; Val: $00565670), (Expr: E_ITEMCHECKADDR ; Val: $0043D7F0), (Expr: E_ITEMREQADDR ; Val: $0043E9F0), (Expr: E_PATHFINDADDR ; Val: $004F8449), (Expr: E_SLEEPADDR ; Val: $006500EC), (Expr: E_DRAGADDR ; Val: $00592DF0), (Expr: E_SYSMSGADDR ; Val: $005BBE10), (Expr: E_MACROADDR ; Val: $0056D970), (Expr: E_SENDPACKET ; Val: $0045BB40), (Expr: E_CONTTOP ; Val: $004D2DE0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7002 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006BE05C), (Expr: C_CLIXRES ; Val: $006BE5E4), (Expr: C_ENEMYID ; Val: $00830990), (Expr: C_SHARDPOS ; Val: $00836790), (Expr: C_NEXTCPOS ; Val: $0083688C), (Expr: C_SYSMSG ; Val: $008372F4), (Expr: C_CONTPOS ; Val: $00837314), (Expr: C_ENEMYHITS ; Val: $008FF4DC), (Expr: C_LHANDID ; Val: $00956E9C), (Expr: C_CHARDIR ; Val: $00957BF8), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0095AE2D), (Expr: C_TARGETCURS ; Val: $0095AE84), (Expr: C_CLILEFT ; Val: $0095AEB0), (Expr: C_CHARPTR ; Val: $0099BB34), (Expr: C_LLIFTEDID ; Val: $0099BB80), (Expr: C_LSHARD ; Val: $009A01C8), (Expr: C_POPUPID ; Val: $009A033C), (Expr: C_JOURNALPTR ; Val: $009D84D0), (Expr: C_SKILLCAPS ; Val: $00A1A7C0), (Expr: C_SKILLLOCK ; Val: $00A1A784), (Expr: C_SKILLSPOS ; Val: $00A1A838), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0058631C), (Expr: E_OLDDIR ; Val: $005F2720), (Expr: E_EXMSGADDR ; Val: $005916E0), (Expr: E_ITEMPROPID ; Val: $00952E14), (Expr: E_ITEMNAMEADDR ; Val: $005657C0), (Expr: E_ITEMPROPADDR ; Val: $005656D0), (Expr: E_ITEMCHECKADDR ; Val: $0043D7F0), (Expr: E_ITEMREQADDR ; Val: $0043E9F0), (Expr: E_PATHFINDADDR ; Val: $004F84A9), (Expr: E_SLEEPADDR ; Val: $006500EC), (Expr: E_DRAGADDR ; Val: $00592E50), (Expr: E_SYSMSGADDR ; Val: $005BBE70), (Expr: E_MACROADDR ; Val: $0056D9D0), (Expr: E_SENDPACKET ; Val: $0045BB40), (Expr: E_CONTTOP ; Val: $004D2DE0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar7000 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $006BE05C), (Expr: C_CLIXRES ; Val: $006BE5E4), (Expr: C_ENEMYID ; Val: $00830990), (Expr: C_SHARDPOS ; Val: $00836790), (Expr: C_NEXTCPOS ; Val: $0083688C), (Expr: C_SYSMSG ; Val: $008372F4), (Expr: C_CONTPOS ; Val: $00837314), (Expr: C_ENEMYHITS ; Val: $008FF4DC), (Expr: C_LHANDID ; Val: $00956E84), (Expr: C_CHARDIR ; Val: $00957BE0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $0095AE15), (Expr: C_TARGETCURS ; Val: $0095AE6C), (Expr: C_CLILEFT ; Val: $0095AE98), (Expr: C_CHARPTR ; Val: $0099BB1C), (Expr: C_LLIFTEDID ; Val: $0099BB68), (Expr: C_LSHARD ; Val: $009A01B0), (Expr: C_POPUPID ; Val: $009A0324), (Expr: C_JOURNALPTR ; Val: $009D84B8), (Expr: C_SKILLCAPS ; Val: $00A1A7A8), (Expr: C_SKILLLOCK ; Val: $00A1A76C), (Expr: C_SKILLSPOS ; Val: $00A1A820), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000088), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000078), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000038), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $000001A8), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00585FBC), (Expr: E_OLDDIR ; Val: $005F23B0), (Expr: E_EXMSGADDR ; Val: $00591380), (Expr: E_ITEMPROPID ; Val: $00952DFC), (Expr: E_ITEMNAMEADDR ; Val: $00565460), (Expr: E_ITEMPROPADDR ; Val: $00565370), (Expr: E_ITEMCHECKADDR ; Val: $0043D5E0), (Expr: E_ITEMREQADDR ; Val: $0043E7E0), (Expr: E_PATHFINDADDR ; Val: $004F8269), (Expr: E_SLEEPADDR ; Val: $006500EC), (Expr: E_DRAGADDR ; Val: $00592AF0), (Expr: E_SYSMSGADDR ; Val: $005BBB00), (Expr: E_MACROADDR ; Val: $0056D670), (Expr: E_SENDPACKET ; Val: $0045B900), (Expr: E_CONTTOP ; Val: $004D2BA0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar60142 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005E0D84), (Expr: C_CLIXRES ; Val: $005E130C), (Expr: C_ENEMYID ; Val: $006CDC38), (Expr: C_SHARDPOS ; Val: $006D3A38), (Expr: C_NEXTCPOS ; Val: $006D3B34), (Expr: C_SYSMSG ; Val: $006D459C), (Expr: C_CONTPOS ; Val: $006D45BC), (Expr: C_ENEMYHITS ; Val: $0079C49C), (Expr: C_LHANDID ; Val: $007F3994), (Expr: C_CHARDIR ; Val: $007F46F0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F7925), (Expr: C_TARGETCURS ; Val: $007F797C), (Expr: C_CLILEFT ; Val: $007F79A8), (Expr: C_CHARPTR ; Val: $00838634), (Expr: C_LLIFTEDID ; Val: $00838680), (Expr: C_LSHARD ; Val: $0083CC30), (Expr: C_POPUPID ; Val: $0083CDC4), (Expr: C_JOURNALPTR ; Val: $00874E58), (Expr: C_SKILLCAPS ; Val: $008B68A8), (Expr: C_SKILLLOCK ; Val: $008B6918), (Expr: C_SKILLSPOS ; Val: $008B6950), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005063CC), (Expr: E_OLDDIR ; Val: $00544670), (Expr: E_EXMSGADDR ; Val: $0050F220), (Expr: E_ITEMPROPID ; Val: $007EF90C), (Expr: E_ITEMNAMEADDR ; Val: $004EE4D0), (Expr: E_ITEMPROPADDR ; Val: $004EE3E0), (Expr: E_ITEMCHECKADDR ; Val: $00406A30), (Expr: E_ITEMREQADDR ; Val: $00406370), (Expr: E_PATHFINDADDR ; Val: $0049A129), (Expr: E_SLEEPADDR ; Val: $0058B098), (Expr: E_DRAGADDR ; Val: $00511320), (Expr: E_SYSMSGADDR ; Val: $0052BF10), (Expr: E_MACROADDR ; Val: $004F50C0), (Expr: E_SENDPACKET ; Val: $0041D020), (Expr: E_CONTTOP ; Val: $0047BFD0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar60130 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005E0D84), (Expr: C_CLIXRES ; Val: $005E130C), (Expr: C_ENEMYID ; Val: $006CDC38), (Expr: C_SHARDPOS ; Val: $006D3A38), (Expr: C_NEXTCPOS ; Val: $006D3B34), (Expr: C_SYSMSG ; Val: $006D459C), (Expr: C_CONTPOS ; Val: $006D45BC), (Expr: C_ENEMYHITS ; Val: $0079C49C), (Expr: C_LHANDID ; Val: $007F3994), (Expr: C_CHARDIR ; Val: $007F46F0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F7925), (Expr: C_TARGETCURS ; Val: $007F797C), (Expr: C_CLILEFT ; Val: $007F79A8), (Expr: C_CHARPTR ; Val: $00838634), (Expr: C_LLIFTEDID ; Val: $00838680), (Expr: C_LSHARD ; Val: $0083CC30), (Expr: C_POPUPID ; Val: $0083CDC4), (Expr: C_JOURNALPTR ; Val: $00874E58), (Expr: C_SKILLCAPS ; Val: $008B68A8), (Expr: C_SKILLLOCK ; Val: $008B6918), (Expr: C_SKILLSPOS ; Val: $008B6950), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005063FC), (Expr: E_OLDDIR ; Val: $005446A0), (Expr: E_EXMSGADDR ; Val: $0050F250), (Expr: E_ITEMPROPID ; Val: $007EF90C), (Expr: E_ITEMNAMEADDR ; Val: $004EE500), (Expr: E_ITEMPROPADDR ; Val: $004EE410), (Expr: E_ITEMCHECKADDR ; Val: $00406A30), (Expr: E_ITEMREQADDR ; Val: $00406370), (Expr: E_PATHFINDADDR ; Val: $0049A159), (Expr: E_SLEEPADDR ; Val: $0058B098), (Expr: E_DRAGADDR ; Val: $00511350), (Expr: E_SYSMSGADDR ; Val: $0052BF40), (Expr: E_MACROADDR ; Val: $004F50F0), (Expr: E_SENDPACKET ; Val: $0041D020), (Expr: E_CONTTOP ; Val: $0047C000), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar60124 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005E0D84), (Expr: C_CLIXRES ; Val: $005E130C), (Expr: C_ENEMYID ; Val: $006CDC38), (Expr: C_SHARDPOS ; Val: $006D3A38), (Expr: C_NEXTCPOS ; Val: $006D3B34), (Expr: C_SYSMSG ; Val: $006D459C), (Expr: C_CONTPOS ; Val: $006D45BC), (Expr: C_ENEMYHITS ; Val: $0079C49C), (Expr: C_LHANDID ; Val: $007F3994), (Expr: C_CHARDIR ; Val: $007F46F0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F7925), (Expr: C_TARGETCURS ; Val: $007F797C), (Expr: C_CLILEFT ; Val: $007F79A8), (Expr: C_CHARPTR ; Val: $00838634), (Expr: C_LLIFTEDID ; Val: $00838680), (Expr: C_LSHARD ; Val: $0083CC30), (Expr: C_POPUPID ; Val: $0083CDC4), (Expr: C_JOURNALPTR ; Val: $00874E58), (Expr: C_SKILLCAPS ; Val: $008B68A8), (Expr: C_SKILLLOCK ; Val: $008B6918), (Expr: C_SKILLSPOS ; Val: $008B6950), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050702C), (Expr: E_OLDDIR ; Val: $00544F30), (Expr: E_EXMSGADDR ; Val: $0050FDE0), (Expr: E_ITEMPROPID ; Val: $007EF90C), (Expr: E_ITEMNAMEADDR ; Val: $004EE700), (Expr: E_ITEMPROPADDR ; Val: $004EE610), (Expr: E_ITEMCHECKADDR ; Val: $00406A30), (Expr: E_ITEMREQADDR ; Val: $00406370), (Expr: E_PATHFINDADDR ; Val: $0049A1C9), (Expr: E_SLEEPADDR ; Val: $0058B098), (Expr: E_DRAGADDR ; Val: $00511F00), (Expr: E_SYSMSGADDR ; Val: $0052CA10), (Expr: E_MACROADDR ; Val: $004F53C0), (Expr: E_SENDPACKET ; Val: $0041CF80), (Expr: E_CONTTOP ; Val: $0047BEE0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); SysVar60123 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005E0D84), (Expr: C_CLIXRES ; Val: $005E130C), (Expr: C_ENEMYID ; Val: $006CDC18), (Expr: C_SHARDPOS ; Val: $006D3A18), (Expr: C_NEXTCPOS ; Val: $006D3B14), (Expr: C_SYSMSG ; Val: $006D457C), (Expr: C_CONTPOS ; Val: $006D459C), (Expr: C_ENEMYHITS ; Val: $0079C47C), (Expr: C_LHANDID ; Val: $007F3974), (Expr: C_CHARDIR ; Val: $007F46D0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F7905), (Expr: C_TARGETCURS ; Val: $007F795C), (Expr: C_CLILEFT ; Val: $007F7988), (Expr: C_CHARPTR ; Val: $00838614), (Expr: C_LLIFTEDID ; Val: $00838660), (Expr: C_LSHARD ; Val: $0083CC10), (Expr: C_POPUPID ; Val: $0083CDA4), (Expr: C_JOURNALPTR ; Val: $00874E38), (Expr: C_SKILLCAPS ; Val: $008B6888), (Expr: C_SKILLLOCK ; Val: $008B68F8), (Expr: C_SKILLSPOS ; Val: $008B6930), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050702C), (Expr: E_OLDDIR ; Val: $00544F30), (Expr: E_EXMSGADDR ; Val: $0050FDE0), (Expr: E_ITEMPROPID ; Val: $007EF8EC), (Expr: E_ITEMNAMEADDR ; Val: $004EE700), (Expr: E_ITEMPROPADDR ; Val: $004EE610), (Expr: E_ITEMCHECKADDR ; Val: $00406A30), (Expr: E_ITEMREQADDR ; Val: $00406370), (Expr: E_PATHFINDADDR ; Val: $0049A1C9), (Expr: E_SLEEPADDR ; Val: $0058B098), (Expr: E_DRAGADDR ; Val: $00511F00), (Expr: E_SYSMSGADDR ; Val: $0052CA10), (Expr: E_MACROADDR ; Val: $004F53C0), (Expr: E_SENDPACKET ; Val: $0041CF80), (Expr: E_CONTTOP ; Val: $0047BEE0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); SysVar60120 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005E0D84), (Expr: C_CLIXRES ; Val: $005E130C), (Expr: C_ENEMYID ; Val: $006CDC18), (Expr: C_SHARDPOS ; Val: $006D3A18), (Expr: C_NEXTCPOS ; Val: $006D3B14), (Expr: C_SYSMSG ; Val: $006D457C), (Expr: C_CONTPOS ; Val: $006D459C), (Expr: C_ENEMYHITS ; Val: $0079C47C), (Expr: C_LHANDID ; Val: $007F3974), (Expr: C_CHARDIR ; Val: $007F46D0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F7905), (Expr: C_TARGETCURS ; Val: $007F795C), (Expr: C_CLILEFT ; Val: $007F7988), (Expr: C_CHARPTR ; Val: $00838614), (Expr: C_LLIFTEDID ; Val: $00838660), (Expr: C_LSHARD ; Val: $0083CC10), (Expr: C_POPUPID ; Val: $0083CDA4), (Expr: C_JOURNALPTR ; Val: $00874E38), (Expr: C_SKILLCAPS ; Val: $008B6888), (Expr: C_SKILLLOCK ; Val: $008B68F8), (Expr: C_SKILLSPOS ; Val: $008B6930), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050703C), (Expr: E_OLDDIR ; Val: $00544EB0), (Expr: E_EXMSGADDR ; Val: $0050FE40), (Expr: E_ITEMPROPID ; Val: $007EF8EC), (Expr: E_ITEMNAMEADDR ; Val: $004EE960), (Expr: E_ITEMPROPADDR ; Val: $004EE870), (Expr: E_ITEMCHECKADDR ; Val: $00406B70), (Expr: E_ITEMREQADDR ; Val: $004064B0), (Expr: E_PATHFINDADDR ; Val: $0049A209), (Expr: E_SLEEPADDR ; Val: $0058B098), (Expr: E_DRAGADDR ; Val: $00511F60), (Expr: E_SYSMSGADDR ; Val: $0052CA10), (Expr: E_MACROADDR ; Val: $004F5500), (Expr: E_SENDPACKET ; Val: $0041D090), (Expr: E_CONTTOP ; Val: $0047BF90), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); SysVar60110 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005DDD84), (Expr: C_CLIXRES ; Val: $005DE30C), (Expr: C_ENEMYID ; Val: $006CAC18), (Expr: C_SHARDPOS ; Val: $006D0A18), (Expr: C_NEXTCPOS ; Val: $006D0B14), (Expr: C_SYSMSG ; Val: $006D157C), (Expr: C_CONTPOS ; Val: $006D159C), (Expr: C_ENEMYHITS ; Val: $0079947C), (Expr: C_LHANDID ; Val: $007F0974), (Expr: C_CHARDIR ; Val: $007F16D0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F4905), (Expr: C_TARGETCURS ; Val: $007F495C), (Expr: C_CLILEFT ; Val: $007F4988), (Expr: C_CHARPTR ; Val: $00835604), (Expr: C_LLIFTEDID ; Val: $00835650), (Expr: C_LSHARD ; Val: $00839C00), (Expr: C_POPUPID ; Val: $00839D94), (Expr: C_JOURNALPTR ; Val: $00871E28), (Expr: C_SKILLCAPS ; Val: $008B3878), (Expr: C_SKILLLOCK ; Val: $008B38E8), (Expr: C_SKILLSPOS ; Val: $008B3920), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050583C), (Expr: E_OLDDIR ; Val: $00541F30), (Expr: E_EXMSGADDR ; Val: $0050CD40), (Expr: E_ITEMPROPID ; Val: $007EC8EC), (Expr: E_ITEMNAMEADDR ; Val: $004EE5E0), (Expr: E_ITEMPROPADDR ; Val: $004EE4F0), (Expr: E_ITEMCHECKADDR ; Val: $00406A10), (Expr: E_ITEMREQADDR ; Val: $00406350), (Expr: E_PATHFINDADDR ; Val: $0049A3F9), (Expr: E_SLEEPADDR ; Val: $0058809C), (Expr: E_DRAGADDR ; Val: $0050EE50), (Expr: E_SYSMSGADDR ; Val: $00529A10), (Expr: E_MACROADDR ; Val: $004F5040), (Expr: E_SENDPACKET ; Val: $0041D0E0), (Expr: E_CONTTOP ; Val: $0047C0E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); SysVar6080 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005DC714), (Expr: C_CLIXRES ; Val: $005DCC9C), (Expr: C_ENEMYID ; Val: $006CAC18), (Expr: C_SHARDPOS ; Val: $006D0A18), (Expr: C_NEXTCPOS ; Val: $006D0B14), (Expr: C_SYSMSG ; Val: $006D157C), (Expr: C_CONTPOS ; Val: $006D159C), (Expr: C_ENEMYHITS ; Val: $0079947C), (Expr: C_LHANDID ; Val: $007F0974), (Expr: C_CHARDIR ; Val: $007F16D0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F4905), (Expr: C_TARGETCURS ; Val: $007F495C), (Expr: C_CLILEFT ; Val: $007F4988), (Expr: C_CHARPTR ; Val: $00835604), (Expr: C_LLIFTEDID ; Val: $00835650), (Expr: C_LSHARD ; Val: $00839C00), (Expr: C_POPUPID ; Val: $00839D94), (Expr: C_JOURNALPTR ; Val: $00871E28), (Expr: C_SKILLCAPS ; Val: $008B3878), (Expr: C_SKILLLOCK ; Val: $008B38E8), (Expr: C_SKILLSPOS ; Val: $008B3920), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050266C), (Expr: E_OLDDIR ; Val: $005420C0), (Expr: E_EXMSGADDR ; Val: $00509BE0), (Expr: E_ITEMPROPID ; Val: $007EC8EC), (Expr: E_ITEMNAMEADDR ; Val: $004EB350), (Expr: E_ITEMPROPADDR ; Val: $004EB260), (Expr: E_ITEMCHECKADDR ; Val: $00403430), (Expr: E_ITEMREQADDR ; Val: $00402D70), (Expr: E_PATHFINDADDR ; Val: $00496CC9), (Expr: E_SLEEPADDR ; Val: $0058809C), (Expr: E_DRAGADDR ; Val: $0050BD00), (Expr: E_SYSMSGADDR ; Val: $00526710), (Expr: E_MACROADDR ; Val: $004F1DB0), (Expr: E_SENDPACKET ; Val: $00419BB0), (Expr: E_CONTTOP ; Val: $004789C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); SysVar6070 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005DC714), (Expr: C_CLIXRES ; Val: $005DCC9C), (Expr: C_ENEMYID ; Val: $006CAC18), (Expr: C_SHARDPOS ; Val: $006D0A18), (Expr: C_NEXTCPOS ; Val: $006D0B14), (Expr: C_SYSMSG ; Val: $006D157C), (Expr: C_CONTPOS ; Val: $006D159C), (Expr: C_ENEMYHITS ; Val: $0079947C), (Expr: C_LHANDID ; Val: $007F0974), (Expr: C_CHARDIR ; Val: $007F16D0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F4905), (Expr: C_TARGETCURS ; Val: $007F495C), (Expr: C_CLILEFT ; Val: $007F4988), (Expr: C_CHARPTR ; Val: $00835604), (Expr: C_LLIFTEDID ; Val: $00835650), (Expr: C_LSHARD ; Val: $00839C00), (Expr: C_POPUPID ; Val: $00839D94), (Expr: C_JOURNALPTR ; Val: $00871E28), (Expr: C_SKILLCAPS ; Val: $008B3878), (Expr: C_SKILLLOCK ; Val: $008B38E8), (Expr: C_SKILLSPOS ; Val: $008B3920), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050266C), (Expr: E_OLDDIR ; Val: $00542090), (Expr: E_EXMSGADDR ; Val: $00509BE0), (Expr: E_ITEMPROPID ; Val: $007EC8EC), (Expr: E_ITEMNAMEADDR ; Val: $004EB350), (Expr: E_ITEMPROPADDR ; Val: $004EB260), (Expr: E_ITEMCHECKADDR ; Val: $00403430), (Expr: E_ITEMREQADDR ; Val: $00402D70), (Expr: E_PATHFINDADDR ; Val: $00496CC9), (Expr: E_SLEEPADDR ; Val: $0058809C), (Expr: E_DRAGADDR ; Val: $0050BD00), (Expr: E_SYSMSGADDR ; Val: $00526710), (Expr: E_MACROADDR ; Val: $004F1DB0), (Expr: E_SENDPACKET ; Val: $00419BB0), (Expr: E_CONTTOP ; Val: $004789C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6062 : array[0..74] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005DC714), (Expr: C_CLIXRES ; Val: $005DCC9C), (Expr: C_ENEMYID ; Val: $006CAC18), (Expr: C_SHARDPOS ; Val: $006D0A18), (Expr: C_NEXTCPOS ; Val: $006D0B14), (Expr: C_SYSMSG ; Val: $006D157C), (Expr: C_CONTPOS ; Val: $006D159C), (Expr: C_ENEMYHITS ; Val: $0079947C), (Expr: C_LHANDID ; Val: $007F0974), (Expr: C_CHARDIR ; Val: $007F16D0), (Expr: C_TARGETCNT ; Val: $00000000), (Expr: C_CURSORKIND ; Val: $007F4905), (Expr: C_TARGETCURS ; Val: $007F495C), (Expr: C_CLILEFT ; Val: $007F4988), (Expr: C_CHARPTR ; Val: $00835604), (Expr: C_LLIFTEDID ; Val: $00835650), (Expr: C_LSHARD ; Val: $00839C00), (Expr: C_POPUPID ; Val: $00839D94), (Expr: C_JOURNALPTR ; Val: $00871E28), (Expr: C_SKILLCAPS ; Val: $008B3878), (Expr: C_SKILLLOCK ; Val: $008B38E8), (Expr: C_SKILLSPOS ; Val: $008B3920), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $0000000C), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $00000034), (Expr: B_LANG ; Val: $00000060), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $0000001C), (Expr: B_LTARGX ; Val: $000001A8), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005023FC), (Expr: E_OLDDIR ; Val: $00542060), (Expr: E_EXMSGADDR ; Val: $00509990), (Expr: E_ITEMPROPID ; Val: $007EC8EC), (Expr: E_ITEMNAMEADDR ; Val: $004EB1E0), (Expr: E_ITEMPROPADDR ; Val: $004EB0F0), (Expr: E_ITEMCHECKADDR ; Val: $004035B0), (Expr: E_ITEMREQADDR ; Val: $00402EF0), (Expr: E_PATHFINDADDR ; Val: $00496E79), (Expr: E_SLEEPADDR ; Val: $0058809C), (Expr: E_DRAGADDR ; Val: $0050BA90), (Expr: E_SYSMSGADDR ; Val: $005265A0), (Expr: E_MACROADDR ; Val: $004F1CC0), (Expr: E_SENDPACKET ; Val: $00419BA0), (Expr: E_CONTTOP ; Val: $00478C00), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000018), (Expr: F_PACKETVER ; Val: $00000001), (Expr: F_PATHFINDVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6061 : array[0..72] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE34C), (Expr: C_CLIXRES ; Val: $005BFB80), (Expr: C_ENEMYID ; Val: $006B2AE8), (Expr: C_SHARDPOS ; Val: $006B88E4), (Expr: C_NEXTCPOS ; Val: $006B8A4C), (Expr: C_SYSMSG ; Val: $006B94B8), (Expr: C_CONTPOS ; Val: $006B94D8), (Expr: C_ENEMYHITS ; Val: $00781360), (Expr: C_LHANDID ; Val: $007D8940), (Expr: C_CHARDIR ; Val: $007D95A8), (Expr: C_TARGETCNT ; Val: $0081A7E8), (Expr: C_CURSORKIND ; Val: $0081D3D4), (Expr: C_TARGETCURS ; Val: $0081D424), (Expr: C_CLILEFT ; Val: $0081D454), (Expr: C_CHARPTR ; Val: $0081D9F4), (Expr: C_LLIFTEDID ; Val: $0081DA40), (Expr: C_LSHARD ; Val: $00821B60), (Expr: C_POPUPID ; Val: $00821CD0), (Expr: C_JOURNALPTR ; Val: $00859E7C), (Expr: C_SKILLCAPS ; Val: $0089C184), (Expr: C_SKILLLOCK ; Val: $0089C1F4), (Expr: C_SKILLSPOS ; Val: $0089C22C), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005091AC), (Expr: E_OLDDIR ; Val: $00553530), (Expr: E_EXMSGADDR ; Val: $00513F10), (Expr: E_ITEMPROPID ; Val: $007D47BC), (Expr: E_ITEMNAMEADDR ; Val: $004F3AF0), (Expr: E_ITEMPROPADDR ; Val: $004F3A10), (Expr: E_ITEMCHECKADDR ; Val: $0053E360), (Expr: E_ITEMREQADDR ; Val: $0053E990), (Expr: E_PATHFINDADDR ; Val: $0049C0FD), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518E80), (Expr: E_SYSMSGADDR ; Val: $005280E0), (Expr: E_MACROADDR ; Val: $004F8220), (Expr: E_SENDPACKET ; Val: $004169E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), (Expr: F_PACKETVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6060 : array[0..72] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BF394), (Expr: C_CLIXRES ; Val: $005C0BC8), (Expr: C_ENEMYID ; Val: $006B3B88), (Expr: C_SHARDPOS ; Val: $006B9984), (Expr: C_NEXTCPOS ; Val: $006B9AEC), (Expr: C_SYSMSG ; Val: $006BA558), (Expr: C_CONTPOS ; Val: $006BA578), (Expr: C_ENEMYHITS ; Val: $00782400), (Expr: C_LHANDID ; Val: $007D99E0), (Expr: C_CHARDIR ; Val: $007DA658), (Expr: C_TARGETCNT ; Val: $0081B8E0), (Expr: C_CURSORKIND ; Val: $0081E4CC), (Expr: C_TARGETCURS ; Val: $0081E51C), (Expr: C_CLILEFT ; Val: $0081E54C), (Expr: C_CHARPTR ; Val: $0081EAEC), (Expr: C_LLIFTEDID ; Val: $0081EB38), (Expr: C_LSHARD ; Val: $00822C58), (Expr: C_POPUPID ; Val: $00822DC8), (Expr: C_JOURNALPTR ; Val: $0085AF74), (Expr: C_SKILLCAPS ; Val: $0089D27C), (Expr: C_SKILLLOCK ; Val: $0089D2EC), (Expr: C_SKILLSPOS ; Val: $0089D324), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00509ABC), (Expr: E_OLDDIR ; Val: $00552E70), (Expr: E_EXMSGADDR ; Val: $00514880), (Expr: E_ITEMPROPID ; Val: $007D585C), (Expr: E_ITEMNAMEADDR ; Val: $004F3FE0), (Expr: E_ITEMPROPADDR ; Val: $004F3F00), (Expr: E_ITEMCHECKADDR ; Val: $0053EB70), (Expr: E_ITEMREQADDR ; Val: $0053F1A0), (Expr: E_PATHFINDADDR ; Val: $0049C3AD), (Expr: E_SLEEPADDR ; Val: $0057D22C), (Expr: E_DRAGADDR ; Val: $005197B0), (Expr: E_SYSMSGADDR ; Val: $00528A70), (Expr: E_MACROADDR ; Val: $004F8710), (Expr: E_SENDPACKET ; Val: $00416B30), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), (Expr: F_PACKETVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6050 : array[0..72] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE34C), (Expr: C_CLIXRES ; Val: $005BFB80), (Expr: C_ENEMYID ; Val: $006B2AE8), (Expr: C_SHARDPOS ; Val: $006B88E4), (Expr: C_NEXTCPOS ; Val: $006B8A4C), (Expr: C_SYSMSG ; Val: $006B94B8), (Expr: C_CONTPOS ; Val: $006B94D8), (Expr: C_ENEMYHITS ; Val: $00781360), (Expr: C_LHANDID ; Val: $007D8940), (Expr: C_CHARDIR ; Val: $007D95A8), (Expr: C_TARGETCNT ; Val: $0081A7E8), (Expr: C_CURSORKIND ; Val: $0081D3D4), (Expr: C_TARGETCURS ; Val: $0081D424), (Expr: C_CLILEFT ; Val: $0081D454), (Expr: C_CHARPTR ; Val: $0081D9F4), (Expr: C_LLIFTEDID ; Val: $0081DA40), (Expr: C_LSHARD ; Val: $00821B60), (Expr: C_POPUPID ; Val: $00821CD0), (Expr: C_JOURNALPTR ; Val: $00859E7C), (Expr: C_SKILLCAPS ; Val: $0089C184), (Expr: C_SKILLLOCK ; Val: $0089C1F4), (Expr: C_SKILLSPOS ; Val: $0089C22C), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005091AC), (Expr: E_OLDDIR ; Val: $00553530), (Expr: E_EXMSGADDR ; Val: $00513F10), (Expr: E_ITEMPROPID ; Val: $007D47BC), (Expr: E_ITEMNAMEADDR ; Val: $004F3AF0), (Expr: E_ITEMPROPADDR ; Val: $004F3A10), (Expr: E_ITEMCHECKADDR ; Val: $0053E360), (Expr: E_ITEMREQADDR ; Val: $0053E990), (Expr: E_PATHFINDADDR ; Val: $0049C0FD), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518E80), (Expr: E_SYSMSGADDR ; Val: $005280E0), (Expr: E_MACROADDR ; Val: $004F8220), (Expr: E_SENDPACKET ; Val: $004169E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), (Expr: F_PACKETVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6040 : array[0..72] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE34C), (Expr: C_CLIXRES ; Val: $005BFB80), (Expr: C_ENEMYID ; Val: $006B2AE8), (Expr: C_SHARDPOS ; Val: $006B88E4), (Expr: C_NEXTCPOS ; Val: $006B8A4C), (Expr: C_SYSMSG ; Val: $006B94B8), (Expr: C_CONTPOS ; Val: $006B94D8), (Expr: C_ENEMYHITS ; Val: $00781360), (Expr: C_LHANDID ; Val: $007D8940), (Expr: C_CHARDIR ; Val: $007D95A8), (Expr: C_TARGETCNT ; Val: $0081A7E8), (Expr: C_CURSORKIND ; Val: $0081D3D4), (Expr: C_TARGETCURS ; Val: $0081D424), (Expr: C_CLILEFT ; Val: $0081D454), (Expr: C_CHARPTR ; Val: $0081D9F4), (Expr: C_LLIFTEDID ; Val: $0081DA40), (Expr: C_LSHARD ; Val: $00821B60), (Expr: C_POPUPID ; Val: $00821CD0), (Expr: C_JOURNALPTR ; Val: $00859E7C), (Expr: C_SKILLCAPS ; Val: $0089C184), (Expr: C_SKILLLOCK ; Val: $0089C1F4), (Expr: C_SKILLSPOS ; Val: $0089C22C), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050912C), (Expr: E_OLDDIR ; Val: $005534B0), (Expr: E_EXMSGADDR ; Val: $00513E90), (Expr: E_ITEMPROPID ; Val: $007D47BC), (Expr: E_ITEMNAMEADDR ; Val: $004F3A70), (Expr: E_ITEMPROPADDR ; Val: $004F3990), (Expr: E_ITEMCHECKADDR ; Val: $0053E2E0), (Expr: E_ITEMREQADDR ; Val: $0053E910), (Expr: E_PATHFINDADDR ; Val: $0049C07D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518E00), (Expr: E_SYSMSGADDR ; Val: $00528060), (Expr: E_MACROADDR ; Val: $004F81A0), (Expr: E_SENDPACKET ; Val: $004169D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), (Expr: F_PACKETVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6030 : array[0..72] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE34C), (Expr: C_CLIXRES ; Val: $005BFB80), (Expr: C_ENEMYID ; Val: $006B2AE8), (Expr: C_SHARDPOS ; Val: $006B88E4), (Expr: C_NEXTCPOS ; Val: $006B8A4C), (Expr: C_SYSMSG ; Val: $006B94B8), (Expr: C_CONTPOS ; Val: $006B94D8), (Expr: C_ENEMYHITS ; Val: $00781360), (Expr: C_LHANDID ; Val: $007D8940), (Expr: C_CHARDIR ; Val: $007D95A8), (Expr: C_TARGETCNT ; Val: $0081A76C), (Expr: C_CURSORKIND ; Val: $0081D354), (Expr: C_TARGETCURS ; Val: $0081D3A4), (Expr: C_CLILEFT ; Val: $0081D3D4), (Expr: C_CHARPTR ; Val: $0081D974), (Expr: C_LLIFTEDID ; Val: $0081D9C0), (Expr: C_LSHARD ; Val: $00821AE0), (Expr: C_POPUPID ; Val: $00821C50), (Expr: C_JOURNALPTR ; Val: $00859DFC), (Expr: C_SKILLCAPS ; Val: $0089C104), (Expr: C_SKILLLOCK ; Val: $0089C174), (Expr: C_SKILLSPOS ; Val: $0089C1AC), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050912C), (Expr: E_OLDDIR ; Val: $005534A0), (Expr: E_EXMSGADDR ; Val: $00513E80), (Expr: E_ITEMPROPID ; Val: $007D47BC), (Expr: E_ITEMNAMEADDR ; Val: $004F3A80), (Expr: E_ITEMPROPADDR ; Val: $004F39A0), (Expr: E_ITEMCHECKADDR ; Val: $0053E2D0), (Expr: E_ITEMREQADDR ; Val: $0053E900), (Expr: E_PATHFINDADDR ; Val: $0049C08D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518DF0), (Expr: E_SYSMSGADDR ; Val: $00528050), (Expr: E_MACROADDR ; Val: $004F81B0), (Expr: E_SENDPACKET ; Val: $004169D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), (Expr: F_PACKETVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6017 : array[0..72] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE34C), (Expr: C_CLIXRES ; Val: $005BFB80), (Expr: C_ENEMYID ; Val: $006B2AE8), (Expr: C_SHARDPOS ; Val: $006B88E4), (Expr: C_NEXTCPOS ; Val: $006B8A4C), (Expr: C_SYSMSG ; Val: $006B94B8), (Expr: C_CONTPOS ; Val: $006B94D8), (Expr: C_ENEMYHITS ; Val: $00781360), (Expr: C_LHANDID ; Val: $007D8938), (Expr: C_CHARDIR ; Val: $007D95A0), (Expr: C_TARGETCNT ; Val: $0081A764), (Expr: C_CURSORKIND ; Val: $0081D34C), (Expr: C_TARGETCURS ; Val: $0081D39C), (Expr: C_CLILEFT ; Val: $0081D3CC), (Expr: C_CHARPTR ; Val: $0081D96C), (Expr: C_LLIFTEDID ; Val: $0081D9B8), (Expr: C_LSHARD ; Val: $00821AD8), (Expr: C_POPUPID ; Val: $00821C48), (Expr: C_JOURNALPTR ; Val: $00859DF4), (Expr: C_SKILLCAPS ; Val: $0089C0FC), (Expr: C_SKILLLOCK ; Val: $0089C16C), (Expr: C_SKILLSPOS ; Val: $0089C1A4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_PACKETVER ; Val: $00000001), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050901C), (Expr: E_OLDDIR ; Val: $00553440), (Expr: E_EXMSGADDR ; Val: $00513CF0), (Expr: E_ITEMPROPID ; Val: $007D47B4), (Expr: E_ITEMNAMEADDR ; Val: $004F3970), (Expr: E_ITEMPROPADDR ; Val: $004F3890), (Expr: E_ITEMCHECKADDR ; Val: $0053E230), (Expr: E_ITEMREQADDR ; Val: $0053E860), (Expr: E_PATHFINDADDR ; Val: $0049C00D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518C60), (Expr: E_SYSMSGADDR ; Val: $00527F30), (Expr: E_MACROADDR ; Val: $004F80A0), (Expr: E_SENDPACKET ; Val: $004169D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), (Expr: F_PACKETVER ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6015 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE34C), (Expr: C_CLIXRES ; Val: $005BFB80), (Expr: C_ENEMYID ; Val: $006B2AE8), (Expr: C_SHARDPOS ; Val: $006B88E4), (Expr: C_NEXTCPOS ; Val: $006B8A4C), (Expr: C_SYSMSG ; Val: $006B94B8), (Expr: C_CONTPOS ; Val: $006B94D8), (Expr: C_ENEMYHITS ; Val: $00781360), (Expr: C_LHANDID ; Val: $007D8938), (Expr: C_CHARDIR ; Val: $007D95A0), (Expr: C_TARGETCNT ; Val: $0081A764), (Expr: C_CURSORKIND ; Val: $0081D34C), (Expr: C_TARGETCURS ; Val: $0081D39C), (Expr: C_CLILEFT ; Val: $0081D3CC), (Expr: C_CHARPTR ; Val: $0081D96C), (Expr: C_LLIFTEDID ; Val: $0081D9B8), (Expr: C_LSHARD ; Val: $00821AD8), (Expr: C_POPUPID ; Val: $00821C48), (Expr: C_JOURNALPTR ; Val: $00859DF4), (Expr: C_SKILLCAPS ; Val: $0089C0FC), (Expr: C_SKILLLOCK ; Val: $0089C16C), (Expr: C_SKILLSPOS ; Val: $0089C1A4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508EEC), (Expr: E_OLDDIR ; Val: $00553420), (Expr: E_EXMSGADDR ; Val: $00513C60), (Expr: E_ITEMPROPID ; Val: $007D47B4), (Expr: E_ITEMNAMEADDR ; Val: $004F37B0), (Expr: E_ITEMPROPADDR ; Val: $004F36D0), (Expr: E_ITEMCHECKADDR ; Val: $0053E1A0), (Expr: E_ITEMREQADDR ; Val: $0053E7D0), (Expr: E_PATHFINDADDR ; Val: $0049BF8D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518BD0), (Expr: E_SYSMSGADDR ; Val: $00527E70), (Expr: E_MACROADDR ; Val: $004F7F40), (Expr: E_SENDPACKET ; Val: $004169C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6013 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE34C), (Expr: C_CLIXRES ; Val: $005BFB80), (Expr: C_ENEMYID ; Val: $006B2AE8), (Expr: C_SHARDPOS ; Val: $006B88E4), (Expr: C_NEXTCPOS ; Val: $006B8A4C), (Expr: C_SYSMSG ; Val: $006B94B8), (Expr: C_CONTPOS ; Val: $006B94D8), (Expr: C_ENEMYHITS ; Val: $00781360), (Expr: C_LHANDID ; Val: $007D8938), (Expr: C_CHARDIR ; Val: $007D95A0), (Expr: C_TARGETCNT ; Val: $0081A764), (Expr: C_CURSORKIND ; Val: $0081D34C), (Expr: C_TARGETCURS ; Val: $0081D39C), (Expr: C_CLILEFT ; Val: $0081D3CC), (Expr: C_CHARPTR ; Val: $0081D96C), (Expr: C_LLIFTEDID ; Val: $0081D9B8), (Expr: C_LSHARD ; Val: $00821AD8), (Expr: C_POPUPID ; Val: $00821C48), (Expr: C_JOURNALPTR ; Val: $00859DF4), (Expr: C_SKILLCAPS ; Val: $0089C0FC), (Expr: C_SKILLLOCK ; Val: $0089C16C), (Expr: C_SKILLSPOS ; Val: $0089C1A4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508EEC), (Expr: E_OLDDIR ; Val: $005533F0), (Expr: E_EXMSGADDR ; Val: $00513C60), (Expr: E_ITEMPROPID ; Val: $007D47B4), (Expr: E_ITEMNAMEADDR ; Val: $004F37B0), (Expr: E_ITEMPROPADDR ; Val: $004F36D0), (Expr: E_ITEMCHECKADDR ; Val: $0053E170), (Expr: E_ITEMREQADDR ; Val: $0053E7A0), (Expr: E_PATHFINDADDR ; Val: $0049BF8D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518BD0), (Expr: E_SYSMSGADDR ; Val: $00527E40), (Expr: E_MACROADDR ; Val: $004F7F40), (Expr: E_SENDPACKET ; Val: $004169C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6012 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE2C4), (Expr: C_CLIXRES ; Val: $005BFAF8), (Expr: C_ENEMYID ; Val: $006B2A68), (Expr: C_SHARDPOS ; Val: $006B8864), (Expr: C_NEXTCPOS ; Val: $006B89CC), (Expr: C_SYSMSG ; Val: $006B9438), (Expr: C_CONTPOS ; Val: $006B9458), (Expr: C_ENEMYHITS ; Val: $007812E0), (Expr: C_LHANDID ; Val: $007D88B8), (Expr: C_CHARDIR ; Val: $007D9520), (Expr: C_TARGETCNT ; Val: $0081A6E4), (Expr: C_CURSORKIND ; Val: $0081D2CC), (Expr: C_TARGETCURS ; Val: $0081D31C), (Expr: C_CLILEFT ; Val: $0081D34C), (Expr: C_CHARPTR ; Val: $0081D8EC), (Expr: C_LLIFTEDID ; Val: $0081D938), (Expr: C_LSHARD ; Val: $00821A58), (Expr: C_POPUPID ; Val: $00821BC8), (Expr: C_JOURNALPTR ; Val: $00859D74), (Expr: C_SKILLCAPS ; Val: $0089C07C), (Expr: C_SKILLLOCK ; Val: $0089C0EC), (Expr: C_SKILLSPOS ; Val: $0089C124), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508F5C), (Expr: E_OLDDIR ; Val: $005531C0), (Expr: E_EXMSGADDR ; Val: $00513C30), (Expr: E_ITEMPROPID ; Val: $007D4734), (Expr: E_ITEMNAMEADDR ; Val: $004F3A00), (Expr: E_ITEMPROPADDR ; Val: $004F3920), (Expr: E_ITEMCHECKADDR ; Val: $0053E010), (Expr: E_ITEMREQADDR ; Val: $0053E640), (Expr: E_PATHFINDADDR ; Val: $0049BCDD), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518B50), (Expr: E_SYSMSGADDR ; Val: $00527DD0), (Expr: E_MACROADDR ; Val: $004F8130), (Expr: E_SENDPACKET ; Val: $00416B60), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6011 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE2C4), (Expr: C_CLIXRES ; Val: $005BFAF8), (Expr: C_ENEMYID ; Val: $006B2A68), (Expr: C_SHARDPOS ; Val: $006B8864), (Expr: C_NEXTCPOS ; Val: $006B89CC), (Expr: C_SYSMSG ; Val: $006B9438), (Expr: C_CONTPOS ; Val: $006B9458), (Expr: C_ENEMYHITS ; Val: $007812E0), (Expr: C_LHANDID ; Val: $007D88B8), (Expr: C_CHARDIR ; Val: $007D9520), (Expr: C_TARGETCNT ; Val: $0081A6E4), (Expr: C_CURSORKIND ; Val: $0081D2CC), (Expr: C_TARGETCURS ; Val: $0081D31C), (Expr: C_CLILEFT ; Val: $0081D34C), (Expr: C_CHARPTR ; Val: $0081D8EC), (Expr: C_LLIFTEDID ; Val: $0081D938), (Expr: C_LSHARD ; Val: $00821A58), (Expr: C_POPUPID ; Val: $00821BC8), (Expr: C_JOURNALPTR ; Val: $00859D74), (Expr: C_SKILLCAPS ; Val: $0089C07C), (Expr: C_SKILLLOCK ; Val: $0089C0EC), (Expr: C_SKILLSPOS ; Val: $0089C124), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050910C), (Expr: E_OLDDIR ; Val: $00553190), (Expr: E_EXMSGADDR ; Val: $00513DB0), (Expr: E_ITEMPROPID ; Val: $007D4734), (Expr: E_ITEMNAMEADDR ; Val: $004F3AE0), (Expr: E_ITEMPROPADDR ; Val: $004F3A00), (Expr: E_ITEMCHECKADDR ; Val: $0053DF20), (Expr: E_ITEMREQADDR ; Val: $0053E550), (Expr: E_PATHFINDADDR ; Val: $0049BD3D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518CE0), (Expr: E_SYSMSGADDR ; Val: $00527ED0), (Expr: E_MACROADDR ; Val: $004F8270), (Expr: E_SENDPACKET ; Val: $004169D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar6000 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE2C4), (Expr: C_CLIXRES ; Val: $005BFAF8), (Expr: C_ENEMYID ; Val: $006B2A98), (Expr: C_SHARDPOS ; Val: $006B8894), (Expr: C_NEXTCPOS ; Val: $006B89FC), (Expr: C_SYSMSG ; Val: $006B9468), (Expr: C_CONTPOS ; Val: $006B9488), (Expr: C_ENEMYHITS ; Val: $00781310), (Expr: C_LHANDID ; Val: $007D88E8), (Expr: C_CHARDIR ; Val: $007D9550), (Expr: C_TARGETCNT ; Val: $0081A714), (Expr: C_CURSORKIND ; Val: $0081D2FC), (Expr: C_TARGETCURS ; Val: $0081D34C), (Expr: C_CLILEFT ; Val: $0081D37C), (Expr: C_CHARPTR ; Val: $0081D91C), (Expr: C_LLIFTEDID ; Val: $0081D968), (Expr: C_LSHARD ; Val: $00821A88), (Expr: C_POPUPID ; Val: $00821BF8), (Expr: C_JOURNALPTR ; Val: $00859DA4), (Expr: C_SKILLCAPS ; Val: $0089C0AC), (Expr: C_SKILLLOCK ; Val: $0089C11C), (Expr: C_SKILLSPOS ; Val: $0089C154), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050900C), (Expr: E_OLDDIR ; Val: $00553140), (Expr: E_EXMSGADDR ; Val: $00513E70), (Expr: E_ITEMPROPID ; Val: $007D4764), (Expr: E_ITEMNAMEADDR ; Val: $004F3AA0), (Expr: E_ITEMPROPADDR ; Val: $004F39C0), (Expr: E_ITEMCHECKADDR ; Val: $0053DF30), (Expr: E_ITEMREQADDR ; Val: $0053E560), (Expr: E_PATHFINDADDR ; Val: $0049C08D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518DA0), (Expr: E_SYSMSGADDR ; Val: $00528010), (Expr: E_MACROADDR ; Val: $004F81D0), (Expr: E_SENDPACKET ; Val: $004169D0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar5091 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE2C4), (Expr: C_CLIXRES ; Val: $005BFAF8), (Expr: C_ENEMYID ; Val: $006B2A08), (Expr: C_SHARDPOS ; Val: $006B8804), (Expr: C_NEXTCPOS ; Val: $006B896C), (Expr: C_SYSMSG ; Val: $006B93D8), (Expr: C_CONTPOS ; Val: $006B93F8), (Expr: C_ENEMYHITS ; Val: $00781280), (Expr: C_LHANDID ; Val: $007D8838), (Expr: C_CHARDIR ; Val: $007D94A0), (Expr: C_TARGETCNT ; Val: $0081A664), (Expr: C_CURSORKIND ; Val: $0081D24C), (Expr: C_TARGETCURS ; Val: $0081D29C), (Expr: C_CLILEFT ; Val: $0081D2CC), (Expr: C_CHARPTR ; Val: $0081D86C), (Expr: C_LLIFTEDID ; Val: $0081D8B8), (Expr: C_LSHARD ; Val: $008219D8), (Expr: C_POPUPID ; Val: $00821B48), (Expr: C_JOURNALPTR ; Val: $00859CF4), (Expr: C_SKILLCAPS ; Val: $0089BFFC), (Expr: C_SKILLLOCK ; Val: $0089C06C), (Expr: C_SKILLSPOS ; Val: $0089C0A4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508F6C), (Expr: E_OLDDIR ; Val: $00552FE0), (Expr: E_EXMSGADDR ; Val: $00513DA0), (Expr: E_ITEMPROPID ; Val: $007D46B4), (Expr: E_ITEMNAMEADDR ; Val: $004F3870), (Expr: E_ITEMPROPADDR ; Val: $004F3790), (Expr: E_ITEMCHECKADDR ; Val: $0053DE50), (Expr: E_ITEMREQADDR ; Val: $0053E480), (Expr: E_PATHFINDADDR ; Val: $0049BF5D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518CA0), (Expr: E_SYSMSGADDR ; Val: $00527E90), (Expr: E_MACROADDR ; Val: $004F7FA0), (Expr: E_SENDPACKET ; Val: $00416A20), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar5090 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE2C4), (Expr: C_CLIXRES ; Val: $005BFAF8), (Expr: C_ENEMYID ; Val: $006B2A08), (Expr: C_SHARDPOS ; Val: $006B8804), (Expr: C_NEXTCPOS ; Val: $006B896C), (Expr: C_SYSMSG ; Val: $006B93D8), (Expr: C_CONTPOS ; Val: $006B93F8), (Expr: C_ENEMYHITS ; Val: $00781280), (Expr: C_LHANDID ; Val: $007D8838), (Expr: C_CHARDIR ; Val: $007D94A0), (Expr: C_TARGETCNT ; Val: $0081A664), (Expr: C_CURSORKIND ; Val: $0081D24C), (Expr: C_TARGETCURS ; Val: $0081D29C), (Expr: C_CLILEFT ; Val: $0081D2CC), (Expr: C_CHARPTR ; Val: $0081D86C), (Expr: C_LLIFTEDID ; Val: $0081D8B8), (Expr: C_LSHARD ; Val: $008219D8), (Expr: C_POPUPID ; Val: $00821B48), (Expr: C_JOURNALPTR ; Val: $00859CF4), (Expr: C_SKILLCAPS ; Val: $0089BFFC), (Expr: C_SKILLLOCK ; Val: $0089C06C), (Expr: C_SKILLSPOS ; Val: $0089C0A4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508F6C), (Expr: E_OLDDIR ; Val: $00553030), (Expr: E_EXMSGADDR ; Val: $00513DA0), (Expr: E_ITEMPROPID ; Val: $007D46B4), (Expr: E_ITEMNAMEADDR ; Val: $004F3870), (Expr: E_ITEMPROPADDR ; Val: $004F3790), (Expr: E_ITEMCHECKADDR ; Val: $0053DEA0), (Expr: E_ITEMREQADDR ; Val: $0053E4D0), (Expr: E_PATHFINDADDR ; Val: $0049BF5D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $00518CA0), (Expr: E_SYSMSGADDR ; Val: $00527EE0), (Expr: E_MACROADDR ; Val: $004F7FA0), (Expr: E_SENDPACKET ; Val: $00416A20), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar5081 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BD2A4), (Expr: C_CLIXRES ; Val: $005BEAD8), (Expr: C_ENEMYID ; Val: $006B19E8), (Expr: C_SHARDPOS ; Val: $006B77E4), (Expr: C_NEXTCPOS ; Val: $006B794C), (Expr: C_SYSMSG ; Val: $006B83B8), (Expr: C_CONTPOS ; Val: $006B83D8), (Expr: C_ENEMYHITS ; Val: $00780260), (Expr: C_LHANDID ; Val: $007D7818), (Expr: C_CHARDIR ; Val: $007D8480), (Expr: C_TARGETCNT ; Val: $00819644), (Expr: C_CURSORKIND ; Val: $0081C22C), (Expr: C_TARGETCURS ; Val: $0081C27C), (Expr: C_CLILEFT ; Val: $0081C2AC), (Expr: C_CHARPTR ; Val: $0081C84C), (Expr: C_LLIFTEDID ; Val: $0081C898), (Expr: C_LSHARD ; Val: $008209B8), (Expr: C_POPUPID ; Val: $00820B28), (Expr: C_JOURNALPTR ; Val: $00858CD4), (Expr: C_SKILLCAPS ; Val: $0089AFDC), (Expr: C_SKILLLOCK ; Val: $0089B04C), (Expr: C_SKILLSPOS ; Val: $0089B084), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508D1C), (Expr: E_OLDDIR ; Val: $005527D0), (Expr: E_EXMSGADDR ; Val: $00513A30), (Expr: E_ITEMPROPID ; Val: $007D3694), (Expr: E_ITEMNAMEADDR ; Val: $004F3490), (Expr: E_ITEMPROPADDR ; Val: $004F33B0), (Expr: E_ITEMCHECKADDR ; Val: $0053D5F0), (Expr: E_ITEMREQADDR ; Val: $0053DC20), (Expr: E_PATHFINDADDR ; Val: $0049BBBD), (Expr: E_SLEEPADDR ; Val: $0057B22C), (Expr: E_DRAGADDR ; Val: $005181F0), (Expr: E_SYSMSGADDR ; Val: $00527430), (Expr: E_MACROADDR ; Val: $004F7BC0), (Expr: E_SENDPACKET ; Val: $004169F0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar5072 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BF2A4), (Expr: C_CLIXRES ; Val: $005C0AD8), (Expr: C_ENEMYID ; Val: $006B39E8), (Expr: C_SHARDPOS ; Val: $006B97E4), (Expr: C_NEXTCPOS ; Val: $006B994C), (Expr: C_SYSMSG ; Val: $006BA3B8), (Expr: C_CONTPOS ; Val: $006BA3D8), (Expr: C_ENEMYHITS ; Val: $00782260), (Expr: C_LHANDID ; Val: $007D9818), (Expr: C_CHARDIR ; Val: $007DA480), (Expr: C_TARGETCNT ; Val: $0081B644), (Expr: C_CURSORKIND ; Val: $0081E22C), (Expr: C_TARGETCURS ; Val: $0081E27C), (Expr: C_CLILEFT ; Val: $0081E2AC), (Expr: C_CHARPTR ; Val: $0081E84C), (Expr: C_LLIFTEDID ; Val: $0081E898), (Expr: C_LSHARD ; Val: $008229B8), (Expr: C_POPUPID ; Val: $00822B28), (Expr: C_JOURNALPTR ; Val: $0085ACD4), (Expr: C_SKILLCAPS ; Val: $0089CFDC), (Expr: C_SKILLLOCK ; Val: $0089D04C), (Expr: C_SKILLSPOS ; Val: $0089D084), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050A4FC), (Expr: E_OLDDIR ; Val: $00553FB0), (Expr: E_EXMSGADDR ; Val: $00515240), (Expr: E_ITEMPROPID ; Val: $007D5694), (Expr: E_ITEMNAMEADDR ; Val: $004F36B0), (Expr: E_ITEMPROPADDR ; Val: $004F35D0), (Expr: E_ITEMCHECKADDR ; Val: $0053EDD0), (Expr: E_ITEMREQADDR ; Val: $0053F400), (Expr: E_PATHFINDADDR ; Val: $0049BD5D), (Expr: E_SLEEPADDR ; Val: $0057D22C), (Expr: E_DRAGADDR ; Val: $00519A20), (Expr: E_SYSMSGADDR ; Val: $00528C10), (Expr: E_MACROADDR ; Val: $004F7DE0), (Expr: E_SENDPACKET ; Val: $004169C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar5071 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BF2A4), (Expr: C_CLIXRES ; Val: $005C0AD8), (Expr: C_ENEMYID ; Val: $006B39E8), (Expr: C_SHARDPOS ; Val: $006B97E4), (Expr: C_NEXTCPOS ; Val: $006B994C), (Expr: C_SYSMSG ; Val: $006BA3B8), (Expr: C_CONTPOS ; Val: $006BA3D8), (Expr: C_ENEMYHITS ; Val: $00782260), (Expr: C_LHANDID ; Val: $007D9818), (Expr: C_CHARDIR ; Val: $007DA480), (Expr: C_TARGETCNT ; Val: $0081B644), (Expr: C_CURSORKIND ; Val: $0081E22C), (Expr: C_TARGETCURS ; Val: $0081E27C), (Expr: C_CLILEFT ; Val: $0081E2AC), (Expr: C_CHARPTR ; Val: $0081E84C), (Expr: C_LLIFTEDID ; Val: $0081E898), (Expr: C_LSHARD ; Val: $008229B8), (Expr: C_POPUPID ; Val: $00822B28), (Expr: C_JOURNALPTR ; Val: $0085ACD4), (Expr: C_SKILLCAPS ; Val: $0089CFDC), (Expr: C_SKILLLOCK ; Val: $0089D04C), (Expr: C_SKILLSPOS ; Val: $0089D084), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050A61C), (Expr: E_OLDDIR ; Val: $005540D0), (Expr: E_EXMSGADDR ; Val: $00515360), (Expr: E_ITEMPROPID ; Val: $007D5694), (Expr: E_ITEMNAMEADDR ; Val: $004F37D0), (Expr: E_ITEMPROPADDR ; Val: $004F36F0), (Expr: E_ITEMCHECKADDR ; Val: $0053EEF0), (Expr: E_ITEMREQADDR ; Val: $0053F520), (Expr: E_PATHFINDADDR ; Val: $0049BD5D), (Expr: E_SLEEPADDR ; Val: $0057D22C), (Expr: E_DRAGADDR ; Val: $00519B40), (Expr: E_SYSMSGADDR ; Val: $00528D30), (Expr: E_MACROADDR ; Val: $004F7F00), (Expr: E_SENDPACKET ; Val: $004169C0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar5065 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE2A4), (Expr: C_CLIXRES ; Val: $005BFAD8), (Expr: C_ENEMYID ; Val: $006B29E8), (Expr: C_SHARDPOS ; Val: $006B87E4), (Expr: C_NEXTCPOS ; Val: $006B894C), (Expr: C_SYSMSG ; Val: $006B93B8), (Expr: C_CONTPOS ; Val: $006B93D8), (Expr: C_ENEMYHITS ; Val: $00781260), (Expr: C_LHANDID ; Val: $007D8818), (Expr: C_CHARDIR ; Val: $007D9480), (Expr: C_TARGETCNT ; Val: $0081A644), (Expr: C_CURSORKIND ; Val: $0081D22C), (Expr: C_TARGETCURS ; Val: $0081D27C), (Expr: C_CLILEFT ; Val: $0081D2AC), (Expr: C_CHARPTR ; Val: $0081D84C), (Expr: C_LLIFTEDID ; Val: $0081D898), (Expr: C_LSHARD ; Val: $008219B8), (Expr: C_POPUPID ; Val: $00821B28), (Expr: C_JOURNALPTR ; Val: $00859CD4), (Expr: C_SKILLCAPS ; Val: $0089BF64), (Expr: C_SKILLLOCK ; Val: $0089BFD4), (Expr: C_SKILLSPOS ; Val: $0089C00C), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508EDC), (Expr: E_OLDDIR ; Val: $00552990), (Expr: E_EXMSGADDR ; Val: $00513BF0), (Expr: E_ITEMPROPID ; Val: $007D4694), (Expr: E_ITEMNAMEADDR ; Val: $004F3650), (Expr: E_ITEMPROPADDR ; Val: $004F3570), (Expr: E_ITEMCHECKADDR ; Val: $0053D7B0), (Expr: E_ITEMREQADDR ; Val: $0053DDE0), (Expr: E_PATHFINDADDR ; Val: $0049BC5D), (Expr: E_SLEEPADDR ; Val: $0057C22C), (Expr: E_DRAGADDR ; Val: $005183B0), (Expr: E_SYSMSGADDR ; Val: $005275F0), (Expr: E_MACROADDR ; Val: $004F7D80), (Expr: E_SENDPACKET ; Val: $004169F0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar505c : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BC284), (Expr: C_CLIXRES ; Val: $005BDAB8), (Expr: C_ENEMYID ; Val: $006B09C0), (Expr: C_SHARDPOS ; Val: $006B67BC), (Expr: C_NEXTCPOS ; Val: $006B6924), (Expr: C_SYSMSG ; Val: $006B7390), (Expr: C_CONTPOS ; Val: $006B73B0), (Expr: C_ENEMYHITS ; Val: $0077F238), (Expr: C_LHANDID ; Val: $007D67F0), (Expr: C_CHARDIR ; Val: $007D7458), (Expr: C_TARGETCNT ; Val: $0081861C), (Expr: C_CURSORKIND ; Val: $0081B204), (Expr: C_TARGETCURS ; Val: $0081B254), (Expr: C_CLILEFT ; Val: $0081B284), (Expr: C_CHARPTR ; Val: $0081B824), (Expr: C_LLIFTEDID ; Val: $0081B870), (Expr: C_LSHARD ; Val: $0081F990), (Expr: C_POPUPID ; Val: $0081FB00), (Expr: C_JOURNALPTR ; Val: $00857CAC), (Expr: C_SKILLCAPS ; Val: $00899F3C), (Expr: C_SKILLLOCK ; Val: $00899FAC), (Expr: C_SKILLSPOS ; Val: $00899FE4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508F0C), (Expr: E_OLDDIR ; Val: $00552590), (Expr: E_EXMSGADDR ; Val: $00513BC0), (Expr: E_ITEMPROPID ; Val: $007D266C), (Expr: E_ITEMNAMEADDR ; Val: $004F3850), (Expr: E_ITEMPROPADDR ; Val: $004F3770), (Expr: E_ITEMCHECKADDR ; Val: $0053D2D0), (Expr: E_ITEMREQADDR ; Val: $0053D900), (Expr: E_PATHFINDADDR ; Val: $0049BB4D), (Expr: E_SLEEPADDR ; Val: $0057B224), (Expr: E_DRAGADDR ; Val: $00518380), (Expr: E_SYSMSGADDR ; Val: $00527510), (Expr: E_MACROADDR ; Val: $004F7F80), (Expr: E_SENDPACKET ; Val: $004169A0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar505a : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BC26C ), (Expr: C_CLIXRES ; Val: $005BDAA0 ), (Expr: C_ENEMYID ; Val: $006B09A0 ), (Expr: C_SHARDPOS ; Val: $006B679C ), (Expr: C_NEXTCPOS ; Val: $006B6904 ), (Expr: C_SYSMSG ; Val: $006B7370 ), (Expr: C_CONTPOS ; Val: $006B7390 ), (Expr: C_ENEMYHITS ; Val: $0077F218 ), (Expr: C_LHANDID ; Val: $007D67D0 ), (Expr: C_CHARDIR ; Val: $007D7438 ), (Expr: C_TARGETCNT ; Val: $008185FC ), (Expr: C_CURSORKIND ; Val: $0081B1E4 ), (Expr: C_TARGETCURS ; Val: $0081B234 ), (Expr: C_CLILEFT ; Val: $0081B264 ), (Expr: C_CHARPTR ; Val: $0081B804 ), (Expr: C_LLIFTEDID ; Val: $0081B850 ), (Expr: C_LSHARD ; Val: $0081F970 ), (Expr: C_POPUPID ; Val: $0081FAE0 ), (Expr: C_JOURNALPTR ; Val: $00857C8C ), (Expr: C_SKILLCAPS ; Val: $00899F1C ), (Expr: C_SKILLLOCK ; Val: $00899F8C ), (Expr: C_SKILLSPOS ; Val: $00899FC4 ), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508C9C), (Expr: E_OLDDIR ; Val: $00552480), (Expr: E_EXMSGADDR ; Val: $00513AA0), (Expr: E_ITEMPROPID ; Val: $007D264C), (Expr: E_ITEMNAMEADDR ; Val: $004F3480), (Expr: E_ITEMPROPADDR ; Val: $004F33A0), (Expr: E_ITEMCHECKADDR ; Val: $0053D240), (Expr: E_ITEMREQADDR ; Val: $0053D870), (Expr: E_PATHFINDADDR ; Val: $0049BC3D), (Expr: E_SLEEPADDR ; Val: $0057B220), (Expr: E_DRAGADDR ; Val: $00518260), (Expr: E_SYSMSGADDR ; Val: $005273C0), (Expr: E_MACROADDR ; Val: $004F7BB0), (Expr: E_SENDPACKET ; Val: $004169E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar504e : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BC26C ), (Expr: C_CLIXRES ; Val: $005BDAA0 ), (Expr: C_ENEMYID ; Val: $006B0980 ), (Expr: C_SHARDPOS ; Val: $006B677C ), (Expr: C_NEXTCPOS ; Val: $006B68E4 ), (Expr: C_SYSMSG ; Val: $006B7350 ), (Expr: C_CONTPOS ; Val: $006B7370 ), (Expr: C_ENEMYHITS ; Val: $0077F1F8 ), (Expr: C_LHANDID ; Val: $007D67B0 ), (Expr: C_CHARDIR ; Val: $007D7418 ), (Expr: C_TARGETCNT ; Val: $008185DC ), (Expr: C_CURSORKIND ; Val: $0081B1C4 ), (Expr: C_TARGETCURS ; Val: $0081B20C ), (Expr: C_CLILEFT ; Val: $0081B23C ), (Expr: C_CHARPTR ; Val: $0081B7DC ), (Expr: C_LLIFTEDID ; Val: $0081B828 ), (Expr: C_LSHARD ; Val: $0081F948 ), (Expr: C_POPUPID ; Val: $0081FAB8 ), (Expr: C_JOURNALPTR ; Val: $00857C64 ), (Expr: C_SKILLCAPS ; Val: $00899EF4 ), (Expr: C_SKILLLOCK ; Val: $00899F64 ), (Expr: C_SKILLSPOS ; Val: $00899F9C ), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508B5C), (Expr: E_OLDDIR ; Val: $00552320), (Expr: E_EXMSGADDR ; Val: $00513940), (Expr: E_ITEMPROPID ; Val: $007D262C), (Expr: E_ITEMNAMEADDR ; Val: $004F3340), (Expr: E_ITEMPROPADDR ; Val: $004F3260), (Expr: E_ITEMCHECKADDR ; Val: $0053D0E0), (Expr: E_ITEMREQADDR ; Val: $0053D710), (Expr: E_PATHFINDADDR ; Val: $0049BC3D), (Expr: E_SLEEPADDR ; Val: $0057B220), (Expr: E_DRAGADDR ; Val: $00518100), (Expr: E_SYSMSGADDR ; Val: $00527260), (Expr: E_MACROADDR ; Val: $004F7A70), (Expr: E_SENDPACKET ; Val: $004169E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar504d : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BC264 ), (Expr: C_CLIXRES ; Val: $005BDA98 ), (Expr: C_ENEMYID ; Val: $006B0970 ), (Expr: C_SHARDPOS ; Val: $006B676C ), (Expr: C_NEXTCPOS ; Val: $006B68D4 ), (Expr: C_SYSMSG ; Val: $006B7340 ), (Expr: C_CONTPOS ; Val: $006B7360 ), (Expr: C_ENEMYHITS ; Val: $0077F1E8 ), (Expr: C_LHANDID ; Val: $007D67A0 ), (Expr: C_CHARDIR ; Val: $007D7408 ), (Expr: C_TARGETCNT ; Val: $008185CC ), (Expr: C_CURSORKIND ; Val: $0081B1B4 ), (Expr: C_TARGETCURS ; Val: $0081B1FC ), (Expr: C_CLILEFT ; Val: $0081B22C ), (Expr: C_CHARPTR ; Val: $0081B7CC ), (Expr: C_LLIFTEDID ; Val: $0081B818 ), (Expr: C_LSHARD ; Val: $0081F938 ), (Expr: C_POPUPID ; Val: $0081FAA8 ), (Expr: C_JOURNALPTR ; Val: $00857C54 ), (Expr: C_SKILLCAPS ; Val: $00899EE4 ), (Expr: C_SKILLLOCK ; Val: $00899F54 ), (Expr: C_SKILLSPOS ; Val: $00899F8C ), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508ABC), (Expr: E_OLDDIR ; Val: $00552280), (Expr: E_EXMSGADDR ; Val: $005138A0), (Expr: E_ITEMPROPID ; Val: $007D261C), (Expr: E_ITEMNAMEADDR ; Val: $004F32A0), (Expr: E_ITEMPROPADDR ; Val: $004F31C0), (Expr: E_ITEMCHECKADDR ; Val: $0053D040), (Expr: E_ITEMREQADDR ; Val: $0053D670), (Expr: E_PATHFINDADDR ; Val: $0049BC3D), (Expr: E_SLEEPADDR ; Val: $0057B220), (Expr: E_DRAGADDR ; Val: $00518060), (Expr: E_SYSMSGADDR ; Val: $005271C0), (Expr: E_MACROADDR ; Val: $004F79D0), (Expr: E_SENDPACKET ; Val: $004169E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar504b : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BC264 ), (Expr: C_CLIXRES ; Val: $005BDA98 ), (Expr: C_ENEMYID ; Val: $006B0970 ), (Expr: C_SHARDPOS ; Val: $006B676C ), (Expr: C_NEXTCPOS ; Val: $006B68D4 ), (Expr: C_SYSMSG ; Val: $006B7340 ), (Expr: C_CONTPOS ; Val: $006B7360 ), (Expr: C_ENEMYHITS ; Val: $0077F1E8 ), (Expr: C_LHANDID ; Val: $007D67A0 ), (Expr: C_CHARDIR ; Val: $007D7408 ), (Expr: C_TARGETCNT ; Val: $008185CC ), (Expr: C_CURSORKIND ; Val: $0081B1B4 ), (Expr: C_TARGETCURS ; Val: $0081B1FC ), (Expr: C_CLILEFT ; Val: $0081B22C ), (Expr: C_CHARPTR ; Val: $0081B7CC ), (Expr: C_LLIFTEDID ; Val: $0081B818 ), (Expr: C_LSHARD ; Val: $0081F938 ), (Expr: C_POPUPID ; Val: $0081FAA8 ), (Expr: C_JOURNALPTR ; Val: $00857C54 ), (Expr: C_SKILLCAPS ; Val: $00899EE4 ), (Expr: C_SKILLLOCK ; Val: $00899F54 ), (Expr: C_SKILLSPOS ; Val: $00899F8C ), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508D0C), (Expr: E_OLDDIR ; Val: $00552200), (Expr: E_EXMSGADDR ; Val: $005139A0), (Expr: E_ITEMPROPID ; Val: $007D261C), (Expr: E_ITEMNAMEADDR ; Val: $004F34F0), (Expr: E_ITEMPROPADDR ; Val: $004F3410), (Expr: E_ITEMCHECKADDR ; Val: $0053CFC0), (Expr: E_ITEMREQADDR ; Val: $0053D5F0), (Expr: E_PATHFINDADDR ; Val: $0049BBBD), (Expr: E_SLEEPADDR ; Val: $0057B220), (Expr: E_DRAGADDR ; Val: $00518160), (Expr: E_SYSMSGADDR ; Val: $005272C0), (Expr: E_MACROADDR ; Val: $004F7C20), (Expr: E_SENDPACKET ; Val: $004169E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar504a : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BC264 ), (Expr: C_CLIXRES ; Val: $005BDA98 ), (Expr: C_ENEMYID ; Val: $006B0970 ), (Expr: C_SHARDPOS ; Val: $006B676C ), (Expr: C_NEXTCPOS ; Val: $006B68D4 ), (Expr: C_SYSMSG ; Val: $006B7340 ), (Expr: C_CONTPOS ; Val: $006B7360 ), (Expr: C_ENEMYHITS ; Val: $0077F1E8 ), (Expr: C_LHANDID ; Val: $007D67A0 ), (Expr: C_CHARDIR ; Val: $007D7408 ), (Expr: C_TARGETCNT ; Val: $008185CC ), (Expr: C_CURSORKIND ; Val: $0081B1B4 ), (Expr: C_TARGETCURS ; Val: $0081B1FC ), (Expr: C_CLILEFT ; Val: $0081B22C ), (Expr: C_CHARPTR ; Val: $0081B7CC ), (Expr: C_LLIFTEDID ; Val: $0081B818 ), (Expr: C_LSHARD ; Val: $0081F938 ), (Expr: C_POPUPID ; Val: $0081FAA8 ), (Expr: C_JOURNALPTR ; Val: $00857C54 ), (Expr: C_SKILLCAPS ; Val: $00899EE4 ), (Expr: C_SKILLLOCK ; Val: $00899F54 ), (Expr: C_SKILLSPOS ; Val: $00899F8C ), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508C4C), (Expr: E_OLDDIR ; Val: $00552200), (Expr: E_EXMSGADDR ; Val: $005138C0), (Expr: E_ITEMPROPID ; Val: $007D261C), (Expr: E_ITEMNAMEADDR ; Val: $004F3410), (Expr: E_ITEMPROPADDR ; Val: $004F3330), (Expr: E_ITEMCHECKADDR ; Val: $0053CEE0), (Expr: E_ITEMREQADDR ; Val: $0053D510), (Expr: E_PATHFINDADDR ; Val: $0049BACD), (Expr: E_SLEEPADDR ; Val: $0057B220), (Expr: E_DRAGADDR ; Val: $00518080), (Expr: E_SYSMSGADDR ; Val: $005271E0), (Expr: E_MACROADDR ; Val: $004F7B30), (Expr: E_SENDPACKET ; Val: $00416990), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar503 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BC264), (Expr: C_CLIXRES ; Val: $005BDA98), (Expr: C_ENEMYID ; Val: $006B0910), (Expr: C_SHARDPOS ; Val: $006B670C), (Expr: C_NEXTCPOS ; Val: $006B6874), (Expr: C_SYSMSG ; Val: $006B72E0), (Expr: C_CONTPOS ; Val: $006B7300), (Expr: C_ENEMYHITS ; Val: $0077F188), (Expr: C_LHANDID ; Val: $007D673C), (Expr: C_CHARDIR ; Val: $007D73A0), (Expr: C_TARGETCNT ; Val: $00818564), (Expr: C_CURSORKIND ; Val: $0081B14C), (Expr: C_TARGETCURS ; Val: $0081B194), (Expr: C_CLILEFT ; Val: $0081B1C4), (Expr: C_CHARPTR ; Val: $0081B764), (Expr: C_LLIFTEDID ; Val: $0081B7B0), (Expr: C_LSHARD ; Val: $0081F8D0), (Expr: C_POPUPID ; Val: $0081FA40), (Expr: C_JOURNALPTR ; Val: $00857BEC), (Expr: C_SKILLCAPS ; Val: $00899E7C), (Expr: C_SKILLLOCK ; Val: $00899EEC), (Expr: C_SKILLSPOS ; Val: $00899F24), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000144), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000184), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508A3C), (Expr: E_OLDDIR ; Val: $00551DB0), (Expr: E_EXMSGADDR ; Val: $00513710), (Expr: E_ITEMPROPID ; Val: $007D25BC), (Expr: E_ITEMNAMEADDR ; Val: $004F33C0), (Expr: E_ITEMPROPADDR ; Val: $004F32E0), (Expr: E_ITEMCHECKADDR ; Val: $0053CD10), (Expr: E_ITEMREQADDR ; Val: $0053D340), (Expr: E_PATHFINDADDR ; Val: $0049BEAD), (Expr: E_SLEEPADDR ; Val: $0057B220), (Expr: E_DRAGADDR ; Val: $00517E80), (Expr: E_SYSMSGADDR ; Val: $00527090), (Expr: E_MACROADDR ; Val: $004F7AF0), (Expr: E_SENDPACKET ; Val: $004169E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar502f : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BB264), (Expr: C_CLIXRES ; Val: $005BCA98), (Expr: C_ENEMYID ; Val: $006AF910), (Expr: C_SHARDPOS ; Val: $006B570C), (Expr: C_NEXTCPOS ; Val: $006B5874), (Expr: C_SYSMSG ; Val: $006B62E0), (Expr: C_CONTPOS ; Val: $006B6300), (Expr: C_ENEMYHITS ; Val: $0077E188), (Expr: C_LHANDID ; Val: $007D573C), (Expr: C_CHARDIR ; Val: $007D63A0), (Expr: C_TARGETCNT ; Val: $00817564), (Expr: C_CURSORKIND ; Val: $0081A14C), (Expr: C_TARGETCURS ; Val: $0081A194), (Expr: C_CLILEFT ; Val: $0081A1C4), (Expr: C_CHARPTR ; Val: $0081A764), (Expr: C_LLIFTEDID ; Val: $0081A7B0), (Expr: C_LSHARD ; Val: $0081E8D0), (Expr: C_POPUPID ; Val: $0081EA40), (Expr: C_JOURNALPTR ; Val: $00856BEC), (Expr: C_SKILLCAPS ; Val: $00898E7C), (Expr: C_SKILLLOCK ; Val: $00898EEC), (Expr: C_SKILLSPOS ; Val: $00898F24), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000144), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050830C), (Expr: E_OLDDIR ; Val: $00551940), (Expr: E_EXMSGADDR ; Val: $005130F0), (Expr: E_ITEMPROPID ; Val: $007D15BC), (Expr: E_ITEMNAMEADDR ; Val: $004F2C60), (Expr: E_ITEMPROPADDR ; Val: $004F2B80), (Expr: E_ITEMCHECKADDR ; Val: $0053C7D0), (Expr: E_ITEMREQADDR ; Val: $0053CE00), (Expr: E_PATHFINDADDR ; Val: $0049B89D), (Expr: E_SLEEPADDR ; Val: $0057A220), (Expr: E_DRAGADDR ; Val: $005177E0), (Expr: E_SYSMSGADDR ; Val: $005269F0), (Expr: E_MACROADDR ; Val: $004F73E0), (Expr: E_SENDPACKET ; Val: $004168E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar502c : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE264), (Expr: C_CLIXRES ; Val: $005BFA98), (Expr: C_ENEMYID ; Val: $006B2910), (Expr: C_SHARDPOS ; Val: $006B870C), (Expr: C_NEXTCPOS ; Val: $006B8874), (Expr: C_SYSMSG ; Val: $006B92E0), (Expr: C_CONTPOS ; Val: $006B9300), (Expr: C_ENEMYHITS ; Val: $00781188), (Expr: C_LHANDID ; Val: $007D873C), (Expr: C_CHARDIR ; Val: $007D93A0), (Expr: C_TARGETCNT ; Val: $0081A564), (Expr: C_CURSORKIND ; Val: $0081D14C), (Expr: C_TARGETCURS ; Val: $0081D194), (Expr: C_CLILEFT ; Val: $0081D1C4), (Expr: C_CHARPTR ; Val: $0081D764), (Expr: C_LLIFTEDID ; Val: $0081D7B0), (Expr: C_LSHARD ; Val: $008218D0), (Expr: C_POPUPID ; Val: $00821A40), (Expr: C_JOURNALPTR ; Val: $00859BEC), (Expr: C_SKILLCAPS ; Val: $0089BE7C), (Expr: C_SKILLLOCK ; Val: $0089BEEC), (Expr: C_SKILLSPOS ; Val: $0089BF24), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000144), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $005092AC), (Expr: E_OLDDIR ; Val: $005528E0), (Expr: E_EXMSGADDR ; Val: $00514090), (Expr: E_ITEMPROPID ; Val: $007D45BC), (Expr: E_ITEMNAMEADDR ; Val: $004F3C00), (Expr: E_ITEMPROPADDR ; Val: $004F3B20), (Expr: E_ITEMCHECKADDR ; Val: $0053D770), (Expr: E_ITEMREQADDR ; Val: $0053DDA0), (Expr: E_PATHFINDADDR ; Val: $0049C96D), (Expr: E_SLEEPADDR ; Val: $0057C220), (Expr: E_DRAGADDR ; Val: $00518780), (Expr: E_SYSMSGADDR ; Val: $00527900), (Expr: E_MACROADDR ; Val: $004F8380), (Expr: E_SENDPACKET ; Val: $004168E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar502b : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE264), (Expr: C_CLIXRES ; Val: $005BFA98), (Expr: C_ENEMYID ; Val: $006B2910), (Expr: C_SHARDPOS ; Val: $006B870C), (Expr: C_NEXTCPOS ; Val: $006B8874), (Expr: C_SYSMSG ; Val: $006B92E0), (Expr: C_CONTPOS ; Val: $006B9300), (Expr: C_ENEMYHITS ; Val: $00781188), (Expr: C_LHANDID ; Val: $007D873C), (Expr: C_CHARDIR ; Val: $007D93A0), (Expr: C_TARGETCNT ; Val: $0081A564), (Expr: C_CURSORKIND ; Val: $0081D14C), (Expr: C_TARGETCURS ; Val: $0081D194), (Expr: C_CLILEFT ; Val: $0081D1C4), (Expr: C_CHARPTR ; Val: $0081D764), (Expr: C_LLIFTEDID ; Val: $0081D7B0), (Expr: C_LSHARD ; Val: $008218D0), (Expr: C_POPUPID ; Val: $00821A40), (Expr: C_JOURNALPTR ; Val: $00859BEC), (Expr: C_SKILLCAPS ; Val: $0089BE7C), (Expr: C_SKILLLOCK ; Val: $0089BEEC), (Expr: C_SKILLSPOS ; Val: $0089BF24), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000144), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050910C), (Expr: E_OLDDIR ; Val: $00552920), (Expr: E_EXMSGADDR ; Val: $00513EF0), (Expr: E_ITEMPROPID ; Val: $007D45BC), (Expr: E_ITEMNAMEADDR ; Val: $004F3A50), (Expr: E_ITEMPROPADDR ; Val: $004F3970), (Expr: E_ITEMCHECKADDR ; Val: $0053D7B0), (Expr: E_ITEMREQADDR ; Val: $0053DDE0), (Expr: E_PATHFINDADDR ; Val: $0049C8BD), (Expr: E_SLEEPADDR ; Val: $0057C220), (Expr: E_DRAGADDR ; Val: $005185E0), (Expr: E_SYSMSGADDR ; Val: $005277D0), (Expr: E_MACROADDR ; Val: $004F81D0), (Expr: E_SENDPACKET ; Val: $004168E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar502a : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BE264), (Expr: C_CLIXRES ; Val: $005BFA98), (Expr: C_ENEMYID ; Val: $006B2910), (Expr: C_SHARDPOS ; Val: $006B870C), (Expr: C_NEXTCPOS ; Val: $006B8874), (Expr: C_SYSMSG ; Val: $006B92E0), (Expr: C_CONTPOS ; Val: $006B9300), (Expr: C_ENEMYHITS ; Val: $00781188), (Expr: C_LHANDID ; Val: $007D873C), (Expr: C_CHARDIR ; Val: $007D93A0), (Expr: C_TARGETCNT ; Val: $0081A564), (Expr: C_CURSORKIND ; Val: $0081D14C), (Expr: C_TARGETCURS ; Val: $0081D194), (Expr: C_CLILEFT ; Val: $0081D1C4), (Expr: C_CHARPTR ; Val: $0081D764), (Expr: C_LLIFTEDID ; Val: $0081D7B0), (Expr: C_LSHARD ; Val: $008218D0), (Expr: C_POPUPID ; Val: $00821A40), (Expr: C_JOURNALPTR ; Val: $00859BEC), (Expr: C_SKILLCAPS ; Val: $0089BE7C), (Expr: C_SKILLLOCK ; Val: $0089BEEC), (Expr: C_SKILLSPOS ; Val: $0089BF24), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000144), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050931C), (Expr: E_OLDDIR ; Val: $00552880), (Expr: E_EXMSGADDR ; Val: $00514180), (Expr: E_ITEMPROPID ; Val: $007D45BC), (Expr: E_ITEMNAMEADDR ; Val: $004F3E60), (Expr: E_ITEMPROPADDR ; Val: $004F3D80), (Expr: E_ITEMCHECKADDR ; Val: $0053D780), (Expr: E_ITEMREQADDR ; Val: $0053DDB0), (Expr: E_PATHFINDADDR ; Val: $0049CE2D), (Expr: E_SLEEPADDR ; Val: $0057C220), (Expr: E_DRAGADDR ; Val: $00518880), (Expr: E_SYSMSGADDR ; Val: $00527920), (Expr: E_MACROADDR ; Val: $004F8580), (Expr: E_SENDPACKET ; Val: $00416920), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar502 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005BD2AC), (Expr: C_CLIXRES ; Val: $005BEAC4), (Expr: C_ENEMYID ; Val: $006B1A50), (Expr: C_SHARDPOS ; Val: $006B784C), (Expr: C_NEXTCPOS ; Val: $006B79B4), (Expr: C_SYSMSG ; Val: $006B8420), (Expr: C_CONTPOS ; Val: $006B8440), (Expr: C_ENEMYHITS ; Val: $007802C8), (Expr: C_LHANDID ; Val: $007D7878), (Expr: C_CHARDIR ; Val: $007D84E0), (Expr: C_TARGETCNT ; Val: $008196A4), (Expr: C_CURSORKIND ; Val: $0081C28C), (Expr: C_TARGETCURS ; Val: $0081C2D4), (Expr: C_CLILEFT ; Val: $0081C304), (Expr: C_CHARPTR ; Val: $0081C8A4), (Expr: C_LLIFTEDID ; Val: $0081C8F0), (Expr: C_LSHARD ; Val: $00820A10), (Expr: C_POPUPID ; Val: $00820B80), (Expr: C_JOURNALPTR ; Val: $00858D2C), (Expr: C_SKILLCAPS ; Val: $0089AFBC), (Expr: C_SKILLLOCK ; Val: $0089B02C), (Expr: C_SKILLSPOS ; Val: $0089B064), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000140), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00508B6C), (Expr: E_OLDDIR ; Val: $00551FE0), (Expr: E_EXMSGADDR ; Val: $005137D0), (Expr: E_ITEMPROPID ; Val: $007D36FC), (Expr: E_ITEMNAMEADDR ; Val: $004F3BA0), (Expr: E_ITEMPROPADDR ; Val: $004F3AC0), (Expr: E_ITEMCHECKADDR ; Val: $0053CEE0), (Expr: E_ITEMREQADDR ; Val: $0053D510), (Expr: E_PATHFINDADDR ; Val: $0049C84D), (Expr: E_SLEEPADDR ; Val: $0057B220), (Expr: E_DRAGADDR ; Val: $00517EC0), (Expr: E_SYSMSGADDR ; Val: $00526F20), (Expr: E_MACROADDR ; Val: $004F82C0), (Expr: E_SENDPACKET ; Val: $004169A0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar501j : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005ADD1C), (Expr: C_CLIXRES ; Val: $005AF4A8), (Expr: C_ENEMYID ; Val: $006A1D90), (Expr: C_SHARDPOS ; Val: $006A1DCC), (Expr: C_NEXTCPOS ; Val: $006A1F24), (Expr: C_SYSMSG ; Val: $006A2990), (Expr: C_CONTPOS ; Val: $006A29B0), (Expr: C_ENEMYHITS ; Val: $0076A838), (Expr: C_LHANDID ; Val: $007C1DA0), (Expr: C_CHARDIR ; Val: $007C2A00), (Expr: C_TARGETCNT ; Val: $00803BAC), (Expr: C_CURSORKIND ; Val: $00806794), (Expr: C_TARGETCURS ; Val: $008067DC), (Expr: C_CLILEFT ; Val: $0080680C), (Expr: C_CHARPTR ; Val: $00806DAC), (Expr: C_LLIFTEDID ; Val: $00806DF8), (Expr: C_LSHARD ; Val: $0080AF18), (Expr: C_POPUPID ; Val: $0080B088), (Expr: C_JOURNALPTR ; Val: $00843234), (Expr: C_SKILLCAPS ; Val: $008854C4), (Expr: C_SKILLLOCK ; Val: $00885534), (Expr: C_SKILLSPOS ; Val: $0088556C), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050126C), (Expr: E_OLDDIR ; Val: $00545970), (Expr: E_EXMSGADDR ; Val: $0050BE20), (Expr: E_ITEMPROPID ; Val: $007BDC1C), (Expr: E_ITEMNAMEADDR ; Val: $004ECB20), (Expr: E_ITEMPROPADDR ; Val: $004ECA40), (Expr: E_ITEMCHECKADDR ; Val: $00530800), (Expr: E_ITEMREQADDR ; Val: $00530E30), (Expr: E_PATHFINDADDR ; Val: $004991ED), (Expr: E_SLEEPADDR ; Val: $0056E21C), (Expr: E_DRAGADDR ; Val: $00510500), (Expr: E_SYSMSGADDR ; Val: $0051F420), (Expr: E_MACROADDR ; Val: $004F1250), (Expr: E_SENDPACKET ; Val: $00416780), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar501i : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005ADD1C), (Expr: C_CLIXRES ; Val: $005AF490), (Expr: C_ENEMYID ; Val: $006A1D60), (Expr: C_SHARDPOS ; Val: $006A1D9C), (Expr: C_NEXTCPOS ; Val: $006A1EF4), (Expr: C_SYSMSG ; Val: $006A2960), (Expr: C_CONTPOS ; Val: $006A2980), (Expr: C_ENEMYHITS ; Val: $0076A808), (Expr: C_LHANDID ; Val: $007C1D70), (Expr: C_CHARDIR ; Val: $007C29D0), (Expr: C_TARGETCNT ; Val: $00803B7C), (Expr: C_CURSORKIND ; Val: $00806764), (Expr: C_TARGETCURS ; Val: $008067AC), (Expr: C_CLILEFT ; Val: $008067DC), (Expr: C_CHARPTR ; Val: $00806D7C), (Expr: C_LLIFTEDID ; Val: $00806DC8), (Expr: C_LSHARD ; Val: $0080AEE8), (Expr: C_POPUPID ; Val: $0080B058), (Expr: C_JOURNALPTR ; Val: $00843204), (Expr: C_SKILLCAPS ; Val: $00885494), (Expr: C_SKILLLOCK ; Val: $00885504), (Expr: C_SKILLSPOS ; Val: $0088553C), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $0050144B), (Expr: E_OLDDIR ; Val: $00545A10), (Expr: E_EXMSGADDR ; Val: $0050C100), (Expr: E_ITEMPROPID ; Val: $007BDBEC), (Expr: E_ITEMNAMEADDR ; Val: $004ECB90), (Expr: E_ITEMPROPADDR ; Val: $004ECAB0), (Expr: E_ITEMCHECKADDR ; Val: $005308F0), (Expr: E_ITEMREQADDR ; Val: $00530F20), (Expr: E_PATHFINDADDR ; Val: $004992DD), (Expr: E_SLEEPADDR ; Val: $0056E21C), (Expr: E_DRAGADDR ; Val: $00510800), (Expr: E_SYSMSGADDR ; Val: $0051F710), (Expr: E_MACROADDR ; Val: $004F12D0), (Expr: E_SENDPACKET ; Val: $00416890), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar501f : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005ADD1C), (Expr: C_CLIXRES ; Val: $005AF484), (Expr: C_ENEMYID ; Val: $006A1BF0), (Expr: C_SHARDPOS ; Val: $006A1C2C), (Expr: C_NEXTCPOS ; Val: $006A1D84), (Expr: C_SYSMSG ; Val: $006A27F0), (Expr: C_CONTPOS ; Val: $006A2810), (Expr: C_ENEMYHITS ; Val: $0076A698), (Expr: C_LHANDID ; Val: $007C1BFC), (Expr: C_CHARDIR ; Val: $007C2860), (Expr: C_TARGETCNT ; Val: $00803A04), (Expr: C_CURSORKIND ; Val: $008065EC), (Expr: C_TARGETCURS ; Val: $00806634), (Expr: C_CLILEFT ; Val: $00806664), (Expr: C_CHARPTR ; Val: $00806C04), (Expr: C_LLIFTEDID ; Val: $00806C50), (Expr: C_LSHARD ; Val: $0080AD70), (Expr: C_POPUPID ; Val: $0080AEE0), (Expr: C_JOURNALPTR ; Val: $0084308C), (Expr: C_SKILLCAPS ; Val: $008852CC), (Expr: C_SKILLLOCK ; Val: $0088533C), (Expr: C_SKILLSPOS ; Val: $00885374), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00500B5C), (Expr: E_OLDDIR ; Val: $005452D0), (Expr: E_EXMSGADDR ; Val: $0050B6F0), (Expr: E_ITEMPROPID ; Val: $007BDA7C), (Expr: E_ITEMNAMEADDR ; Val: $004EC7A0), (Expr: E_ITEMPROPADDR ; Val: $004EC6C0), (Expr: E_ITEMCHECKADDR ; Val: $005301C0), (Expr: E_ITEMREQADDR ; Val: $005307F0), (Expr: E_PATHFINDADDR ; Val: $0049961B), (Expr: E_SLEEPADDR ; Val: $0056E21C), (Expr: E_DRAGADDR ; Val: $0050FDD0), (Expr: E_SYSMSGADDR ; Val: $0051EB70), (Expr: E_MACROADDR ; Val: $004F0CA0), (Expr: E_SENDPACKET ; Val: $004168A0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar501d : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005ADCE4), (Expr: C_CLIXRES ; Val: $005AF44C), (Expr: C_ENEMYID ; Val: $006A1BC0), (Expr: C_SHARDPOS ; Val: $006A1BFC), (Expr: C_NEXTCPOS ; Val: $006A1D54), (Expr: C_SYSMSG ; Val: $006A27C0), (Expr: C_CONTPOS ; Val: $006A27E0), (Expr: C_ENEMYHITS ; Val: $0076A668), (Expr: C_LHANDID ; Val: $007C1BCC), (Expr: C_CHARDIR ; Val: $007C2830), (Expr: C_TARGETCNT ; Val: $008039D4), (Expr: C_CURSORKIND ; Val: $008065BC), (Expr: C_TARGETCURS ; Val: $00806604), (Expr: C_CLILEFT ; Val: $00806634), (Expr: C_CHARPTR ; Val: $00806BD4), (Expr: C_LLIFTEDID ; Val: $00806C20), (Expr: C_LSHARD ; Val: $0080AD40), (Expr: C_POPUPID ; Val: $0080AEB0), (Expr: C_JOURNALPTR ; Val: $0084305C), (Expr: C_SKILLCAPS ; Val: $0088529C), (Expr: C_SKILLLOCK ; Val: $0088530C), (Expr: C_SKILLSPOS ; Val: $00885344), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $00500A4C), (Expr: E_OLDDIR ; Val: $00545270), (Expr: E_EXMSGADDR ; Val: $0050B660), (Expr: E_ITEMPROPID ; Val: $007BDA4C), (Expr: E_ITEMNAMEADDR ; Val: $004EC7F0), (Expr: E_ITEMPROPADDR ; Val: $004EC710), (Expr: E_ITEMCHECKADDR ; Val: $00530200), (Expr: E_ITEMREQADDR ; Val: $00530830), (Expr: E_PATHFINDADDR ; Val: $0049925B), (Expr: E_SLEEPADDR ; Val: $0056E21C), (Expr: E_DRAGADDR ; Val: $0050FD40), (Expr: E_SYSMSGADDR ; Val: $0051EBE0), (Expr: E_MACROADDR ; Val: $004F0CF0), (Expr: E_SENDPACKET ; Val: $00416700), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar501d1 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005ABCD4), (Expr: C_CLIXRES ; Val: $005AD43C), (Expr: C_ENEMYID ; Val: $0069FBB0), (Expr: C_SHARDPOS ; Val: $0069FBEC), (Expr: C_NEXTCPOS ; Val: $0069FD44), (Expr: C_SYSMSG ; Val: $006A07B0), (Expr: C_CONTPOS ; Val: $006A07D0), (Expr: C_ENEMYHITS ; Val: $00768658), (Expr: C_LHANDID ; Val: $007BFBBC), (Expr: C_CHARDIR ; Val: $007C0820), (Expr: C_TARGETCNT ; Val: $008019C4), (Expr: C_CURSORKIND ; Val: $008045AC), (Expr: C_TARGETCURS ; Val: $008045F4), (Expr: C_CLILEFT ; Val: $00804624), (Expr: C_CHARPTR ; Val: $00804BC4), (Expr: C_LLIFTEDID ; Val: $00804C10), (Expr: C_LSHARD ; Val: $00808D30), (Expr: C_POPUPID ; Val: $00808EA0), (Expr: C_JOURNALPTR ; Val: $0084104C), (Expr: C_SKILLCAPS ; Val: $0088328C), (Expr: C_SKILLLOCK ; Val: $008832FC), (Expr: C_SKILLSPOS ; Val: $00883334), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004FEDDC), (Expr: E_OLDDIR ; Val: $00543880), (Expr: E_EXMSGADDR ; Val: $00509B60), (Expr: E_ITEMPROPID ; Val: $007BBA3C), (Expr: E_ITEMNAMEADDR ; Val: $004EA9E0), (Expr: E_ITEMPROPADDR ; Val: $004EA900), (Expr: E_ITEMCHECKADDR ; Val: $0052E860), (Expr: E_ITEMREQADDR ; Val: $0052EE90), (Expr: E_PATHFINDADDR ; Val: $0049748B), (Expr: E_SLEEPADDR ; Val: $0056C21C), (Expr: E_DRAGADDR ; Val: $0050E280), (Expr: E_SYSMSGADDR ; Val: $0051D080), (Expr: E_MACROADDR ; Val: $004EEEF0), (Expr: E_SENDPACKET ; Val: $00416850), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar501a : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005ABC94), (Expr: C_CLIXRES ; Val: $005AD3FC), (Expr: C_ENEMYID ; Val: $0069FB70), (Expr: C_SHARDPOS ; Val: $0069FBAC), (Expr: C_NEXTCPOS ; Val: $0069FD04), (Expr: C_SYSMSG ; Val: $006A0770), (Expr: C_CONTPOS ; Val: $006A0790), (Expr: C_ENEMYHITS ; Val: $00768618), (Expr: C_LHANDID ; Val: $007BFB7C), (Expr: C_CHARDIR ; Val: $007C07E0), (Expr: C_TARGETCNT ; Val: $00801984), (Expr: C_CURSORKIND ; Val: $0080456C), (Expr: C_TARGETCURS ; Val: $008045B4), (Expr: C_CLILEFT ; Val: $008045E4), (Expr: C_CHARPTR ; Val: $00804B84), (Expr: C_LLIFTEDID ; Val: $00804BD0), (Expr: C_LSHARD ; Val: $00808CF0), (Expr: C_POPUPID ; Val: $00808E60), (Expr: C_JOURNALPTR ; Val: $0084100C), (Expr: C_SKILLCAPS ; Val: $0088324C), (Expr: C_SKILLLOCK ; Val: $008832BC), (Expr: C_SKILLSPOS ; Val: $008832F4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004FE8FC), (Expr: E_OLDDIR ; Val: $005433F0), (Expr: E_EXMSGADDR ; Val: $00509560), (Expr: E_ITEMPROPID ; Val: $007BB9FC), (Expr: E_ITEMNAMEADDR ; Val: $004EA4E0), (Expr: E_ITEMPROPADDR ; Val: $004EA400), (Expr: E_ITEMCHECKADDR ; Val: $0052E160), (Expr: E_ITEMREQADDR ; Val: $0052E790), (Expr: E_PATHFINDADDR ; Val: $004972DB), (Expr: E_SLEEPADDR ; Val: $0056C21C), (Expr: E_DRAGADDR ; Val: $0050DC40), (Expr: E_SYSMSGADDR ; Val: $0051C9D0), (Expr: E_MACROADDR ; Val: $004EE9E0), (Expr: E_SENDPACKET ; Val: $00416640), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar501a1 : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005ABC94), (Expr: C_CLIXRES ; Val: $005AD3FC), (Expr: C_ENEMYID ; Val: $0069FB70), (Expr: C_SHARDPOS ; Val: $0069FBAC), (Expr: C_NEXTCPOS ; Val: $0069FD04), (Expr: C_SYSMSG ; Val: $006A0770), (Expr: C_CONTPOS ; Val: $006A0790), (Expr: C_ENEMYHITS ; Val: $00768618), (Expr: C_LHANDID ; Val: $007BFB7C), (Expr: C_CHARDIR ; Val: $007C07E0), (Expr: C_TARGETCNT ; Val: $00801984), (Expr: C_CURSORKIND ; Val: $0080456C), (Expr: C_TARGETCURS ; Val: $008045B4), (Expr: C_CLILEFT ; Val: $008045E4), (Expr: C_CHARPTR ; Val: $00804B84), (Expr: C_LLIFTEDID ; Val: $00804BD0), (Expr: C_LSHARD ; Val: $00808CF0), (Expr: C_POPUPID ; Val: $00808E60), (Expr: C_JOURNALPTR ; Val: $0084100C), (Expr: C_SKILLCAPS ; Val: $0088324C), (Expr: C_SKILLLOCK ; Val: $008832BC), (Expr: C_SKILLSPOS ; Val: $008832F4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004FE92C), (Expr: E_OLDDIR ; Val: $00543420), (Expr: E_EXMSGADDR ; Val: $00509590), (Expr: E_ITEMPROPID ; Val: $007BB9FC), (Expr: E_ITEMNAMEADDR ; Val: $004EA510), (Expr: E_ITEMPROPADDR ; Val: $004EA430), (Expr: E_ITEMCHECKADDR ; Val: $0052E190), (Expr: E_ITEMREQADDR ; Val: $0052E7C0), (Expr: E_PATHFINDADDR ; Val: $0049730B), (Expr: E_SLEEPADDR ; Val: $0056C21C), (Expr: E_DRAGADDR ; Val: $0050DC70), (Expr: E_SYSMSGADDR ; Val: $0051CA00), (Expr: E_MACROADDR ; Val: $004EEA10), (Expr: E_SENDPACKET ; Val: $00416640), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar500b : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A9C94), (Expr: C_CLIXRES ; Val: $005AB3FC), (Expr: C_ENEMYID ; Val: $0069DB40), (Expr: C_SHARDPOS ; Val: $0069DB7C), (Expr: C_NEXTCPOS ; Val: $0069DCD4), (Expr: C_SYSMSG ; Val: $0069E740), (Expr: C_CONTPOS ; Val: $0069E760), (Expr: C_ENEMYHITS ; Val: $007665E8), (Expr: C_LHANDID ; Val: $007BDB4C), (Expr: C_CHARDIR ; Val: $007BE7B0), (Expr: C_TARGETCNT ; Val: $007FF954), (Expr: C_CURSORKIND ; Val: $0080253C), (Expr: C_TARGETCURS ; Val: $00802584), (Expr: C_CLILEFT ; Val: $008025B4), (Expr: C_CHARPTR ; Val: $00802B54), (Expr: C_LLIFTEDID ; Val: $00802BA0), (Expr: C_LSHARD ; Val: $00806CC0), (Expr: C_POPUPID ; Val: $00806E30), (Expr: C_JOURNALPTR ; Val: $0083EFDC), (Expr: C_SKILLCAPS ; Val: $0088120C), (Expr: C_SKILLLOCK ; Val: $0088127C), (Expr: C_SKILLSPOS ; Val: $008812B4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004FEC5C), (Expr: E_OLDDIR ; Val: $00542A10), (Expr: E_EXMSGADDR ; Val: $005098F0), (Expr: E_ITEMPROPID ; Val: $007B99CC), (Expr: E_ITEMNAMEADDR ; Val: $004EA9C0), (Expr: E_ITEMPROPADDR ; Val: $004EA8E0), (Expr: E_ITEMCHECKADDR ; Val: $0052D860), (Expr: E_ITEMREQADDR ; Val: $0052DE90), (Expr: E_PATHFINDADDR ; Val: $0049768B), (Expr: E_SLEEPADDR ; Val: $0056B21C), (Expr: E_DRAGADDR ; Val: $0050DFD0), (Expr: E_SYSMSGADDR ; Val: $0051CDA0), (Expr: E_MACROADDR ; Val: $004EEF20), (Expr: E_SENDPACKET ; Val: $00416750), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar500a : array[0..70] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A9C94), (Expr: C_CLIXRES ; Val: $005AB3FC), (Expr: C_ENEMYID ; Val: $0069DB40), (Expr: C_SHARDPOS ; Val: $0069DB7C), (Expr: C_NEXTCPOS ; Val: $0069DCD4), (Expr: C_SYSMSG ; Val: $0069E740), (Expr: C_CONTPOS ; Val: $0069E760), (Expr: C_ENEMYHITS ; Val: $007665E8), (Expr: C_LHANDID ; Val: $007BDB4C), (Expr: C_CHARDIR ; Val: $007BE7B0), (Expr: C_TARGETCNT ; Val: $007FF954), (Expr: C_CURSORKIND ; Val: $0080253C), (Expr: C_TARGETCURS ; Val: $00802584), (Expr: C_CLILEFT ; Val: $008025B4), (Expr: C_CHARPTR ; Val: $00802B54), (Expr: C_LLIFTEDID ; Val: $00802BA0), (Expr: C_LSHARD ; Val: $00806CC0), (Expr: C_POPUPID ; Val: $00806E30), (Expr: C_JOURNALPTR ; Val: $0083EFDC), (Expr: C_SKILLCAPS ; Val: $0088120C), (Expr: C_SKILLLOCK ; Val: $0088127C), (Expr: C_SKILLSPOS ; Val: $008812B4), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_STATML ; Val: $00000002), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $00000070), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000178), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004FEFBC), (Expr: E_OLDDIR ; Val: $00542D30), (Expr: E_EXMSGADDR ; Val: $00509C50), (Expr: E_ITEMPROPID ; Val: $007B99CC), (Expr: E_ITEMNAMEADDR ; Val: $004EAD70), (Expr: E_ITEMPROPADDR ; Val: $004EAC90), (Expr: E_ITEMCHECKADDR ; Val: $0052DCE0), (Expr: E_ITEMREQADDR ; Val: $0052E310), (Expr: E_PATHFINDADDR ; Val: $004977DB), (Expr: E_SLEEPADDR ; Val: $0056B21C), (Expr: E_DRAGADDR ; Val: $0050E330), (Expr: E_SYSMSGADDR ; Val: $0051D090), (Expr: E_MACROADDR ; Val: $004EF280), (Expr: E_SENDPACKET ; Val: $00416930), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar4011e : array[0..69] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A0AE4), (Expr: C_CLIXRES ; Val: $005A2328), (Expr: C_ENEMYID ; Val: $00694770), (Expr: C_SHARDPOS ; Val: $006947AC), (Expr: C_NEXTCPOS ; Val: $00694904), (Expr: C_SYSMSG ; Val: $00695368), (Expr: C_CONTPOS ; Val: $00695388), (Expr: C_ENEMYHITS ; Val: $0075D118), (Expr: C_LHANDID ; Val: $007B43D8), (Expr: C_CHARDIR ; Val: $007B5038), (Expr: C_TARGETCNT ; Val: $007E61DC), (Expr: C_CURSORKIND ; Val: $007E8464), (Expr: C_TARGETCURS ; Val: $007E84AC), (Expr: C_CLILEFT ; Val: $007E84DC), (Expr: C_CHARPTR ; Val: $007E8A7C), (Expr: C_LLIFTEDID ; Val: $007E8AC8), (Expr: C_LSHARD ; Val: $007ECBE8), (Expr: C_POPUPID ; Val: $007ECD58), (Expr: C_JOURNALPTR ; Val: $00824F04), (Expr: C_SKILLCAPS ; Val: $00867134), (Expr: C_SKILLLOCK ; Val: $008671A0), (Expr: C_SKILLSPOS ; Val: $008671D8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000170), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F6AEC), (Expr: E_OLDDIR ; Val: $00539D20), (Expr: E_EXMSGADDR ; Val: $00501600), (Expr: E_ITEMPROPID ; Val: $007B0258), (Expr: E_ITEMNAMEADDR ; Val: $004E28B0), (Expr: E_ITEMPROPADDR ; Val: $004E27D0), (Expr: E_ITEMCHECKADDR ; Val: $00524B40), (Expr: E_ITEMREQADDR ; Val: $00525170), (Expr: E_PATHFINDADDR ; Val: $00495DCB), (Expr: E_SLEEPADDR ; Val: $00562224), (Expr: E_DRAGADDR ; Val: $00505BD0), (Expr: E_SYSMSGADDR ; Val: $00514150), (Expr: E_MACROADDR ; Val: $004E6CA0), (Expr: E_SENDPACKET ; Val: $004160E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar4011c : array[0..69] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A0AE4), (Expr: C_CLIXRES ; Val: $005A2320), (Expr: C_ENEMYID ; Val: $00694770), (Expr: C_SHARDPOS ; Val: $006947AC), (Expr: C_NEXTCPOS ; Val: $00694904), (Expr: C_SYSMSG ; Val: $00695368), (Expr: C_CONTPOS ; Val: $00695388), (Expr: C_ENEMYHITS ; Val: $0075D118), (Expr: C_LHANDID ; Val: $007B43D8), (Expr: C_CHARDIR ; Val: $007B5038), (Expr: C_TARGETCNT ; Val: $007E61DC), (Expr: C_CURSORKIND ; Val: $007E8400), (Expr: C_TARGETCURS ; Val: $007E8444), (Expr: C_CLILEFT ; Val: $007E8474), (Expr: C_CHARPTR ; Val: $007E8A14), (Expr: C_LLIFTEDID ; Val: $007E8A60), (Expr: C_LSHARD ; Val: $007ECB80), (Expr: C_POPUPID ; Val: $007ECCF0), (Expr: C_JOURNALPTR ; Val: $00824E9C), (Expr: C_SKILLCAPS ; Val: $008670CC), (Expr: C_SKILLLOCK ; Val: $00867138), (Expr: C_SKILLSPOS ; Val: $00867170), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000170), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F6A3C), (Expr: E_OLDDIR ; Val: $00539C70), (Expr: E_EXMSGADDR ; Val: $00501550), (Expr: E_ITEMPROPID ; Val: $007B0258), (Expr: E_ITEMNAMEADDR ; Val: $004E2800), (Expr: E_ITEMPROPADDR ; Val: $004E2720), (Expr: E_ITEMCHECKADDR ; Val: $00524A90), (Expr: E_ITEMREQADDR ; Val: $005250C0), (Expr: E_PATHFINDADDR ; Val: $00495DBB), (Expr: E_SLEEPADDR ; Val: $00562224), (Expr: E_DRAGADDR ; Val: $00505B20), (Expr: E_SYSMSGADDR ; Val: $005140A0), (Expr: E_MACROADDR ; Val: $004E6BF0), (Expr: E_SENDPACKET ; Val: $004160E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar4011b : array[0..69] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A0AE4), (Expr: C_CLIXRES ; Val: $005A2320), (Expr: C_ENEMYID ; Val: $00694770), (Expr: C_SHARDPOS ; Val: $006947AC), (Expr: C_NEXTCPOS ; Val: $00694904), (Expr: C_SYSMSG ; Val: $00695368), (Expr: C_CONTPOS ; Val: $00695388), (Expr: C_ENEMYHITS ; Val: $0075D118), (Expr: C_LHANDID ; Val: $007B43D8), (Expr: C_CHARDIR ; Val: $007B5038), (Expr: C_TARGETCNT ; Val: $007E61DC), (Expr: C_CURSORKIND ; Val: $007E8400), (Expr: C_TARGETCURS ; Val: $007E8444), (Expr: C_CLILEFT ; Val: $007E8474), (Expr: C_CHARPTR ; Val: $007E8A14), (Expr: C_LLIFTEDID ; Val: $007E8A60), (Expr: C_LSHARD ; Val: $007ECB80), (Expr: C_POPUPID ; Val: $007ECCF0), (Expr: C_JOURNALPTR ; Val: $00824E9C), (Expr: C_SKILLCAPS ; Val: $008670CC), (Expr: C_SKILLLOCK ; Val: $00867138), (Expr: C_SKILLSPOS ; Val: $00867170), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000170), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F682C), (Expr: E_OLDDIR ; Val: $00539C20), (Expr: E_EXMSGADDR ; Val: $00501330), (Expr: E_ITEMPROPID ; Val: $007B0258), (Expr: E_ITEMNAMEADDR ; Val: $004E2770), (Expr: E_ITEMPROPADDR ; Val: $004E2690), (Expr: E_ITEMCHECKADDR ; Val: $00524B40), (Expr: E_ITEMREQADDR ; Val: $00525170), (Expr: E_PATHFINDADDR ; Val: $0049592B), (Expr: E_SLEEPADDR ; Val: $00562224), (Expr: E_DRAGADDR ; Val: $00505900), (Expr: E_SYSMSGADDR ; Val: $00513EC0), (Expr: E_MACROADDR ; Val: $004E6B00), (Expr: E_SENDPACKET ; Val: $00415F90), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar4011a : array[0..69] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A0AE4), (Expr: C_CLIXRES ; Val: $005A233C), (Expr: C_ENEMYID ; Val: $00694790), (Expr: C_SHARDPOS ; Val: $006947CC), (Expr: C_NEXTCPOS ; Val: $00694924), (Expr: C_SYSMSG ; Val: $00695388), (Expr: C_CONTPOS ; Val: $006953A8), (Expr: C_ENEMYHITS ; Val: $0075D138), (Expr: C_LHANDID ; Val: $007B43F0), (Expr: C_CHARDIR ; Val: $007B5050), (Expr: C_TARGETCNT ; Val: $007E61F4), (Expr: C_CURSORKIND ; Val: $007E8418), (Expr: C_TARGETCURS ; Val: $007E845C), (Expr: C_CLILEFT ; Val: $007E848C), (Expr: C_CHARPTR ; Val: $007E8A2C), (Expr: C_LLIFTEDID ; Val: $007E8A78), (Expr: C_LSHARD ; Val: $007ECB98), (Expr: C_POPUPID ; Val: $007ECD08), (Expr: C_JOURNALPTR ; Val: $00824EB4), (Expr: C_SKILLCAPS ; Val: $008670E4), (Expr: C_SKILLLOCK ; Val: $00867150), (Expr: C_SKILLSPOS ; Val: $00867188), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000170), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F696C), (Expr: E_OLDDIR ; Val: $00539AF0), (Expr: E_EXMSGADDR ; Val: $00501520), (Expr: E_ITEMPROPID ; Val: $007B0270), (Expr: E_ITEMNAMEADDR ; Val: $004E28D0), (Expr: E_ITEMPROPADDR ; Val: $004E27F0), (Expr: E_ITEMCHECKADDR ; Val: $00524940), (Expr: E_ITEMREQADDR ; Val: $00524F70), (Expr: E_PATHFINDADDR ; Val: $004959FB), (Expr: E_SLEEPADDR ; Val: $00562224), (Expr: E_DRAGADDR ; Val: $00505AF0), (Expr: E_SYSMSGADDR ; Val: $005140F0), (Expr: E_MACROADDR ; Val: $004E6C60), (Expr: E_SENDPACKET ; Val: $00415F10), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), (Expr: F_EXCHARSTATC ; Val: $00000014), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar4010b : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059D53C), (Expr: C_CLIXRES ; Val: $0059ED50), (Expr: C_ENEMYID ; Val: $00691120), (Expr: C_SHARDPOS ; Val: $0069115C), (Expr: C_NEXTCPOS ; Val: $006912B4), (Expr: C_SYSMSG ; Val: $00691D18), (Expr: C_CONTPOS ; Val: $00691D38), (Expr: C_ENEMYHITS ; Val: $00759AC8), (Expr: C_LHANDID ; Val: $007B0D80), (Expr: C_CHARDIR ; Val: $007B19E0), (Expr: C_TARGETCNT ; Val: $007E2B84), (Expr: C_CURSORKIND ; Val: $007E4D88), (Expr: C_TARGETCURS ; Val: $007E4DCC), (Expr: C_CLILEFT ; Val: $007E4DFC), (Expr: C_CHARPTR ; Val: $007E539C), (Expr: C_LLIFTEDID ; Val: $007E53E8), (Expr: C_LSHARD ; Val: $007E9378), (Expr: C_POPUPID ; Val: $007E94E8), (Expr: C_JOURNALPTR ; Val: $00821694), (Expr: C_SKILLCAPS ; Val: $008638C4), (Expr: C_SKILLLOCK ; Val: $00863930), (Expr: C_SKILLSPOS ; Val: $00863968), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000170), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F47EC), (Expr: E_OLDDIR ; Val: $00537D70), (Expr: E_EXMSGADDR ; Val: $004FF300), (Expr: E_ITEMPROPID ; Val: $007ACC00), (Expr: E_ITEMNAMEADDR ; Val: $004E0740), (Expr: E_ITEMPROPADDR ; Val: $004E0660), (Expr: E_ITEMCHECKADDR ; Val: $00522B80), (Expr: E_ITEMREQADDR ; Val: $005231B0), (Expr: E_PATHFINDADDR ; Val: $00493C9B), (Expr: E_SLEEPADDR ; Val: $00560224), (Expr: E_DRAGADDR ; Val: $005038D0), (Expr: E_SYSMSGADDR ; Val: $00511E40), (Expr: E_MACROADDR ; Val: $004E4AD0), (Expr: E_SENDPACKET ; Val: $00415F40), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar4010a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059D53C), (Expr: C_CLIXRES ; Val: $0059ED50), (Expr: C_ENEMYID ; Val: $00691120), (Expr: C_SHARDPOS ; Val: $0069115C), (Expr: C_NEXTCPOS ; Val: $006912B4), (Expr: C_SYSMSG ; Val: $00691D18), (Expr: C_CONTPOS ; Val: $00691D38), (Expr: C_ENEMYHITS ; Val: $00759AC8), (Expr: C_LHANDID ; Val: $007B0D80), (Expr: C_CHARDIR ; Val: $007B19E0), (Expr: C_TARGETCNT ; Val: $007E2B84), (Expr: C_CURSORKIND ; Val: $007E4D88), (Expr: C_TARGETCURS ; Val: $007E4DCC), (Expr: C_CLILEFT ; Val: $007E4DFC), (Expr: C_CHARPTR ; Val: $007E539C), (Expr: C_LLIFTEDID ; Val: $007E53E8), (Expr: C_LSHARD ; Val: $007E9378), (Expr: C_POPUPID ; Val: $007E94E8), (Expr: C_JOURNALPTR ; Val: $00821694), (Expr: C_SKILLCAPS ; Val: $008638C4), (Expr: C_SKILLLOCK ; Val: $00863930), (Expr: C_SKILLSPOS ; Val: $00863968), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000170), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000044), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F47AC), (Expr: E_OLDDIR ; Val: $00537D30), (Expr: E_EXMSGADDR ; Val: $004FF2C0), (Expr: E_ITEMPROPID ; Val: $007ACC00), (Expr: E_ITEMNAMEADDR ; Val: $004E0700), (Expr: E_ITEMPROPADDR ; Val: $004E0620), (Expr: E_ITEMCHECKADDR ; Val: $00522B40), (Expr: E_ITEMREQADDR ; Val: $00523170), (Expr: E_PATHFINDADDR ; Val: $00493C9B), (Expr: E_SLEEPADDR ; Val: $00560224), (Expr: E_DRAGADDR ; Val: $00503890), (Expr: E_SYSMSGADDR ; Val: $00511E00), (Expr: E_MACROADDR ; Val: $004E4A90), (Expr: E_SENDPACKET ; Val: $00415F40), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar409a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059A53C), (Expr: C_CLIXRES ; Val: $0059BCE8), (Expr: C_ENEMYID ; Val: $0068E040), (Expr: C_SHARDPOS ; Val: $0068E07C), (Expr: C_NEXTCPOS ; Val: $0068E1D4), (Expr: C_SYSMSG ; Val: $0068EC38), (Expr: C_CONTPOS ; Val: $0068EC58), (Expr: C_ENEMYHITS ; Val: $007569E8), (Expr: C_LHANDID ; Val: $007ADCA0), (Expr: C_CHARDIR ; Val: $007AE900), (Expr: C_TARGETCNT ; Val: $007DFAA4), (Expr: C_CURSORKIND ; Val: $007E1CA8), (Expr: C_TARGETCURS ; Val: $007E1CEC), (Expr: C_CLILEFT ; Val: $007E1D1C), (Expr: C_CHARPTR ; Val: $007E22BC), (Expr: C_LLIFTEDID ; Val: $007E2308), (Expr: C_LSHARD ; Val: $007E6294), (Expr: C_POPUPID ; Val: $007E6408), (Expr: C_JOURNALPTR ; Val: $0081E5B4), (Expr: C_SKILLCAPS ; Val: $008607E4), (Expr: C_SKILLLOCK ; Val: $00860850), (Expr: C_SKILLSPOS ; Val: $00860888), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F28BC), (Expr: E_OLDDIR ; Val: $005355F0), (Expr: E_EXMSGADDR ; Val: $004FD1F0), (Expr: E_ITEMPROPID ; Val: $007A9B20), (Expr: E_ITEMNAMEADDR ; Val: $004DE890), (Expr: E_ITEMPROPADDR ; Val: $004DE7B0), (Expr: E_ITEMCHECKADDR ; Val: $005203E0), (Expr: E_ITEMREQADDR ; Val: $00520A10), (Expr: E_PATHFINDADDR ; Val: $004934BB), (Expr: E_SLEEPADDR ; Val: $0055D224), (Expr: E_DRAGADDR ; Val: $005017E0), (Expr: E_SYSMSGADDR ; Val: $0050FCA0), (Expr: E_MACROADDR ; Val: $004E2C20), (Expr: E_SENDPACKET ; Val: $00416060), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar407b : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059A504), (Expr: C_CLIXRES ; Val: $0059BCB0), (Expr: C_ENEMYID ; Val: $0068E000), (Expr: C_SHARDPOS ; Val: $0068E03C), (Expr: C_NEXTCPOS ; Val: $0068E194), (Expr: C_SYSMSG ; Val: $0068EBF8), (Expr: C_CONTPOS ; Val: $0068EC18), (Expr: C_ENEMYHITS ; Val: $007569A8), (Expr: C_LHANDID ; Val: $007ADC60), (Expr: C_CHARDIR ; Val: $007AE8C0), (Expr: C_TARGETCNT ; Val: $007DFA64), (Expr: C_CURSORKIND ; Val: $007E1C68), (Expr: C_TARGETCURS ; Val: $007E1CAC), (Expr: C_CLILEFT ; Val: $007E1CDC), (Expr: C_CHARPTR ; Val: $007E227C), (Expr: C_LLIFTEDID ; Val: $007E22C8), (Expr: C_LSHARD ; Val: $007E6254), (Expr: C_POPUPID ; Val: $007E63C8), (Expr: C_JOURNALPTR ; Val: $0081E574), (Expr: C_SKILLCAPS ; Val: $008607A4), (Expr: C_SKILLLOCK ; Val: $00860810), (Expr: C_SKILLSPOS ; Val: $00860848), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F236C), (Expr: E_OLDDIR ; Val: $00535030), (Expr: E_EXMSGADDR ; Val: $004FCC20), (Expr: E_ITEMPROPID ; Val: $007A9AE0), (Expr: E_ITEMNAMEADDR ; Val: $004DE210), (Expr: E_ITEMPROPADDR ; Val: $004DE130), (Expr: E_ITEMCHECKADDR ; Val: $0051FE40), (Expr: E_ITEMREQADDR ; Val: $00520470), (Expr: E_PATHFINDADDR ; Val: $00492BBB), (Expr: E_SLEEPADDR ; Val: $0055D224), (Expr: E_DRAGADDR ; Val: $00501200), (Expr: E_SYSMSGADDR ; Val: $0050F6B0), (Expr: E_MACROADDR ; Val: $004E25A0), (Expr: E_SENDPACKET ; Val: $00415F70), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar407a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059A504), (Expr: C_CLIXRES ; Val: $0059BCB0), (Expr: C_ENEMYID ; Val: $0068E000), (Expr: C_SHARDPOS ; Val: $0068E03C), (Expr: C_NEXTCPOS ; Val: $0068E194), (Expr: C_SYSMSG ; Val: $0068EBF8), (Expr: C_CONTPOS ; Val: $0068EC18), (Expr: C_ENEMYHITS ; Val: $007569A8), (Expr: C_LHANDID ; Val: $007ADC60), (Expr: C_CHARDIR ; Val: $007AE8C0), (Expr: C_CURSORKIND ; Val: $007E1C68), (Expr: C_TARGETCNT ; Val: $007DFA64), (Expr: C_TARGETCURS ; Val: $007E1CAC), (Expr: C_CLILEFT ; Val: $007E1CDC), (Expr: C_CHARPTR ; Val: $007E227C), (Expr: C_LLIFTEDID ; Val: $007E22C8), (Expr: C_LSHARD ; Val: $007E6254), (Expr: C_POPUPID ; Val: $007E63C8), (Expr: C_JOURNALPTR ; Val: $0081E574), (Expr: C_SKILLCAPS ; Val: $008607A4), (Expr: C_SKILLLOCK ; Val: $00860810), (Expr: C_SKILLSPOS ; Val: $00860848), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F233C), (Expr: E_OLDDIR ; Val: $00535000), (Expr: E_EXMSGADDR ; Val: $004FCBF0), (Expr: E_ITEMPROPID ; Val: $007A9AE0), (Expr: E_ITEMNAMEADDR ; Val: $004DE1E0), (Expr: E_ITEMPROPADDR ; Val: $004DE100), (Expr: E_ITEMCHECKADDR ; Val: $0051FE10), (Expr: E_ITEMREQADDR ; Val: $00520440), (Expr: E_PATHFINDADDR ; Val: $00492BBB), (Expr: E_SLEEPADDR ; Val: $0055D224), (Expr: E_DRAGADDR ; Val: $005011D0), (Expr: E_SYSMSGADDR ; Val: $0050F680), (Expr: E_MACROADDR ; Val: $004E2570), (Expr: E_SENDPACKET ; Val: $00415F70), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar406a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059A504), (Expr: C_CLIXRES ; Val: $0059BC50), (Expr: C_ENEMYID ; Val: $0068DFA0), (Expr: C_SHARDPOS ; Val: $0068DFDC), (Expr: C_NEXTCPOS ; Val: $0068E134), (Expr: C_SYSMSG ; Val: $0068EB98), (Expr: C_CONTPOS ; Val: $0068EBB8), (Expr: C_ENEMYHITS ; Val: $00756948), (Expr: C_LHANDID ; Val: $007ADC00), (Expr: C_CHARDIR ; Val: $007AE860), (Expr: C_TARGETCNT ; Val: $007DFA04), (Expr: C_CURSORKIND ; Val: $007E1C08), (Expr: C_TARGETCURS ; Val: $007E1C4C), (Expr: C_CLILEFT ; Val: $007E1C7C), (Expr: C_CHARPTR ; Val: $007E221C), (Expr: C_LLIFTEDID ; Val: $007E2268), (Expr: C_LSHARD ; Val: $007E61F4), (Expr: C_POPUPID ; Val: $007E6368), (Expr: C_JOURNALPTR ; Val: $0081E514), (Expr: C_SKILLCAPS ; Val: $00860744), (Expr: C_SKILLLOCK ; Val: $008607B0), (Expr: C_SKILLSPOS ; Val: $008607E8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F205C), (Expr: E_OLDDIR ; Val: $00534E50), (Expr: E_EXMSGADDR ; Val: $004FC810), (Expr: E_ITEMPROPID ; Val: $007A9A80), (Expr: E_ITEMNAMEADDR ; Val: $004DE070), (Expr: E_ITEMPROPADDR ; Val: $004DDF90), (Expr: E_ITEMCHECKADDR ; Val: $0051FC30), (Expr: E_ITEMREQADDR ; Val: $00520260), (Expr: E_PATHFINDADDR ; Val: $00492B0B), (Expr: E_SLEEPADDR ; Val: $0055D224), (Expr: E_DRAGADDR ; Val: $00500E00), (Expr: E_SYSMSGADDR ; Val: $0050F2E0), (Expr: E_MACROADDR ; Val: $004E2460), (Expr: E_SENDPACKET ; Val: $00415F80), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar405b : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059A4F4), (Expr: C_CLIXRES ; Val: $0059BC40), (Expr: C_ENEMYID ; Val: $0068E0C0), (Expr: C_SHARDPOS ; Val: $0068E0FC), (Expr: C_NEXTCPOS ; Val: $00862E54), (Expr: C_SYSMSG ; Val: $008638B8), (Expr: C_CONTPOS ; Val: $008638D8), (Expr: C_ENEMYHITS ; Val: $0092B668), (Expr: C_LHANDID ; Val: $00DCAB78), (Expr: C_CHARDIR ; Val: $00DCC778), (Expr: C_TARGETCNT ; Val: $00DFD91C), (Expr: C_CURSORKIND ; Val: $00DFFB20), (Expr: C_TARGETCURS ; Val: $00DFFB64), (Expr: C_CLILEFT ; Val: $00DFFB94), (Expr: C_CHARPTR ; Val: $00E00134), (Expr: C_LLIFTEDID ; Val: $00E00180), (Expr: C_LSHARD ; Val: $00E0410C), (Expr: C_POPUPID ; Val: $00E09280), (Expr: C_JOURNALPTR ; Val: $00E5249C), (Expr: C_SKILLCAPS ; Val: $00E946CC), (Expr: C_SKILLLOCK ; Val: $00E94738), (Expr: C_SKILLSPOS ; Val: $00E94770), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F290C), (Expr: E_OLDDIR ; Val: $00535830), (Expr: E_EXMSGADDR ; Val: $004FD240), (Expr: E_ITEMPROPID ; Val: $00DC69F8), (Expr: E_ITEMNAMEADDR ; Val: $004DED00), (Expr: E_ITEMPROPADDR ; Val: $004DEC20), (Expr: E_ITEMCHECKADDR ; Val: $005206E0), (Expr: E_ITEMREQADDR ; Val: $00520D10), (Expr: E_PATHFINDADDR ; Val: $0049263B), (Expr: E_SLEEPADDR ; Val: $0055D228), (Expr: E_DRAGADDR ; Val: $00501810), (Expr: E_SYSMSGADDR ; Val: $0050FD60), (Expr: E_MACROADDR ; Val: $004E3090), (Expr: E_SENDPACKET ; Val: $00415F10), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar405a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059A4DC), (Expr: C_CLIXRES ; Val: $0059BC28), (Expr: C_ENEMYID ; Val: $0068E0C0), (Expr: C_SHARDPOS ; Val: $0068E0FC), (Expr: C_NEXTCPOS ; Val: $00862E54), (Expr: C_SYSMSG ; Val: $008638B8), (Expr: C_CONTPOS ; Val: $008638D8), (Expr: C_ENEMYHITS ; Val: $0092B668), (Expr: C_LHANDID ; Val: $00DCAB78), (Expr: C_CHARDIR ; Val: $00DCC778), (Expr: C_TARGETCNT ; Val: $00DFD91C), (Expr: C_CURSORKIND ; Val: $00DFFB20), (Expr: C_TARGETCURS ; Val: $00DFFB64), (Expr: C_CLILEFT ; Val: $00DFFB94), (Expr: C_CHARPTR ; Val: $00E00134), (Expr: C_LLIFTEDID ; Val: $00E00180), (Expr: C_LSHARD ; Val: $00E0410C), (Expr: C_POPUPID ; Val: $00E09280), (Expr: C_JOURNALPTR ; Val: $00E5249C), (Expr: C_SKILLCAPS ; Val: $00E946CC), (Expr: C_SKILLLOCK ; Val: $00E94738), (Expr: C_SKILLSPOS ; Val: $00E94770), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000C4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000004C), (Expr: B_CONTNEXT ; Val: $00000058), (Expr: B_ENEMYHPVAL ; Val: $000000C4), (Expr: B_SHOPCURRENT ; Val: $000000CC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000DC), (Expr: B_SKILLDIST ; Val: $0000006C), (Expr: B_SYSMSGSTR ; Val: $00000100), (Expr: B_EVSKILLPAR ; Val: $000000D8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F27AC), (Expr: E_OLDDIR ; Val: $005357A0), (Expr: E_EXMSGADDR ; Val: $004FD040), (Expr: E_ITEMPROPID ; Val: $00DC69F8), (Expr: E_ITEMNAMEADDR ; Val: $004DED00), (Expr: E_ITEMPROPADDR ; Val: $004DEC20), (Expr: E_ITEMCHECKADDR ; Val: $00520620), (Expr: E_ITEMREQADDR ; Val: $00520C50), (Expr: E_PATHFINDADDR ; Val: $0049246B), (Expr: E_SLEEPADDR ; Val: $0055D228), (Expr: E_DRAGADDR ; Val: $00501630), (Expr: E_SYSMSGADDR ; Val: $0050FC40), (Expr: E_MACROADDR ; Val: $004E3090), (Expr: E_SENDPACKET ; Val: $00415FA0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar404t : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0059A4DC), (Expr: C_CLIXRES ; Val: $0059BC28), (Expr: C_ENEMYID ; Val: $0068E0C8), (Expr: C_SHARDPOS ; Val: $0068E110), (Expr: C_NEXTCPOS ; Val: $00862E64), (Expr: C_SYSMSG ; Val: $008638C8), (Expr: C_CONTPOS ; Val: $008638E8), (Expr: C_ENEMYHITS ; Val: $0092B670), (Expr: C_LHANDID ; Val: $00DCAB80), (Expr: C_CHARDIR ; Val: $00DCC780), (Expr: C_TARGETCNT ; Val: $00DFD924), (Expr: C_CURSORKIND ; Val: $00DFFB28), (Expr: C_TARGETCURS ; Val: $00DFFB6C), (Expr: C_CLILEFT ; Val: $00DFFB9C), (Expr: C_CHARPTR ; Val: $00E0013C), (Expr: C_LLIFTEDID ; Val: $00E00188), (Expr: C_LSHARD ; Val: $00E04114), (Expr: C_POPUPID ; Val: $00E09288), (Expr: C_JOURNALPTR ; Val: $00E524A4), (Expr: C_SKILLCAPS ; Val: $00E94044), (Expr: C_SKILLLOCK ; Val: $00E940B0), (Expr: C_SKILLSPOS ; Val: $00E940E8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004F268C), (Expr: E_OLDDIR ; Val: $00535700), (Expr: E_EXMSGADDR ; Val: $004FCF50), (Expr: E_ITEMPROPID ; Val: $00DC6A00), (Expr: E_ITEMNAMEADDR ; Val: $004DEB90), (Expr: E_ITEMPROPADDR ; Val: $004DEAB0), (Expr: E_ITEMCHECKADDR ; Val: $005205C0), (Expr: E_ITEMREQADDR ; Val: $00520BF0), (Expr: E_PATHFINDADDR ; Val: $0049222B), (Expr: E_SLEEPADDR ; Val: $0055D224), (Expr: E_DRAGADDR ; Val: $00501530), (Expr: E_SYSMSGADDR ; Val: $0050FB50), (Expr: E_MACROADDR ; Val: $004E2F80), (Expr: E_SENDPACKET ; Val: $00415FA0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar404b : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $00593314), (Expr: C_CLIXRES ; Val: $00594A2C), (Expr: C_ENEMYID ; Val: $00686B00), (Expr: C_SHARDPOS ; Val: $00686B3C), (Expr: C_NEXTCPOS ; Val: $0085B874), (Expr: C_SYSMSG ; Val: $0085C2D8), (Expr: C_CONTPOS ; Val: $0085C2F8), (Expr: C_ENEMYHITS ; Val: $00923E90), (Expr: C_LHANDID ; Val: $00D9B2F8), (Expr: C_CHARDIR ; Val: $00D9EE38), (Expr: C_TARGETCNT ; Val: $00DBFFDC), (Expr: C_CURSORKIND ; Val: $00DC21E0), (Expr: C_TARGETCURS ; Val: $00DC2224), (Expr: C_CLILEFT ; Val: $00DC2254), (Expr: C_CHARPTR ; Val: $00DC27F4), (Expr: C_LLIFTEDID ; Val: $00DC2840), (Expr: C_LSHARD ; Val: $00DC67CC), (Expr: C_POPUPID ; Val: $00DCB940), (Expr: C_JOURNALPTR ; Val: $00E14B4C), (Expr: C_SKILLCAPS ; Val: $00E56D7C), (Expr: C_SKILLLOCK ; Val: $00E56DE4), (Expr: C_SKILLSPOS ; Val: $00E56E18), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004ED95C), (Expr: E_OLDDIR ; Val: $0052EB60), (Expr: E_EXMSGADDR ; Val: $004F81E0), (Expr: E_ITEMPROPID ; Val: $00D97178), (Expr: E_ITEMNAMEADDR ; Val: $004D9160), (Expr: E_ITEMPROPADDR ; Val: $004D9080), (Expr: E_ITEMCHECKADDR ; Val: $0051A0C0), (Expr: E_ITEMREQADDR ; Val: $0051A6F0), (Expr: E_PATHFINDADDR ; Val: $0048EB5B), (Expr: E_SLEEPADDR ; Val: $00556228), (Expr: E_DRAGADDR ; Val: $004FC790), (Expr: E_SYSMSGADDR ; Val: $00509730), (Expr: E_MACROADDR ; Val: $004DD4B0), (Expr: E_SENDPACKET ; Val: $00415B90), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar404a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $00593314), (Expr: C_CLIXRES ; Val: $00594A2C), (Expr: C_ENEMYID ; Val: $00686AF8), (Expr: C_SHARDPOS ; Val: $00686B40), (Expr: C_NEXTCPOS ; Val: $0085B874), (Expr: C_SYSMSG ; Val: $0085C2D8), (Expr: C_CONTPOS ; Val: $0085C2F8), (Expr: C_ENEMYHITS ; Val: $00923E88), (Expr: C_LHANDID ; Val: $00D9B2F0), (Expr: C_CHARDIR ; Val: $00D9EE30), (Expr: C_TARGETCNT ; Val: $00DBFFD4), (Expr: C_CURSORKIND ; Val: $00DC21D8), (Expr: C_TARGETCURS ; Val: $00DC221C), (Expr: C_CLILEFT ; Val: $00DC224C), (Expr: C_CHARPTR ; Val: $00DC27EC), (Expr: C_LLIFTEDID ; Val: $00DC2838), (Expr: C_LSHARD ; Val: $00DC67C4), (Expr: C_POPUPID ; Val: $00DCB938), (Expr: C_JOURNALPTR ; Val: $00E14B44), (Expr: C_SKILLCAPS ; Val: $00E566E4), (Expr: C_SKILLLOCK ; Val: $00E5674C), (Expr: C_SKILLSPOS ; Val: $00E56780), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004ED9BC), (Expr: E_OLDDIR ; Val: $0052EA70), (Expr: E_EXMSGADDR ; Val: $004F81E0), (Expr: E_ITEMPROPID ; Val: $00D97170), (Expr: E_ITEMNAMEADDR ; Val: $004D9170), (Expr: E_ITEMPROPADDR ; Val: $004D9090), (Expr: E_ITEMCHECKADDR ; Val: $00519FE0), (Expr: E_ITEMREQADDR ; Val: $0051A610), (Expr: E_PATHFINDADDR ; Val: $0048E87B), (Expr: E_SLEEPADDR ; Val: $00556224), (Expr: E_DRAGADDR ; Val: $004FC790), (Expr: E_SYSMSGADDR ; Val: $005097A0), (Expr: E_MACROADDR ; Val: $004DD4C0), (Expr: E_SENDPACKET ; Val: $00415A00), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar403e : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005932EC), (Expr: C_CLIXRES ; Val: $00594A04), (Expr: C_ENEMYID ; Val: $00686AA8), (Expr: C_SHARDPOS ; Val: $00686AF0), (Expr: C_NEXTCPOS ; Val: $0085B824), (Expr: C_SYSMSG ; Val: $0085C288), (Expr: C_CONTPOS ; Val: $0085C2A8), (Expr: C_ENEMYHITS ; Val: $00923E38), (Expr: C_LHANDID ; Val: $00D9B2A0), (Expr: C_CHARDIR ; Val: $00D9EDE0), (Expr: C_TARGETCNT ; Val: $00DBFF84), (Expr: C_CURSORKIND ; Val: $00DC2188), (Expr: C_TARGETCURS ; Val: $00DC21A0), (Expr: C_CLILEFT ; Val: $00DC21D0), (Expr: C_CHARPTR ; Val: $00DC2764), (Expr: C_LLIFTEDID ; Val: $00DC27B0), (Expr: C_LSHARD ; Val: $00DC673C), (Expr: C_POPUPID ; Val: $00DCB8B0), (Expr: C_JOURNALPTR ; Val: $00E14ABC), (Expr: C_SKILLCAPS ; Val: $00E5665C), (Expr: C_SKILLLOCK ; Val: $00E566C4), (Expr: C_SKILLSPOS ; Val: $00E566F8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004ED4AC), (Expr: E_OLDDIR ; Val: $0052E030), (Expr: E_EXMSGADDR ; Val: $004F7770), (Expr: E_ITEMPROPID ; Val: $00D97120), (Expr: E_ITEMNAMEADDR ; Val: $004D8DF0), (Expr: E_ITEMPROPADDR ; Val: $004D8D10), (Expr: E_ITEMCHECKADDR ; Val: $00519560), (Expr: E_ITEMREQADDR ; Val: $00519B90), (Expr: E_PATHFINDADDR ; Val: $0048E9EB), (Expr: E_SLEEPADDR ; Val: $0055621C), (Expr: E_DRAGADDR ; Val: $004FBD20), (Expr: E_SYSMSGADDR ; Val: $00508CE0), (Expr: E_MACROADDR ; Val: $004DD010), (Expr: E_SENDPACKET ; Val: $00415A10), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar403d : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005932FC), (Expr: C_CLIXRES ; Val: $00594A14), (Expr: C_ENEMYID ; Val: $00686AB8), (Expr: C_SHARDPOS ; Val: $00686B00), (Expr: C_NEXTCPOS ; Val: $0085B834), (Expr: C_SYSMSG ; Val: $0085C298), (Expr: C_CONTPOS ; Val: $0085C2B8), (Expr: C_ENEMYHITS ; Val: $00923E48), (Expr: C_LHANDID ; Val: $00D9B2B0), (Expr: C_CHARDIR ; Val: $00D9EDF0), (Expr: C_TARGETCNT ; Val: $00DBFF94), (Expr: C_CURSORKIND ; Val: $00DC2198), (Expr: C_TARGETCURS ; Val: $00DC21B0), (Expr: C_CLILEFT ; Val: $00DC21E0), (Expr: C_CHARPTR ; Val: $00DC2774), (Expr: C_LLIFTEDID ; Val: $00DC27C0), (Expr: C_LSHARD ; Val: $00DC674C), (Expr: C_POPUPID ; Val: $00DCB8C0), (Expr: C_JOURNALPTR ; Val: $00E14ACC), (Expr: C_SKILLCAPS ; Val: $00E5666C), (Expr: C_SKILLLOCK ; Val: $00E566D4), (Expr: C_SKILLSPOS ; Val: $00E56708), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004ED49C), (Expr: E_OLDDIR ; Val: $0052DE90), (Expr: E_EXMSGADDR ; Val: $004F7770), (Expr: E_ITEMPROPID ; Val: $00D97130), (Expr: E_ITEMNAMEADDR ; Val: $004D8DF0), (Expr: E_ITEMPROPADDR ; Val: $004D8D10), (Expr: E_ITEMCHECKADDR ; Val: $00519350), (Expr: E_ITEMREQADDR ; Val: $00519980), (Expr: E_PATHFINDADDR ; Val: $0048EAAB), (Expr: E_SLEEPADDR ; Val: $0055621C), (Expr: E_DRAGADDR ; Val: $004FBD20), (Expr: E_SYSMSGADDR ; Val: $00508C90), (Expr: E_MACROADDR ; Val: $004DD010), (Expr: E_SENDPACKET ; Val: $00415BE0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar403c : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005922FC), (Expr: C_CLIXRES ; Val: $005939FC), (Expr: C_ENEMYID ; Val: $00685A98), (Expr: C_SHARDPOS ; Val: $00685AE0), (Expr: C_NEXTCPOS ; Val: $0085A814), (Expr: C_SYSMSG ; Val: $0085B278), (Expr: C_CONTPOS ; Val: $0085B298), (Expr: C_ENEMYHITS ; Val: $00922E28), (Expr: C_LHANDID ; Val: $00D9A290), (Expr: C_CHARDIR ; Val: $00D9DDD0), (Expr: C_TARGETCNT ; Val: $00DBEF74), (Expr: C_CURSORKIND ; Val: $00DC1178), (Expr: C_TARGETCURS ; Val: $00DC1190), (Expr: C_CLILEFT ; Val: $00DC11C0), (Expr: C_CHARPTR ; Val: $00DC1754), (Expr: C_LLIFTEDID ; Val: $00DC17A0), (Expr: C_LSHARD ; Val: $00DC572C), (Expr: C_POPUPID ; Val: $00DCA8A0), (Expr: C_JOURNALPTR ; Val: $00E13AAC), (Expr: C_SKILLCAPS ; Val: $00E5564C), (Expr: C_SKILLLOCK ; Val: $00E556B4), (Expr: C_SKILLSPOS ; Val: $00E556E8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000024), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000164), (Expr: B_SHOPPRICE ; Val: $00000030), (Expr: B_GUMPPTR ; Val: $00000038), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004ED12C), (Expr: E_OLDDIR ; Val: $0052DD30), (Expr: E_EXMSGADDR ; Val: $004F7450), (Expr: E_ITEMPROPID ; Val: $00D96110), (Expr: E_ITEMNAMEADDR ; Val: $004D8940), (Expr: E_ITEMPROPADDR ; Val: $004D8860), (Expr: E_ITEMCHECKADDR ; Val: $00519240), (Expr: E_ITEMREQADDR ; Val: $00519870), (Expr: E_PATHFINDADDR ; Val: $0048E73B), (Expr: E_SLEEPADDR ; Val: $0055521C), (Expr: E_DRAGADDR ; Val: $004FBA50), (Expr: E_SYSMSGADDR ; Val: $005089C0), (Expr: E_MACROADDR ; Val: $004DCB60), (Expr: E_SENDPACKET ; Val: $00415A60), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar403b : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A8DDC), (Expr: C_CLIXRES ; Val: $005AB33C), (Expr: C_ENEMYID ; Val: $006A8AB0), (Expr: C_SHARDPOS ; Val: $006A8AF8), (Expr: C_NEXTCPOS ; Val: $0087D814), (Expr: C_SYSMSG ; Val: $0087E278), (Expr: C_CONTPOS ; Val: $0087E298), (Expr: C_ENEMYHITS ; Val: $00945E28), (Expr: C_LHANDID ; Val: $00DBD290), (Expr: C_CHARDIR ; Val: $00DC0DD0), (Expr: C_TARGETCNT ; Val: $00DE1F84), (Expr: C_CURSORKIND ; Val: $00DE4188), (Expr: C_TARGETCURS ; Val: $00DE41A0), (Expr: C_CLILEFT ; Val: $00DE41D0), (Expr: C_CHARPTR ; Val: $00DE4764), (Expr: C_LLIFTEDID ; Val: $00DE47B0), (Expr: C_LSHARD ; Val: $00DE873C), (Expr: C_POPUPID ; Val: $00DED8B0), (Expr: C_JOURNALPTR ; Val: $00E36ABC), (Expr: C_SKILLCAPS ; Val: $00E786BC), (Expr: C_SKILLLOCK ; Val: $00E78724), (Expr: C_SKILLSPOS ; Val: $00E78758), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000148), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004EF55C), (Expr: E_OLDDIR ; Val: $0053E300), (Expr: E_EXMSGADDR ; Val: $004F99E0), (Expr: E_ITEMPROPID ; Val: $00DB9110), (Expr: E_ITEMNAMEADDR ; Val: $004DA750), (Expr: E_ITEMPROPADDR ; Val: $004DA670), (Expr: E_ITEMCHECKADDR ; Val: $0051C8C0), (Expr: E_ITEMREQADDR ; Val: $0051CEF0), (Expr: E_PATHFINDADDR ; Val: $0049050B), (Expr: E_SLEEPADDR ; Val: $00567220), (Expr: E_DRAGADDR ; Val: $004FE200), (Expr: E_SYSMSGADDR ; Val: $0050BE90), (Expr: E_MACROADDR ; Val: $004DEBE0), (Expr: E_SENDPACKET ; Val: $00415AD0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar403a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A1E4C), (Expr: C_CLIXRES ; Val: $005A4AA4), (Expr: C_ENEMYID ; Val: $006A2240), (Expr: C_SHARDPOS ; Val: $006A2288), (Expr: C_NEXTCPOS ; Val: $00876FA4), (Expr: C_SYSMSG ; Val: $00877A0C), (Expr: C_CONTPOS ; Val: $00877A2C), (Expr: C_ENEMYHITS ; Val: $0093F5C4), (Expr: C_LHANDID ; Val: $00DB6A3C), (Expr: C_CHARDIR ; Val: $00DBA598), (Expr: C_TARGETCNT ; Val: $00DDB5A4), (Expr: C_CURSORKIND ; Val: $00DDD7B0), (Expr: C_TARGETCURS ; Val: $00DDD7C8), (Expr: C_CLILEFT ; Val: $00DDD7F8), (Expr: C_CHARPTR ; Val: $00DDDD8C), (Expr: C_LLIFTEDID ; Val: $00DDDDD8), (Expr: C_LSHARD ; Val: $00DE1D74), (Expr: C_POPUPID ; Val: $00DE6EE8), (Expr: C_JOURNALPTR ; Val: $00E300EC), (Expr: C_SKILLCAPS ; Val: $00E71CE8), (Expr: C_SKILLLOCK ; Val: $00E71D50), (Expr: C_SKILLSPOS ; Val: $00E71D88), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000160), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004EBADC), (Expr: E_OLDDIR ; Val: $00539A30), (Expr: E_EXMSGADDR ; Val: $004F5D40), (Expr: E_ITEMPROPID ; Val: $00DB28B8), (Expr: E_ITEMNAMEADDR ; Val: $004D7150), (Expr: E_ITEMPROPADDR ; Val: $004D7070), (Expr: E_ITEMCHECKADDR ; Val: $00518310), (Expr: E_ITEMREQADDR ; Val: $005189B0), (Expr: E_PATHFINDADDR ; Val: $0048E27B), (Expr: E_SLEEPADDR ; Val: $00562220), (Expr: E_DRAGADDR ; Val: $004FA450), (Expr: E_SYSMSGADDR ; Val: $00507D90), (Expr: E_MACROADDR ; Val: $004DB2F0), (Expr: E_SENDPACKET ; Val: $004156F0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar402a : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A1E34), (Expr: C_CLIXRES ; Val: $005A4A84), (Expr: C_ENEMYID ; Val: $006A2210), (Expr: C_SHARDPOS ; Val: $006A2258), (Expr: C_NEXTCPOS ; Val: $00876F74), (Expr: C_SYSMSG ; Val: $008779DC), (Expr: C_CONTPOS ; Val: $008779FC), (Expr: C_ENEMYHITS ; Val: $0093F594), (Expr: C_LHANDID ; Val: $00DB6A04), (Expr: C_CHARDIR ; Val: $00DBA560), (Expr: C_TARGETCNT ; Val: $00DDB56C), (Expr: C_CURSORKIND ; Val: $00DDD778), (Expr: C_TARGETCURS ; Val: $00DDD790), (Expr: C_CLILEFT ; Val: $00DDD7C0), (Expr: C_CHARPTR ; Val: $00DDDD54), (Expr: C_LLIFTEDID ; Val: $00DDDDA0), (Expr: C_LSHARD ; Val: $00DE1D3C), (Expr: C_POPUPID ; Val: $00DE6EB0), (Expr: C_JOURNALPTR ; Val: $00E300B4), (Expr: C_SKILLCAPS ; Val: $00E71CB0), (Expr: C_SKILLLOCK ; Val: $00E71D18), (Expr: C_SKILLSPOS ; Val: $00E71D50), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B4), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000024), (Expr: B_CONTX ; Val: $00000034), (Expr: B_CONTITEM ; Val: $0000003C), (Expr: B_CONTNEXT ; Val: $00000048), (Expr: B_ENEMYHPVAL ; Val: $000000B4), (Expr: B_SHOPCURRENT ; Val: $000000BC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000CC), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000F0), (Expr: B_EVSKILLPAR ; Val: $000000C8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000160), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004EB7FC), (Expr: E_OLDDIR ; Val: $005399B0), (Expr: E_EXMSGADDR ; Val: $004F5AB0), (Expr: E_ITEMPROPID ; Val: $00DB2880), (Expr: E_ITEMNAMEADDR ; Val: $004D6EC0), (Expr: E_ITEMPROPADDR ; Val: $004D6DE0), (Expr: E_ITEMCHECKADDR ; Val: $005182B0), (Expr: E_ITEMREQADDR ; Val: $00518950), (Expr: E_PATHFINDADDR ; Val: $0048DEEB), (Expr: E_SLEEPADDR ; Val: $00562220), (Expr: E_DRAGADDR ; Val: $004FA240), (Expr: E_SYSMSGADDR ; Val: $00507D80), (Expr: E_MACROADDR ; Val: $004DB050), (Expr: E_SENDPACKET ; Val: $00415620), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar401b : array[0..68] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005A11FC), (Expr: C_CLIXRES ; Val: $005A3E4C), (Expr: C_ENEMYID ; Val: $006A1500), (Expr: C_SHARDPOS ; Val: $006A1548), (Expr: C_NEXTCPOS ; Val: $00876264), (Expr: C_SYSMSG ; Val: $00876CCC), (Expr: C_CONTPOS ; Val: $00876CEC), (Expr: C_ENEMYHITS ; Val: $0093E884), (Expr: C_LHANDID ; Val: $00DB5CEC), (Expr: C_CHARDIR ; Val: $00DB9848), (Expr: C_TARGETCNT ; Val: $00DDA854), (Expr: C_CURSORKIND ; Val: $00DDCA60), (Expr: C_TARGETCURS ; Val: $00DDCA78), (Expr: C_CLILEFT ; Val: $00DDCAA8), (Expr: C_CHARPTR ; Val: $00DDD03C), (Expr: C_LLIFTEDID ; Val: $00DDD088), (Expr: C_LSHARD ; Val: $00DE1024), (Expr: C_POPUPID ; Val: $00DE6198), (Expr: C_JOURNALPTR ; Val: $00E2F39C), (Expr: C_SKILLCAPS ; Val: $00E70F98), (Expr: C_SKILLLOCK ; Val: $00E71000), (Expr: C_SKILLSPOS ; Val: $00E71038), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B0), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000020), (Expr: B_CONTX ; Val: $00000030), (Expr: B_CONTITEM ; Val: $00000038), (Expr: B_CONTNEXT ; Val: $00000044), (Expr: B_ENEMYHPVAL ; Val: $000000B0), (Expr: B_SHOPCURRENT ; Val: $000000B8), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000C8), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000EC), (Expr: B_EVSKILLPAR ; Val: $000000C4), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000160), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004EA42C), (Expr: E_OLDDIR ; Val: $00538290), (Expr: E_EXMSGADDR ; Val: $004F4700), (Expr: E_ITEMPROPID ; Val: $00DB1B68), (Expr: E_ITEMNAMEADDR ; Val: $004D5B90), (Expr: E_ITEMPROPADDR ; Val: $004D5AB0), (Expr: E_ITEMCHECKADDR ; Val: $00517250), (Expr: E_ITEMREQADDR ; Val: $005178F0), (Expr: E_PATHFINDADDR ; Val: $0048DC9B), (Expr: E_SLEEPADDR ; Val: $00561218), (Expr: E_DRAGADDR ; Val: $004F9090), (Expr: E_SYSMSGADDR ; Val: $00506C20), (Expr: E_MACROADDR ; Val: $004D9D60), (Expr: E_SENDPACKET ; Val: $00415790), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000001), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar400c : array[0..63] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0058A8CC), (Expr: C_CLIXRES ; Val: $0058D394), (Expr: C_ENEMYID ; Val: $0068A780), (Expr: C_SHARDPOS ; Val: $0068A7C8), (Expr: C_NEXTCPOS ; Val: $0085F4E0), (Expr: C_SYSMSG ; Val: $0085FF4C), (Expr: C_CONTPOS ; Val: $0085FF6C), (Expr: C_ENEMYHITS ; Val: $00927B04), (Expr: C_LHANDID ; Val: $00D9EE5C), (Expr: C_CHARDIR ; Val: $00DA2910), (Expr: C_TARGETCNT ; Val: $00DC391C), (Expr: C_CURSORKIND ; Val: $00DC5B28), (Expr: C_TARGETCURS ; Val: $00DC5B40), (Expr: C_CLILEFT ; Val: $00DC5B70), (Expr: C_CHARPTR ; Val: $00DC6104), (Expr: C_LLIFTEDID ; Val: $00DC6150), (Expr: C_LSHARD ; Val: $00000000), (Expr: C_POPUPID ; Val: $00DCB558), (Expr: C_JOURNALPTR ; Val: $00E1475C), (Expr: C_SKILLCAPS ; Val: $00E56358), (Expr: C_SKILLLOCK ; Val: $00E563C0), (Expr: C_SKILLSPOS ; Val: $00E563F8), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $00000038), (Expr: B_ITEMSTACK ; Val: $0000003E), (Expr: B_STATNAME ; Val: $000000B0), (Expr: B_STATWEIGHT ; Val: $00000038), (Expr: B_STATAR ; Val: $0000003A), (Expr: B_CONTSIZEX ; Val: $00000020), (Expr: B_CONTX ; Val: $00000030), (Expr: B_CONTITEM ; Val: $00000038), (Expr: B_CONTNEXT ; Val: $00000044), (Expr: B_ENEMYHPVAL ; Val: $000000B0), (Expr: B_SHOPCURRENT ; Val: $000000B8), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000C8), (Expr: B_SKILLDIST ; Val: $00000068), (Expr: B_SYSMSGSTR ; Val: $000000EC), (Expr: B_EVSKILLPAR ; Val: $000000C4), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000160), (Expr: B_TITHE ; Val: $00000064), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000025), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004DD19C), (Expr: E_OLDDIR ; Val: $00527AD0), (Expr: E_EXMSGADDR ; Val: $004E7410), (Expr: E_PATHFINDADDR ; Val: $00487AEB), (Expr: E_SLEEPADDR ; Val: $0054E1FC), (Expr: E_DRAGADDR ; Val: $004EBC80), (Expr: E_SYSMSGADDR ; Val: $004F8660), (Expr: E_MACROADDR ; Val: $004D1710), (Expr: E_SENDPACKET ; Val: $004154E0), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000001), (Expr: F_EVPROPERTY ; Val: $00000000), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar300c : array[0..60] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005211CC), (Expr: C_CLIXRES ; Val: $005239C8), (Expr: C_ENEMYID ; Val: $0063591C), (Expr: C_SHARDPOS ; Val: $00635A4C), (Expr: C_NEXTCPOS ; Val: $0080A730), (Expr: C_SYSMSG ; Val: $0080B180), (Expr: C_CONTPOS ; Val: $0080B19C), (Expr: C_ENEMYHITS ; Val: $008D2B10), (Expr: C_LHANDID ; Val: $00CD7A34), (Expr: C_CHARDIR ; Val: $00CDB4B8), (Expr: C_CURSORKIND ; Val: $00CDE6B0), (Expr: C_TARGETCURS ; Val: $00CDE6C8), (Expr: C_CLILEFT ; Val: $00CDE6F8), (Expr: C_CHARPTR ; Val: $00CDEC8C), (Expr: C_LLIFTEDID ; Val: $00CDECD8), (Expr: C_JOURNALPTR ; Val: $00D2D1DC), (Expr: C_SKILLLOCK ; Val: $00D6EDD4), (Expr: C_SKILLSPOS ; Val: $00D6EE08), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $00000080), (Expr: B_ITEMTYPE ; Val: $0000003C), (Expr: B_ITEMSTACK ; Val: $00000042), (Expr: B_STATNAME ; Val: $000000A4), (Expr: B_STATWEIGHT ; Val: $0000003A), (Expr: B_STATAR ; Val: $00000038), (Expr: B_CONTSIZEX ; Val: $00000020), (Expr: B_CONTX ; Val: $00000030), (Expr: B_CONTITEM ; Val: $00000038), (Expr: B_CONTNEXT ; Val: $00000040), (Expr: B_ENEMYHPVAL ; Val: $000000A4), (Expr: B_SHOPCURRENT ; Val: $000000AC), (Expr: B_SHOPNEXT ; Val: $00000048), (Expr: B_BILLFIRST ; Val: $000000BC), (Expr: B_SKILLDIST ; Val: $00000064), (Expr: B_SYSMSGSTR ; Val: $000000E0), (Expr: B_EVSKILLPAR ; Val: $000000B8), (Expr: B_LLIFTEDTYPE ; Val: $00000006), (Expr: B_LLIFTEDKIND ; Val: $00000030), (Expr: B_LANG ; Val: $00000158), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000021), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004CA226), (Expr: E_OLDDIR ; Val: $0049B060), (Expr: E_EXMSGADDR ; Val: $004C5CD0), (Expr: E_PATHFINDADDR ; Val: $0047B97B), (Expr: E_SLEEPADDR ; Val: $005001EC), (Expr: E_DRAGADDR ; Val: $004CA5E0), (Expr: E_SYSMSGADDR ; Val: $004D4D10), (Expr: E_MACROADDR ; Val: $004B4B50), (Expr: E_SENDPACKET ; Val: $0042EFF0), (Expr: E_SENDLEN ; Val: $00635978), (Expr: E_SENDECX ; Val: $00CDE690), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000000), (Expr: F_EVPROPERTY ; Val: $00000000), (Expr: F_MACROMAP ; Val: $00000000), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar203 : array[0..60] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $0050A1C4), (Expr: C_CLIXRES ; Val: $0050CC3C), (Expr: C_ENEMYID ; Val: $00CC5358), (Expr: C_SHARDPOS ; Val: $00741CCC), (Expr: C_NEXTCPOS ; Val: $00B656E0), (Expr: C_SYSMSG ; Val: $00B66130), (Expr: C_CONTPOS ; Val: $00B6614C), (Expr: C_ENEMYHITS ; Val: $00D15B28), (Expr: C_LHANDID ; Val: $00CC044C), (Expr: C_CHARDIR ; Val: $00CC1FA8), (Expr: C_CURSORKIND ; Val: $00CC5184), (Expr: C_TARGETCURS ; Val: $00CC519C), (Expr: C_CLILEFT ; Val: $00CC51CC), (Expr: C_CHARPTR ; Val: $00CC535C), (Expr: C_LLIFTEDID ; Val: $00CC53A4), (Expr: C_JOURNALPTR ; Val: $00D16B88), (Expr: C_SKILLLOCK ; Val: $00D5874C), (Expr: C_SKILLSPOS ; Val: $00D58780), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $0000007C), (Expr: B_ITEMTYPE ; Val: $0000003C), (Expr: B_ITEMSTACK ; Val: $00000040), (Expr: B_STATNAME ; Val: $000000A4), (Expr: B_STATWEIGHT ; Val: $0000003A), (Expr: B_STATAR ; Val: $00000038), (Expr: B_CONTSIZEX ; Val: $00000020), (Expr: B_CONTX ; Val: $00000030), (Expr: B_CONTITEM ; Val: $00000038), (Expr: B_CONTNEXT ; Val: $00000040), (Expr: B_ENEMYHPVAL ; Val: $000000A4), (Expr: B_SHOPCURRENT ; Val: $000000AC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000BC), (Expr: B_SKILLDIST ; Val: $00000064), (Expr: B_SYSMSGSTR ; Val: $000000E0), (Expr: B_EVSKILLPAR ; Val: $000000B8), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $0000002C), (Expr: B_LANG ; Val: $00000158), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000021), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004E0BA7), (Expr: E_OLDDIR ; Val: $004E6281), (Expr: E_EXMSGADDR ; Val: $004842A0), (Expr: E_PATHFINDADDR ; Val: $0047677B), (Expr: E_SLEEPADDR ; Val: $004F1170), (Expr: E_DRAGADDR ; Val: $004884D0), (Expr: E_SYSMSGADDR ; Val: $004C4A70), (Expr: E_MACROADDR ; Val: $004735F0), (Expr: E_SENDPACKET ; Val: $004C2F70), (Expr: E_SENDLEN ; Val: $00D15AF0), (Expr: E_SENDECX ; Val: $00CC516C), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000000), (Expr: F_EVPROPERTY ; Val: $00000000), (Expr: F_MACROMAP ; Val: $00000000), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// SysVar200 : array[0..60] of TSysVar = ( /// VARIABLES ///////// (Expr: C_CLILOGGED ; Val: $005000FC), (Expr: C_CLIXRES ; Val: $0050284C), (Expr: C_ENEMYID ; Val: $00C88508), (Expr: C_SHARDPOS ; Val: $00705088), (Expr: C_NEXTCPOS ; Val: $00B28AA0), (Expr: C_SYSMSG ; Val: $00B294F0), (Expr: C_CONTPOS ; Val: $00B2950C), (Expr: C_ENEMYHITS ; Val: $00CD8CA8), (Expr: C_LHANDID ; Val: $00C837F4), (Expr: C_CHARDIR ; Val: $00C85330), (Expr: C_CURSORKIND ; Val: $00C88330), (Expr: C_TARGETCURS ; Val: $00C88348), (Expr: C_CLILEFT ; Val: $00C88378), (Expr: C_CHARPTR ; Val: $00C8850C), (Expr: C_LLIFTEDID ; Val: $00C88554), (Expr: C_JOURNALPTR ; Val: $00CD9D08), (Expr: C_SKILLLOCK ; Val: $00D1B8BC), (Expr: C_SKILLSPOS ; Val: $00D1B8F0), /// BASE CONSTANTS //// (Expr: B_TARGPROC ; Val: $00000010), (Expr: B_CHARSTATUS ; Val: $00000020), (Expr: B_ITEMID ; Val: $0000007C), (Expr: B_ITEMTYPE ; Val: $0000003C), (Expr: B_ITEMSTACK ; Val: $00000040), (Expr: B_STATNAME ; Val: $000000A4), (Expr: B_STATWEIGHT ; Val: $0000003A), (Expr: B_STATAR ; Val: $00000038), (Expr: B_CONTSIZEX ; Val: $00000020), (Expr: B_CONTX ; Val: $00000030), (Expr: B_CONTITEM ; Val: $00000038), (Expr: B_CONTNEXT ; Val: $00000040), (Expr: B_ENEMYHPVAL ; Val: $000000A4), (Expr: B_SHOPCURRENT ; Val: $000000AC), (Expr: B_SHOPNEXT ; Val: $00000044), (Expr: B_BILLFIRST ; Val: $000000BC), (Expr: B_SKILLDIST ; Val: $00000064), (Expr: B_SYSMSGSTR ; Val: $000000E0), (Expr: B_EVSKILLPAR ; Val: $000000B4), (Expr: B_LLIFTEDTYPE ; Val: $00000004), (Expr: B_LLIFTEDKIND ; Val: $0000002C), (Expr: B_LANG ; Val: $00000158), (Expr: B_FINDREP ; Val: $00000160), (Expr: B_SHOPPRICE ; Val: $0000002C), (Expr: B_GUMPPTR ; Val: $00000034), (Expr: B_ITEMSLOT ; Val: $00000021), (Expr: B_LTARGTILE ; Val: $00000028), (Expr: B_LTARGX ; Val: $00000020), /// EVENTS //////////// (Expr: E_REDIR ; Val: $004D7C57), (Expr: E_OLDDIR ; Val: $004DBEA6), (Expr: E_EXMSGADDR ; Val: $004800C0), (Expr: E_PATHFINDADDR ; Val: $0047458B), (Expr: E_SLEEPADDR ; Val: $004E7164), (Expr: E_DRAGADDR ; Val: $00484210), (Expr: E_SYSMSGADDR ; Val: $004BE5A0), (Expr: E_MACROADDR ; Val: $00471530), (Expr: E_SENDPACKET ; Val: $004BCD60), (Expr: E_SENDLEN ; Val: $00CD8C70), (Expr: E_SENDECX ; Val: $00C88330), /// FEATURES ////////// (Expr: F_EXTSTAT ; Val: $00000000), (Expr: F_EVPROPERTY ; Val: $00000000), (Expr: F_MACROMAP ; Val: $00000001), /// END /////////////// (Expr: LISTEND ; Val: $00000000) ); //////////////////////////////////////////////////////////////////////////////// ClientList : array[0..229] of TClientList = ( (Cli: '7.0.52.2'; List: @SysVar70520; ), (Cli: '7.0.52.0'; List: @SysVar70520; ), (Cli: '7.0.51.1'; List: @SysVar70511; ), (Cli: '7.0.50.0'; List: @SysVar704962; ), (Cli: '7.0.49.69'; List: @SysVar704962; ), (Cli: '7.0.49.62'; List: @SysVar704962; ), (Cli: '7.0.49.2'; List: @SysVar704762; ), (Cli: '7.0.49.0'; List: @SysVar704762; ), (Cli: '7.0.48.0'; List: @SysVar704762; ), (Cli: '7.0.47.62'; List: @SysVar704762; ), (Cli: '7.0.47.0'; List: @SysVar70470; ), (Cli: '7.0.46.24'; List: @SysVar704624; ), (Cli: '7.0.46.2'; List: @SysVar70460; ), (Cli: '7.0.46.0'; List: @SysVar70460; ), (Cli: '7.0.45.89'; List: @SysVar704589; ), (Cli: '7.0.45.77'; List: @SysVar704577; ), (Cli: '7.0.45.65'; List: @SysVar704565; ), (Cli: '7.0.45.0'; List: @SysVar704010; ), (Cli: '7.0.44.2'; List: @SysVar704010; ), (Cli: '7.0.43.1'; List: @SysVar704010; ), (Cli: '7.0.42.0'; List: @SysVar704010; ), (Cli: '7.0.41.1'; List: @SysVar704010; ), (Cli: '7.0.40.10'; List: @SysVar704010; ), (Cli: '7.0.40.1'; List: @SysVar70380; ), (Cli: '7.0.40.0'; List: @SysVar70380; ), (Cli: '7.0.39.0'; List: @SysVar70380; ), (Cli: '7.0.38.2'; List: @SysVar70380; ), (Cli: '7.0.38.1'; List: @SysVar70380; ), (Cli: '7.0.38.0'; List: @SysVar70380; ), (Cli: '7.0.37.0'; List: @SysVar703523; ), (Cli: '7.0.36.0'; List: @SysVar703523; ), (Cli: '7.0.35.23'; List: @SysVar703523; ), (Cli: '7.0.35.6'; List: @SysVar70353; ), (Cli: '7.0.35.3'; List: @SysVar70353; ), (Cli: '7.0.35.1'; List: @SysVar703423; ), (Cli: '7.0.35.0'; List: @SysVar703423; ), (Cli: '7.0.34.23'; List: @SysVar703423; ), (Cli: '7.0.34.15'; List: @SysVar703415; ), (Cli: '7.0.34.6'; List: @SysVar70346; ), (Cli: '7.0.34.2'; List: @SysVar70342; ), (Cli: '7.0.33.1'; List: @SysVar70331; ), (Cli: '7.0.32.11'; List: @SysVar703211; ), (Cli: '7.0.31.0'; List: @SysVar70310; ), (Cli: '7.0.30.3'; List: @SysVar70301; ), (Cli: '7.0.30.2'; List: @SysVar70301; ), (Cli: '7.0.30.1'; List: @SysVar70301; ), (Cli: '7.0.29.3'; List: @SysVar70292; ), (Cli: '7.0.29.2'; List: @SysVar70292; ), (Cli: '7.0.28.0'; List: @SysVar702766; ), (Cli: '7.0.27.66'; List: @SysVar702766; ), (Cli: '7.0.27.9'; List: @SysVar70279; ), (Cli: '7.0.27.8'; List: @SysVar70277; ), (Cli: '7.0.27.7'; List: @SysVar70277; ), (Cli: '7.0.27.5'; List: @SysVar70275; ), (Cli: '7.0.26.5'; List: @SysVar70264; ), (Cli: '7.0.26.4'; List: @SysVar70264; ), (Cli: '7.0.25.7'; List: @SysVar70256; ), (Cli: '7.0.25.6'; List: @SysVar70256; ), (Cli: '7.0.24.5'; List: @SysVar70243; ), (Cli: '7.0.24.3'; List: @SysVar70243; ), (Cli: '7.0.23.1'; List: @SysVar70220; ), (Cli: '7.0.23.0'; List: @SysVar70220; ), (Cli: '7.0.22.8'; List: @SysVar70220; ), (Cli: '7.0.22.0'; List: @SysVar70220; ), (Cli: '7.0.21.2'; List: @SysVar70212; ), (Cli: '7.0.21.1'; List: @SysVar70211; ), (Cli: '7.0.20.0'; List: @SysVar70200; ), (Cli: '7.0.19.1'; List: @SysVar70191; ), (Cli: '7.0.19.0'; List: @SysVar70190; ), (Cli: '7.0.18.0'; List: @SysVar70170; ), (Cli: '7.0.17.0'; List: @SysVar70170; ), (Cli: '7.0.16.3'; List: @SysVar70160; ), (Cli: '7.0.16.1'; List: @SysVar70160; ), (Cli: '7.0.16.0'; List: @SysVar70160; ), (Cli: '7.0.15.1'; List: @SysVar70144; ), (Cli: '7.0.14.4'; List: @SysVar70144; ), (Cli: '7.0.14.3'; List: @SysVar70143; ), (Cli: '7.0.14.2'; List: @SysVar70140; ), (Cli: '7.0.14.0'; List: @SysVar70140; ), (Cli: '7.0.13.4'; List: @SysVar70131; ), (Cli: '7.0.13.3'; List: @SysVar70131; ), (Cli: '7.0.13.2'; List: @SysVar70131; ), (Cli: '7.0.13.1'; List: @SysVar70131; ), (Cli: '7.0.13.0'; List: @SysVar70130; ), (Cli: '7.0.12.1'; List: @SysVar70120; ), (Cli: '7.0.12.0'; List: @SysVar70120; ), (Cli: '7.0.11.4'; List: @SysVar70112; ), (Cli: '7.0.11.3'; List: @SysVar70112; ), (Cli: '7.0.11.2'; List: @SysVar70112; ), (Cli: '7.0.11.1'; List: @SysVar70110; ), (Cli: '7.0.11.0'; List: @SysVar70110; ), (Cli: '7.0.10.3'; List: @SysVar70102; ), (Cli: '7.0.10.2'; List: @SysVar70102; ), (Cli: '7.0.10.1'; List: @SysVar70101; ), (Cli: '7.0.9.1'; List: @SysVar7090; ), (Cli: '7.0.9.0'; List: @SysVar7090; ), (Cli: '7.0.8.2'; List: @SysVar7082; ), (Cli: '7.0.8.1'; List: @SysVar7080; ), (Cli: '7.0.8.0'; List: @SysVar7080; ), (Cli: '7.0.7.3'; List: @SysVar7071; ), (Cli: '7.0.7.1'; List: @SysVar7071; ), (Cli: '7.0.7.0'; List: @SysVar7070; ), (Cli: '7.0.6.5'; List: @SysVar7064; ), (Cli: '7.0.6.4'; List: @SysVar7064; ), (Cli: '7.0.6.3'; List: @SysVar7063; ), (Cli: '7.0.5.0'; List: @SysVar7050; ), (Cli: '7.0.4.5'; List: @SysVar7045; ), (Cli: '7.0.4.4'; List: @SysVar7044; ), (Cli: '7.0.4.3'; List: @SysVar7043; ), (Cli: '7.0.4.2'; List: @SysVar7042; ), (Cli: '7.0.4.1'; List: @SysVar7041; ), (Cli: '7.0.4.0'; List: @SysVar7040; ), (Cli: '7.0.3.1'; List: @SysVar7030; ), (Cli: '7.0.3.0'; List: @SysVar7030; ), (Cli: '7.0.2.2'; List: @SysVar7021; ), (Cli: '7.0.2.1'; List: @SysVar7021; ), (Cli: '7.0.1.1'; List: @SysVar7011; ), (Cli: '7.0.0.4'; List: @SysVar7004; ), (Cli: '7.0.0.3'; List: @SysVar7003; ), (Cli: '7.0.0.2'; List: @SysVar7002; ), (Cli: '7.0.0.0'; List: @SysVar7000; ), (Cli: '6.0.14.3'; List: @SysVar60142; ), (Cli: '6.0.14.2'; List: @SysVar60142; ), (Cli: '6.0.14.1'; List: @SysVar60130; ), (Cli: '6.0.13.1'; List: @SysVar60130; ), (Cli: '6.0.13.0'; List: @SysVar60130; ), (Cli: '6.0.12.4'; List: @SysVar60124; ), (Cli: '6.0.12.3'; List: @SysVar60123; ), (Cli: '6.0.12.0'; List: @SysVar60120; ), (Cli: '6.0.11.0'; List: @SysVar60110; ), (Cli: '6.0.10.0'; List: @SysVar6080; ), (Cli: '6.0.9.2'; List: @SysVar6080; ), (Cli: '6.0.9.1'; List: @SysVar6080; ), (Cli: '6.0.9.0'; List: @SysVar6080; ), (Cli: '6.0.8.0'; List: @SysVar6080; ), (Cli: '6.0.7.0'; List: @SysVar6070; ), (Cli: '6.0.6.2'; List: @SysVar6062; ), (Cli: '6.0.6.1'; List: @SysVar6061; ), (Cli: '6.0.6.0'; List: @SysVar6060; ), (Cli: '6.0.5.0'; List: @SysVar6050; ), (Cli: '6.0.4.0'; List: @SysVar6040; ), (Cli: '6.0.3.1'; List: @SysVar6030; ), (Cli: '6.0.3.0'; List: @SysVar6030; ), (Cli: '6.0.2.2'; List: @SysVar6017; ), (Cli: '6.0.2.1'; List: @SysVar6017; ), (Cli: '6.0.2.0'; List: @SysVar6017; ), (Cli: '6.0.1.10'; List: @SysVar6017; ), (Cli: '6.0.1.9'; List: @SysVar6017; ), (Cli: '6.0.1.8'; List: @SysVar6017; ), (Cli: '6.0.1.7'; List: @SysVar6017; ), (Cli: '6.0.1.6'; List: @SysVar6015; ), (Cli: '6.0.1.5'; List: @SysVar6015; ), (Cli: '6.0.1.4'; List: @SysVar6013; ), (Cli: '6.0.1.3'; List: @SysVar6013; ), (Cli: '6.0.1.2'; List: @SysVar6012; ), (Cli: '6.0.1.1'; List: @SysVar6011; ), (Cli: '6.0.1.0'; List: @SysVar6011; ), (Cli: '6.0.0.0'; List: @SysVar6000; ), (Cli: '5.0.9.1'; List: @SysVar5091; ), (Cli: '5.0.9.0'; List: @SysVar5090; ), (Cli: '5.0.8.4'; List: @SysVar5081; ), (Cli: '5.0.8.3'; List: @SysVar5081; ), (Cli: '5.0.8.2'; List: @SysVar5081; ), (Cli: '5.0.8.1'; List: @SysVar5081; ), (Cli: '5.0.8.0'; List: @SysVar5072; ), (Cli: '5.0.7.2'; List: @SysVar5072; ), (Cli: '5.0.7.1'; List: @SysVar5071; ), (Cli: '5.0.7.0'; List: @SysVar5065; ), (Cli: '5.0.6.5'; List: @SysVar5065; ), (Cli: '5.0.6e'; List: @SysVar505c; ), (Cli: '5.0.6d'; List: @SysVar505c; ), (Cli: '5.0.6c'; List: @SysVar505c; ), (Cli: '5.0.6b'; List: @SysVar505c; ), (Cli: '5.0.6a'; List: @SysVar505c; ), (Cli: '5.0.5c'; List: @SysVar505c; ), (Cli: '5.0.5b'; List: @SysVar505a; ), (Cli: '5.0.5a'; List: @SysVar505a; ), (Cli: '5.0.4e'; List: @SysVar504e; ), (Cli: '5.0.4d'; List: @SysVar504d; ), (Cli: '5.0.4c'; List: @SysVar504b; ), (Cli: '5.0.4b'; List: @SysVar504b; ), (Cli: '5.0.4a'; List: @SysVar504a; ), (Cli: '5.0.3'; List: @SysVar503; ), (Cli: '5.0.2g'; List: @SysVar502f; ), (Cli: '5.0.2f'; List: @SysVar502f; ), (Cli: '5.0.2d'; List: @SysVar502c; ), (Cli: '5.0.2c'; List: @SysVar502c; ), (Cli: '5.0.2b'; List: @SysVar502b; ), (Cli: '5.0.2a'; List: @SysVar502a; ), (Cli: '5.0.2'; List: @SysVar502; ), (Cli: '5.0.1j'; List: @SysVar501j; ), (Cli: '5.0.1i'; List: @SysVar501i; ), (Cli: '5.0.1h'; List: @SysVar501f; ), (Cli: '5.0.1f'; List: @SysVar501f; ), (Cli: '5.0.1d'; List: @SysVar501d; ), (Cli: '5.0.1d1'; List: @SysVar501d1; ), (Cli: '5.0.1c'; List: @SysVar501a; ), (Cli: '5.0.1a'; List: @SysVar501a; ), (Cli: '5.0.1a1'; List: @SysVar501a1; ), (Cli: '5.0.0b'; List: @SysVar500b; ), (Cli: '5.0.0a'; List: @SysVar500a; ), (Cli: '4.0.11f'; List: @SysVar4011e; ), (Cli: '4.0.11e'; List: @SysVar4011e; ), (Cli: '4.0.11c'; List: @SysVar4011c; ), (Cli: '4.0.11b'; List: @SysVar4011b; ), (Cli: '4.0.11a'; List: @SysVar4011a; ), (Cli: '4.0.10b'; List: @SysVar4010b; ), (Cli: '4.0.10a'; List: @SysVar4010a; ), (Cli: '4.0.9b'; List: @SysVar409a; ), (Cli: '4.0.9a'; List: @SysVar409a; ), (Cli: '4.0.8a'; List: @SysVar407b; ), (Cli: '4.0.7b'; List: @SysVar407b; ), (Cli: '4.0.7a'; List: @SysVar407a; ), (Cli: '4.0.6a'; List: @SysVar406a; ), (Cli: '4.0.5b'; List: @SysVar405b; ), (Cli: '4.0.5a'; List: @SysVar405a; ), (Cli: '4.0.4t'; List: @SysVar404t; ), (Cli: '4.0.4b'; List: @SysVar404b; ), (Cli: '4.0.4a'; List: @SysVar404a; ), (Cli: '4.0.3e'; List: @SysVar403e; ), (Cli: '4.0.3d'; List: @SysVar403d; ), (Cli: '4.0.3c'; List: @SysVar403c; ), (Cli: '4.0.3b'; List: @SysVar403b; ), (Cli: '4.0.3a'; List: @SysVar403a; ), (Cli: '4.0.2a'; List: @SysVar402a; ), (Cli: '4.0.1b'; List: @SysVar401b; ), (Cli: '4.0.0c'; List: @SysVar400c; ), (Cli: '3.0.0c'; List: @SysVar300c; ), (Cli: '2.0.3'; List: @SysVar203; ), (Cli: '2.0.0'; List: @SysVar200; ) ); //////////////////////////////////////////////////////////////////////////////// constructor TCstDB.Create; begin inherited Create; Update(''); // initialize all variables with zeroes end; //////////////////////////////////////////////////////////////////////////////// function GetCst(Expr : TConstantNames; List : PSysVarList) : Cardinal; // get value from table var i : Integer; begin Result:=0; if List=nil then Exit; // The following could have been done faster using a sorted or hash based // list. Left as is since updating is only required when switching clients // and there are not that many entries to cause performance issues. i:=0; while List^[i].Expr<>LISTEND do begin if List^[i].Expr=Expr then begin Result:=List^[i].Val; Exit; end; Inc(i); end; end; //////////////////////////////////////////////////////////////////////////////// procedure TCstDB.Update(CliVer : AnsiString); // reads client-specific values from tables and loads them into object var i : Integer; List : PSysVarList; begin CliVer:=LowerCase(CliVer); List:=nil; // Find list that matches CliVer for i:=0 to High(ClientList) do if LowerCase(ClientList[i].Cli)=CliVer then begin List:=ClientList[i].List; Break; end; // The following could have been done faster using a sorted or hash based // list. Left as is since updating is only required when switching clients // and there are not that many entries to cause performance issues. /// VARIABLES ///////// BLOCKINFO:=GetCst(C_BLOCKINFO,List); CLILOGGED:=GetCst(C_CLILOGGED,List); CLIXRES:=GetCst(C_CLIXRES,List); ENEMYID:=GetCst(C_ENEMYID,List); SHARDPOS:=GetCst(C_SHARDPOS,List); NEXTCPOS:=GetCst(C_NEXTCPOS,List); SYSMSG:=GetCst(C_SYSMSG,List); CONTPOS:=GetCst(C_CONTPOS,List); ENEMYHITS:=GetCst(C_ENEMYHITS,List); LHANDID:=GetCst(C_LHANDID,List); CHARDIR:=GetCst(C_CHARDIR,List); TARGETCNT:=GetCst(C_TARGETCNT,List); CURSORKIND:=GetCst(C_CURSORKIND,List); TARGETCURS:=GetCst(C_TARGETCURS,List); CLILEFT:=GetCst(C_CLILEFT,List); CHARPTR:=GetCst(C_CHARPTR,List); LLIFTEDID:=GetCst(C_LLIFTEDID,List); LSHARD:=GetCst(C_LSHARD,List); POPUPID:=GetCst(C_POPUPID,List); JOURNALPTR:=GetCst(C_JOURNALPTR,List); SKILLCAPS:=GetCst(C_SKILLCAPS,List); SKILLLOCK:=GetCst(C_SKILLLOCK,List); SKILLSPOS:=GetCst(C_SKILLSPOS,List); /// BASE CONSTANTS //// BTARGPROC:=GetCst(B_TARGPROC,List); BCHARSTATUS:=GetCst(B_CHARSTATUS,List); BITEMID:=GetCst(B_ITEMID,List); BITEMTYPE:=GetCst(B_ITEMTYPE,List); BITEMSTACK:=GetCst(B_ITEMSTACK,List); BSTATNAME:=GetCst(B_STATNAME,List); BSTATWEIGHT:=GetCst(B_STATWEIGHT,List); BSTATAR:=GetCst(B_STATAR,List); BSTATML:=GetCst(B_STATML,List); BCONTSIZEX:=GetCst(B_CONTSIZEX,List); BCONTX:=GetCst(B_CONTX,List); BCONTITEM:=GetCst(B_CONTITEM,List); BCONTNEXT:=GetCst(B_CONTNEXT,List); BENEMYHPVAL:=GetCst(B_ENEMYHPVAL,List); BSHOPCURRENT:=GetCst(B_SHOPCURRENT,List); BSHOPNEXT:=GetCst(B_SHOPNEXT,List); BBILLFIRST:=GetCst(B_BILLFIRST,List); BSKILLDIST:=GetCst(B_SKILLDIST,List); BSYSMSGSTR:=GetCst(B_SYSMSGSTR,List); BEVSKILLPAR:=GetCst(B_EVSKILLPAR,List); BLLIFTEDTYPE:=GetCst(B_LLIFTEDTYPE,List); BLLIFTEDKIND:=GetCst(B_LLIFTEDKIND,List); BLANG:=GetCst(B_LANG,List); BTITHE:=GetCst(B_TITHE,List); BFINDREP:=GetCst(B_FINDREP,List); BSHOPPRICE:=GetCst(B_SHOPPRICE,List); BGUMPPTR:=GetCst(B_GUMPPTR,List); BITEMSLOT:=GetCst(B_ITEMSLOT,List); BPACKETVER:=GetCst(B_PACKETVER,List); BLTARGTILE:=GetCst(B_LTARGTILE,List); BLTARGX:=GetCst(B_LTARGX,List); BSTAT1:=GetCst(B_STAT1,List); /// EVENTS //////////// EREDIR:=GetCst(E_REDIR,List); EOLDDIR:=GetCst(E_OLDDIR,List); EEXMSGADDR:=GetCst(E_EXMSGADDR,List); EITEMPROPID:=GetCst(E_ITEMPROPID,List); EITEMNAMEADDR:=GetCst(E_ITEMNAMEADDR,List); EITEMPROPADDR:=GetCst(E_ITEMPROPADDR,List); EITEMCHECKADDR:=GetCst(E_ITEMCHECKADDR,List); EITEMREQADDR:=GetCst(E_ITEMREQADDR,List); EPATHFINDADDR:=GetCst(E_PATHFINDADDR,List); ESLEEPADDR:=GetCst(E_SLEEPADDR,List); EDRAGADDR:=GetCst(E_DRAGADDR,List); ESYSMSGADDR:=GetCst(E_SYSMSGADDR,List); EMACROADDR:=GetCst(E_MACROADDR,List); ESKILLLOCKADDR:=GetCst(E_SKILLLOCKADDR,List); ESENDPACKET:=GetCst(E_SENDPACKET,List); ESENDLEN:=GetCst(E_SENDLEN,List); ESENDECX:=GetCst(E_SENDECX,List); ECONTTOP:=GetCst(E_CONTTOP,List); ESTATBAR:=GetCst(E_STATBAR,List); /// FEATURES ////////// FEXTSTAT:=GetCst(F_EXTSTAT,List); FEVPROPERTY:=GetCst(F_EVPROPERTY,List); FMACROMAP:=GetCst(F_MACROMAP,List); FEXCHARSTATC:=GetCst(F_EXCHARSTATC,List); FPACKETVER:=GetCst(F_PACKETVER,List); FPATHFINDVER:=GetCst(F_PATHFINDVER,List); FFLAGS:=GetCst(F_FLAGS,List); end; //////////////////////////////////////////////////////////////////////////////// function GetSupportedCli : AnsiString; // assemble client list, space separated, also starts and ends with a space var i : Integer; begin Result:=' '; for i:=0 to High(ClientList) do Result:=Result+ClientList[i].Cli+' '; Result:=LowerCase(Result); end; //////////////////////////////////////////////////////////////////////////////// initialization SupportedCli:=GetSupportedCli; // assign to static variable end.
uses crt , SysUtils; { @Developer: Babichev Maxim @KSU, year: 2013 - 2014 @Program: MaxiBasic @Version: 0.5 } Const Shift = $100; DetermineTheTypesOf : packed array[1..4] of packed record Name : String[20]; Size : Byte; Arithmetic : boolean; end = ( (Name : 'INTEGER'; Size: 2; Arithmetic: TRUE), (Name : 'WORD'; Size: 2; Arithmetic: TRUE), (Name : 'BYTE'; Size: 1; Arithmetic: TRUE), (Name : 'CHAR'; Size: 1; Arithmetic: FALSE) ); Digits: set of Char = ['0'..'9']; Liters: set of Char = ['A'..'Z']; Dividers: set of Char = ['+', '-', '*', '/', ':', '.', ';', '=', '[', ']', '(', ')', '<', '>', '"']; Type TLexer = object procedure TWrite(Bt : byte); procedure TWrite(Bt1, Bt2 : byte); procedure TWrite(Bt1, Bt2, Bt3 : byte); procedure TWrite(Bt1, Bt2, Bt3, Bt4 : byte); procedure CheckForErrors(Code : Byte; Msg : String); procedure Prog; procedure Stmt; procedure Opers; procedure XPRS; procedure CompilationExpressions1; procedure CompilationExpressions2; procedure Vars; procedure OutInt; procedure ReadInt; procedure ToStack(Param : Word); procedure MakeCompare; function FromStack : Word; function NextWord : String; function InId(Name : String) : Word; end; var InpStr : packed array[0..4096] of Char; OutStr : packed array[0..4096] of Byte; InpF, OutF : File; OutPtr : Word = 0; Lexer : TLexer; InpSize, InpPtr : Word; VarTabl : packed record Field : packed array[0..1000] of packed record Name : String[20]; Tip : Byte; Size : Word; Adr : Word; end; FieldNum : Word; end; Address : Word = 0; Stack : packed array[0..65534] of Word; StackPtr : Word = 0; DataBase : Word = 0; TmpInt : Integer = 0; ReadAdr : Word = 0; StrNum : Word = 1; CurseWord : String = ''; procedure TLexer.MakeCompare; var First, Second : Char; begin XPRS; TWrite($50); if CurseWord[1] in ['<', '>', '='] then first := CurseWord[1]; CurseWord := NextWord; Second := ' '; if CurseWord[1] in ['<','>','='] then begin Second := CurseWord[1]; CurseWord := NextWord; end; XPRS; TWrite($5B); TWrite($93); TWrite($3B, $C3); Case First of '=':TWrite($74, $03); '>':Case Second of ' ':TWrite($7F, $03); '=':TWrite($7D, $03); end; '<':case Second of ' ':TWrite($7C, $03); '=':TWrite($7E, $03); '>':TWrite($75, $03); end; end; end; procedure TLexer.Prog; var retpoint : Word; begin CurseWord := NextWord; if CurseWord = 'DEFINE' then begin Vars; DataBase := $FFFE - Address; TWrite($BC, Lo(DataBase), Hi(DataBase)); TWrite($E9, $00, $00); retpoint := OutPtr; OutInt; ReadAdr := OutPtr; ReadInt; OutStr[retpoint - 2] := Lo(OutPtr - RetPoint); OutStr[retpoint - 1] := Hi(OutPtr - RetPoint); if CurseWord = 'BEGIN' then begin Stmt; if CurseWord <> 'END' then CheckForErrors(3, 'end'); if NextWord <> '.' then CheckForErrors(3, '.'); end else CheckForErrors(3, ' begin'); end else CheckForErrors(3, ' define'); TWrite($90); TWrite($B8, $00, $4C); TWrite($CD, $21); end; procedure TLexer.Stmt; begin CurseWord := NextWord; While CurseWord <> 'END' do OPERS; end; procedure TLexer.Opers; var NewName : String; Tmp,NewNum : Word; StrBeg : Word; IfPtr, ElsePtr, WhilePtr1, WhilePtr2 : Word; ToEnd, ToBegin : Word; begin if CurseWord = 'PRINTI' then begin CurseWord := NextWord; XPRS; TWrite($B6, $01); TmpInt := -(OutPtr - 3); TWrite($E8, Lo(TmpInt), Hi(TmpInt)); end else if CurseWord = 'PRINTW' then begin CurseWord := NextWord; XPRS; TWrite($B6, $00); TmpInt := -(OutPtr - 3); TWrite($E8, Lo(TmpInt), Hi(TmpInt)); end else if CurseWord = 'PRINTS' then begin If NextWord <> '(' then CheckForErrors(2, '('); If NextWord <> '"' then CheckForErrors(2,'"'); Inc(OutPtr,2); StrBeg := OutPtr; while InpStr[InpPtr] <> '"' do begin TWrite(Ord(InpStr[InpPtr])); Inc(InpPtr) end; inc(InpPtr); CurseWord := NextWord; if CurseWord = 'L' then begin CurseWord := NextWord; TWrite(13, 10); end; TWrite(Ord('$')); if CurseWord <> ')' then CheckForErrors(2, ')'); OutStr[StrBeg - 2] := $EB; OutStr[StrBeg - 1]:= OutPtr - StrBeg; TWrite($BA, Lo(StrBeg + shift), Hi(StrBeg + shift)); TWrite($B8, $00, $09); TWrite($CD, $21); CurseWord := NextWord; end else if CurseWord = 'BEGIN' then begin CurseWord := NextWord; while CurseWord <> 'END' do Opers; CurseWord := NextWord; end else if CurseWord = 'IF' then begin CurseWord := NextWord; MakeCompare; TWrite($E9, 0, 0); IfPtr := OutPtr; If CurseWord <> 'THEN' then CheckForErrors(3, 'then'); CurseWord := NextWord; Opers; if CurseWord = 'ELSE' then begin TWrite($E9, 0, 0); ElsePtr := OutPtr; end else ElsePtr := 0; OutStr[IfPtr - 2] := Lo(OutPtr - IfPtr); OutStr[IfPtr - 1] := Hi(OutPtr - IfPtr); if ElsePtr <> 0 then begin CurseWord := NextWord; Opers; OutStr[ElsePtr - 2] := Lo(OutPtr - ElsePtr); OutStr[ElsePtr - 1] := Hi(OutPtr - ElsePtr); end; end else if CurseWord = 'WHILE' then begin CurseWord := NextWord; WhilePtr1 := OutPtr; MakeCompare; TWrite($E9, 0, 0); WhilePtr2 := OutPtr; If CurseWord <> 'DO' then CheckForErrors(3,'do'); CurseWord := NextWord; Opers; TmpInt := -(OutPtr - WhilePtr1 + 3); TWrite($E9, Lo(TmpInt), Hi(TmpInt)); OutStr[WhilePtr2 - 2] := Lo(OutPtr - WhilePtr2); OutStr[WhilePtr2 - 1] := Hi(OutPtr - WhilePtr2); end else if CurseWord = 'FOR' then begin CurseWord := NextWord; NewName := CurseWord; NewNum := InId(CurseWord); if NewNum = 0 then CheckForErrors(8, CurseWord); if VarTabl.Field[NewNum].Tip <> 1 then CheckForErrors(9, 'integer'); if NextWord <> '=' then CheckForErrors(2, '='); CurseWord := NextWord; XPRS; Tmp := VarTabl.Field[NewNum].Adr; TWrite($A3, Lo(DataBase + Tmp), Hi(DataBase + Tmp)); if CurseWord <> 'TO' then CheckForErrors(3,'to'); ToBegin := OutPtr; CurseWord := NextWord; XPRS; TWrite($3B, $06, Lo(DataBase + Tmp), Hi(DataBase + Tmp)); TWrite($7D, $03); TWrite($E9,0,0); ToEnd := OutPtr; if CurseWord <> 'DO' then CheckForErrors(3,'do'); CurseWord := NextWord; Opers; TWrite($FF, $06, Lo(DataBase + Tmp), Hi(DataBase + Tmp)); TmpInt := -(OutPtr - ToBegin + 3); TWrite($E9, Lo(TmpInt), Hi(TmpInt)); OutStr[ToEnd - 2] := Lo(OutPtr - ToEnd); OutStr[ToEnd - 1] := Hi(OutPtr - ToEnd); end else if InId(CurseWord) <> 0 then begin NewName := CurseWord; with DetermineTheTypesOf[VarTabl.Field[InId(NewName)].Tip] do begin CurseWord := NextWord; if CurseWord = '[' then begin CurseWord := NextWord; XPRS; TWrite($2D, $01, $00); if Size = 2 then TWrite($D1, $E0); if CurseWord <> ']' then CheckForErrors(2, ']'); CurseWord := NextWord; end else TWrite($2B, $C0); if CurseWord <> '=' then CheckForErrors(2, '='); CurseWord := NextWord; TWrite($50); if not Arithmetic then if CurseWord <> '"' then CheckForErrors(2, '"'); XPRS; TWrite($5B); Tmp := VarTabl.Field[InId(NewName)].Adr; if Size = 1 then TWrite($88, $87, Lo(DataBase + Tmp), Hi(DataBase + Tmp)) else TWrite($89, $87, Lo(DataBase + Tmp), Hi(DataBase + Tmp)); end; end else CheckForErrors(7, CurseWord); end; procedure TLexer.XPRS; begin CompilationExpressions2; while CurseWord[1] in ['+', '-'] do begin TWrite($50); if not (CurseWord[1] in ['+','-']) then CheckForErrors(2,'"+" или "-"'); ToStack(Ord(CurseWord[1])); CurseWord := NextWord; CompilationExpressions2; TWrite($5B); case Chr(Lo(FromStack)) of '+': TWrite($03,$C3); '-': TWrite($93,$2B,$C3); end; end; end; procedure TLexer.CompilationExpressions1; var Code, I, TmpInt : Integer; Tmp : Word; NewName : String; begin if CurseWord = 'CON' then begin TmpInt := -(OutPtr - ReadAdr + 3); TWrite($E8, Lo(TmpInt), Hi(TmpInt)); CurseWord := NextWord; end else if CurseWord[1] = '"' then begin CurseWord := NextWord; TWrite($2A, $E4, $B0, Ord(InpStr[InpPtr - 1])); if CurseWord <> '"' then CheckForErrors(2, '"'); CurseWord := NextWord; end else if (CurseWord[1] in ['0'..'9']) then begin Val(CurseWord, I, Code); if Code <> 0 then CheckForErrors(6, 'числа'); TWrite($B8, Lo(I), Hi(I)); CurseWord := NextWord; end else if CurseWord = '(' then begin CurseWord := NextWord; XPRS; if CurseWord <> ')' then CheckForErrors(2, ')'); CurseWord := NextWord; end else if InId(CurseWord) <> 0 then begin NewName := CurseWord; CurseWord := NextWord; if CurseWord = '[' then begin TWrite($50); CurseWord := NextWord; XPRS; TWrite($2D, $01, $00); if DetermineTheTypesOf[VarTabl.Field[InId(NewName)].Tip].Size = 2 then TWrite($D1,$E0); TWrite($8B,$D8); TWrite($58); if CurseWord <> ']' then CheckForErrors(2, ']'); CurseWord:=NextWord; end else TWrite($2B,$DB); Tmp:=VarTabl.Field[InId(NewName)].Adr; if DetermineTheTypesOf[VarTabl.Field[InId(NewName)].Tip].Size = 1 then begin TWrite($8A, $87, Lo(DataBase + Tmp), Hi(DataBase + Tmp)); TWrite($B4, $00); end else TWrite($8B, $87, Lo(DataBase + Tmp), Hi(DataBase + Tmp)); end else CheckForErrors(8, CurseWord); end; function TLexer.InId(Name : String) : Word; var i : Word; begin InId:=0; for i := 1 to VarTabl.FieldNum do if VarTabl.Field[i].Name = Name then InId := i; end; function TLexer.NextWord : String; var tmp:string = ''; begin while (InpStr[InpPtr] in [#10, #13, ' ', '}', '{']) do begin while (InpStr[InpPtr] in [#10, #13, ' ', '}']) do begin if InpStr[InpPtr] = #10 then Inc(StrNum); inc (InpPtr); end; if InpStr[InpPtr]='{' then while InpStr[InpPtr] <> '}' do begin if InpStr[InpPtr] = #10 then Inc(StrNum); inc(InpPtr); end; end; if InpStr[InpPtr] in Digits then while InpStr[InpPtr] in Digits do begin tmp += InpStr[InpPtr]; inc(InpPtr); end else if (InpStr[InpPtr] in Dividers) then begin tmp := InpStr[InpPtr]; inc(InpPtr); end else if UpCase(InpStr[InpPtr]) in Liters then while UpCase(InpStr[InpPtr]) in Digits + Liters do begin tmp += UpCase(InpStr[InpPtr]); inc(InpPtr); end else CheckForErrors(10, InpStr[InpPtr]); NextWord := tmp; end; procedure TLexer.CompilationExpressions2; begin CompilationExpressions1; While CurseWord[1] in ['*', '/'] do begin TWrite($50); if not (CurseWord[1] in ['*', '/']) then CheckForErrors(2, '"*" или "/"'); ToStack(ord(CurseWord[1])); CompilationExpressions1; TWrite($5B); case chr(Lo(FromStack)) of '*' : TWrite($F7,$E3); '/' : TWrite($93,$F6,$F3); end; end; end; procedure TLexer.ToStack(Param : Word); begin Stack[StackPtr] := Param; Inc(StackPtr); end; function TLexer.FromStack : Word; begin Dec(StackPtr); FromStack := Stack[StackPtr]; end; procedure TLexer.TWrite(Bt : byte); begin OutStr[OutPtr] := Bt; Inc(OutPtr); end; procedure TLexer.TWrite(Bt1, Bt2 : byte); begin OutStr[OutPtr] := Bt1; OutStr[OutPtr + 1] := Bt2; Inc(OutPtr, 2); end; procedure TLexer.TWrite(Bt1, Bt2, Bt3 : byte); begin OutStr[OutPtr] := Bt1; OutStr[OutPtr + 1] := Bt2; OutStr[OutPtr + 2] := Bt3; Inc(OutPtr, 3); end; procedure TLexer.TWrite(Bt1, Bt2, Bt3, Bt4:byte); begin OutStr[OutPtr] := Bt1; OutStr[OutPtr + 1]:=Bt2; OutStr[OutPtr + 2] := Bt3; OutStr[OutPtr + 3] := Bt4; Inc(OutPtr, 4); end; procedure TLexer.ReadInt; var BufAdr : Word; begin TWrite($EB, $0A); BufAdr := OutPtr + shift; TWrite($07, $2E, $2E); TWrite($2E, $2E, $2E, $2E); TWrite($2E, $2E, $90); TWrite($BA, Lo(BufAdr), Hi(BufAdr)); TWrite($B0, $0A); TWrite($B4, $0C); TWrite($CD, $21); TWrite($B8, 0, 0); TWrite($B9, $0A, $00); TWrite($BB, $02, $00); TWrite($8A, $97, Lo(BufAdr), Hi(BufAdr)); TWrite($80, $FA, $2D); TWrite($75, $01); TWrite($43); TWrite($80, $BF, Lo(BufAdr), Hi(BufAdr)); TWrite($0D); TWrite($74, $10); TWrite($F7, $E1); TWrite($8A, $97, Lo(BufAdr), Hi(BufAdr)); TWrite($80, $F2, $30); TWrite($B6, $00); TWrite($03, $C2); TWrite($43); TWrite($EB, $E9); TWrite($80, $3E, Lo(BufAdr + 2), Hi(BufAdr + 2)); TWrite($2D); TWrite($75, $02); TWrite($F7, $D8); TWrite($C3); end; procedure TLexer.OutInt; begin TWrite($50); TWrite($BF, $41, $01); TWrite($B9, $06, $00); TWrite($B0, $20); TWrite($F3, $AA); TWrite($58); TWrite($BF, $46, $01); TWrite($B9, $0A, $00); TWrite($B3, $20); TWrite($80, $FE, $00); TWrite($74, $09); TWrite($3D, $00, $00); TWrite($79, $04); TWrite($B3, $2D); TWrite($F7, $D8); TWrite($BA, $00, $00); TWrite($F7, $F1); TWrite($80, $CA, $30); TWrite($88, $15); TWrite($4F); TWrite($3C, $00); TWrite($75, $F1); TWrite($88, $1D); TWrite($BA, $41, $01); TWrite($B4, $09); TWrite($CD, $21); TWrite($C3); TWrite($2B, $2B, $2B); TWrite($2B, $2B, $2B, $24); TWrite($00); end; procedure TLexer.Vars; var I : Integer; NewName : String; NewNum : Byte; Code, NewSize : Integer; begin CurseWord := NextWord; if InId(CurseWord) <> 0 then CheckForErrors(1, CurseWord) else begin NewName := CurseWord; if NextWord <> ':' then CheckForErrors(2, ':'); CurseWord := NextWord; NewNum := 0; for i:=1 to 4 do if CurseWord = DetermineTheTypesOf[i].Name then NewNum := i; if NewNum = 0 then CheckForErrors(4, 'тип'); CurseWord := NextWord; if CurseWord <> ';' then if CurseWord <> '[' then CheckForErrors(2, '[') else begin CurseWord := NextWord; Val(CurseWord, NewSize, Code); if (Code <> 0) or (NewSize < 1) then CheckForErrors(5, 'натуральное число'); If NextWord <> ']' then CheckForErrors(2, ']'); If NextWord <> ';' then CheckForErrors(2, ';'); end else NewSize := 1; with VarTabl do begin Inc(FieldNum); Field[FieldNum].Name := NewName; Field[FieldNum].Tip := NewNum; Field[FieldNum].Size := NewSize; Field[FieldNum].Adr := Address; Inc(Address, Field[FieldNum].Size * DetermineTheTypesOf[Field[FieldNum].Tip].Size); end; end; CurseWord := NextWord; if CurseWord = 'DEFINE' then Vars; end; procedure TLexer.CheckForErrors(Code : Byte; Msg : String); begin Case Code Of 1: Write('[1] Повторное определение переменной ', Msg); 2: Write('[2] Ожидается символ "', Msg, '"'); 3: Write('[3] Ожидается слово ', Msg); 4: Write('[4] Неправильно указан ', Msg); 5: Write('[5] Ожидается ', Msg); 6: Write('[6] Неверный формат ', Msg); 7: Write('[7] Неверный тип операнда'); 8: Write('[8] Неизвестный идентификатор ', Msg); 9: Write('[9] Ожидается переменная типа ', Msg); 10: Write('[10] Неизвестный символ: "', Msg, '"'); end; WriteLn(', ( cтрока: ', StrNum, ' )'); WriteLn('последнее считанное слово: ', CurseWord); Halt(1); end; begin writeln('--------------------------------------'); writeln(' @Author: Babichev Maxim (REZ1DENT3)'); writeln(' @Compiler: MaxiBasic, version: 0.5'); writeln('--------------------------------------'); if ParamCount < 1 then begin WriteLn('[fne] Передайте файл компилятору'); Halt(1); end; if (not FileExists(ParamStr(1))) then begin WriteLn('[fn] Файла не существует'); Halt(1); end; VarTabl.FieldNum := 0; Assign(InpF, ParamStr(1)); Reset(InpF, 1); BlockRead(InpF, InpStr, SizeOf(InpStr), InpSize); Close(InpF); Lexer.Prog; writeln('[c] Компиляция успешно завершена'); Assign(OutF, copy(ParamStr(1), 0, pos('.', ParamStr(1)) - 1) + '.com'); Rewrite(OutF, 1); BlockWrite(OutF, OutStr, OutPtr); Close(OutF); end.
unit FC.StockChart.UnitTask.Bars.StatisticsDialog; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Contnrs, Dialogs, BaseUtils,SystemService, ufmDialogClose_B, ufmDialog_B, ActnList, StdCtrls, ExtendControls, ExtCtrls, Spin, StockChart.Definitions,StockChart.Definitions.Units, FC.Definitions, DB, Grids, DBGrids, MultiSelectDBGrid, ColumnSortDBGrid, EditDBGrid, MemoryDS, ComCtrls, TeEngine, Series, TeeProcs, Chart, FC.StockChart.CustomDialog_B, ImgList, JvCaptionButton, JvComponentBase, JvDockControlForm; type TfmBarsStatisticsDialog = class(TfmStockChartCustomDialog_B) taReport: TMemoryDataSet; DataSource1: TDataSource; pbProgress: TProgressBar; taReportTime: TTimeField; taReportOC: TFloatField; taReportHL: TFloatField; pcPages: TPageControl; tsIntradays: TTabSheet; tsMonthVolatility: TTabSheet; Label1: TLabel; grReport: TEditDBGrid; Label2: TLabel; grWeekdayStatistics: TEditDBGrid; DataSource2: TDataSource; taWeekdayStatistics: TMemoryDataSet; taWeekdayStatisticsOC: TFloatField; taWeekdayStatisticsHL: TFloatField; taWeekdayStatisticsWeekday: TStringField; chIntraday: TChart; chIntradayOC: TBarSeries; chIntradayHL: TBarSeries; Label3: TLabel; cbBars: TExtendComboBox; chMonthVolatility: TChart; laHelp: TTipPanel; chMonthVolatilityOC: TBarSeries; chMonthVolatilityHL: TBarSeries; tsAllPeaks: TTabSheet; Panel1: TPanel; Label4: TLabel; Label5: TLabel; edOC: TExtendSpinEdit; ckOC: TExtendCheckBox; ckHL: TExtendCheckBox; edHL: TExtendSpinEdit; buOR: TRadioButton; buAND: TRadioButton; chAllPeaks: TChart; chAllPeaksHL: TBarSeries; chAllPeaksOC: TBarSeries; ckAllPeaksShowMarks: TExtendCheckBox; Bevel1: TBevel; procedure ckAllPeaksShowMarksClick(Sender: TObject); procedure edOCChange(Sender: TObject); procedure ckHLClick(Sender: TObject); procedure cbBarsChange(Sender: TObject); procedure pcPagesChange(Sender: TObject); procedure grReportChangeRecord(Sender: TObject); private FCalculating : integer; FIndicator: ISCIndicatorBars; procedure CalculateIntradays; procedure CaclulateMonthVolatility; procedure CalculateWeekDayStatistics(const aFrom,aTo: TTime); procedure CalculateAllPeaks; public class procedure Run(const aIndicator: ISCIndicatorBars; const aStockChart: IStockChart); constructor Create(const aStockChart: IStockChart); override; destructor Destroy; override; end; implementation uses Math,DateUtils,Application.Definitions; type TDirection = (dNone,dUp,dDown); {$R *.dfm} { TfmCalculateWidthDialog } procedure TfmBarsStatisticsDialog.CaclulateMonthVolatility; var aInterval: integer; i: integer; begin aInterval:=StockChart.StockSymbol.GetTimeIntervalValue; cbBars.Clear; for i := 0 to (1440 div aInterval)-1 do cbBars.AddItem(TimeToStr(i*aInterval/MinsPerDay),TObject(i)); end; procedure TfmBarsStatisticsDialog.CalculateAllPeaks; var i: integer; aInputData: ISCInputDataCollection; aHL,aOC:integer; aHLMax,aOCMax: integer; aHLR,aOCR: boolean; aIsPeak:boolean; begin TWaitCursor.SetUntilIdle; aInputData:=FIndicator.GetInputData; chAllPeaks.AutoRepaint:=false; try chAllPeaksHL.Clear; chAllPeaksOC.Clear; aHLMax:=edHL.Value; aOCMax:=edOC.Value; if not ckHL.Checked then aHLMax:=MaxInt; if not ckOC.Checked then aOCMax:=MaxInt; for i:=FIndicator.GetFirstValidValueIndex to aInputData.Count-1 do begin aHL:=aInputData.PriceToPoint(abs(aInputData.DirectGetItem_DataHigh(i)-aInputData.DirectGetItem_DataLow(i))); aOC:=aInputData.PriceToPoint(abs(aInputData.DirectGetItem_DataOpen(i)-aInputData.DirectGetItem_DataClose(i))); aIsPeak:=false; aHLR:=aHL>aHLMax; aOCR:=aOC>aOCMax; if ckHL.Checked and ckOC.Checked then begin if buAND.Checked then aIsPeak:=aHLR and aOCR else aIsPeak:=aHLR or aOCR; end else if ckHL.Checked then aIsPeak:=aHLR else if ckOC.Checked then aIsPeak:=aOCR; if aIsPeak then begin chAllPeaksHL.AddXY(aInputData.DirectGetItem_DataDateTime(i),aHL); chAllPeaksOC.AddXY(aInputData.DirectGetItem_DataDateTime(i),aOC); end; end; finally chAllPeaks.AutoRepaint:=true; chAllPeaks.Repaint; ckAllPeaksShowMarksClick(nil); end; end; procedure TfmBarsStatisticsDialog.CalculateIntradays; var i,j: Integer; aInputData: ISCInputDataCollection; aIntradayStatisticsOC: array of TSCRealNumber; aIntradayStatisticsHL: array of TSCRealNumber; aIntradayStatisticsCNT: array of TSCRealNumber; aInterval: integer; begin TWaitCursor.SetUntilIdle; aInputData:=FIndicator.GetInputData; aInterval:=StockChart.StockSymbol.GetTimeIntervalValue; SetLength(aIntradayStatisticsOC,1440 div aInterval); SetLength(aIntradayStatisticsHL,1440 div aInterval); SetLength(aIntradayStatisticsCNT,1440 div aInterval); for i:=FIndicator.GetFirstValidValueIndex to aInputData.Count-1 do begin j:=MinuteOfTheDay(aInputData.DirectGetItem_DataDateTime(i)); j:=j div aInterval; aIntradayStatisticsOC[j]:=aIntradayStatisticsOC[j]+ Abs(aInputData.DirectGetItem_DataClose(i)-aInputData.DirectGetItem_DataOpen(i)); aIntradayStatisticsHL[j]:=aIntradayStatisticsHL[j]+ Abs(aInputData.DirectGetItem_DataHigh(i)-aInputData.DirectGetItem_DataLow(i)); aIntradayStatisticsCNT[j]:=aIntradayStatisticsCNT[j]+1; end; inc(FCalculating); try taReport.DisableControls; taReport.EmptyTable; taReport.Open; chIntradayOC.Clear; chIntradayHL.Clear; for I := 0 to High(aIntradayStatisticsOC) do begin taReport.Append; taReportTime.Value:=i*aInterval/MinsPerDay; if aIntradayStatisticsCNT[i]<>0 then begin taReportOC.Value:=RoundTo(aInputData.PriceToPoint(aIntradayStatisticsOC[i])/aIntradayStatisticsCNT[i],-2); taReportHL.Value:=RoundTo(aInputData.PriceToPoint(aIntradayStatisticsHL[i])/aIntradayStatisticsCNT[i],-2); chIntradayOC.AddXY(taReportTime.Value,taReportOC.Value); chIntradayHL.AddXY(taReportTime.Value,taReportHL.Value); end else begin chIntradayOC.AddXY(taReportTime.Value,0); chIntradayHL.AddXY(taReportTime.Value,0); end; taReport.Post; end; taReport.First; finally dec(FCalculating); taReport.EnableControls; end; inc(FCalculating); try grReport.RefreshSort; finally dec(FCalculating); end; grReportChangeRecord(nil); end; procedure TfmBarsStatisticsDialog.CalculateWeekDayStatistics(const aFrom, aTo: TTime); var i,j: Integer; aInputData: ISCInputDataCollection; aWeekdayStatisticsOC: array [1..7] of TSCRealNumber; aWeekdayStatisticsHL: array [1..7] of TSCRealNumber; aWeekdayStatisticsCNT: array [1..7] of integer; aDT: TDateTime; begin TWaitCursor.SetUntilIdle; aInputData:=FIndicator.GetInputData; ZeroMemory(@aWeekdayStatisticsOC[1],7*SizeOf(TSCRealNumber)); ZeroMemory(@aWeekdayStatisticsHL[1],7*SizeOf(TSCRealNumber)); ZeroMemory(@aWeekdayStatisticsCNT[1],7*SizeOf(integer)); for i:=FIndicator.GetFirstValidValueIndex to aInputData.Count-1 do begin aDT:=aInputData.DirectGetItem_DataDateTime(i); if (CompareDateTime(Frac(aDT),aFrom)>=0) and (CompareDateTime(Frac(aDT),aTo)<=0) then begin j:=DayOfTheWeek(aDT); aWeekdayStatisticsOC[j]:=aWeekdayStatisticsOC[j]+ Abs(aInputData.DirectGetItem_DataClose(i)-aInputData.DirectGetItem_DataOpen(i)); aWeekdayStatisticsHL[j]:=aWeekdayStatisticsHL[j]+ Abs(aInputData.DirectGetItem_DataHigh(i)-aInputData.DirectGetItem_DataLow(i)); aWeekdayStatisticsCNT[j]:=aWeekdayStatisticsCNT[j]+1; end; end; inc(FCalculating); try taWeekdayStatistics.EmptyTable; taWeekdayStatistics.Open; for I := 1 to 7 do begin taWeekdayStatistics.Append; taWeekdayStatisticsWeekday.Value:=WeekdaysLong[i]; if aWeekdayStatisticsCNT[i]<>0 then begin taWeekdayStatisticsOC.Value:=RoundTo(aInputData.PriceToPoint(aWeekdayStatisticsOC[i])/aWeekdayStatisticsCNT[i],-2); taWeekdayStatisticsHL.Value:=RoundTo(aInputData.PriceToPoint(aWeekdayStatisticsHL[i])/aWeekdayStatisticsCNT[i],-2); end; taWeekdayStatistics.Post; end; finally dec(FCalculating); end; grWeekdayStatistics.RefreshSort; end; procedure TfmBarsStatisticsDialog.cbBarsChange(Sender: TObject); var i: Integer; aInputData: ISCInputDataCollection; aMinute: integer; aCount:integer; aOC,aHL: TSCRealNumber; aCurrentMonth: integer; aCurrentYear: integer; begin TWaitCursor.SetUntilIdle; chMonthVolatilityOC.Clear; chMonthVolatilityHL.Clear; if cbBars.ItemIndex<>-1 then begin aMinute:=integer(cbBars.Items.Objects[cbBars.ItemIndex])*StockChart.StockSymbol.GetTimeIntervalValue; aInputData:=FIndicator.GetInputData; aOC:=0; aHL:=0; aCount:=0; aCurrentMonth:=-1; aCurrentYear:=-1; chMonthVolatility.AutoRepaint:=false; try for i:=FIndicator.GetFirstValidValueIndex to aInputData.Count-1 do begin if (aCurrentMonth<>MonthOf(aInputData.DirectGetItem_DataDateTime(i))) or (aCurrentYear<>YearOf(aInputData.DirectGetItem_DataDateTime(i))) or (i=aInputData.Count-1) then begin if aCurrentMonth<>-1 then begin if aCount=0 then begin chIntradayOC.AddXY(EncodeDate(aCurrentYear,aCurrentMonth,1),0); chIntradayHL.AddXY(EncodeDate(aCurrentYear,aCurrentMonth,1),0); end else begin chMonthVolatilityOC.AddXY(EncodeDate(aCurrentYear,aCurrentMonth,1),aInputData.PriceToPoint(aOC/aCount)); chMonthVolatilityHL.AddXY(EncodeDate(aCurrentYear,aCurrentMonth,1),aInputData.PriceToPoint(aHL/aCount)); end; end; aCurrentMonth:=MonthOf(aInputData.DirectGetItem_DataDateTime(i)); aCurrentYear:=YearOf(aInputData.DirectGetItem_DataDateTime(i)); aOC:=0; aHL:=0; aCount:=0; end; if MinuteOfTheDay(aInputData.DirectGetItem_DataDateTime(i))=aMinute then begin aOC:=aOC+Abs(aInputData.DirectGetItem_DataClose(i)-aInputData.DirectGetItem_DataOpen(i)); aHL:=aHL+Abs(aInputData.DirectGetItem_DataHigh(i)-aInputData.DirectGetItem_DataLow(i)); inc(aCount); end; end; finally chMonthVolatility.AutoRepaint:=true; chMonthVolatility.Repaint; end; end; end; procedure TfmBarsStatisticsDialog.ckAllPeaksShowMarksClick(Sender: TObject); begin inherited; chAllPeaksHL.Marks.Visible:=ckAllPeaksShowMarks.Checked; end; procedure TfmBarsStatisticsDialog.ckHLClick(Sender: TObject); begin edOC.Enabled:=ckOC.Checked; edHL.Enabled:=ckHL.Checked; buAND.Enabled:=edOC.Enabled and edHL.Enabled; buOR.Enabled:=edOC.Enabled and edHL.Enabled; edOCChange(nil); end; constructor TfmBarsStatisticsDialog.Create(const aStockChart: IStockChart); begin inherited; edHL.Value:=Workspace.Storage(self).ReadInteger(edHL,'Value',20); edOC.Value:=Workspace.Storage(self).ReadInteger(edOC,'Value',10); RegisterPersistValue(buAND,true); buOR.Checked:=not buAND.Checked; RegisterPersistValue(ckOC,true); RegisterPersistValue(ckHL,true); RegisterPersistValue(ckAllPeaksShowMarks,false); pcPages.ActivePageIndex:=0; pcPagesChange(nil); end; destructor TfmBarsStatisticsDialog.Destroy; begin Workspace.Storage(self).WriteInteger(edHL,'Value',edHL.Value); Workspace.Storage(self).WriteInteger(edOC,'Value',edOC.Value); inherited; end; procedure TfmBarsStatisticsDialog.edOCChange(Sender: TObject); begin inherited; if Visible then CalculateAllPeaks; end; procedure TfmBarsStatisticsDialog.grReportChangeRecord(Sender: TObject); begin if FCalculating>0 then exit; CalculateWeekDayStatistics( taReportTime.Value, taReportTime.Value+(StockChart.StockSymbol.GetTimeIntervalValue/MinsPerDay)-1/SecsPerDay); end; procedure TfmBarsStatisticsDialog.pcPagesChange(Sender: TObject); begin inherited; if not Visible then exit; if pcPages.ActivePage=tsIntradays then begin laHelp.Caption:='This page shows bar''s intraday volatility and it''s dependency from the day of the week'; if (pcPages.ActivePage.Tag=0) then CalculateIntradays; pcPages.ActivePage.Tag:=1; end else if pcPages.ActivePage=tsMonthVolatility then begin laHelp.Caption:='This page shows how the selected bar''s volatility changes from month to month'; if (pcPages.ActivePage.Tag=0) then CaclulateMonthVolatility; pcPages.ActivePage.Tag:=1; end else if pcPages.ActivePage=tsAllPeaks then begin laHelp.Caption:='This page shows all peaks that meet the conditions'; if (pcPages.ActivePage.Tag=0) then CalculateAllPeaks; pcPages.ActivePage.Tag:=1; end; end; class procedure TfmBarsStatisticsDialog.Run(const aIndicator: ISCIndicatorBars; const aStockChart: IStockChart); begin with TfmBarsStatisticsDialog.Create(aStockChart) do begin FIndicator:=aIndicator; Caption:=IndicatorFactory.GetIndicatorInfo(FIndicator.GetIID).Name+': '+Caption; Show; pcPagesChange(nil); end; end; end.
unit cVillage; interface type Tvillage = class //=== Protected ================================================================ Protected fID :Integer; fName :String; fpos_x :Integer; fpos_y :Integer; fOwner :Integer; fPoints :Integer; fBonus :Integer; //=== Public =================================================================== public property ID :Integer read fID write fID ; property Name :String read fName write fName ; property x :Integer read fpos_x write fpos_x ; property y :Integer read fpos_y write fpos_y ; property Owner :Integer read fOwner write fOwner ; property Points :Integer read fPoints write fPoints; property Bonus :Integer read fBonus write fBonus ; Constructor Create(ID :Integer; name :String; pos_x :Integer; pos_y :Integer; Owner :Integer; Points :Integer; Bonus :Integer); end; implementation //=== Constructor ============================================================== Constructor TVillage.Create(ID :Integer; name :String; pos_x :Integer; pos_y :Integer; Owner :Integer; Points :Integer; Bonus :Integer); begin fID := id ; fName := name ; fpos_x := pos_x ; fpos_y := pos_y ; fOwner := Owner ; fPoints:= Points; fBonus := Bonus ; end; end.
namespace RemObjects.SDK.CodeGen4; uses RemObjects.Elements.RTL; type RodlLibrary = public class (RodlEntity) private fXmlDocument: XmlDocument; // only for supporting SaveToFile fJsonNode: JsonNode; // only for supporting SaveToFile fStructs: EntityCollection<RodlStruct>; fArrays: EntityCollection<RodlArray>; fEnums: EntityCollection<RodlEnum>; fExceptions: EntityCollection<RodlException>; fGroups: EntityCollection<RodlGroup>; fUses: EntityCollection<RodlUse>; fServices: EntityCollection<RodlService>; fEventSinks: EntityCollection<RodlEventSink>; method LoadXML(aFile: String): XmlDocument; begin exit XmlDocument.FromFile(aFile); end; method isUsedRODLLoaded(anUse:RodlUse): Boolean; begin if EntityID.Equals(anUse.UsedRodlId) then exit true; for m in &Uses.Items do begin if m = anUse then continue; if m.UsedRodlId.Equals(anUse.UsedRodlId) then exit true; end; exit false; end; public constructor; begin Includes := nil; fStructs := new EntityCollection<RodlStruct>(self, "Struct"); fArrays := new EntityCollection<RodlArray>(self, "Array"); fEnums := new EntityCollection<RodlEnum>(self, "Enum"); fExceptions := new EntityCollection<RodlException>(self, "Exception"); fGroups := new EntityCollection<RodlGroup>(self, "Group"); fUses := new EntityCollection<RodlUse>(self, "Use"); fServices := new EntityCollection<RodlService>(self, "Service"); fEventSinks := new EntityCollection<RodlEventSink>(self, "EventSink"); end; constructor withURL(aURL: Url); begin constructor; LoadFromUrl(aURL); end; constructor (node: XmlElement); begin constructor; LoadFromXmlNode(node, nil); end; constructor (node: JsonNode); begin constructor; LoadFromJsonNode(node, nil); end; method LoadFromXmlNode(node: XmlElement; use: RodlUse := nil); begin if use = nil then begin fXmlDocument := node.Document; // needs to be kept in scope inherited LoadFromXmlNode(node); if (node.Attribute["Namespace"] ≠ nil) then &Namespace := node.Attribute["Namespace"].Value; if (node.Attribute["DataSnap"] ≠ nil) then DataSnap := node.Attribute["DataSnap"].Value = "1"; if (node.Attribute["ScopedEnums"] ≠ nil) then ScopedEnums := node.Attribute["ScopedEnums"].Value = "1"; DontApplyCodeGen := ((node.Attribute["SkipCodeGen"] ≠ nil) and (node.Attribute["SkipCodeGen"].Value = "1")) or ((node.Attribute["DontCodeGen"] ≠ nil) and (node.Attribute["DontCodeGen"].Value = "1")); var lInclude := node.FirstElementWithName("Includes"); if (lInclude ≠ nil) then begin Includes := new RodlInclude(); Includes.LoadFromXmlNode(lInclude); end else begin Includes := nil; end; end else begin use.Name := node.Attribute["Name"]:Value; use.UsedRodlId := Guid.TryParse(node.Attribute["UID"].Value); use.DontApplyCodeGen := use.DontApplyCodeGen or (((node.Attribute["SkipCodeGen"] ≠ nil) and (node.Attribute["SkipCodeGen"].Value = "1")) or ((node.Attribute["DontCodeGen"] ≠ nil) and (node.Attribute["DontCodeGen"].Value = "1"))); if (node.Attribute["Namespace"] ≠ nil) then use.Namespace := node.Attribute["Namespace"].Value; var lInclude := node.FirstElementWithName("Includes"); if (lInclude ≠ nil) then begin use.Includes := new RodlInclude(); use.Includes.LoadFromXmlNode(lInclude); end; if isUsedRODLLoaded(use) then exit; end; fUses.LoadFromXmlNode(node.FirstElementWithName("Uses"), use, -> new RodlUse); fStructs.LoadFromXmlNode(node.FirstElementWithName("Structs"), use, -> new RodlStruct); fArrays.LoadFromXmlNode(node.FirstElementWithName("Arrays"), use, -> new RodlArray); fEnums.LoadFromXmlNode(node.FirstElementWithName("Enums"), use, -> new RodlEnum); fExceptions.LoadFromXmlNode(node.FirstElementWithName("Exceptions"), use, -> new RodlException); fGroups.LoadFromXmlNode(node.FirstElementWithName("Groups"), use, -> new RodlGroup); fServices.LoadFromXmlNode(node.FirstElementWithName("Services"), use, -> new RodlService); fEventSinks.LoadFromXmlNode(node.FirstElementWithName("EventSinks"), use, -> new RodlEventSink); end; method LoadFromJsonNode(node: JsonNode; use: RodlUse := nil); begin if not assigned(use) then begin fJsonNode := node; // needs to be kept in scope inherited LoadFromJsonNode(node); &Namespace := node["Namespace"]:StringValue; DataSnap := valueOrDefault(node["DataSnap"]:BooleanValue); ScopedEnums := valueOrDefault(node["ScopedEnums"]:BooleanValue); DontApplyCodeGen := valueOrDefault(node["SkipCodeGen"]:BooleanValue) or valueOrDefault(node["DontCodeGen"]:BooleanValue); var lIncludes := coalesce(node["Includes"], node["Platforms"]); if assigned(lIncludes) then begin Includes := new RodlInclude(); Includes.LoadFromJsonNode(lIncludes); end else begin Includes := nil; end; end else begin use.Name := node["Name"]:StringValue; use.UsedRodlId := Guid.TryParse(node["ID"]:StringValue); use.DontApplyCodeGen := valueOrDefault(node["SkipCodeGen"]:BooleanValue) or valueOrDefault(node["DontCodeGen"]:BooleanValue); use.Namespace := node["Namespace"]:StringValue; var lIncludes := coalesce(node["Includes"], node["Platforms"]); if assigned(lIncludes) then begin Includes := new RodlInclude(); Includes.LoadFromJsonNode(lIncludes); end; if isUsedRODLLoaded(use) then exit; end; fUses.LoadFromJsonNode(node["Uses"], use, -> new RodlUse); fStructs.LoadFromJsonNode(node["Structs"], use, -> new RodlStruct); fArrays.LoadFromJsonNode(node["Arrays"], use, -> new RodlArray); fEnums.LoadFromJsonNode(node["Enums"], use, -> new RodlEnum); fExceptions.LoadFromJsonNode(node["Exceptions"], use, -> new RodlException); fGroups.LoadFromJsonNode(node["Groups"], use, -> new RodlGroup); fServices.LoadFromJsonNode(node["Services"], use, -> new RodlService); fEventSinks.LoadFromJsonNode(node["EventSinks"], use, -> new RodlEventSink); end; method LoadFromString(aString: String; use: RodlUse := nil); begin if length(aString) > 0 then begin case aString[0] of '<': LoadFromXmlNode(XmlDocument.FromString(aString).Root, use); '{': LoadFromJsonNode(JsonDocument.FromString(aString).Root, use); else raise new Exception("Unexpected file format for rodl."); end; end; end; // method LoadRemoteRodlFromXmlNode(node: XmlElement); begin {$MESSAGE optimize code} var lServers := node.ElementsWithName("Server"); if lServers.Count ≠ 1 then raise new Exception("Server element not found in remoteRODL."); var lServerUris := lServers.FirstOrDefault.ElementsWithName("ServerUri"); if lServerUris.Count ≠ 1 then raise new Exception("lServerUris element not found in remoteRODL."); LoadFromUrl(Url.UrlWithString(lServerUris.FirstOrDefault.Value)); end; method LoadFromFile(aFilename: String); begin if Path.GetExtension(aFilename):ToLowerInvariant = ".remoterodl" then begin var lRemoteRodl := LoadXML(aFilename); if not assigned(lRemoteRodl)then raise new Exception("Could not read "+aFilename); LoadRemoteRodlFromXmlNode(lRemoteRodl.Root); end else begin Filename := aFilename; LoadFromString(File.ReadText(Filename)); end; end; method LoadFromUrl(aUrl: Url); begin case caseInsensitive(aUrl.Scheme) of "http", "https": begin LoadFromString(Http.GetString(new HttpRequest(aUrl))); end; "file": begin LoadFromFile(aUrl.FilePath); end; "superhttp", "superhttps", "supertcp", "supertcps", "tcp", "tcps": raise new Exception("Unsupported URL Scheme ("+aUrl.Scheme+") in remoteRODL."); else raise new Exception("Unsupported URL Scheme ("+aUrl.Scheme+") in remoteRODL."); end; end; method LoadUsedLibraryFromFile(aFilename: String; use: RodlUse); begin LoadFromString(File.ReadText(aFilename), use); end; method SaveToFile(aFilename: String); begin if assigned(fXmlDocument) then fXmlDocument.SaveToFile(aFilename) else if assigned(fJsonNode) then File.WriteText(aFilename, fJsonNode.ToString); end; [ToString] method ToString: String; begin result := coalesce(fXmlDocument:ToString, fJsonNode:ToString); end; method FindEntity(aName: String):RodlEntity; begin var lEntity: RodlEntity; lEntity := fStructs.FindEntity(aName); if (lEntity = nil) then lEntity := fArrays.FindEntity(aName); if (lEntity = nil) then lEntity := fEnums.FindEntity(aName); if (lEntity = nil) then lEntity := fExceptions.FindEntity(aName); if (lEntity = nil) then lEntity := fGroups.FindEntity(aName); if (lEntity = nil) then lEntity := fUses.FindEntity(aName); if (lEntity = nil) then lEntity := fServices.FindEntity(aName); if (lEntity = nil) then lEntity := fEventSinks.FindEntity(aName); exit lEntity; end; property Structs: EntityCollection<RodlStruct> read fStructs; property Arrays: EntityCollection<RodlArray> read fArrays; property Enums: EntityCollection<RodlEnum> read fEnums; property Exceptions: EntityCollection<RodlException> read fExceptions; property Groups: EntityCollection<RodlGroup> read fGroups; property &Uses: EntityCollection<RodlUse> read fUses; property Services: EntityCollection<RodlService> read fServices; property EventSinks: EntityCollection<RodlEventSink> read fEventSinks; property Filename: String; property &Namespace: String; property Includes: RodlInclude; property DontApplyCodeGen: Boolean; property DataSnap: Boolean := false; property ScopedEnums: Boolean := false; end; // // // RodlUse = public class(RodlEntity) public constructor; begin inherited constructor; Includes := nil; UsedRodlId := Guid.Empty; end; method LoadFromXmlNode(node: XmlElement); override; begin inherited LoadFromXmlNode(node); var lInclude: XmlElement := node.FirstElementWithName("Includes"); if assigned(lInclude) then begin Includes := new RodlInclude(); Includes.LoadFromXmlNode(lInclude); end else begin Includes := nil; end; if (node.Attribute["Rodl"] ≠ nil) then FileName := node.Attribute["Rodl"].Value; if (node.Attribute["AbsoluteRodl"] ≠ nil) then AbsoluteRodl := node.Attribute["AbsoluteRodl"].Value; if (node.Attribute["UsedRodlUID"] ≠ nil) then UsedRodlId := Guid.TryParse(node.Attribute["UsedRodlUID"].Value); DontApplyCodeGen := (node.Attribute["DontCodeGen"] ≠ nil) and (node.Attribute["DontCodeGen"].Value = "1"); var usedRodlFileName: String := Path.GetFullPath(FileName); if (not usedRodlFileName.FileExists and not FileName.IsAbsolutePath) then begin if (OwnerLibrary.Filename ≠ nil) then usedRodlFileName := Path.GetFullPath(Path.Combine(Path.GetFullPath(OwnerLibrary.Filename).ParentDirectory, FileName)); end; if (not usedRodlFileName.FileExists and not FileName.IsAbsolutePath) then begin if (FromUsedRodl:AbsoluteFileName ≠ nil) then usedRodlFileName := Path.GetFullPath(Path.Combine(FromUsedRodl:AbsoluteFileName:ParentDirectory, FileName)); end; if (not usedRodlFileName.FileExists) then usedRodlFileName := AbsoluteRodl; if String.IsNullOrEmpty(usedRodlFileName) then Exit; if (not usedRodlFileName.FileExists) then begin usedRodlFileName := usedRodlFileName.Replace("/", Path.DirectorySeparatorChar).Replace("\", Path.DirectorySeparatorChar); var lFilename := Path.GetFileName(usedRodlFileName).ToLowerInvariant; //writeLn("checking for "+lFilename); if RodlCodeGen.KnownRODLPaths.ContainsKey(lFilename) then usedRodlFileName := RodlCodeGen.KnownRODLPaths[lFilename]; end; //writeLn("using rodl: "+usedRodlFileName); if (usedRodlFileName.FileExists) then begin AbsoluteFileName := usedRodlFileName; OwnerLibrary.LoadUsedLibraryFromFile(usedRodlFileName, self); Loaded := true; end; end; method LoadFromJsonNode(node: JsonNode); override; begin inherited LoadFromJsonNode(node); var lIncludes := coalesce(node["Includes"], node["Platforms"]); if assigned(lIncludes) then begin Includes := new RodlInclude(); Includes.LoadFromJsonNode(lIncludes); end else begin Includes := nil; end; FileName := node["Rodl"]:StringValue; AbsoluteRodl := node["AbsoluteRodl"]:StringValue; UsedRodlId := Guid.TryParse(node["UsedRodlID"]:StringValue); DontApplyCodeGen := valueOrDefault(node["DontCodeGen"]:BooleanValue); var usedRodlFileName: String := Path.GetFullPath(FileName); if (not usedRodlFileName.FileExists and not FileName.IsAbsolutePath) then begin if (OwnerLibrary.Filename ≠ nil) then usedRodlFileName := Path.GetFullPath(Path.Combine(Path.GetFullPath(OwnerLibrary.Filename).ParentDirectory, FileName)); end; if (not usedRodlFileName.FileExists and not FileName.IsAbsolutePath) then begin if (FromUsedRodl:AbsoluteFileName ≠ nil) then usedRodlFileName := Path.GetFullPath(Path.Combine(FromUsedRodl:AbsoluteFileName:ParentDirectory, FileName)); end; if (not usedRodlFileName.FileExists) then usedRodlFileName := AbsoluteRodl; if String.IsNullOrEmpty(usedRodlFileName) then Exit; if (not usedRodlFileName.FileExists) then begin usedRodlFileName := usedRodlFileName.Replace("/", Path.DirectorySeparatorChar).Replace("\", Path.DirectorySeparatorChar); var lFilename := Path.GetFileName(usedRodlFileName).ToLowerInvariant; //writeLn("checking for "+lFilename); if RodlCodeGen.KnownRODLPaths.ContainsKey(lFilename) then usedRodlFileName := RodlCodeGen.KnownRODLPaths[lFilename]; end; //writeLn("using rodl: "+usedRodlFileName); if (usedRodlFileName.FileExists) then begin AbsoluteFileName := usedRodlFileName; OwnerLibrary.LoadUsedLibraryFromFile(usedRodlFileName, self); Loaded := true; end; end; property FileName: String; property AbsoluteRodl: String; property &Namespace: String; property Includes: RodlInclude; property UsedRodlId: Guid; property IsMerged: Boolean read not UsedRodlId.Equals(Guid.Empty); property DontApplyCodeGen: Boolean; property Loaded: Boolean; property AbsoluteFileName: String; end; // // // RodlGroup = public class(RodlEntity) end; end.
unit vr_process; {$mode objfpc}{$H+} interface uses Classes, SysUtils, process, UTF8Process, Pipes, strutils, LConvEncoding {$IFDEF WINDOWS},Windows{$ENDIF}; type IProgramByLine = interface; TProgramByLineEvent = procedure(const Sender: IProgramByLine; const ALine: string; const AIsAddToLastLine: Boolean) of object; { IProgramByLine } IProgramByLine = interface ['{F0C02B9C-F6D8-4AFA-8854-1F9F64806B0E}'] function GetOnLine: TProgramByLineEvent; function GetOnTerminate: TNotifyEvent; function GetProcess: TProcess; procedure SetOnLine(AValue: TProgramByLineEvent); procedure SetOnTerminate(AValue: TNotifyEvent); function Terminate(const AExitCode: Integer): Boolean; property Process: TProcess read GetProcess; property OnTerminate: TNotifyEvent read GetOnTerminate write SetOnTerminate; property OnLine: TProgramByLineEvent read GetOnLine write SetOnLine; end; TStopStreamByLine = function: Boolean of object; TStreamByLineEvent = procedure(const ALine: string; const AIsAddToLastLine: Boolean) of object; { TStreamByLine } TStreamByLine = class(TThread) private FStopCallBack: TStopStreamByLine; FStream: TInputPipeStream; FOnLine: TStreamByLineEvent; FIsSyncronize: Boolean; FLine: string; FIsAddToLastLine: Boolean; procedure DoLineSync; protected procedure Execute; override; public constructor CreateAlt(const AStream: TInputPipeStream; const AOnLine: TStreamByLineEvent; const AStopCallBack: TStopStreamByLine = nil; const AIsSyncronize: Boolean = False; ACreateSuspended: Boolean = False); //property StopCallBack: TStopStreamByLine read FStopCallBack write FStopCallBack; end; function RunProgramByLine(const AProgram: string; const AParams: array of string; const AOnLine: TProgramByLineEvent; const AOnTerminate: TNotifyEvent = nil; const AIsSyncronize: Boolean = False): IProgramByLine; implementation type { TProgramByLine } TProgramByLine = class(TInterfacedObject, IProgramByLine) private FProcess: TProcess; FOnLine: TProgramByLineEvent; FStream: TStreamByLine; procedure OnStreamLine(const ALine: string; const AIsAddToLastLine: Boolean); function StreamStopProc: Boolean; protected { IProgramByLine } function GetOnLine: TProgramByLineEvent; function GetOnTerminate: TNotifyEvent; function GetProcess: TProcess; procedure SetOnLine(AValue: TProgramByLineEvent); procedure SetOnTerminate(AValue: TNotifyEvent); function Terminate(const AExitCode: Integer): Boolean; public constructor Create(const AProgram: string; const AParams: array of string; const AOnLine: TProgramByLineEvent; const AOnTerminate: TNotifyEvent = nil; const AIsSyncronize: Boolean = False); virtual; destructor Destroy; override; //property IsSyncronize: Boolean read FIsSyncronize write FIsSyncronize; //property Process: TProcess read FProcess; end; {$IFDEF WINDOWS} function OEMToUTF8(const S: string): string; var Dst: PWideChar; ws: WideString; begin Dst := AllocMem((Length(S) + 1) * SizeOf(WideChar)); if OemToCharW(PChar(s), Dst) then begin ws := PWideChar(Dst); Result := UTF8Encode(ws); end else Result := s; FreeMem(Dst); end;{$ENDIF} function RunProgramByLine(const AProgram: string; const AParams: array of string; const AOnLine: TProgramByLineEvent; const AOnTerminate: TNotifyEvent; const AIsSyncronize: Boolean ): IProgramByLine; begin Result := TProgramByLine.Create(AProgram, AParams, AOnLine, AOnTerminate, AIsSyncronize); end; { TStreamByLine } procedure TStreamByLine.DoLineSync; begin FOnLine(FLine, FIsAddToLastLine); end; procedure TStreamByLine.Execute; const READ_BYTES = 2048; var sOutput: string; sBuf: string; IsNewLine: Boolean = True; function _ReadOutput: Boolean; var NumBytes: LongInt; begin if FStream.NumBytesAvailable = 0 then Exit(False); NumBytes := FStream.Read(sBuf[1], READ_BYTES); Result := NumBytes > 0; if Result then sOutput += Copy(sBuf, 1, NumBytes); end; procedure _DoLine; var i: SizeInt; begin if sOutput = '' then Exit; repeat FIsAddToLastLine := not IsNewLine; i := PosSet([#10, #13], sOutput); IsNewLine := i > 0; if IsNewLine then begin FLine := Copy(sOutput, 1, i - 1); case sOutput[i] of #13: if (sOutput[i + 1] = #10) then Inc(i); #10: if (sOutput[i + 1] = #13) then Inc(i); end; Delete(sOutput, 1, i); end else begin FLine := sOutput; sOutput := ''; end; {$IFDEF WINDOWS} if GuessEncoding(FLine) <> EncodingUTF8 then FLine := OEMToUTF8(FLine);{$ENDIF} if Assigned(FOnLine) then if FIsSyncronize then Synchronize(@DoLineSync) else DoLineSync; until (sOutput = ''); end; begin if FStream = nil then Exit; SetLength(sBuf, READ_BYTES); while not Terminated and (not Assigned(FStopCallBack) or not FStopCallBack()) do begin if not _ReadOutput then begin _DoLine; Sleep(100); end; end; while _ReadOutput do ; _DoLine; end; constructor TStreamByLine.CreateAlt(const AStream: TInputPipeStream; const AOnLine: TStreamByLineEvent; const AStopCallBack: TStopStreamByLine; const AIsSyncronize: Boolean; ACreateSuspended: Boolean); begin inherited Create(ACreateSuspended); FOnLine := AOnLine; FStream := AStream; FStopCallBack := AStopCallBack; FIsSyncronize := AIsSyncronize; end; { TProgramByLine } procedure TProgramByLine.OnStreamLine(const ALine: string; const AIsAddToLastLine: Boolean); begin if Assigned(FOnLine) then FOnLine(Self, ALine, AIsAddToLastLine); end; function TProgramByLine.StreamStopProc: Boolean; begin Result := not FProcess.Running; end; function TProgramByLine.GetOnLine: TProgramByLineEvent; begin Result := FOnLine; end; function TProgramByLine.GetOnTerminate: TNotifyEvent; begin Result := FStream.OnTerminate; end; function TProgramByLine.GetProcess: TProcess; begin Result := FProcess; end; procedure TProgramByLine.SetOnLine(AValue: TProgramByLineEvent); begin FOnLine := AValue; end; procedure TProgramByLine.SetOnTerminate(AValue: TNotifyEvent); begin FStream.OnTerminate := AValue; end; function TProgramByLine.Terminate(const AExitCode: Integer): Boolean; begin Result := FProcess.Terminate(AExitCode); end; constructor TProgramByLine.Create(const AProgram: string; const AParams: array of string; const AOnLine: TProgramByLineEvent; const AOnTerminate: TNotifyEvent; const AIsSyncronize: Boolean); var opts: TProcessOptions; i: Integer; begin FOnLine := AOnLine; //OnTerminate := AOnTerminate; opts := []; Exclude(opts, poWaitOnExit); //Exclude(opts, poUsePipes); opts := opts + [poUsePipes, {poNoConsole,} poStderrToOutPut, poNewProcessGroup]; FProcess := TProcessUTF8.Create(nil); FProcess.Executable := AProgram; if Length(AParams) > 0 then for i := 0 to Length(AParams) - 1 do FProcess.Parameters.Add(AParams[i]); FProcess.Options := opts; //FProcess.ShowWindow := swoHIDE; try FProcess.Execute; FStream := TStreamByLine.CreateAlt(FProcess.Output, @OnStreamLine, @StreamStopProc, AIsSyncronize); FStream.OnTerminate := AOnTerminate; except if FStream = nil then FStream := TStreamByLine.CreateAlt(nil, nil); end; end; destructor TProgramByLine.Destroy; begin FStream.Free; inherited Destroy; end; end.
{///////////////////////////////////////////////////////////////////////////////////////////////////////////// Модуль для управления почтой по средствам IMAP ///////////////////////////////////////////////////////////////////////////////////////////////////////////// 13.06.2015 - К сожалению использовать IMAP для чтения и отправки писем это какой то геморой, добавляю поддержку SMTP. Настройки для яндекса: Входящая почта Протокол — IMAP; Имя сервера — imap.yandex.ru; Порт — 993; SSL — SSL/TLS; Аутентификация — Обычный пароль. Исходящая почта Имя сервера — smtp.yandex.ru; Порт — 465; SSL — SSL/TLS; Аутентификация — Обычный пароль. - Так же идея в том, что грузим сначала заголовок письма, а дальше применяем к нему методы и если заголовка не хватает, то догружаем тело... - Имя пользователя EMAIL - целиком, например, user@host.ru 11.06.2015 - А что если загружать заголовок\тело и с ним работать остальными методами класса?! 05.2015 - RuCode * Нвчал разработку /////////////////////////////////////////////////////////////////////////////////////////////////////////////} unit Mails; {$mode objfpc}{$H+} interface uses Classes, Dialogs, SysUtils, ExtCtrls, Forms, Controls, imapsend, ssl_openssl, synautil, synacode, synaicnv, mimemess, mimepart, synachar, smtpsend; const ERROR_CAPTION = 'Ошибка'; ERROR_INDEX_MESSAGE = 'Индекс сообщения должен быть от 1 до числа равного количеству писем...'; ERROR_RECIEVE_HEADER = 'Ошибка получения заголовка письма #%d'; ERROR_RECIEVE_BODY = 'Ошибка получения тела письма #%d'; type TMailState = ({:Не загружено пиьсмо}msNone, {:Загружен заголовок}msMailHead, {:Загружено целиком}msMailAll); { TCustomMail } TCustomMail = class(TObject) private fConnected: boolean; {: Флаги что бы определять где делать logout, ибо приложение зависает} fSMTPConnected, fIMAPConnected: boolean; {:Индекс текущего письма} fCurrentMail: integer; {:Состояние письма} fMailState: TMailState; {:Для хранения полного ответа на нашу команду} fFullResult: TStringList; {:Для хранения полного письма или его заголовка} fMailData: TStringList; {:Для чтения почты по протоколу IMAP} fIMAPClient: TIMAPSend; {:Для отправки почты по протоколу SMTP} fSMTPClient: TSMTPSend; function GetCountOfMails: integer; function GetCountOfNewMails: integer; function GetFullResult: TStringList; function GetIMAPHost: string; function GetIMAPPort: integer; function GetPassword: string; function GetResultString: string; function GetSelectedFolder: string; function GetSMTPHost: string; function GetSMTPPort: integer; function GetUserName: string; procedure SetConnected(AValue: boolean); procedure SetIMAPHost(AValue: string); procedure SetIMAPPort(AValue: integer); procedure SetPassword(AValue: string); procedure SetSelectedFolder(AFolderName: string); procedure SetSMTPHost(AValue: string); procedure SetSMTPPort(AValue: integer); procedure SetUserName(AValue: string); public constructor Create; virtual; destructor Destroy; override; procedure Nop; {:Узнать список директорий на сервере.} procedure GetFolderList(var ListFolders: TStringList); {:Получить заголовок сообщения.} function GetMailHeader(Index: integer): string; {:Получить сообщение.} function GetMailBody(Index: integer): string; {:Получить текст сообщения в расшифрованном виде} function GetMailText: string; {:Получить количество вложений} function GetMailAttachCount: integer; {:Получить имя файла вложения} function GetMailAttachFileName(Index: integer): string; {:Сохранить вложение в файо} procedure SaveAttachToFile(AttachIndex: integer; AFileName: string); {:Узнать почту отправителя} function GetEmailFrom: string; {:Узнать почту получателя} function GetEmailTo: string; {:Тема письма} function GetEmailSubject: string; {:Дата отправки письма} function GetEmailDate: TDateTime; {:Отправка письма} function SendMail(ToAddr, Subject, Text: string; FileName: string = ''): boolean; overload; function SendMail(ToAddr, Subject, Text: string; AttachName: string; Stream: TStream): boolean; overload; public {:Имя пользователя для авторизации.} property UserName: string read GetUserName write SetUserName; {:Пароль для авторизации.} property Password: string read GetPassword write SetPassword; {:Адрес сервера IMAP.} property IMAPHost: string read GetIMAPHost write SetIMAPHost; {:Порт на котором вертиться протокол IMAP.} property IMAPPort: integer read GetIMAPPort write SetIMAPPort; {:Адрес сервера SMTP.} property SMTPHost: string read GetSMTPHost write SetSMTPHost; {:Порт на котором вертиться протокол SMTP.} property SMTPPort: integer read GetSMTPPort write SetSMTPPort; {:Управление соединением и получение состояния соединения.} property Connected: boolean read fConnected write SetConnected; {:Узнать или указать текущую директорию.} property SelectedFolder: string read GetSelectedFolder write SetSelectedFolder; {:Количество новых писем} property CountOfNewMails: integer read GetCountOfNewMails; {:Количество писем в директории} property CountOfMails: integer read GetCountOfMails; {:Результаты команды.} property FullResult: TStringList read GetFullResult; {:Результаты команды.} property ResultString: string read GetResultString; end; TMail = class(TCustomMail) public {:Имя пользователя для авторизации.} property UserName; {:Пароль для авторизации.} property Password; {:Адрес сервера IMAP.} property IMAPHost; {:Порт на котором вертиться протокол IMAP.} property IMAPPort; {:Адрес сервера SMTP.} property SMTPHost; {:Порт на котором вертиться протокол SMTP.} property SMTPPort; {:Управление соединением и получение состояния соединения.} property Connected; {:Узнать или указать текущую директорию.} property SelectedFolder; {:Количество новых писем} property CountOfNewMails; {:Количество писем в директории} property CountOfMails; {:Результаты команды.} property FullResult; {:Результаты команды.} property ResultString; end; implementation { TCustomMail } procedure TCustomMail.SetConnected(AValue: boolean); // Устанавливаем или сбрасываем соединение с сервером begin if fConnected = AValue then Exit; if AValue then begin fIMAPConnected := fIMAPClient.Login; fSMTPConnected := fSMTPClient.Login; fConnected := fIMAPConnected and fSMTPConnected; if not fConnected then begin if fSMTPConnected then fSMTPClient.Logout; if fIMAPConnected then fIMAPClient.Logout; end; end else begin fIMAPClient.Logout; fSMTPClient.Logout; fConnected := False; end; end; procedure TCustomMail.SetIMAPHost(AValue: string); // Установить имя сервера IMAP begin fIMAPClient.TargetHost := AValue; end; procedure TCustomMail.SetIMAPPort(AValue: integer); // Установить порт подключения к серверу IMAP begin fIMAPClient.TargetPort := IntToStr(AValue); end; procedure TCustomMail.SetPassword(AValue: string); // Устанавливаем пароль для авторизации begin fIMAPClient.Password := AValue; fSMTPClient.Password := AValue; end; procedure TCustomMail.SetSelectedFolder(AFolderName: string); // Выбираем новую директорию begin fIMAPClient.SelectFolder(AFolderName); end; procedure TCustomMail.SetSMTPHost(AValue: string); // Установить имя сервера SMTP begin fSMTPClient.TargetHost := AValue; end; procedure TCustomMail.SetSMTPPort(AValue: integer); // Установить порт сервера SMTP begin fSMTPClient.TargetPort := IntToStr(AValue); end; procedure TCustomMail.SetUserName(AValue: string); // Устанавливаем имя пользователя begin fIMAPClient.UserName := AValue; fSMTPClient.UserName := AValue; end; function TCustomMail.GetFullResult: TStringList; // Получим полный ответ от сервера begin fFullResult.Assign(fIMAPClient.FullResult); fFullResult.Add(fSMTPClient.FullResult.Text); Result := fFullResult; end; function TCustomMail.GetIMAPHost: string; // Получить имя сервера IMAP begin Result := fIMAPClient.TargetHost; end; function TCustomMail.GetIMAPPort: integer; // Получить порт сервера IMAP begin Result := StrToInt(fIMAPClient.TargetPort); end; function TCustomMail.GetPassword: string; // Получить пароль begin if fIMAPClient.Password <> fSMTPClient.Password then raise Exception.Create( 'Фатальная ошибка: Пароль пользователя должен быть одинаковым и для входящей и для исходящей почты...'); Result := fIMAPClient.Password; end; function TCustomMail.GetCountOfNewMails: integer; // Количество новых писем begin Result := fIMAPClient.SelectedRecent; end; function TCustomMail.GetCountOfMails: integer; // Количество писем begin Result := fIMAPClient.SelectedCount; end; function TCustomMail.GetResultString: string; // Статус команды begin Result := fIMAPClient.ResultString + #13 + #10 + fSMTPClient.ResultString; end; function TCustomMail.GetSelectedFolder: string; // Определить текущею директорию begin Result := fIMAPClient.SelectedFolder; end; function TCustomMail.GetSMTPHost: string; // Получить имя сервера SMTP begin Result := fSMTPClient.TargetHost; end; function TCustomMail.GetSMTPPort: integer; // Получить порт SMTP begin Result := StrToInt(fSMTPClient.TargetPort); end; function TCustomMail.GetUserName: string; // Получить имя пользователя begin if fIMAPClient.UserName <> fSMTPClient.UserName then raise Exception.Create( 'Фатальная ошибка: Имя пользователя должно быть одинаковым и для входящей и для исходящей почты...'); Result := fIMAPClient.UserName; end; procedure TCustomMail.GetFolderList(var ListFolders: TStringList); // Получить список директорий на сервере var i: integer; begin fIMAPClient.List('', ListFolders); for i := 0 to ListFolders.Count - 1 do ListFolders[i] := CharsetConversion(ListFolders[i], TMimeChar.UTF_7mod, TMimeChar.UTF_8); end; function TCustomMail.GetMailHeader(Index: integer): string; // Получить заголовок сообщения begin Result := ''; if Index < 1 then begin MessageDlg(ERROR_CAPTION, ERROR_INDEX_MESSAGE, mtError, [mbOK], ''); Exit; end; if not fIMAPClient.FetchHeader(Index, fMailData) then begin MessageDlg(ERROR_CAPTION, Format(ERROR_RECIEVE_HEADER, [Index]), mtError, [mbOK], ''); Exit; end; Result := fMailData.Text; fCurrentMail := Index; fMailState := msMailHead; end; function TCustomMail.GetMailBody(Index: integer): string; // Получить заголовок сообщения begin Result := ''; if Index < 1 then begin MessageDlg(ERROR_CAPTION, ERROR_INDEX_MESSAGE, mtError, [mbOK], ''); Exit; end; if not fIMAPClient.FetchMess(Index, fMailData) then begin MessageDlg(ERROR_CAPTION, Format(ERROR_RECIEVE_BODY, [Index]), mtError, [mbOK], ''); Exit; end; Result := fMailData.Text; fCurrentMail := Index; fMailState := msMailAll; end; function TCustomMail.GetMailText: string; // Получить текст письма из тела письма var MimeMess: TMimemess; begin Result := ''; if fMailState = msNone then Exit; if fMailState = msMailHead then GetMailBody(fCurrentMail); MimeMess := TMimemess.Create; MimeMess.Lines.Assign(fMailData); MimeMess.DecodeMessage; Result := MimeMess.MessagePart.PartBody.Text; MimeMess.Free; end; function TCustomMail.GetMailAttachCount: integer; // Получить количество вложений var MimeMess: TMimemess; begin Result := -1; if fMailState = msNone then Exit; if fMailState = msMailHead then GetMailBody(fCurrentMail); MimeMess := TMimemess.Create; MimeMess.Lines.Assign(fMailData); MimeMess.DecodeMessage; Result := MimeMess.MessagePart.GetSubPartCount; MimeMess.Free; end; function TCustomMail.GetMailAttachFileName(Index: integer): string; // Получить имя файла вложения var MimeMess: TMimeMess; MimePart: TMimePart; begin Result := ''; if fMailState = msNone then Exit; if fMailState = msMailHead then GetMailBody(fCurrentMail); MimeMess := TMimemess.Create; MimeMess.Lines.Assign(fMailData); MimeMess.DecodeMessage; MimePart := MimeMess.MessagePart.GetSubPart(Index); MimePart.DecodePart; Result := MimePart.FileName; MimeMess.Free; end; procedure TCustomMail.SaveAttachToFile(AttachIndex: integer; AFileName: string); // Cохраняет вложение в файл procedure SaveToFile(szData, szPath: string); var hFile: TextFile; begin AssignFile(hFile, szPath); Rewrite(hFile); Write(hFile, szData); CloseFile(hFile); end; const ATTACHMENT_STR = 'attachment'; var MimePart: TMimePart; i, CountAttach: integer; Stream: TStringStream; MailMessage: TMimeMess; begin if fMailState = msNone then Exit; if fMailState = msMailHead then GetMailBody(fCurrentMail); MailMessage := TMimeMess.Create; CountAttach := -1; if not Connected then Exit; MailMessage.Lines.Assign(fMailData); MailMessage.DecodeMessage; for i := 0 to MailMessage.MessagePart.GetSubPartCount - 1 do begin Inc(CountAttach, 1); MimePart := MailMessage.MessagePart.GetSubPart(i); if not SameText(MimePart.Disposition, ATTACHMENT_STR) then Continue; if CountAttach <> AttachIndex then Continue; Stream := TStringStream.Create(''); try Stream.WriteString(DecodeBase64(MimePart.PartBody.Text)); SaveToFile(Stream.DataString, AFileName); finally Stream.Free; MailMessage.Free; end; end; end; function TCustomMail.GetEmailFrom: string; // Узнать кем отправлено письмо var MailMessage: TMimeMess; begin MailMessage := TMimeMess.Create; MailMessage.Lines.Assign(fMailData); MailMessage.DecodeMessage; Result := MailMessage.Header.From; MailMessage.Free; end; function TCustomMail.GetEmailTo: string; // Узнать кем отправлено письмо var MailMessage: TMimeMess; begin MailMessage := TMimeMess.Create; MailMessage.Lines.Assign(fMailData); MailMessage.DecodeMessage; Result := MailMessage.Header.ToList[0]; MailMessage.Free; end; function TCustomMail.GetEmailSubject: string; // Узнать тему письма var MailMessage: TMimeMess; begin MailMessage := TMimeMess.Create; MailMessage.Lines.Assign(fMailData); MailMessage.DecodeMessage; Result := MailMessage.Header.Subject; MailMessage.Free; end; function TCustomMail.GetEmailDate: TDateTime; // Дата отправки письма var MailMessage: TMimeMess; begin MailMessage := TMimeMess.Create; MailMessage.Lines.Assign(fMailData); MailMessage.DecodeMessage; Result := MailMessage.Header.Date; MailMessage.Free; end; function TCustomMail.SendMail(ToAddr, Subject, Text: string; FileName: string): boolean; // Отправка письма var MailMessage: TMimeMess; MIMEPart: TMimePart; StringList: TStringList; begin Result := False; MailMessage := TMimeMess.Create; StringList := TStringList.Create; try // Заголовок письма MailMessage.Header.Subject := Subject;// тема сообщения MailMessage.Header.From := fSMTPClient.UserName; // имя и адрес отправителя MailMessage.Header.ToList.Add(ToAddr); // имя и адрес получателя // Корневой элемент MIMEPart := MailMessage.AddPartMultipart('alternative', nil); if length(Text) <> 0 then begin StringList.Text := Text; MailMessage.AddPartText(StringList, MIMEPart); end; // Вложение MIMEPart := MailMessage.AddPartMultipart('attachment', nil); if FileName <> '' then MailMessage.AddPartBinaryFromFile(FileName, MIMEPart); // Кодируем и отправляем MailMessage.EncodeMessage; Result := True; Result := Result and fSMTPClient.MailFrom(fSMTPClient.UserName, Length(fSMTPClient.UserName)); Result := Result and fSMTPClient.MailTo(ToAddr); Result := Result and fSMTPClient.MailData(MailMessage.Lines); finally MailMessage.Free; StringList.Free; end; end; function TCustomMail.SendMail(ToAddr, Subject, Text: string; AttachName: string; Stream: TStream): boolean; // Отправка письма var MailMessage: TMimeMess; MIMEPart: TMimePart; StringList: TStringList; begin Result := False; MailMessage := TMimeMess.Create; StringList := TStringList.Create; try // Заголовок письма MailMessage.Header.Subject := Subject;// тема сообщения MailMessage.Header.From := fSMTPClient.UserName; // имя и адрес отправителя MailMessage.Header.ToList.Add(ToAddr); // имя и адрес получателя // Корневой элемент MIMEPart := MailMessage.AddPartMultipart('alternative', nil); if length(Text) <> 0 then begin StringList.Text := Text; MailMessage.AddPartText(StringList, MIMEPart); end; // Вложение MIMEPart := MailMessage.AddPartMultipart('attachment', nil); MailMessage.AddPartBinary(Stream, AttachName, MIMEPart); // Кодируем и отправляем MailMessage.EncodeMessage; Result := True; Result := Result and fSMTPClient.MailFrom(fSMTPClient.UserName, Length(fSMTPClient.UserName)); Result := Result and fSMTPClient.MailTo(ToAddr); Result := Result and fSMTPClient.MailData(MailMessage.Lines); finally MailMessage.Free; StringList.Free; end; end; constructor TCustomMail.Create; // Создание обьекта begin inherited Create; // IMAP fIMAPClient := TIMAPSend.Create; fIMAPClient.AutoTLS := True; fIMAPClient.FullSSL := True; IMAPHost := 'imap.yandex.ru'; IMAPPort := 993; // SMTP fSMTPClient := TSMTPSend.Create; fSMTPClient.AutoTLS := True; fSMTPClient.FullSSL := True; SMTPHost := 'smtp.yandex.ru'; SMTPPort := 465; // Инициализация fSMTPConnected := False; fIMAPConnected := False; fCurrentMail := -1; fMailState := msNone; fMailData := TStringList.Create; fFullResult := TStringList.Create; fConnected := False; end; destructor TCustomMail.Destroy; // Уничтожение обьекта begin fMailData.Free; fFullResult.Free; if fSMTPConnected then fSMTPClient.Logout; fSMTPClient.Free; if fIMAPConnected then fIMAPClient.Logout; fIMAPClient.Free; inherited Destroy; end; procedure TCustomMail.Nop; begin if Assigned(fSMTPClient) then fSMTPClient.NoOp; if Assigned(fIMAPClient) then fIMAPClient.NoOp; end; end.
{ } { Readers v3.08 } { } { This unit is copyright © 1999-2004 by David J Butler } { } { This unit is part of Delphi Fundamentals. } { Its original file name is cReaders.pas } { The latest version is available from the Fundamentals home page } { http://fundementals.sourceforge.net/ } { } { I invite you to use this unit, free of charge. } { I invite you to distibute this unit, but it must be for free. } { I also invite you to contribute to its development, } { but do not distribute a modified copy of this file. } { } { A forum is available on SourceForge for general discussion } { http://sourceforge.net/forum/forum.php?forum_id=2117 } { } { } { Revision history: } { 01/03/1999 0.01 Initial version. } { 26/06/1999 1.02 Created cStreams unit. } { 03/05/2002 3.03 Created cReaders unit. } { 13/05/2002 3.04 Added TBufferedReader and TSplitBufferReader. } { 13/07/2002 3.05 Moved text reader functionality to AReaderEx. } { 23/08/2002 3.06 Added SelfTest procedure. } { 09/04/2003 3.07 Memory reader support for blocks with unknown size. } { 06/03/2004 3.08 Improvements to AReaderEx. } { } {$INCLUDE ..\cDefines.inc} unit cReaders; interface uses { Delphi } Windows, SysUtils, { Fundamentals } cUtils; { } { AReader } { Abstract base class for a Reader. } { } { Inherited classes must implement the abstract methods from AReader. } { } { Read returns the actual number of bytes copied to the buffer. } { Size returns -1 for reader's with unknown data size. } { } type AReader = class protected function GetPosition: Int64; virtual; abstract; procedure SetPosition(const Position: Int64); virtual; abstract; function GetSize: Int64; virtual; abstract; public function Read(var Buffer; const Size: Integer): Integer; virtual; abstract; property Position: Int64 read GetPosition write SetPosition; property Size: Int64 read GetSize; function EOF: Boolean; virtual; abstract; end; EReader = class(Exception); { } { AReaderEx } { Base class for Reader implementations. AReaderEx extends AReader with } { commonly used functions. } { } { All methods in AReaderEx is implemented using calls to the abstract } { methods in AReader. Reader implementations can override the virtual } { methods in AReaderEx with more efficient versions. } { } { Match functions return True when a match is found. Match leaves the } { reader's position unchanged except if a match is made and SkipOnMatch } { is True. } { } { Locate returns the offset (relative to the current position) of the } { first match in the stream. Locate preserves the reader's position. } { Locate returns -1 if a match was not made. } { } type TReaderEOLType = ( eolEOF, // EOF Files, Internet eolEOFAtEOF, // #26 at EOF Files eolCR, // #13 Unix, Internet eolLF, // #10 Internet eolCRLF, // #13#10 MS-DOS, Windows, Internet eolLFCR); // #10#13 Mac TReaderEOLTypes = Set of TReaderEOLType; const DefaultReaderEOLTypes = [eolEOF, eolEOFAtEOF, eolCR, eolLF, eolCRLF, eolLFCR]; type AReaderEx = class(AReader) private function SkipLineTerminator(const EOLTypes: TReaderEOLTypes): Integer; public procedure RaiseReadError(const Msg: String = ''); procedure RaiseSeekError; procedure ReadBuffer(var Buffer; const Size: Integer); function ReadStr(const Size: Integer): String; virtual; function ReadWideStr(const Length: Integer): WideString; virtual; function GetToEOF: String; virtual; function GetAsString: String; virtual; function ReadByte: Byte; virtual; function ReadWord: Word; function ReadLongWord: LongWord; function ReadLongInt: LongInt; function ReadInt64: Int64; function ReadSingle: Single; function ReadDouble: Double; function ReadExtended: Extended; function ReadPackedString: String; function ReadPackedStringArray: StringArray; function ReadPackedWideString: WideString; function Peek(var Buffer; const Size: Integer): Integer; virtual; procedure PeekBuffer(var Buffer; const Size: Integer); function PeekStr(const Size: Integer): String; virtual; function PeekByte: Byte; virtual; function PeekWord: Word; function PeekLongWord: LongWord; function PeekLongInt: LongInt; function PeekInt64: Int64; function Match(const Buffer; const Size: Integer; const CaseSensitive: Boolean = True): Integer; virtual; function MatchBuffer(const Buffer; const Size: Integer; const CaseSensitive: Boolean = True): Boolean; function MatchStr(const S: String; const CaseSensitive: Boolean = True): Boolean; virtual; function MatchChar(const Ch: Char; const MatchNonMatch: Boolean = False; const SkipOnMatch: Boolean = False): Boolean; overload; function MatchChar(const C: CharSet; var Ch: Char; const MatchNonMatch: Boolean = False; const SkipOnMatch: Boolean = False): Boolean; overload; procedure Skip(const Count: Integer = 1); virtual; procedure SkipByte; function SkipAll(const Ch: Char; const MatchNonMatch: Boolean = False; const MaxCount: Integer = -1): Integer; overload; function SkipAll(const C: CharSet; const MatchNonMatch: Boolean = False; const MaxCount: Integer = -1): Integer; overload; function Locate(const Ch: Char; const LocateNonMatch: Boolean = False; const MaxOffset: Integer = -1): Integer; overload; virtual; function Locate(const C: CharSet; const LocateNonMatch: Boolean = False; const MaxOffset: Integer = -1): Integer; overload; virtual; function LocateBuffer(const Buffer; const Size: Integer; const MaxOffset: Integer = -1; const CaseSensitive: Boolean = True): Integer; virtual; function LocateStr(const S: String; const MaxOffset: Integer = -1; const CaseSensitive: Boolean = True): Integer; virtual; function ExtractAll(const C: CharSet; const ExtractNonMatch: Boolean = False; const MaxCount: Integer = -1): String; function ExtractLine(const MaxLineLength: Integer = -1; const EOLTypes: TReaderEOLTypes = DefaultReaderEOLTypes): String; function SkipLine(const MaxLineLength: Integer = -1; const EOLTypes: TReaderEOLTypes = DefaultReaderEOLTypes): Boolean; end; { } { TMemoryReader } { Reader implementation for a memory block. } { } { If the reader is initialized with Size = -1, the content is unsized and } { EOF will always return False. } { } type TMemoryReader = class(AReaderEx) protected FData : Pointer; FSize : Integer; FPos : Integer; function GetPosition: Int64; override; procedure SetPosition(const Position: Int64); override; function GetSize: Int64; override; public constructor Create(const Data: Pointer; const Size: Integer); property Data: Pointer read FData; property Size: Integer read FSize; procedure SetData(const Data: Pointer; const Size: Integer); function Read(var Buffer; const Size: Integer): Integer; override; function EOF: Boolean; override; function ReadByte: Byte; override; function ReadLongInt: LongInt; function ReadInt64: Int64; function PeekByte: Byte; override; function Match(const Buffer; const Size: Integer; const CaseSensitive: Boolean = True): Integer; override; procedure Skip(const Count: Integer = 1); override; end; EMemoryReader = class(EReader); { } { TStringReader } { Memory reader implementation for a reference counted string (long string). } { } type TStringReader = class(TMemoryReader) protected FDataString : String; procedure SetDataString(const S: String); public constructor Create(const Data: String); property DataString: String read FDataString write SetDataString; function GetAsString: String; override; end; { } { TFileReader } { Reader implementation for a file. } { } type TFileReaderAccessHint = ( frahNone, frahRandomAccess, frahSequentialAccess); TFileReader = class(AReaderEx) protected FHandle : Integer; FHandleOwner : Boolean; function GetPosition: Int64; override; procedure SetPosition(const Position: Int64); override; function GetSize: Int64; override; public constructor Create(const FileName: String; const AccessHint: TFileReaderAccessHint = frahNone); overload; constructor Create(const FileHandle: Integer; const HandleOwner: Boolean = False); overload; destructor Destroy; override; property Handle: Integer read FHandle; property HandleOwner: Boolean read FHandleOwner; function Read(var Buffer; const Size: Integer): Integer; override; function EOF: Boolean; override; end; EFileReader = class(EReader); function ReadFileToStr(const FileName: String): String; { } { AReaderProxy } { Base class for Reader Proxies. } { } type AReaderProxy = class(AReaderEx) protected FReader : AReaderEx; FReaderOwner : Boolean; function GetPosition: Int64; override; procedure SetPosition(const Position: Int64); override; function GetSize: Int64; override; public constructor Create(const Reader: AReaderEx; const ReaderOwner: Boolean = True); destructor Destroy; override; function Read(var Buffer; const Size: Integer): Integer; override; function EOF: Boolean; override; property Reader: AReaderEx read FReader; property ReaderOwner: Boolean read FReaderOwner write FReaderOwner; end; { } { TReaderProxy } { Reader Proxy implementation. } { } { Proxies a block of data from Reader from the Reader's current position. } { Size specifies the size of the data to be proxied, or if Size = -1, } { all data up to EOF is proxied. } { } type TReaderProxy = class(AReaderProxy) protected FOffset : Int64; FSize : Int64; function GetPosition: Int64; override; procedure SetPosition(const Position: Int64); override; function GetSize: Int64; override; public constructor Create(const Reader: AReaderEx; const ReaderOwner: Boolean = True; const Size: Int64 = -1); function Read(var Buffer; const Size: Integer): Integer; override; function EOF: Boolean; override; end; { } { TBufferedReader } { ReaderProxy implementation for buffered reading. } { } type TBufferedReader = class(AReaderProxy) protected FBufferSize : Integer; FPos : Int64; FBuffer : Pointer; FBufUsed : Integer; FBufPos : Integer; function GetPosition: Int64; override; procedure SetPosition(const Position: Int64); override; function GetSize: Int64; override; function FillBuf: Boolean; procedure BufferByte; function PosBuf(const C: CharSet; const LocateNonMatch: Boolean; const MaxOffset: Integer): Integer; public constructor Create(const Reader: AReaderEx; const BufferSize: Integer = 128; const ReaderOwner: Boolean = True); destructor Destroy; override; function Read(var Buffer; const Size: Integer): Integer; override; function EOF: Boolean; override; function ReadByte: Byte; override; function PeekByte: Byte; override; procedure Skip(const Count: Integer = 1); override; function Locate(const C: CharSet; const LocateNonMatch: Boolean = False; const MaxOffset: Integer = -1): Integer; override; property BufferSize: Integer read FBufferSize; procedure InvalidateBuffer; end; { } { TSplitBufferedReader } { ReaderProxy implementation for split buffered reading. } { } { One buffer is used for read-ahead buffering, the other for seek-back } { buffering. } { } type TSplitBufferedReader = class(AReaderProxy) protected FBufferSize : Integer; FPos : Int64; FBuffer : Array[0..1] of Pointer; FBufUsed : Array[0..1] of Integer; FBufNr : Integer; FBufPos : Integer; function GetPosition: Int64; override; procedure SetPosition(const Position: Int64); override; function GetSize: Int64; override; function BufferStart: Integer; function BufferRemaining: Integer; function MoveBuf(var Dest: PByte; var Remaining: Integer): Boolean; function FillBuf(var Dest: PByte; var Remaining: Integer): Boolean; public constructor Create(const Reader: AReaderEx; const BufferSize: Integer = 128; const ReaderOwner: Boolean = True); destructor Destroy; override; property BufferSize: Integer read FBufferSize; function Read(var Buffer; const Size: Integer): Integer; override; function EOF: Boolean; override; procedure InvalidateBuffer; end; { } { TBufferedFileReader } { TBufferedReader instance using a TFileReader. } { } type TBufferedFileReader = class(TBufferedReader) public constructor Create(const FileName: String; const BufferSize: Integer = 512); overload; constructor Create(const FileHandle: Integer; const HandleOwner: Boolean = False; const BufferSize: Integer = 512); overload; end; { } { TSplitBufferedFileReader } { TSplitBufferedReader instance using a TFileReader. } { } type TSplitBufferedFileReader = class(TSplitBufferedReader) public constructor Create(const FileName: String; const BufferSize: Integer = 512); end; { } { Self-testing code } { } procedure SelfTest; implementation { } { AReaderEx } { } const DefaultBufSize = 2048; procedure AReaderEx.RaiseReadError(const Msg: String); var S : String; begin if Msg = '' then S := 'Read error' else S := Msg; raise EReader.Create(S); end; procedure AReaderEx.RaiseSeekError; begin raise EReader.Create('Seek error'); end; procedure AReaderEx.ReadBuffer(var Buffer; const Size: Integer); begin if Size <= 0 then exit; if Read(Buffer, Size) <> Size then RaiseReadError; end; function AReaderEx.ReadStr(const Size: Integer): String; var L : Integer; begin if Size <= 0 then begin Result := ''; exit; end; SetLength(Result, Size); L := Read(Pointer(Result)^, Size); if L <= 0 then begin Result := ''; exit; end; if L < Size then SetLength(Result, L); end; function AReaderEx.ReadWideStr(const Length: Integer): WideString; var L : Integer; begin if Length <= 0 then begin Result := ''; exit; end; SetLength(Result, Length); L := Read(Pointer(Result)^, Length * Sizeof(WideChar)) div Sizeof(WideChar); if L <= 0 then begin Result := ''; exit; end; if L < Length then SetLength(Result, L); end; function AReaderEx.GetToEOF: String; var S : Int64; B : Array[0..DefaultBufSize - 1] of Byte; I, J : Integer; L, N : Integer; R : Boolean; Q : PChar; begin S := GetSize; if S < 0 then // size unknown begin Q := nil; Result := ''; L := 0; // actual size N := 0; // allocated size R := EOF; While not R do begin I := Read(B[0], DefaultBufSize); R := EOF; if I > 0 then begin J := L + I; if J > N then begin // allocate the exact buffer size for the first two reads // allocate double the buffer size from the third read if J <= DefaultBufSize * 2 then N := J else N := J * 2; SetLength(Result, N); Q := Pointer(Result); Inc(Q, L); end; Move(B[0], Q^, I); Inc(Q, I); Inc(L, I); end else if not R then RaiseReadError; end; if L < N then // set exact result size SetLength(Result, L); end else // size known Result := ReadStr(S - GetPosition); end; function AReaderEx.GetAsString: String; begin SetPosition(0); Result := GetToEOF; end; function AReaderEx.ReadByte: Byte; begin ReadBuffer(Result, Sizeof(Byte)); end; function AReaderEx.ReadWord: Word; begin ReadBuffer(Result, Sizeof(Word)); end; function AReaderEx.ReadLongWord: LongWord; begin ReadBuffer(Result, Sizeof(LongWord)); end; function AReaderEx.ReadLongInt: LongInt; begin ReadBuffer(Result, Sizeof(LongInt)); end; function AReaderEx.ReadInt64: Int64; begin ReadBuffer(Result, Sizeof(Int64)); end; function AReaderEx.ReadSingle: Single; begin ReadBuffer(Result, Sizeof(Single)); end; function AReaderEx.ReadDouble: Double; begin ReadBuffer(Result, Sizeof(Double)); end; function AReaderEx.ReadExtended: Extended; begin ReadBuffer(Result, Sizeof(Extended)); end; function AReaderEx.ReadPackedString: String; var L : Integer; begin L := ReadLongInt; if L < 0 then raise EReader.Create('Invalid string'); Result := ReadStr(L); end; function AReaderEx.ReadPackedStringArray: StringArray; var I, L : Integer; begin L := ReadLongInt; if L < 0 then raise EReader.Create('Invalid array'); SetLength(Result, L); For I := 0 to L - 1 do Result[I] := ReadPackedString; end; function AReaderEx.ReadPackedWideString: WideString; var L : Integer; begin L := ReadLongInt; if L < 0 then raise EReader.Create('Invalid string'); Result := ReadWideStr(L); end; function AReaderEx.Peek(var Buffer; const Size: Integer): Integer; var P : Int64; begin P := GetPosition; Result := Read(Buffer, Size); if Result > 0 then SetPosition(P); end; procedure AReaderEx.PeekBuffer(var Buffer; const Size: Integer); begin if Size <= 0 then exit; if Peek(Buffer, Size) <> Size then RaiseReadError; end; function AReaderEx.PeekStr(const Size: Integer): String; var L : Integer; begin if Size <= 0 then begin Result := ''; exit; end; SetLength(Result, Size); L := Peek(Pointer(Result)^, Size); if L <= 0 then begin Result := ''; exit; end; if L < Size then SetLength(Result, L); end; function AReaderEx.PeekByte: Byte; begin PeekBuffer(Result, Sizeof(Byte)); end; function AReaderEx.PeekWord: Word; begin PeekBuffer(Result, Sizeof(Word)); end; function AReaderEx.PeekLongWord: LongWord; begin PeekBuffer(Result, Sizeof(LongWord)); end; function AReaderEx.PeekLongInt: LongInt; begin PeekBuffer(Result, Sizeof(LongInt)); end; function AReaderEx.PeekInt64: Int64; begin PeekBuffer(Result, Sizeof(Int64)); end; { Returns the number of characters read and matched, or -1 if no match } function AReaderEx.Match(const Buffer; const Size: Integer; const CaseSensitive: Boolean): Integer; var B : Pointer; F : Array[0..DefaultBufSize - 1] of Byte; M : Boolean; R : Boolean; begin if Size <= 0 then begin Result := -1; exit; end; M := Size > DefaultBufSize; if M then GetMem(B, Size) else B := @F[0]; try Result := Peek(B^, Size); if Result <= 0 then exit; if CaseSensitive then R := CompareMem(Buffer, B^, Result) else R := CompareMemNoCase(Buffer, B^, Result) = crEqual; if not R then Result := -1; finally if M then FreeMem(B); end; end; function AReaderEx.MatchBuffer(const Buffer; const Size: Integer; const CaseSensitive: Boolean): Boolean; var I : Integer; begin I := Match(Buffer, Size, CaseSensitive); if I < 0 then begin Result := False; exit; end; if I < Size then RaiseReadError; Result := True; end; function AReaderEx.MatchStr(const S: String; const CaseSensitive: Boolean): Boolean; begin Result := MatchBuffer(Pointer(S)^, Length(S), CaseSensitive); end; function AReaderEx.MatchChar(const Ch: Char; const MatchNonMatch: Boolean; const SkipOnMatch: Boolean): Boolean; begin if EOF then begin Result := False; exit; end; Result := (Char(PeekByte) = Ch) xor MatchNonMatch; if Result and SkipOnMatch then Skip(Sizeof(Byte)); end; function AReaderEx.MatchChar(const C: CharSet; var Ch: Char; const MatchNonMatch: Boolean; const SkipOnMatch: Boolean): Boolean; begin if EOF then begin Result := False; exit; end; Ch := Char(PeekByte); Result := (Ch in C) xor MatchNonMatch; if Result and SkipOnMatch then Skip(Sizeof(Byte)); end; procedure AReaderEx.Skip(const Count: Integer); begin if Count < 0 then raise EReader.Create('Skip error'); if Count = 0 then exit; SetPosition(GetPosition + Count); end; procedure AReaderEx.SkipByte; begin Skip(Sizeof(Byte)); end; function AReaderEx.SkipAll(const Ch: Char; const MatchNonMatch: Boolean; const MaxCount: Integer): Integer; begin Result := 0; While (MaxCount < 0) or (Result < MaxCount) do if not MatchChar(Ch, MatchNonMatch, True) then exit else Inc(Result); end; function AReaderEx.SkipAll(const C: CharSet; const MatchNonMatch: Boolean; const MaxCount: Integer): Integer; var Ch : Char; begin Result := 0; While (MaxCount < 0) or (Result < MaxCount) do if not MatchChar(C, Ch, MatchNonMatch, True) then exit else Inc(Result); end; function AReaderEx.Locate(const Ch: Char; const LocateNonMatch: Boolean; const MaxOffset: Integer): Integer; var P : Int64; I : Integer; begin P := GetPosition; I := 0; While not EOF and ((MaxOffset < 0) or (I <= MaxOffset)) do if (Char(ReadByte) = Ch) xor LocateNonMatch then begin SetPosition(P); Result := I; exit; end else Inc(I); SetPosition(P); Result := -1; end; function AReaderEx.Locate(const C: CharSet; const LocateNonMatch: Boolean; const MaxOffset: Integer): Integer; var P : Int64; I : Integer; begin P := GetPosition; I := 0; While not EOF and ((MaxOffset < 0) or (I <= MaxOffset)) do if (Char(ReadByte) in C) xor LocateNonMatch then begin SetPosition(P); Result := I; exit; end else Inc(I); SetPosition(P); Result := -1; end; function AReaderEx.LocateBuffer(const Buffer; const Size: Integer; const MaxOffset: Integer; const CaseSensitive: Boolean): Integer; var P : Int64; I, J : Integer; B : Pointer; R, M : Boolean; F : Array[0..DefaultBufSize - 1] of Byte; begin if Size <= 0 then begin Result := -1; exit; end; M := Size > DefaultBufSize; if M then GetMem(B, Size) else B := @F[0]; try P := GetPosition; I := 0; While not EOF and ((MaxOffset < 0) or (I <= MaxOffset)) do begin J := Read(B^, Size); if J < Size then begin if EOF then begin SetPosition(P); Result := -1; exit; end else RaiseReadError; end; if CaseSensitive then R := CompareMem(Buffer, B^, Size) else R := CompareMemNoCase(Buffer, B^, Size) = crEqual; if R then begin SetPosition(P); Result := I; exit; end else begin Inc(I); SetPosition(P + I); end; end; SetPosition(P); Result := -1; finally if M then FreeMem(B); end; end; function AReaderEx.LocateStr(const S: String; const MaxOffset: Integer; const CaseSensitive: Boolean): Integer; begin Result := LocateBuffer(Pointer(S)^, Length(S), MaxOffset, CaseSensitive); end; function AReaderEx.ExtractAll(const C: CharSet; const ExtractNonMatch: Boolean; const MaxCount: Integer): String; var I : Integer; begin I := Locate(C, not ExtractNonMatch, MaxCount); if I = -1 then if MaxCount = -1 then Result := GetToEOF else Result := ReadStr(MaxCount) else Result := ReadStr(I); end; const csNewLineNone : CharSet = []; csNewLineCR : CharSet = [#13]; csNewLineLF : CharSet = [#10]; csNewLineEOF : CharSet = [#26]; csNewLineCRLF : CharSet = [#10, #13]; csNewLineCREOF : CharSet = [#13, #26]; csNewLineLFEOF : CharSet = [#10, #26]; csNewLineCRLFEOF : CharSet = [#10, #13, #26]; procedure FirstNewLineCharsFromEOLTypes(const EOLTypes: TReaderEOLTypes; var Chars: PCharSet); begin if [eolCR, eolCRLF] * EOLTypes <> [] then if [eolLF, eolLFCR] * EOLTypes <> [] then if eolEOFAtEOF in EOLTypes then Chars := @csNewLineCRLFEOF else Chars := @csNewLineCRLF else if eolEOFAtEOF in EOLTypes then Chars := @csNewLineCREOF else Chars := @csNewLineCR else if [eolLF, eolLFCR] * EOLTypes <> [] then if eolEOFAtEOF in EOLTypes then Chars := @csNewLineLFEOF else Chars := @csNewLineLF else if eolEOFAtEOF in EOLTypes then Chars := @csNewLineEOF else Chars := @csNewLineNone; end; function AReaderEx.SkipLineTerminator(const EOLTypes: TReaderEOLTypes): Integer; var C, D : Char; R : Boolean; begin C := Char(ReadByte); if ((C = #10) and ([eolLFCR, eolLF] * EOLTypes = [eolLF])) or ((C = #13) and ([eolCRLF, eolCR] * EOLTypes = [eolCR])) then begin Result := 1; exit; end; if not (((C = #10) and (eolLFCR in EOLTypes)) or ((C = #13) and (eolCRLF in EOLTypes))) then begin SetPosition(GetPosition - 1); Result := 0; exit; end; R := EOF; if (C = #26) and (eolEOFAtEOF in EOLTypes) and R then begin Result := 1; exit; end; if R then begin if ((C = #10) and (eolLF in EOLTypes)) or ((C = #13) and (eolCR in EOLTypes)) then begin Result := 1; exit; end; SetPosition(GetPosition - 1); Result := 0; exit; end; D := Char(ReadByte); if ((C = #13) and (D = #10) and (eolCRLF in EOLTypes)) or ((C = #10) and (D = #13) and (eolLFCR in EOLTypes)) then begin Result := 2; exit; end; if ((C = #13) and (eolCR in EOLTypes)) or ((C = #10) and (eolLF in EOLTypes)) then begin SetPosition(GetPosition - 1); Result := 1; exit; end; SetPosition(GetPosition - 2); Result := 0; end; function AReaderEx.ExtractLine(const MaxLineLength: Integer; const EOLTypes: TReaderEOLTypes): String; var NewLineChars : PCharSet; Fin : Boolean; begin if EOLTypes = [] then begin Result := ''; exit; end; if EOLTypes = [eolEOF] then begin Result := GetToEOF; exit; end; FirstNewLineCharsFromEOLTypes(EOLTypes, NewLineChars); Result := ''; Repeat Result := Result + ExtractAll(NewLineChars^, True, MaxLineLength); if EOF then if eolEOF in EOLTypes then exit else RaiseReadError; Fin := (MaxLineLength >= 0) and (Length(Result) >= MaxLineLength); if not Fin then begin Fin := SkipLineTerminator(EOLTypes) > 0; if not Fin then Result := Result + Char(ReadByte); end; Until Fin; end; function AReaderEx.SkipLine(const MaxLineLength: Integer; const EOLTypes: TReaderEOLTypes): Boolean; var NewLineChars : PCharSet; I : Integer; P, Q : Int64; Fin : Boolean; begin if EOLTypes = [] then begin Result := False; exit; end; Result := True; if EOLTypes = [eolEOF] then begin Position := Size; exit; end; FirstNewLineCharsFromEOLTypes(EOLTypes, NewLineChars); Fin := False; Repeat I := Locate(NewLineChars^, False, MaxLineLength); if I < 0 then if MaxLineLength < 0 then begin Position := Size; exit; end else begin P := Position + MaxLineLength; Q := Size; if P > Q then P := Q; Position := P; exit; end else begin Skip(I); if EOF then exit; Fin := SkipLineTerminator(EOLTypes) > 0; if not Fin then SkipByte; end; Until Fin; end; { } { TMemoryReader } { For Size < 0 the memory reader assumes no size limit. } { } constructor TMemoryReader.Create(const Data: Pointer; const Size: Integer); begin inherited Create; SetData(Data, Size); end; procedure TMemoryReader.SetData(const Data: Pointer; const Size: Integer); begin FData := Data; FSize := Size; FPos := 0; end; function TMemoryReader.GetPosition: Int64; begin Result := FPos; end; procedure TMemoryReader.SetPosition(const Position: Int64); var S : Integer; begin S := FSize; if (Position < 0) or ((S >= 0) and (Position > S)) then RaiseSeekError; FPos := Integer(Position); end; function TMemoryReader.GetSize: Int64; begin Result := FSize; end; function TMemoryReader.Read(var Buffer; const Size: Integer): Integer; var L, S, I : Integer; P : PByte; begin I := FPos; S := FSize; if (Size <= 0) or ((S >= 0) and (I >= S)) then begin Result := 0; exit; end; if S < 0 then L := Size else begin L := S - I; if Size < L then L := Size; end; P := FData; Inc(P, I); MoveMem(P^, Buffer, L); Result := L; Inc(FPos, L); end; function TMemoryReader.EOF: Boolean; var S : Integer; begin S := FSize; if S < 0 then Result := False else Result := FPos >= S; end; function TMemoryReader.ReadByte: Byte; var I, S : Integer; P : PByte; begin I := FPos; S := FSize; if (S >= 0) and (I >= S) then RaiseReadError; P := FData; Inc(P, I); Result := P^; Inc(FPos); end; function TMemoryReader.ReadLongInt: LongInt; var I, S : Integer; begin I := FPos; S := FSize; if (S >= 0) and (I + Sizeof(LongInt) > S) then RaiseReadError; Result := PLongInt(@PChar(FData)[I])^; Inc(FPos, Sizeof(LongInt)); end; function TMemoryReader.ReadInt64: Int64; var I, S : Integer; begin I := FPos; S := FSize; if (S >= 0) and (I + Sizeof(Int64) > S) then RaiseReadError; Result := PInt64(@PChar(FData)[I])^; Inc(FPos, Sizeof(Int64)); end; function TMemoryReader.PeekByte: Byte; var I, S : Integer; P : PByte; begin I := FPos; S := FSize; if (S >= 0) and (I >= S) then RaiseReadError; P := FData; Inc(P, I); Result := P^; end; function TMemoryReader.Match(const Buffer; const Size: Integer; const CaseSensitive: Boolean): Integer; var L, S : Integer; P : PByte; R : Boolean; begin S := FSize; if S < 0 then L := Size else begin L := S - FPos; if L > Size then L := Size; end; if L <= 0 then begin Result := -1; exit; end; P := FData; Inc(P, FPos); if CaseSensitive then R := CompareMem(Buffer, P^, L) else R := CompareMemNoCase(Buffer, P^, L) = crEqual; if R then Result := L else Result := -1; end; procedure TMemoryReader.Skip(const Count: Integer); var S, I : Integer; begin if Count <= 0 then exit; S := FSize; if S < 0 then Inc(FPos, Count) else begin I := FPos + Count; if I > S then RaiseSeekError; FPos := I; end; end; { } { TStringReader } { } constructor TStringReader.Create(const Data: String); begin FDataString := Data; inherited Create(Pointer(FDataString), Length(FDataString)); end; procedure TStringReader.SetDataString(const S: String); begin FDataString := S; SetData(Pointer(FDataString), Length(FDataString)); end; function TStringReader.GetAsString: String; begin Result := FDataString; end; { } { TFileReader } { } constructor TFileReader.Create(const FileName: String; const AccessHint: TFileReaderAccessHint); {$IFDEF OS_WIN32} var F : LongWord; {$ENDIF} begin inherited Create; {$IFDEF OS_WIN32} F := FILE_ATTRIBUTE_NORMAL; Case AccessHint of frahNone : ; frahRandomAccess : F := F or FILE_FLAG_RANDOM_ACCESS; frahSequentialAccess : F := F or FILE_FLAG_SEQUENTIAL_SCAN; end; FHandle := Integer(Windows.CreateFile(PChar(FileName), GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_EXISTING, F, 0)); {$ELSE} FHandle := FileOpen(FileName, fmOpenRead or fmShareDenyNone); {$ENDIF} if FHandle = -1 then raise EFileReader.Create('File open error'); FHandleOwner := True; end; constructor TFileReader.Create(const FileHandle: Integer; const HandleOwner: Boolean); begin inherited Create; FHandle := FileHandle; FHandleOwner := HandleOwner; end; destructor TFileReader.Destroy; begin if FHandleOwner and (FHandle <> -1) and (FHandle <> 0) then FileClose(FHandle); inherited Destroy; end; function TFileReader.GetPosition: Int64; begin Result := FileSeek(FHandle, Int64(0), 1); if Result = -1 then raise EFileReader.Create('File error'); end; procedure TFileReader.SetPosition(const Position: Int64); begin if FileSeek(FHandle, Position, 0) = -1 then raise EFileReader.Create('File seek error'); end; function TFileReader.GetSize: Int64; var I : Int64; begin I := GetPosition; Result := FileSeek(FHandle, Int64(0), 2); SetPosition(I); if Result = -1 then raise EFileReader.Create('File error'); end; function TFileReader.Read(var Buffer; const Size: Integer): Integer; var I : Integer; begin if Size <= 0 then begin Result := 0; exit; end; I := FileRead(FHandle, Buffer, Size); if I <= 0 then begin Result := 0; exit; end; Result := I; end; function TFileReader.EOF: Boolean; begin Result := GetPosition >= GetSize; end; { ReadFileToStr } function ReadFileToStr(const FileName: String): String; var F : TFileReader; begin F := TFileReader.Create(FileName); try Result := F.GetAsString; finally F.Free; end; end; { } { AReaderProxy } { } constructor AReaderProxy.Create(const Reader: AReaderEx; const ReaderOwner: Boolean); begin Assert(Assigned(Reader)); inherited Create; FReader := Reader; FReaderOwner := ReaderOwner; end; destructor AReaderProxy.Destroy; begin if FReaderOwner then FreeAndNil(FReader); inherited Destroy; end; function AReaderProxy.Read(var Buffer; const Size: Integer): Integer; begin Result := FReader.Read(Buffer, Size); end; function AReaderProxy.EOF: Boolean; begin Result := FReader.EOF; end; function AReaderProxy.GetPosition: Int64; begin Result := FReader.GetPosition; end; procedure AReaderProxy.SetPosition(const Position: Int64); begin FReader.SetPosition(Position); end; function AReaderProxy.GetSize: Int64; begin Result := FReader.GetSize; end; { } { TReaderProxy } { } constructor TReaderProxy.Create(const Reader: AReaderEx; const ReaderOwner: Boolean; const Size: Int64); begin inherited Create(Reader, ReaderOwner); FOffset := Reader.GetPosition; FSize := Size; end; function TReaderProxy.GetPosition: Int64; begin Result := FReader.GetPosition - FOffset; end; procedure TReaderProxy.SetPosition(const Position: Int64); begin if Position < 0 then raise EReader.Create('Seek error'); if (FSize >= 0) and (Position > FOffset + FSize) then raise EReader.Create('Seek error'); FReader.SetPosition(FOffset + Position); end; function TReaderProxy.GetSize: Int64; begin Result := FReader.GetSize; if Result >= FOffset then Dec(Result, FOffset) else Result := -1; if (FSize >= 0) and (FSize < Result) then Result := FSize; end; function TReaderProxy.EOF: Boolean; begin Result := FReader.EOF; if Result or (FSize < 0) then exit; Result := FReader.Position >= FOffset + FSize; end; function TReaderProxy.Read(var Buffer; const Size: Integer): Integer; var L : Integer; M : Int64; begin L := Size; if FSize >= 0 then begin M := FSize - (FReader.Position - FOffset); if M < L then L := Integer(M); end; if L <= 0 then begin Result := 0; exit; end; Result := FReader.Read(Buffer, L); end; { } { TBufferedReader } { } constructor TBufferedReader.Create(const Reader: AReaderEx; const BufferSize: Integer; const ReaderOwner: Boolean); begin inherited Create(Reader, ReaderOwner); FBufferSize := BufferSize; GetMem(FBuffer, BufferSize); FPos := Reader.GetPosition; end; destructor TBufferedReader.Destroy; begin if Assigned(FBuffer) then FreeMem(FBuffer); inherited Destroy; end; function TBufferedReader.GetPosition: Int64; begin Result := FPos; end; function TBufferedReader.GetSize: Int64; begin Result := FReader.GetSize; end; procedure TBufferedReader.SetPosition(const Position: Int64); var B, C : Int64; begin B := Position - FPos; if B = 0 then exit; C := B + FBufPos; if (C >= 0) and (C <= FBufUsed) then begin Inc(FBufPos, Integer(B)); FPos := Position; exit; end; FReader.SetPosition(Position); FPos := Position; FBufPos := 0; FBufUsed := 0; end; procedure TBufferedReader.Skip(const Count: Integer); var I : Integer; P : Int64; begin if Count < 0 then raise EReader.Create('Seek error'); if Count = 0 then exit; I := FBufUsed - FBufPos; if I >= Count then begin Inc(FBufPos, Count); Inc(FPos, Count); exit; end; P := GetPosition + Count; FReader.SetPosition(P); FPos := P; FBufPos := 0; FBufUsed := 0; end; // Internal function FillBuf // Returns True if buffer was only partially filled function TBufferedReader.FillBuf: Boolean; var P : PByte; L, N : Integer; begin L := FBufferSize - FBufUsed; if L <= 0 then begin Result := False; exit; end; P := FBuffer; Inc(P, FBufPos); N := FReader.Read(P^, L); Inc(FBufUsed, N); Result := N < L; end; function TBufferedReader.Read(var Buffer; const Size: Integer): Integer; var L, M : Integer; P, Q : PByte; R : Boolean; begin if Size <= 0 then begin Result := 0; exit; end; Q := @Buffer; M := Size; R := False; Repeat L := FBufUsed - FBufPos; if L > M then L := M; if L > 0 then begin P := FBuffer; Inc(P, FBufPos); MoveMem(P^, Q^, L); Inc(FBufPos, L); Inc(FPos, L); Dec(M, L); if M = 0 then begin Result := Size; exit; end; Inc(Q, L); end; FBufPos := 0; FBufUsed := 0; if R then begin Result := Size - M; exit; end; R := FillBuf; Until False; end; function TBufferedReader.EOF: Boolean; begin if FBufUsed > FBufPos then Result := False else Result := FReader.EOF; end; procedure TBufferedReader.InvalidateBuffer; begin FReader.SetPosition(FPos); FBufPos := 0; FBufUsed := 0; end; // Internal function BufferByte // Fills buffer with at least one character, otherwise raises an exception procedure TBufferedReader.BufferByte; var I : Integer; begin I := FBufUsed; if FBufPos < I then exit; if I >= FBufferSize then begin FBufPos := 0; FBufUsed := 0; end; FillBuf; if FBufPos >= FBufUsed then RaiseReadError; end; function TBufferedReader.ReadByte: Byte; var P : PByte; begin BufferByte; P := FBuffer; Inc(P, FBufPos); Result := P^; Inc(FBufPos); Inc(FPos); end; function TBufferedReader.PeekByte: Byte; var P : PByte; begin BufferByte; P := FBuffer; Inc(P, FBufPos); Result := P^; end; function TBufferedReader.PosBuf(const C: CharSet; const LocateNonMatch: Boolean; const MaxOffset: Integer): Integer; var P : PChar; L : Integer; begin P := FBuffer; L := FBufPos; Inc(P, L); Result := 0; While (L < FBufUsed) and ((MaxOffset < 0) or (Result <= MaxOffset)) do if (P^ in C) xor LocateNonMatch then exit else begin Inc(P); Inc(L); Inc(Result); end; Result := -1; end; function TBufferedReader.Locate(const C: CharSet; const LocateNonMatch: Boolean; const MaxOffset: Integer): Integer; var I, J, M, K : Integer; P : Int64; R : Boolean; begin P := GetPosition; M := MaxOffset; J := 0; R := False; Repeat K := FBufUsed - FBufPos; if K > 0 then begin I := PosBuf(C, LocateNonMatch, M); if I >= 0 then begin SetPosition(P); Result := J + I; exit; end; end; if R then begin SetPosition(P); Result := -1; exit; end; Inc(J, K); Inc(FPos, K); FBufPos := 0; FBufUsed := 0; if M >= 0 then begin Dec(M, K); if M < 0 then begin SetPosition(P); Result := -1; exit; end; end; R := FillBuf; Until False; end; { } { TSplitBufferedReader } { } constructor TSplitBufferedReader.Create(const Reader: AReaderEx; const BufferSize: Integer; const ReaderOwner: Boolean); var I : Integer; begin inherited Create(Reader, ReaderOwner); FBufferSize := BufferSize; For I := 0 to 1 do GetMem(FBuffer[I], BufferSize); FPos := Reader.GetPosition; end; destructor TSplitBufferedReader.Destroy; var I : Integer; begin For I := 0 to 1 do if Assigned(FBuffer[I]) then FreeMem(FBuffer[I]); inherited Destroy; end; function TSplitBufferedReader.GetSize: Int64; begin Result := FReader.GetSize; end; function TSplitBufferedReader.GetPosition: Int64; begin Result := FPos; end; // Internal function BufferStart used by SetPosition // Returns the relative offset of the first buffered byte function TSplitBufferedReader.BufferStart: Integer; begin Result := -FBufPos; if FBufNr = 1 then Dec(Result, FBufUsed[0]); end; // Internal function BufferRemaining used by SetPosition // Returns the length of the remaining buffered data function TSplitBufferedReader.BufferRemaining: Integer; begin Result := FBufUsed[FBufNr] - FBufPos; if FBufNr = 0 then Inc(Result, FBufUsed[1]); end; procedure TSplitBufferedReader.SetPosition(const Position: Int64); var D : Int64; begin D := Position - FPos; if D = 0 then exit; if (D >= BufferStart) and (D <= BufferRemaining) then begin Inc(FBufPos, D); if (FBufNr = 1) and (FBufPos < 0) then // Set position from Buf1 to Buf0 begin Inc(FBufPos, FBufUsed[0]); FBufNr := 0; end else if (FBufNr = 0) and (FBufPos > FBufUsed[0]) then // Set position from Buf0 to Buf1 begin Dec(FBufPos, FBufUsed[0]); FBufNr := 1; end; FPos := Position; exit; end; FReader.SetPosition(Position); FPos := Position; FBufNr := 0; FBufPos := 0; FBufUsed[0] := 0; FBufUsed[1] := 0; end; procedure TSplitBufferedReader.InvalidateBuffer; begin FReader.SetPosition(FPos); FBufNr := 0; FBufPos := 0; FBufUsed[0] := 0; FBufUsed[1] := 0; end; // Internal function MoveBuf used by Read // Moves remaining data from Buffer[BufNr]^[BufPos] to Dest // Returns True if complete (Remaining=0) function TSplitBufferedReader.MoveBuf(var Dest: PByte; var Remaining: Integer): Boolean; var P : PByte; L, R, N, O : Integer; begin N := FBufNr; O := FBufPos; L := FBufUsed[N] - O; if L <= 0 then begin Result := False; exit; end; P := FBuffer[N]; Inc(P, O); R := Remaining; if R < L then L := R; MoveMem(P^, Dest^, L); Inc(Dest, L); Inc(FBufPos, L); Dec(R, L); if R <= 0 then Result := True else Result := False; Remaining := R; end; // Internal function FillBuf used by Read // Fill Buffer[BufNr]^[BufPos] with up to BufferSize bytes and moves // the read data to Dest // Returns True if complete (incomplete Read or Remaining=0) function TSplitBufferedReader.FillBuf(var Dest: PByte; var Remaining: Integer): Boolean; var P : PByte; I, L, N : Integer; begin N := FBufNr; I := FBufUsed[N]; L := FBufferSize - I; if L <= 0 then begin Result := False; exit; end; P := FBuffer[N]; Inc(P, I); I := FReader.Read(P^, L); if I > 0 then begin Inc(FBufUsed[N], I); if MoveBuf(Dest, Remaining) then begin Result := True; exit; end; end; Result := I < L; end; function TSplitBufferedReader.Read(var Buffer; const Size: Integer): Integer; var Dest : PByte; Remaining : Integer; begin if Size <= 0 then begin Result := 0; exit; end; Dest := @Buffer; Remaining := Size; Repeat if MoveBuf(Dest, Remaining) then begin Result := Size; Inc(FPos, Size); exit; end; if FillBuf(Dest, Remaining) then begin Result := Size - Remaining; Inc(FPos, Result); exit; end; if FBufNr = 0 then FBufNr := 1 else begin Swap(FBuffer[0], FBuffer[1]); FBufUsed[0] := FBufUsed[1]; FBufUsed[1] := 0; end; FBufPos := 0; Until False; end; function TSplitBufferedReader.EOF: Boolean; begin if FBufUsed[FBufNr] > FBufPos then Result := False else if FBufNr = 1 then Result := FReader.EOF else if FBufUsed[1] > 0 then Result := False else Result := FReader.EOF; end; { } { TBufferedFileReader } { } constructor TBufferedFileReader.Create(const FileName: String; const BufferSize: Integer); begin inherited Create(TFileReader.Create(FileName), BufferSize, True); end; constructor TBufferedFileReader.Create(const FileHandle: Integer; const HandleOwner: Boolean; const BufferSize: Integer); begin inherited Create(TFileReader.Create(FileHandle, HandleOwner), BufferSize, True); end; { } { TSplitBufferedFileReader } { } constructor TSplitBufferedFileReader.Create(const FileName: String; const BufferSize: Integer); begin inherited Create(TFileReader.Create(FileName), BufferSize, True); end; { } { Self-testing code } { } {$ASSERTIONS ON} procedure TestReader(const Reader: AReaderEx; const FreeReader: Boolean); begin try Reader.Position := 0; Assert(not Reader.EOF, 'Reader.EOF'); Assert(Reader.Size = 26, 'Reader.Size'); Assert(Reader.PeekStr(0) = '', 'Reader.PeekStr'); Assert(Reader.PeekStr(-1) = '', 'Reader.PeekStr'); Assert(Reader.PeekStr(2) = '01', 'Reader.PeekStr'); Assert(Char(Reader.PeekByte) = '0', 'Reader.PeekByte'); Assert(Char(Reader.ReadByte) = '0', 'Reader.ReadByte'); Assert(Char(Reader.PeekByte) = '1', 'Reader.PeekByte'); Assert(Char(Reader.ReadByte) = '1', 'Reader.ReadByte'); Assert(Reader.ReadStr(0) = '', 'Reader.ReadStr'); Assert(Reader.ReadStr(-1) = '', 'Reader.ReadStr'); Assert(Reader.ReadStr(1) = '2', 'Reader.ReadStr'); Assert(Reader.MatchChar('3'), 'Reader.MatchChar'); Assert(Reader.MatchStr('3', True), 'Reader.MatchStr'); Assert(Reader.MatchStr('345', True), 'Reader.MatchStr'); Assert(not Reader.MatchStr('35', True), 'Reader.MatchStr'); Assert(not Reader.MatchStr('4', True), 'Reader.MatchStr'); Assert(not Reader.MatchStr('', True), 'Reader.MatchStr'); Assert(Reader.ReadStr(2) = '34', 'Reader.ReadStr'); Assert(Reader.PeekStr(3) = '567', 'Reader.PeekStr'); Assert(Reader.Locate('5', False, 0) = 0, 'Reader.Locate'); Assert(Reader.Locate('8', False, -1) = 3, 'Reader.Locate'); Assert(Reader.Locate('8', False, 3) = 3, 'Reader.Locate'); Assert(Reader.Locate('8', False, 2) = -1, 'Reader.Locate'); Assert(Reader.Locate('8', False, 4) = 3, 'Reader.Locate'); Assert(Reader.Locate('0', False, -1) = -1, 'Reader.Locate'); Assert(Reader.Locate(['8'], False, -1) = 3, 'Reader.Locate'); Assert(Reader.Locate(['8'], False, 3) = 3, 'Reader.Locate'); Assert(Reader.Locate(['8'], False, 2) = -1, 'Reader.Locate'); Assert(Reader.Locate(['0'], False, -1) = -1, 'Reader.Locate'); Assert(Reader.LocateStr('8', -1, True) = 3, 'Reader.LocateStr'); Assert(Reader.LocateStr('8', 3, True) = 3, 'Reader.LocateStr'); Assert(Reader.LocateStr('8', 2, True) = -1, 'Reader.LocateStr'); Assert(Reader.LocateStr('89', -1, True) = 3, 'Reader.LocateStr'); Assert(Reader.LocateStr('0', -1, True) = -1, 'Reader.LocateStr'); Assert(not Reader.EOF, 'Reader.EOF'); Assert(Reader.Position = 5, 'Reader.Position'); Reader.Position := 7; Reader.SkipByte; Assert(Reader.Position = 8, 'Reader.Position'); Reader.Skip(2); Assert(Reader.Position = 10, 'Reader.Position'); Assert(not Reader.EOF, 'Reader.EOF'); Assert(Reader.MatchStr('abcd', False), 'Reader.MatchStr'); Assert(not Reader.MatchStr('abcd', True), 'Reader.MatchStr'); Assert(Reader.LocateStr('d', -1, True) = 3, 'Reader.LocateStr'); Assert(Reader.LocateStr('d', 3, False) = 3, 'Reader.LocateStr'); Assert(Reader.LocateStr('D', -1, True) = -1, 'Reader.LocateStr'); Assert(Reader.LocateStr('D', -1, False) = 3, 'Reader.LocateStr'); Assert(Reader.SkipAll('X', False, -1) = 0, 'Reader.SkipAll'); Assert(Reader.SkipAll('A', False, -1) = 1, 'Reader.SkipAll'); Assert(Reader.SkipAll(['b', 'C'], False, -1) = 2, 'Reader.SkipAll'); Assert(Reader.SkipAll(['d'], False, 0) = 0, 'Reader.SkipAll'); Assert(Reader.ExtractAll(['d', 'E'], False, 1) = 'd', 'Reader.ExtractAll'); Assert(Reader.ExtractAll(['*'], True, 1) = 'E', 'Reader.ExtractAll'); Assert(Reader.ReadStr(2) = '*.', 'Reader.ReadStr'); Assert(Reader.ExtractAll(['X'], False, 1) = 'X', 'Reader.ExtractAll'); Assert(Reader.ExtractAll(['X'], False, -1) = 'XX', 'Reader.ExtractAll'); Assert(Reader.ExtractAll(['X', '*'], True, 1) = 'Y', 'Reader.ExtractAll'); Assert(Reader.ExtractAll(['X', '*'], True, -1) = 'YYY','Reader.ExtractAll'); Assert(Reader.ExtractAll(['X'], False, -1) = '', 'Reader.ExtractAll'); Assert(Reader.ExtractAll(['X'], True, -1) = '*.', 'Reader.ExtractAll'); Assert(Reader.EOF, 'Reader.EOF'); Assert(Reader.Position = 26, 'Reader.Position'); Reader.Position := Reader.Position - 2; Assert(Reader.PeekStr(3) = '*.', 'Reader.PeekStr'); Assert(Reader.ReadStr(3) = '*.', 'Reader.ReadStr'); finally if FreeReader then Reader.Free; end; end; procedure TestLineReader(const Reader: AReaderEx; const FreeReader: Boolean); begin try Reader.Position := 0; Assert(not Reader.EOF, 'Reader.EOF'); Assert(Reader.ExtractLine = '1', 'Reader.ExtractLine'); Assert(Reader.ExtractLine = '23', 'Reader.ExtractLine'); Assert(Reader.ExtractLine = '', 'Reader.ExtractLine'); Assert(Reader.ExtractLine = '4', 'Reader.ExtractLine'); Assert(Reader.ExtractLine = '5', 'Reader.ExtractLine'); Assert(Reader.ExtractLine = '6', 'Reader.ExtractLine'); Assert(Reader.EOF, 'Reader.EOF'); Reader.Position := 0; Assert(Reader.ExtractLine(-1, [eolCRLF, eolEOF]) = '1', 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCRLF, eolEOF]) = '23'#13#13'4'#10'5'#10#13'6', 'Reader.ExtractLine'); Assert(Reader.EOF, 'Reader.EOF'); Reader.Position := 0; Assert(Reader.ExtractLine(-1, [eolCR, eolEOF]) = '1', 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolEOF]) = #10'23', 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolEOF]) = '', 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolEOF]) = '4'#10'5'#10, 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolEOF]) = '6', 'Reader.ExtractLine'); Assert(Reader.EOF, 'Reader.EOF'); Reader.Position := 0; Assert(Reader.ExtractLine(-1, [eolCR, eolCRLF, eolEOF]) = '1', 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolCRLF, eolEOF]) = '23', 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolCRLF, eolEOF]) = '', 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolCRLF, eolEOF]) = '4'#10'5'#10, 'Reader.ExtractLine'); Assert(Reader.ExtractLine(-1, [eolCR, eolCRLF, eolEOF]) = '6', 'Reader.ExtractLine'); Assert(Reader.EOF, 'Reader.EOF'); Reader.Position := 0; Assert(Reader.SkipLine(-1, [eolCRLF, eolEOF]), 'Reader.SkipLine'); Assert(Reader.SkipLine(-1, [eolCRLF, eolEOF]), 'Reader.SkipLine'); Assert(Reader.EOF, 'Reader.EOF'); Reader.Position := 0; Assert(Reader.SkipLine(-1, [eolCR, eolCRLF, eolEOF]), 'Reader.SkipLine'); Assert(Reader.SkipLine(-1, [eolCR, eolCRLF, eolEOF]), 'Reader.SkipLine'); Assert(Reader.SkipLine(-1, [eolCR, eolCRLF, eolEOF]), 'Reader.SkipLine'); Assert(Reader.SkipLine(-1, [eolCR, eolCRLF, eolEOF]), 'Reader.SkipLine'); Assert(Reader.SkipLine(-1, [eolCR, eolCRLF, eolEOF]), 'Reader.SkipLine'); Assert(Reader.EOF, 'Reader.EOF'); finally if FreeReader then Reader.Free; end; end; type TUnsizedStringReader = class(TStringReader) protected function GetSize: Int64; override; end; function TUnsizedStringReader.GetSize: Int64; begin Result := -1; end; procedure TestUnsizedReader(const Data: String); var S : TUnsizedStringReader; T : String; begin S := TUnsizedStringReader.Create(Data); try T := S.GetToEOF; Assert(T = Data, 'UnsizedReader.GetToEOF'); Assert(S.EOF, 'UnsizedReader.EOF'); finally S.Free; end; end; procedure SelfTest; var S : TStringReader; I : Integer; T : String; begin S := TStringReader.Create('0123456789AbCdE*.XXXYYYY*.'); try TestReader(TReaderProxy.Create(S, False, -1), True); TestReader(S, False); TestReader(TBufferedReader.Create(S, 128, False), True); For I := 1 to 16 do TestReader(TBufferedReader.Create(S, I, False), True); TestReader(TSplitBufferedReader.Create(S, 128, False), True); For I := 1 to 16 do TestReader(TSplitBufferedReader.Create(S, I, False), True); finally S.Free; end; S := TStringReader.Create('1'#13#10'23'#13#13'4'#10'5'#10#13'6'); try TestLineReader(TReaderProxy.Create(S, False, -1), True); For I := 1 to 32 do TestLineReader(TBufferedReader.Create(S, I, False), True); For I := 1 to 32 do TestLineReader(TSplitBufferedReader.Create(S, I, False), True); TestLineReader(S, False); finally S.Free; end; TestUnsizedReader(''); TestUnsizedReader('A'); TestUnsizedReader('ABC'); T := ''; For I := 1 to 1000 do T := T + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; TestUnsizedReader(T); end; end.
//////////////////////////////////////////////////////////////////////////////// // // // FileName : SUIMemo.pas // Creator : Shen Min // Date : 2002-08-22 V1-V3 // 2003-07-02 V4 // Comment : // // Copyright (c) 2002-2003 Sunisoft // http://www.sunisoft.com // Email: support@sunisoft.com // //////////////////////////////////////////////////////////////////////////////// unit SUIMemo; interface {$I SUIPack.inc} uses Windows, Messages, SysUtils, Classes, Controls, StdCtrls, Graphics, Forms, ComCtrls, SUIScrollBar, SUIThemes, SUIMgr; type TsuiMemo = class(TCustomMemo) private m_BorderColor : TColor; m_MouseDown : Boolean; m_UIStyle : TsuiUIStyle; m_FileTheme : TsuiFileTheme; // scroll bar m_VScrollBar : TsuiScrollBar; m_HScrollBar : TsuiScrollBar; m_SelfChanging : Boolean; m_UserChanging : Boolean; procedure SetHScrollBar(const Value: TsuiScrollBar); procedure SetVScrollBar(const Value: TsuiScrollBar); procedure OnHScrollBarChange(Sender : TObject); procedure OnVScrollBarChange(Sender : TObject); procedure UpdateScrollBars(); procedure UpdateScrollBarsPos(); procedure UpdateInnerScrollBars(); procedure CMEnabledChanged(var Msg : TMessage); message CM_ENABLEDCHANGED; procedure CMVisibleChanged(var Msg : TMessage); message CM_VISIBLECHANGED; procedure WMSIZE(var Msg : TMessage); message WM_SIZE; procedure WMMOVE(var Msg : TMessage); message WM_MOVE; procedure WMCut(var Message: TMessage); message WM_Cut; procedure WMPaste(var Message: TMessage); message WM_PASTE; procedure WMClear(var Message: TMessage); message WM_CLEAR; procedure WMUndo(var Message: TMessage); message WM_UNDO; procedure WMLBUTTONDOWN(var Message: TMessage); message WM_LBUTTONDOWN; procedure WMLButtonUp(var Message: TMessage); message WM_LBUTTONUP; procedure WMMOUSEWHEEL(var Message: TMessage); message WM_MOUSEWHEEL; procedure WMSetText(var Message:TWMSetText); message WM_SETTEXT; procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; procedure WMMOUSEMOVE(var Message: TMessage); message WM_MOUSEMOVE; procedure WMVSCROLL(var Message: TWMVScroll); message WM_VSCROLL; procedure WMHSCROLL(var Message: TWMHScroll); message WM_HSCROLL; procedure WMPAINT(var Msg : TMessage); message WM_PAINT; procedure WMEARSEBKGND(var Msg : TMessage); message WM_ERASEBKGND; procedure SetBorderColor(const Value: TColor); procedure SetFileTheme(const Value: TsuiFileTheme); procedure SetUIStyle(const Value: TsuiUIStyle); protected procedure Notification(AComponent: TComponent; Operation: TOperation); override; public constructor Create(AOwner: TComponent); override; published property FileTheme : TsuiFileTheme read m_FileTheme write SetFileTheme; property UIStyle : TsuiUIStyle read m_UIStyle write SetUIStyle; property BorderColor : TColor read m_BorderColor write SetBorderColor; // scroll bar property VScrollBar : TsuiScrollBar read m_VScrollBar write SetVScrollBar; property HScrollBar : TsuiScrollBar read m_HScrollBar write SetHScrollBar; property Align; property Alignment; property Anchors; property BiDiMode; property Color; property Constraints; property Ctl3D; property DragCursor; property DragKind; property DragMode; property Enabled; property Font; property HideSelection; property ImeMode; property ImeName; property Lines; property MaxLength; property OEMConvert; property ParentBiDiMode; property ParentColor; property ParentCtl3D; property ParentFont; property ParentShowHint; property PopupMenu; property ReadOnly; property ScrollBars; property ShowHint; property TabOrder; property TabStop; property Visible; property WantReturns; property WantTabs; property WordWrap; property OnChange; property OnClick; property OnDblClick; property OnDragDrop; property OnDragOver; property OnEndDock; property OnEndDrag; property OnEnter; property OnExit; property OnKeyDown; property OnKeyPress; property OnKeyUp; property OnMouseDown; property OnMouseMove; property OnMouseUp; property OnStartDock; property OnStartDrag; end; // Don't use it, some problems. // TsuiRichEdit = class(TCustomRichEdit) // private // m_BorderColor : TColor; // m_MouseDown : Boolean; // m_UIStyle : TsuiUIStyle; // m_FileTheme : TsuiFileTheme; // // // scroll bar // m_VScrollBar : TsuiScrollBar; // m_HScrollBar : TsuiScrollBar; // m_SelfChanging : Boolean; // m_UserChanging : Boolean; // // procedure SetHScrollBar(const Value: TsuiScrollBar); // procedure SetVScrollBar(const Value: TsuiScrollBar); // procedure OnHScrollBarChange(Sender : TObject); // procedure OnVScrollBarChange(Sender : TObject); // procedure UpdateScrollBars(); // procedure UpdateScrollBarsPos(); // procedure UpdateInnerScrollBars(); // // procedure CMEnabledChanged(var Msg : TMessage); message CM_ENABLEDCHANGED; // procedure WMSIZE(var Msg : TMessage); message WM_SIZE; // procedure WMMOVE(var Msg : TMessage); message WM_MOVE; // procedure WMCut(var Message: TMessage); message WM_Cut; // procedure WMPaste(var Message: TMessage); message WM_PASTE; // procedure WMClear(var Message: TMessage); message WM_CLEAR; // procedure WMUndo(var Message: TMessage); message WM_UNDO; // procedure WMLBUTTONDOWN(var Message: TMessage); message WM_LBUTTONDOWN; // procedure WMLButtonUp(var Message: TMessage); message WM_LBUTTONUP; // procedure WMMOUSEWHEEL(var Message: TMessage); message WM_MOUSEWHEEL; // procedure WMSetText(var Message:TWMSetText); message WM_SETTEXT; // procedure WMKeyDown(var Message: TWMKeyDown); message WM_KEYDOWN; // procedure WMMOUSEMOVE(var Message: TMessage); message WM_MOUSEMOVE; // procedure WMVSCROLL(var Message: TWMVScroll); message WM_VSCROLL; // procedure WMHSCROLL(var Message: TWMHScroll); message WM_HSCROLL; // // procedure WMPAINT(var Msg : TMessage); message WM_PAINT; // procedure WMEARSEBKGND(var Msg : TMessage); message WM_ERASEBKGND; // // procedure SetBorderColor(const Value: TColor); // procedure SetFileTheme(const Value: TsuiFileTheme); // procedure SetUIStyle(const Value: TsuiUIStyle); // // protected // procedure Notification(AComponent: TComponent; Operation: TOperation); override; // // public // constructor Create(AOwner: TComponent); override; // // published // property FileTheme : TsuiFileTheme read m_FileTheme write SetFileTheme; // property UIStyle : TsuiUIStyle read m_UIStyle write SetUIStyle; // property BorderColor : TColor read m_BorderColor write SetBorderColor; // // // scroll bar // property VScrollBar : TsuiScrollBar read m_VScrollBar write SetVScrollBar; // property HScrollBar : TsuiScrollBar read m_HScrollBar write SetHScrollBar; // // property Align; // property Alignment; // property Anchors; // property BiDiMode; // property Color; // property Constraints; // property Ctl3D; // property DragCursor; // property DragKind; // property DragMode; // property Enabled; // property Font; // property HideSelection; // property ImeMode; // property ImeName; // property Lines; // property MaxLength; // property OEMConvert; // property ParentBiDiMode; // property ParentColor; // property ParentCtl3D; // property ParentFont; // property ParentShowHint; // property PopupMenu; // property ReadOnly; // property ScrollBars; // property ShowHint; // property TabOrder; // property TabStop; // property Visible; // property WantReturns; // property WantTabs; // property WordWrap; // property OnChange; // property OnClick; // property OnDblClick; // property OnDragDrop; // property OnDragOver; // property OnEndDock; // property OnEndDrag; // property OnEnter; // property OnExit; // property OnKeyDown; // property OnKeyPress; // property OnKeyUp; // property OnMouseDown; // property OnMouseMove; // property OnMouseUp; // property OnStartDock; // property OnStartDrag; // end; implementation uses SUIPublic, SUIProgressBar; { TsuiMemo } procedure TsuiMemo.CMEnabledChanged(var Msg: TMessage); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.CMVisibleChanged(var Msg: TMessage); begin inherited; if not Visible then begin if m_VScrollBar <> nil then m_VScrollBar.Visible := Visible; if m_HScrollBar <> nil then m_HScrollBar.Visible := Visible; end else UpdateScrollBarsPos(); end; constructor TsuiMemo.Create(AOwner: TComponent); begin inherited; ControlStyle := ControlStyle + [csOpaque]; BorderStyle := bsNone; BorderWidth := 2; m_SelfChanging := false; m_UserChanging := false; m_MouseDown := false; UIStyle := GetSUIFormStyle(AOwner); end; procedure TsuiMemo.Notification(AComponent: TComponent; Operation: TOperation); begin inherited; if AComponent = nil then Exit; if ( (Operation = opRemove) and (AComponent = m_HScrollBar) )then begin m_HScrollBar := nil; UpdateInnerScrollBars(); end; if ( (Operation = opRemove) and (AComponent = m_VScrollBar) )then begin m_VScrollBar := nil; UpdateInnerScrollBars(); end; if ( (Operation = opRemove) and (AComponent = m_FileTheme) )then begin m_FileTheme := nil; SetUIStyle(SUI_THEME_DEFAULT); end; end; procedure TsuiMemo.OnHScrollBarChange(Sender: TObject); begin if m_SelfChanging then Exit; m_UserChanging := true; SendMessage(Handle, WM_HSCROLL, MakeWParam(SB_THUMBPOSITION, m_HScrollBar.Position), 0); Invalidate; m_UserChanging := false; end; procedure TsuiMemo.OnVScrollBarChange(Sender: TObject); begin if m_SelfChanging then Exit; m_UserChanging := true; SendMessage(Handle, WM_VSCROLL, MakeWParam(SB_THUMBPOSITION, m_VScrollBar.Position), 0); Invalidate; m_UserChanging := false; end; procedure TsuiMemo.SetBorderColor(const Value: TColor); begin m_BorderColor := Value; Repaint(); end; procedure TsuiMemo.SetFileTheme(const Value: TsuiFileTheme); begin m_FileTheme := Value; if m_VScrollBar <> nil then m_VScrollBar.FileTheme := Value; if m_HScrollBar <> nil then m_HScrollBar.FileTheme := Value; SetUIStyle(m_UIStyle); end; procedure TsuiMemo.SetHScrollBar(const Value: TsuiScrollBar); begin if m_HScrollBar = Value then Exit; if m_HScrollBar <> nil then begin m_HScrollBar.OnChange := nil; m_HScrollBar.LineButton := 0; m_HScrollBar.Max := 100; m_HScrollBar.Enabled := true; end; m_HScrollBar := Value; if m_HScrollBar = nil then begin UpdateInnerScrollBars(); Exit; end; m_HScrollBar.Orientation := suiHorizontal; m_HScrollBar.OnChange := OnHScrollBarChange; m_HScrollBar.BringToFront(); UpdateInnerScrollBars(); UpdateScrollBarsPos(); end; procedure TsuiMemo.SetUIStyle(const Value: TsuiUIStyle); var OutUIStyle : TsuiUIStyle; begin m_UIStyle := Value; if UsingFileTheme(m_FileTheme, m_UIStyle, OutUIStyle) then m_BorderColor := m_FileTheme.GetColor(SUI_THEME_CONTROL_BORDER_COLOR) else m_BorderColor := GetInsideThemeColor(OutUIStyle, SUI_THEME_CONTROL_BORDER_COLOR); if m_VScrollBar <> nil then m_VScrollBar.UIStyle := OutUIStyle; if m_HScrollBar <> nil then m_HScrollBar.UIStyle := OutUIStyle; Repaint(); end; procedure TsuiMemo.SetVScrollBar(const Value: TsuiScrollBar); begin if m_VScrollBar = Value then Exit; if m_VScrollBar <> nil then begin m_VScrollBar.OnChange := nil; m_VScrollBar.LineButton := 0; m_VScrollBar.Max := 100; m_VScrollBar.Enabled := true; end; m_VScrollBar := Value; if m_VScrollBar = nil then begin UpdateInnerScrollBars(); Exit; end; m_VScrollBar.Orientation := suiVertical; m_VScrollBar.OnChange := OnVScrollBArChange; m_VScrollBar.BringToFront(); UpdateInnerScrollBars(); UpdateScrollBarsPos(); end; procedure TsuiMemo.UpdateInnerScrollBars; begin if (m_VScrollBar <> nil) and (m_HScrollBar <> nil) then ScrollBars := ssBoth else if (m_VScrollBar <> nil) and (m_HScrollBar = nil) then ScrollBars := ssVertical else if (m_HScrollBar <> nil) and (m_VScrollBar = nil) then ScrollBars := ssHorizontal else ScrollBars := ssNone; end; procedure TsuiMemo.UpdateScrollBars; var info : tagScrollInfo; barinfo : tagScrollBarInfo; begin if m_UserChanging then Exit; m_SelfChanging := true; if m_HScrollBar <> nil then begin barinfo.cbSize := SizeOf(barinfo); if not SUIGetScrollBarInfo(Handle, Integer(OBJID_HSCROLL), barinfo) then begin m_HScrollBar.Visible := false; end else if (barinfo.rgstate[0] = STATE_SYSTEM_INVISIBLE) or (barinfo.rgstate[0] = STATE_SYSTEM_UNAVAILABLE) or (not Enabled) then begin m_HScrollBar.LineButton := 0; m_HScrollBar.Enabled := false; m_HScrollBar.SliderVisible := false; end else begin m_HScrollBar.LineButton := abs(barinfo.xyThumbBottom - barinfo.xyThumbTop); m_HScrollBar.SmallChange := 3 * m_HScrollBar.PageSize; m_HScrollBar.Enabled := true; m_HScrollBar.SliderVisible := true; end; info.cbSize := SizeOf(info); info.fMask := SIF_ALL; GetScrollInfo(Handle, SB_HORZ, info); m_HScrollBar.Max := info.nMax - Integer(info.nPage) + 1; m_HScrollBar.Min := info.nMin; m_HScrollBar.Position := info.nPos; end; if m_VScrollBar <> nil then begin barinfo.cbSize := SizeOf(barinfo); if not SUIGetScrollBarInfo(Handle, Integer(OBJID_VSCROLL), barinfo) then begin m_VScrollBar.Visible := false; end else if (barinfo.rgstate[0] = STATE_SYSTEM_INVISIBLE) or (barinfo.rgstate[0] = STATE_SYSTEM_UNAVAILABLE) or (not Enabled) then begin m_VScrollBar.LineButton := 0; m_VScrollBar.Enabled := false; m_VScrollBar.SliderVisible := false; end else begin m_VScrollBar.LineButton := abs(barinfo.xyThumbBottom - barinfo.xyThumbTop); m_VScrollBar.Enabled := true; m_VScrollBar.SliderVisible := true; end; info.cbSize := SizeOf(info); info.fMask := SIF_ALL; GetScrollInfo(Handle, SB_VERT, info); m_VScrollBar.Max := info.nMax - Integer(info.nPage) + 1; m_VScrollBar.Min := info.nMin; m_VScrollBar.Position := info.nPos; end; m_SelfChanging := false; end; procedure TsuiMemo.UpdateScrollBarsPos; var L2R : Boolean; begin L2R := ((BidiMode = bdLeftToRight) or (BidiMode = bdRightToLeftReadingOnly)) or (not SysLocale.MiddleEast); if m_HScrollBar <> nil then begin if Height < m_HScrollBar.Height then m_HScrollBar.Visible := false else m_HScrollBar.Visible := true; if L2R then begin m_HScrollBar.Left := Left + 1; m_HScrollBar.Top := Top + Height - m_HScrollBar.Height - 2; if m_VScrollBar <> nil then m_HScrollBar.Width := Width - 1 - m_VScrollBar.Width else m_HScrollBar.Width := Width - 1 end else begin m_HScrollBar.Top := Top + Height - m_HScrollBar.Height - 2; if m_VScrollBar <> nil then begin m_HScrollBar.Left := Left + m_VScrollBar.Width + 1; m_HScrollBar.Width := Width - 2 - m_VScrollBar.Width end else begin m_HScrollBar.Left := Left + 1; m_HScrollBar.Width := Width - 2; end; end; end; if m_VScrollBar <> nil then begin if Width < m_VScrollBar.Width then m_VScrollBar.Visible := false else m_VScrollBar.Visible := true; if L2R then begin m_VScrollBar.Left := Left + Width - m_VScrollBar.Width - 2; m_VScrollBar.Top := Top + 1; if m_HScrollBar <> nil then m_VScrollBar.Height := Height - 2 - m_HScrollBar.Height else m_VScrollBar.Height := Height - 2; end else begin m_VScrollBar.Left := Left + 2; m_VScrollBar.Top := Top + 1; if m_HScrollBar <> nil then m_VScrollBar.Height := Height - 2 - m_HScrollBar.Height else m_VScrollBar.Height := Height - 2; end; end; UpdateScrollBars(); end; procedure TsuiMemo.WMClear(var Message: TMessage); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.WMCut(var Message: TMessage); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.WMEARSEBKGND(var Msg: TMessage); begin inherited; DrawControlBorder(self, m_BorderColor, Color); end; procedure TsuiMemo.WMHSCROLL(var Message: TWMHScroll); begin inherited; if m_UserChanging then Exit; UpdateScrollBars(); end; procedure TsuiMemo.WMKeyDown(var Message: TWMKeyDown); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.WMLBUTTONDOWN(var Message: TMessage); begin inherited; m_MouseDown := true; UpdateScrollBars(); end; procedure TsuiMemo.WMLButtonUp(var Message: TMessage); begin inherited; m_MouseDown := false; end; procedure TsuiMemo.WMMOUSEMOVE(var Message: TMessage); begin inherited; if m_MouseDown then UpdateScrollBars(); end; procedure TsuiMemo.WMMOUSEWHEEL(var Message: TMessage); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.WMMOVE(var Msg: TMessage); begin inherited; UpdateScrollBarsPos(); end; procedure TsuiMemo.WMPAINT(var Msg: TMessage); begin inherited; DrawControlBorder(self, m_BorderColor, Color); end; procedure TsuiMemo.WMPaste(var Message: TMessage); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.WMSetText(var Message: TWMSetText); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.WMSIZE(var Msg: TMessage); begin inherited; UpdateScrollBarsPos(); end; procedure TsuiMemo.WMUndo(var Message: TMessage); begin inherited; UpdateScrollBars(); end; procedure TsuiMemo.WMVSCROLL(var Message: TWMVScroll); begin inherited; if m_UserChanging then Exit; UpdateScrollBars(); end; //{ TsuiRichEdit } // //procedure TsuiRichEdit.CMEnabledChanged(var Msg: TMessage); //begin // inherited; // UpdateScrollBars(); //end; // //constructor TsuiRichEdit.Create(AOwner: TComponent); //begin // inherited; // // ControlStyle := ControlStyle + [csOpaque]; // BorderStyle := bsNone; // BorderWidth := 2; // m_SelfChanging := false; // m_UserChanging := false; // m_MouseDown := false; // UIStyle := GetSUIFormStyle(AOwner); //end; // //procedure TsuiRichEdit.Notification(AComponent: TComponent; // Operation: TOperation); //begin // inherited; // // if AComponent = nil then // Exit; // // if ( // (Operation = opRemove) and // (AComponent = m_HScrollBar) // )then // begin // m_HScrollBar := nil; // UpdateInnerScrollBars(); // end; // // if ( // (Operation = opRemove) and // (AComponent = m_VScrollBar) // )then // begin // m_VScrollBar := nil; // UpdateInnerScrollBars(); // end; // // if ( // (Operation = opRemove) and // (AComponent = m_FileTheme) // )then // begin // m_FileTheme := nil; // SetUIStyle(SUI_THEME_DEFAULT); // end; //end; // //procedure TsuiRichEdit.OnHScrollBarChange(Sender: TObject); //begin // if m_SelfChanging then // Exit; // m_UserChanging := true; // SendMessage(Handle, WM_HSCROLL, MakeWParam(SB_THUMBPOSITION, m_HScrollBar.Position), 0); // Invalidate; // m_UserChanging := false; //end; // //procedure TsuiRichEdit.OnVScrollBarChange(Sender: TObject); //begin // if m_SelfChanging then // Exit; // m_UserChanging := true; // SendMessage(Handle, WM_VSCROLL, MakeWParam(SB_THUMBPOSITION, m_VScrollBar.Position), 0); // Invalidate; // m_UserChanging := false; //end; // //procedure TsuiRichEdit.SetBorderColor(const Value: TColor); //begin // m_BorderColor := Value; // Repaint(); //end; // //procedure TsuiRichEdit.SetFileTheme(const Value: TsuiFileTheme); //begin // m_FileTheme := Value; // if m_VScrollBar <> nil then // m_VScrollBar.FileTheme := Value; // if m_HScrollBar <> nil then // m_HScrollBar.FileTheme := Value; // SetUIStyle(m_UIStyle); //end; // //procedure TsuiRichEdit.SetHScrollBar(const Value: TsuiScrollBar); //begin // if m_HScrollBar = Value then // Exit; // if m_HScrollBar <> nil then // begin // m_HScrollBar.OnChange := nil; // m_HScrollBar.LineButton := 0; // m_HScrollBar.Max := 100; // m_HScrollBar.Enabled := true; // end; // // m_HScrollBar := Value; // if m_HScrollBar = nil then // begin // UpdateInnerScrollBars(); // Exit; // end; // m_HScrollBar.Orientation := suiHorizontal; // m_HScrollBar.OnChange := OnHScrollBarChange; // m_HScrollBar.BringToFront(); // UpdateInnerScrollBars(); // // UpdateScrollBarsPos(); //end; // //procedure TsuiRichEdit.SetUIStyle(const Value: TsuiUIStyle); //var // OutUIStyle : TsuiUIStyle; //begin // m_UIStyle := Value; // // if UsingFileTheme(m_FileTheme, m_UIStyle, OutUIStyle) then // m_BorderColor := m_FileTheme.GetColor(SUI_THEME_CONTROL_BORDER_COLOR) // else // m_BorderColor := GetInsideThemeColor(OutUIStyle, SUI_THEME_CONTROL_BORDER_COLOR); // // if m_VScrollBar <> nil then // m_VScrollBar.UIStyle := OutUIStyle; // if m_HScrollBar <> nil then // m_HScrollBar.UIStyle := OutUIStyle; // Repaint(); //end; // //procedure TsuiRichEdit.SetVScrollBar(const Value: TsuiScrollBar); //begin // if m_VScrollBar = Value then // Exit; // if m_VScrollBar <> nil then // begin // m_VScrollBar.OnChange := nil; // m_VScrollBar.LineButton := 0; // m_VScrollBar.Max := 100; // m_VScrollBar.Enabled := true; // end; // // m_VScrollBar := Value; // if m_VScrollBar = nil then // begin // UpdateInnerScrollBars(); // Exit; // end; // m_VScrollBar.Orientation := suiVertical; // m_VScrollBar.OnChange := OnVScrollBArChange; // m_VScrollBar.BringToFront(); // UpdateInnerScrollBars(); // // UpdateScrollBarsPos(); //end; // //procedure TsuiRichEdit.UpdateInnerScrollBars; //begin // if (m_VScrollBar <> nil) and (m_HScrollBar <> nil) then // ScrollBars := ssBoth // else if (m_VScrollBar <> nil) and (m_HScrollBar = nil) then // ScrollBars := ssVertical // else if (m_HScrollBar <> nil) and (m_VScrollBar = nil) then // ScrollBars := ssHorizontal // else // ScrollBars := ssNone; //end; // //procedure TsuiRichEdit.UpdateScrollBars; //var // info : tagScrollInfo; // barinfo : tagScrollBarInfo; //begin // if m_UserChanging then // Exit; // m_SelfChanging := true; // if m_HScrollBar <> nil then // begin // barinfo.cbSize := SizeOf(barinfo); // GetScrollBarInfo(Handle, Integer(OBJID_HSCROLL), barinfo); // if (barinfo.rgstate[0] = STATE_SYSTEM_INVISIBLE) or // (barinfo.rgstate[0] = STATE_SYSTEM_UNAVAILABLE) then // begin // m_HScrollBar.LineButton := 0; // m_HScrollBar.Enabled := false; // m_HScrollBar.SliderVisible := false; // end // else // begin // m_HScrollBar.LineButton := abs(barinfo.xyThumbBottom - barinfo.xyThumbTop); // m_HScrollBar.SmallChange := 3 * m_HScrollBar.PageSize; // m_HScrollBar.Enabled := true; // m_HScrollBar.SliderVisible := true; // end; // info.cbSize := SizeOf(info); // info.fMask := SIF_ALL; // GetScrollInfo(Handle, SB_HORZ, info); // m_HScrollBar.Max := info.nMax - Integer(info.nPage) + 1; // m_HScrollBar.Min := info.nMin; // m_HScrollBar.Position := info.nPos; // end; // // if m_VScrollBar <> nil then // begin // barinfo.cbSize := SizeOf(barinfo); // GetScrollBarInfo(Handle, Integer(OBJID_VSCROLL), barinfo); // if (barinfo.rgstate[0] = STATE_SYSTEM_INVISIBLE) or // (barinfo.rgstate[0] = STATE_SYSTEM_UNAVAILABLE) then // begin // m_VScrollBar.LineButton := 0; // m_VScrollBar.Enabled := false; // m_VScrollBar.SliderVisible := false; // end // else // begin // m_VScrollBar.LineButton := abs(barinfo.xyThumbBottom - barinfo.xyThumbTop); // m_VScrollBar.Enabled := true; // m_VScrollBar.SliderVisible := true; // end; // info.cbSize := SizeOf(info); // info.fMask := SIF_ALL; // GetScrollInfo(Handle, SB_VERT, info); // m_VScrollBar.Max := info.nMax - Integer(info.nPage) + 1; // m_VScrollBar.Min := info.nMin; // m_VScrollBar.Position := info.nPos; // end; // m_SelfChanging := false; //end; // //procedure TsuiRichEdit.UpdateScrollBarsPos; //begin // if m_HScrollBar <> nil then // begin // if Height < m_HScrollBar.Height then // m_HScrollBar.Visible := false // else // m_HScrollBar.Visible := true; // m_HScrollBar.Left := Left + 1; // m_HScrollBar.Top := Top + Height - m_HScrollBar.Height - 2; // if m_VScrollBar <> nil then // m_HScrollBar.Width := Width - 2 - m_VScrollBar.Width // else // m_HScrollBar.Width := Width - 2 // end; // // if m_VScrollBar <> nil then // begin // if Width < m_VScrollBar.Width then // m_VScrollBar.Visible := false // else // m_VScrollBar.Visible := true; // m_VScrollBar.Left := Left + Width - m_VScrollBar.Width - 2; // m_VScrollBar.Top := Top + 1; // if m_HScrollBar <> nil then // m_VScrollBar.Height := Height - 2 - m_HScrollBar.Height // else // m_VScrollBar.Height := Height - 2; // end; // // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMClear(var Message: TMessage); //begin // inherited; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMCut(var Message: TMessage); //begin // inherited; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMEARSEBKGND(var Msg: TMessage); //begin // inherited; // // DrawControlBorder(self, m_BorderColor, Color); //end; // //procedure TsuiRichEdit.WMHSCROLL(var Message: TWMHScroll); //begin // inherited; // if m_UserChanging then // Exit; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMKeyDown(var Message: TWMKeyDown); //begin // inherited; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMLBUTTONDOWN(var Message: TMessage); //begin // inherited; // m_MouseDown := true; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMLButtonUp(var Message: TMessage); //begin // inherited; // m_MouseDown := false; //end; // //procedure TsuiRichEdit.WMMOUSEMOVE(var Message: TMessage); //begin // inherited; // if m_MouseDown then UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMMOUSEWHEEL(var Message: TMessage); //begin // inherited; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMMOVE(var Msg: TMessage); //begin // inherited; // UpdateScrollBarsPos(); //end; // //procedure TsuiRichEdit.WMPAINT(var Msg: TMessage); //begin // inherited; // // DrawControlBorder(self, m_BorderColor, Color); //end; // //procedure TsuiRichEdit.WMPaste(var Message: TMessage); //begin // inherited; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMSetText(var Message: TWMSetText); //begin // inherited; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMSIZE(var Msg: TMessage); //begin // inherited; // UpdateScrollBarsPos(); //end; // //procedure TsuiRichEdit.WMUndo(var Message: TMessage); //begin // inherited; // UpdateScrollBars(); //end; // //procedure TsuiRichEdit.WMVSCROLL(var Message: TWMVScroll); //begin // inherited; // if m_UserChanging then // Exit; // UpdateScrollBars(); //end; end.
unit Contatos2.model.contatos; interface uses Contatos2.model.interfaces, Contatos2.entidade.contatos, System.Generics.Collections, Contatos2.model.ConstSQL, firedac.stan.param, System.JSON; Type TModelContatos = Class(TInterfacedObject, iModelContatos) Private Flista : TObjectList<TContatos>; Fcontato : Tcontatos; Procedure MontarLista; Public Constructor Create; Destructor Destroy; Override; Class function New: iModelContatos; Function Novo (Valor : tcontatos) : boolean; Function Editar (Valor : tcontatos) : boolean; Function Remover (Valor : integer) : boolean; Function Listar : tobjectlist<Tcontatos>; Function Buscar (Valor : string) : TObjectList<Tcontatos>; Function Contato (Valor : integer) : Tcontatos; Function JSON : TJSonArray; Function JSON2 : string; End; implementation uses Contatos2.model.query, System.SysUtils, ULGTDataSetHelper, REST.Json; { TModelContatos } function TModelContatos.Buscar(Valor: string): TObjectList<Tcontatos>; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Busca); myquery.Query.ParamByName('pNome').AsString := '%'+Valor+'%'; myquery.Query.Open(); myquery.Query.First; Flista.Clear; while not myquery.Query.Eof do begin FLista.Add(tContatos.Create); Flista.Last.id := myquery.Query.FieldByName('Id').AsInteger; FLista.Last.nome := myquery.Query.FieldByName('Nome').AsString; FLista.Last.telefone := myquery.Query.FieldByName('Fixo').AsString; FLista.Last.Celular := myquery.Query.FieldByName('Celular').AsString; FLista.Last.Email := myquery.Query.FieldByName('Email').AsString; myquery.Query.Next; end; myquery.Query.Close; Result:= Flista; end; function TModelContatos.Contato(Valor: integer): Tcontatos; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Item); myquery.Query.ParamByName('pId').AsInteger := Valor; myquery.Query.Open(); Fcontato.id := myquery.Query.FieldByName('Id').AsInteger; Fcontato.nome := myquery.Query.FieldByName('Nome').AsString; Fcontato.telefone := myquery.Query.FieldByName('Fixo').AsString; Fcontato.Celular := myquery.Query.FieldByName('Celular').Asstring; Fcontato.Email := myquery.Query.FieldByName('Email').AsString; myquery.Query.Close; Result := Fcontato; end; constructor TModelContatos.Create; begin //if Not Assigned(Flista) then flista := TObjectList<TContatos>.create; Fcontato := Tcontatos.Create; end; destructor TModelContatos.Destroy; begin FreeAndNil(Fcontato); FreeAndNil(Flista); inherited; end; function TModelContatos.Editar(Valor: tcontatos): boolean; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Edita); myquery.Query.ParamByName('pCodigo').AsInteger := Valor.id; myquery.Query.ParamByName('pNome').AsString := Valor.nome; myquery.Query.ParamByName('pFixo').AsString := Valor.telefone; myquery.Query.ParamByName('pCelular').AsString := Valor.Celular; myquery.Query.ParamByName('pEmail').AsString := Valor.Email; try myquery.Query.ExecSQL; Result := True; Except Result := False; end; end; function TModelContatos.JSON: TJSonArray; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Lista); myquery.Query.Open(); Result := myquery.Query.DataSetToJSON(); myquery.Query.Close; end; function TModelContatos.JSON2: string; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Lista); myquery.Query.Open(); myquery.Query.First; Flista.Clear; while not myquery.Query.Eof do begin FLista.Add(tContatos.Create); Flista.Last.id := myquery.Query.FieldByName('Id').AsInteger; FLista.Last.nome := myquery.Query.FieldByName('Nome').AsString; FLista.Last.telefone := myquery.Query.FieldByName('Fixo').AsString; FLista.Last.Celular := myquery.Query.FieldByName('Celular').AsString; FLista.Last.Email := myquery.Query.FieldByName('Email').AsString; myquery.Query.Next; end; myquery.Query.Close; Result := TJSON.ObjectToJsonString(Flista); end; function TModelContatos.Listar: tobjectlist<Tcontatos>; begin MontarLista; Result := Flista; end; procedure TModelContatos.MontarLista; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Lista); myquery.Query.Open(); myquery.Query.First; Flista.Clear; while not myquery.Query.Eof do begin FLista.Add(tContatos.Create); Flista.Last.id := myquery.Query.FieldByName('Id').AsInteger; FLista.Last.nome := myquery.Query.FieldByName('Nome').AsString; FLista.Last.telefone := myquery.Query.FieldByName('Fixo').AsString; FLista.Last.Celular := myquery.Query.FieldByName('Celular').AsString; FLista.Last.Email := myquery.Query.FieldByName('Email').AsString; myquery.Query.Next; end; myquery.Query.Close; end; class function TModelContatos.New: iModelContatos; begin result := self.Create; end; function TModelContatos.Novo(Valor: tcontatos): boolean; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Novo); myquery.Query.ParamByName('pNome').AsString := Valor.nome; myquery.Query.ParamByName('pFixo').AsString := Valor.telefone; myquery.Query.ParamByName('pCelular').AsString := Valor.Celular; myquery.Query.ParamByName('pEmail').AsString := Valor.Email; try myquery.Query.ExecSQL; Result := True; Except Result := False; end; end; function TModelContatos.Remover(Valor: integer): boolean; var myquery : iquery; begin myquery := tquery.New; myquery.Query.SQL.Clear; myquery.Query.SQL.Add(SQL_Apaga); myquery.Query.ParamByName('pCodigo').AsInteger := Valor; try myquery.Query.ExecSQL; Result := true; Except Result := false; end; end; end.
unit NsLibSSH2Session; interface uses Windows, SysUtils, Classes, WinSock, libssh2, NsLibSSH2Const; type TAuthType = (atNone, atPassword, atPublicKey); type TNsLibSSH2Session = class(TComponent) private FServerIP: string; FServerPort: Integer; FUsername: string; FPassword: string; FPublicKeyFile: string; FPrivateKeyFile: string; FAuthType: TAuthType; FOpened: Boolean; FStatus: string; FFingerprint: PAnsiChar; FUserAuth: PAnsiChar; FSocket: TSocket; FSession: PLIBSSH2_SESSION; Auth: set of Byte; SockAddr: sockaddr_in; WSA_Data: WSAData; //Events FAfterCreate: TNotifyEvent; FBeforeDestroy: TNotifyEvent; FBeforeOpen: TNotifyEvent; FAfterOpen: TNotifyEvent; FBeforeClose: TNotifyEvent; FAfterClose: TNotifyEvent; protected procedure InitProperties; function ConnectToServer: Boolean; function StartSSHSession: Boolean; function AuthOnServer: Boolean; // Property getters/setters function GetSession: PLIBSSH2_SESSION; function GetFingerprint: PAnsiChar; function GetUserAuth: PAnsiChar; function GetServerIP: string; procedure SetServerIP(Value: string); function GetServerPort: Integer; procedure SetServerPort(Value: Integer); function GetUsername: string; procedure SetUsername(Value: string); function GetPassword: string; procedure SetPassword(Value: string); function GetPublicKeyFile: string; procedure SetPublicKeyFile(Value: string); function GetPrivateKeyFile: string; procedure SetPrivateKeyFile(Value: string); function GetAuthType: TAuthType; procedure SetAuthType(Value: TAuthType); function GetOpened: Boolean; function GetStatus: string; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; function Open: Boolean; function OpenEx(const AServerIP, AUserName, APassword, APublicKeyFile, APrivateKeyFile: string; AAuthType: TAuthType; AServerPort: Integer): Boolean; procedure Close; property Session: PLIBSSH2_SESSION read GetSession; property Fingerprint: PAnsiChar read GetFingerprint; property UserAuth: PAnsiChar read GetUserAuth; published property AfterCreate: TNotifyEvent read FAfterCreate write FAfterCreate; property BeforeDestroy: TNotifyEvent read FBeforeDestroy write FBeforeDestroy; property BeforeOpen: TNotifyEvent read FBeforeOpen write FBeforeOpen; property AfterOpen: TNotifyEvent read FAfterOpen write FAfterOpen; property BeforeClose: TNotifyEvent read FBeforeClose write FBeforeClose; property AfterClose: TNotifyEvent read FAfterClose write FAfterClose; property ServerIP: string read GetServerIP write SetServerIP; property ServerPort: Integer read GetServerPort write SetServerPort; property Username: string read GetUsername write SetUsername; property Password: string read GetPassword write SetPassword; property PublicKeyFile: string read GetPublicKeyFile write SetPublicKeyFile; property PrivateKeyFile: string read GetPrivateKeyFile write SetPrivateKeyFile; property AuthType: TAuthType read GetAuthType write SetAuthType default atNone; property Opened: Boolean read GetOpened; property Status: string read GetStatus; end; procedure Register; implementation procedure Register; begin RegisterComponents('NeferSky', [TNsLibSSH2Session]); end; //--------------------------------------------------------------------------- { TNsLibSSH2Session } // Public constructor TNsLibSSH2Session.Create(AOwner: TComponent); var rc: Integer; begin inherited Create(AOwner); InitProperties; rc := WSAStartup(MAKEWORD(2, 0), WSA_Data); if (rc <> 0) then begin raise Exception.CreateFmt(ER_WSAERROR, [rc]); Exit; end; rc := libssh2_init(0); if (rc <> 0) then begin raise Exception.CreateFmt(ER_LIBSSH2_INIT, [rc]); Exit; end; if Assigned(AfterCreate) then AfterCreate(Self); end; //--------------------------------------------------------------------------- destructor TNsLibSSH2Session.Destroy; begin if Assigned(BeforeDestroy) then BeforeDestroy(Self); if Opened then Close; libssh2_exit; WSACleanup; inherited Destroy; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.Open: Boolean; begin if Assigned(BeforeOpen) then BeforeOpen(Self); Result := False; if Opened then Close; if not ConnectToServer then Exit; if not StartSSHSession then begin Close; Exit; end; if not AuthOnServer then begin Close; Exit; end; FStatus := ST_CONNECTED; FOpened := True; Result := Opened; if Assigned(AfterOpen) then AfterOpen(Self); end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.OpenEx(const AServerIP, AUserName, APassword, APublicKeyFile, APrivateKeyFile: string; AAuthType: TAuthType; AServerPort: Integer): Boolean; begin ServerIP := AServerIP; Username := AUserName; Password := APassword; ServerPort := AServerPort; PublicKeyFile := APublicKeyFile; PrivateKeyFile := APrivateKeyFile; AuthType := AAuthType; Result := Open; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.Close; begin if Assigned(BeforeClose) then BeforeClose(Self); if FSession <> nil then begin libssh2_session_disconnect(FSession, ST_SESSION_CLOSED); libssh2_session_free(FSession); FSession := nil; end; if FSocket <> INVALID_SOCKET then CloseSocket(FSocket); FFingerprint := DEFAULT_EMPTY_STR; FUserAuth := DEFAULT_EMPTY_STR; FStatus := ST_DISCONNECTED; FOpened := False; if Assigned(AfterClose) then AfterClose(Self); end; //--------------------------------------------------------------------------- // Protected procedure TNsLibSSH2Session.InitProperties; begin FServerIP := DEFAULT_EMPTY_STR; FServerPort := DEFAULT_SSH_PORT; FUsername := DEFAULT_EMPTY_STR; FPassword := DEFAULT_EMPTY_STR; FPublicKeyFile := DEFAULT_EMPTY_STR; FPrivateKeyFile := DEFAULT_EMPTY_STR; FAuthType := atNone; FOpened := False; FFingerprint := DEFAULT_EMPTY_STR; FUserAuth := DEFAULT_EMPTY_STR; FStatus := ST_DISCONNECTED; FSession := nil; Auth := []; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.ConnectToServer: Boolean; begin Result := False; FSocket := Socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (FSocket = INVALID_SOCKET) then begin FStatus := ER_OPEN_SOCKET; Exit; end; SockAddr.sin_family := AF_INET; SockAddr.sin_addr.s_addr := inet_addr(PAnsiChar(ServerIP)); if ((INADDR_NONE = SockAddr.sin_addr.s_addr) and (INADDR_NONE = inet_addr(PAnsiChar(ServerIP)))) then begin FStatus := ER_IP_INCORRECT; Exit; end; SockAddr.sin_port := htons(ServerPort); if (Connect(FSocket, SockAddr, SizeOf(sockaddr_in)) <> 0) then begin FStatus := ER_CONNECT; Exit; end; Result := True; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.StartSSHSession: Boolean; var rc: Integer; begin Result := False; FSession := libssh2_session_init; if (FSession = nil) then begin FStatus := ER_SESSION_INIT; Exit; end; rc := libssh2_session_handshake(FSession, FSocket); if (rc <> 0) then begin FStatus := Format(ER_SESSION_START, [rc]); Exit; end; Result := True; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.AuthOnServer: Boolean; begin Result := False; FFingerprint := libssh2_hostkey_hash(FSession, LIBSSH2_HOSTKEY_HASH_SHA1); FUserAuth := libssh2_userauth_list(FSession, PAnsiChar(Username), StrLen(PAnsiChar(Username))); if (Pos('password', FUserAuth) <> 0) then Include(Auth, AUTH_PASSWORD); if (Pos('publickey', FUserAuth) <> 0) then Include(Auth, AUTH_PUBLICKEY); if ((AuthType = atPublicKey) and (AUTH_PUBLICKEY in Auth)) then Auth := [AUTH_PUBLICKEY] else if ((AuthType = atPassword) and (AUTH_PASSWORD in Auth)) then Auth := [AUTH_PASSWORD] else begin FStatus := ER_AUTH_METHOD; Exit; end; if (Auth = [AUTH_PUBLICKEY]) then begin if (libssh2_userauth_publickey_fromfile(FSession, PAnsiChar(Username), PAnsiChar(PublicKeyFile), PAnsiChar(PrivateKeyFile), PAnsiChar(Password)) <> 0) then begin FStatus := ER_PUBKEY; Exit; end; end else if (Auth = [AUTH_PASSWORD]) then begin if (libssh2_userauth_password(FSession, PAnsiChar(Username), PAnsiChar(Password)) <> 0) then begin FStatus := ER_PASSWORD; Exit; end; end else begin FStatus := ER_AUTH_METHOD; Exit; end; libssh2_session_set_blocking(FSession, 0); Result := True; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetAuthType: TAuthType; begin Result := FAuthType; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetFingerprint: PAnsiChar; begin Result := FFingerprint; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetOpened: Boolean; begin Result := FOpened; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetPassword: string; begin Result := FPassword; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetPrivateKeyFile: string; begin Result := FPrivateKeyFile; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetPublicKeyFile: string; begin Result := FPublicKeyFile; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetServerIP: string; begin Result := FServerIP; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetServerPort: Integer; begin Result := FServerPort; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetSession: PLIBSSH2_SESSION; begin Result := FSession; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetStatus: string; begin Result := FStatus; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetUserAuth: PAnsiChar; begin Result := FUserAuth; end; //--------------------------------------------------------------------------- function TNsLibSSH2Session.GetUsername: string; begin Result := FUsername; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.SetAuthType(Value: TAuthType); begin if FAuthType <> Value then FAuthType := Value; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.SetPassword(Value: string); begin if FPassword <> Value then FPassword := Value; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.SetPrivateKeyFile(Value: string); begin if FPrivateKeyFile <> Value then FPrivateKeyFile := Value; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.SetPublicKeyFile(Value: string); begin if FPublicKeyFile <> Value then FPublicKeyFile := Value; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.SetServerIP(Value: string); begin if FServerIP <> Value then FServerIP := Value; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.SetServerPort(Value: Integer); begin if FServerPort <> Value then FServerPort := Value; end; //--------------------------------------------------------------------------- procedure TNsLibSSH2Session.SetUsername(Value: string); begin if FUsername <> Value then FUsername := Value; end; end.
unit ncListaEspera; { ResourceString: Dario 13/03/13 } interface uses SysUtils, DB, MD5, Classes, Windows, ClasseCS, ncSessao, ncClassesBase; type TncItemListaEspera = class private function GetString: String; procedure SetString(const Value: String); published public ilID : Integer; ilCliente : Integer; ilNomeCliente : String; ilDataHora : TDateTime; ilPrevisao : TDateTime; ilPrevMaq : Integer; ilPrevSessao : Integer; ilObs : String; ilCartao : String; _Operacao : Byte; constructor Create; procedure LoadFromStram(S: TStream); procedure LoadFromDataset(D: TDataset); procedure SaveToStream(S: TStream); procedure SaveToDataset(D: TDataset; aPos: Integer); procedure Limpa; procedure AssignFrom(B: TncItemListaEspera); function Igual(B: TncItemListaEspera): Boolean; procedure SetPrevisao(Value: TDateTime); procedure SetPrevMaq(Value: Integer); procedure SetPrevSessao(Value: Integer); property AsString: String read GetString write SetString; end; TncListaEspera = class private FItens : TList; function GetItem(I: Integer): TncItemListaEspera; function GetString: String; procedure SetString(Value: String); public constructor Create; destructor Destroy; override; procedure AjustaOperacao(B: TncListaEspera); procedure Remove(IME: TncItemListaEspera); procedure Delete(aIndex: Integer); procedure Limpa; procedure AjustaPrevisao(Sessoes: TncSessoes); function Count: Integer; function NewItem: TncItemListaEspera; function GetItemByID(aID: Integer): TncItemListaEspera; function GetItemBySessao(aSessao: Integer): TncItemListaEspera; property Itens[I: Integer]: TncItemListaEspera read GetItem; Default; property AsString: String read GetString write SetString; end; implementation { TncItemListaEspera } procedure TncItemListaEspera.AssignFrom(B: TncItemListaEspera); begin ilID := B.ilID; ilCliente := B.ilCliente; ilNomeCliente := B.ilNomeCliente; ilDataHora := B.ilDataHora; ilPrevisao := B.ilPrevisao; ilPrevMaq := B.ilPrevMaq; ilPrevSessao := B.ilPrevSessao; ilObs := B.ilObs; ilCartao := B.ilCartao; _Operacao := B._Operacao; end; constructor TncItemListaEspera.Create; begin Limpa; end; function TncItemListaEspera.GetString: String; begin Result := IntToStr(ilID) + sFldDelim(Classid_TncItemListaEspera) + IntToStr(ilCliente) + sFlddelim(Classid_TncItemListaEspera) + ilNomeCliente + sFldDelim(Classid_TncItemListaEspera) + GetDTStr(ilDataHora) + sFldDelim(Classid_TncItemListaEspera) + GetDTStr(ilPrevisao) + sFldDelim(Classid_TncItemListaEspera) + IntToStr(ilPrevMaq) + sFldDelim(Classid_TncItemListaEspera) + IntToStr(ilPrevSessao) + sFldDelim(Classid_TncItemListaEspera) + ilObs + sFldDelim(Classid_TncItemListaEspera) + ilCartao + sFldDelim(Classid_TncItemListaEspera) + IntToStr(_Operacao) + sFldDelim(Classid_TncItemListaEspera); end; function TncItemListaEspera.Igual(B: TncItemListaEspera): Boolean; begin Result := False; if ilID <> B.ilID then Exit; if ilCliente <> B.ilCliente then Exit; if ilNomeCliente <> B.ilNomeCliente then Exit; if ilDataHora <> B.ilDataHora then Exit; if ilPrevisao <> B.ilPrevisao then Exit; if ilPrevMaq <> B.ilPrevMaq then Exit; if ilPrevSessao <> B.ilPrevSessao then Exit; if ilObs <> B.ilObs then Exit; if ilCartao <> B.ilCartao then Exit; Result := True; end; procedure TncItemListaEspera.Limpa; begin ilID := -1; ilCliente := 0; ilNomeCliente := ''; ilDataHora := 0; ilPrevisao := 0; ilPrevMaq := 0; ilPrevSessao := 0; ilObs := ''; ilCartao := ''; _Operacao := osNenhuma; end; procedure TncItemListaEspera.LoadFromDataset(D: TDataset); begin ilID := D.FieldByName('ID').AsInteger; // do not localize ilCliente := D.FieldByName('Cliente').AsInteger; // do not localize ilNomeCliente := D.FieldByName('NomeCliente').AsString; // do not localize ilDataHora := D.FieldByName('DataHora').AsDateTime; // do not localize ilPrevisao := D.FieldByName('Previsao').AsDateTime; // do not localize ilPrevMaq := D.FieldByName('PrevMaq').AsInteger; // do not localize ilPrevSessao := D.FieldByName('PrevSessao').AsInteger; // do not localize ilObs := D.FieldByName('Obs').AsString; // do not localize ilCartao := D.FieldByName('Cartao').AsString; // do not localize end; procedure TncItemListaEspera.LoadFromStram(S: TStream); var I : Integer; Str : String; begin S.Read(I, SizeOf(I)); if I>0 then begin SetLength(Str, I); S.Read(Str[1], I); AsString := Str; end else Limpa; end; procedure TncItemListaEspera.SaveToDataset(D: TDataset; aPos: Integer); begin D.FieldByName('Cliente').AsInteger := ilCliente; // do not localize D.FieldByName('NomeCliente').AsString := ilNomeCliente; // do not localize D.FieldByName('DataHora').AsDateTime := ilDataHora; // do not localize D.FieldByName('Pos').AsInteger := aPos; // do not localize if ilPrevisao>0 then D.FieldByName('Previsao').AsDateTime := ilPrevisao else // do not localize D.FieldByName('Previsao').Clear; // do not localize if ilPrevMaq>0 then D.FieldByName('PrevMaq').AsInteger := ilPrevMaq else // do not localize D.FieldByName('PrevMaq').Clear; // do not localize if ilPrevSessao>0 then D.FieldByName('PrevSessao').AsInteger := ilPrevSessao else // do not localize D.FieldByName('PrevSessao').Clear; // do not localize D.FieldByName('Obs').AsString := ilObs; // do not localize D.FieldByName('Cartao').AsString := ilCartao; // do not localize end; procedure TncItemListaEspera.SaveToStream(S: TStream); var Str: String; I : Integer; begin Str := AsString; I := Length(Str); S.Write(I, SizeOf(I)); if I>0 then S.Write(Str[1], I); end; procedure TncItemListaEspera.SetPrevisao(Value: TDateTime); begin if Value <> ilPrevisao then begin ilPrevisao := Value; _Operacao := osAlterar; end; end; procedure TncItemListaEspera.SetPrevMaq(Value: Integer); begin if Value <> ilPrevMaq then begin ilPrevMaq := Value; _Operacao := osAlterar; end; end; procedure TncItemListaEspera.SetPrevSessao(Value: Integer); begin if Value <> ilPrevSessao then begin ilPrevSessao := Value; _Operacao := osAlterar; end; end; procedure TncItemListaEspera.SetString(const Value: String); var S: String; function pCampo: String; begin Result := GetNextStrDelim(S, classid_TncItemListaEspera); end; begin S := Value; ilID := StrToIntDef(pCampo, -1); ilCliente := StrToIntDef(pCampo, 0); ilNomeCliente := pCampo; ilDataHora := DTFromStr(pCampo); ilPrevisao := DTFromStr(pCampo); ilPrevMaq := StrToIntDef(pCampo, 0); ilPrevSessao := StrToIntDef(pCampo, 0); ilObs := pCampo; ilCartao := pCampo; _Operacao := StrToIntDef(pCampo, osNenhuma); end; procedure TncListaEspera.AjustaOperacao(B: TncListaEspera); var I : Integer; IL : TncItemListaEspera; begin for I := 0 to Count - 1 do with Itens[I] do if (ilID<>-1) and (B.GetItemByID(ilID)=nil) then _Operacao := osExcluir; for I := 0 to B.Count - 1 do if (B[I].ilID=-1) then begin if B[I]._Operacao<>osCancelar then begin B[I]._Operacao := osIncluir; NewItem.AssignFrom(B[I]); end; end else begin IL := GetItemByID(B[I].ilID); if IL<>nil then begin if B[I]._Operacao=osCancelar then IL._Operacao := osCancelar else begin IL.AssignFrom(B[I]); IL._Operacao := osAlterar; end; end; end; for I := Count-1 downto 0 do if Itens[I]._Operacao=osNenhuma then begin Itens[I].Free; FItens.Delete(I); end; end; type TTerminoSessao = record tsTermino : TDateTime; tsSessao : Integer; tsMaq : Integer; end; procedure TncListaEspera.AjustaPrevisao(Sessoes: TncSessoes); var A : Array of TTerminoSessao; Termino : TDateTime; I, T, k: Integer; procedure _MoveUp(aPos: Integer); var j: Integer; begin for j := aPos to T-2 do A[j+1] := A[j]; end; function AddPos: Integer; begin for Result := 0 to T-2 do if Termino < A[Result].tsTermino then Exit; Result := T-1; end; begin SetLength(A, 0); T := 0; for I := 0 to Sessoes.Count - 1 do with Sessoes[I], Tarifador do if CreditoTotal.Ticks>0 then begin Termino := Inicio + TicksToDateTime(Pausas.TicksTotal + CreditoTotal.Ticks); Inc(T); SetLength(A, T); k := AddPos; if k<(T-1) then _MoveUp(k); A[k].tsTermino := Termino; A[k].tsSessao := ID; A[k].tsMaq := Maq; end; for I := T to Count-1 do begin Itens[I].SetPrevisao(0); Itens[I].SetPrevMaq(0); Itens[I].SetPrevSessao(0); end; for I := 0 to T-1 do begin Itens[I].SetPrevisao(A[I].tsTermino); Itens[I].SetPrevMaq(A[I].tsMaq); Itens[I].SetPrevSessao(A[I].tsSessao); end; end; function TncListaEspera.Count: Integer; begin Result := FItens.Count; end; constructor TncListaEspera.Create; begin FItens := TList.Create; end; procedure TncListaEspera.Delete(aIndex: Integer); begin FItens.Delete(aIndex); end; destructor TncListaEspera.Destroy; begin Limpa; FItens.Free; inherited; end; function TncListaEspera.GetItem(I: Integer): TncItemListaEspera; begin Result := TncItemListaEspera(FItens[I]); end; function TncListaEspera.GetItemByID(aID: Integer): TncItemListaEspera; var I : Integer; begin for I := 0 to Count - 1 do if Itens[I].ilID=aID then begin Result := Itens[I]; Exit; end; Result := nil; end; function TncListaEspera.GetItemBySessao(aSessao: Integer): TncItemListaEspera; var I : Integer; begin for I := 0 to Count - 1 do if Itens[I].ilPrevSessao=aSessao then begin Result := Itens[I]; Exit; end; Result := nil; end; function TncListaEspera.GetString: String; var I : Integer; begin Result := ''; for I := 0 to Count - 1 do Result := Result + Itens[I].AsString + sListaDelim(classid_TncListaEspera); end; procedure TncListaEspera.Limpa; begin while Count>0 do begin Itens[0].Free; FItens.Delete(0); end; end; function TncListaEspera.NewItem: TncItemListaEspera; begin Result := TncItemListaEspera.Create; FItens.Add(Result); end; procedure TncListaEspera.Remove(IME: TncItemListaEspera); begin FItens.Remove(IME); end; procedure TncListaEspera.SetString(Value: String); var S: String; begin while GetNextListItem(Value, S, classid_TncListaEspera) do NewItem.AsString := S; end; end.
unit Trans; {$mode objfpc}{$H+} interface uses Classes, SysUtils; type TMapLoc = packed record Xpos: Byte; Ypos: Byte; end; const Ln = #13#10; //table needed for encoding area names Table: array [$00..$FF] of string[5] = ( { 0 1 2 3 4 5 6 7 8 9 A B C D E F } {0}'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {1}'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,' ' , {2}'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {3}'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {4}'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,Ln , {5}'#' ,Ln+Ln ,'HIRO','GARY','POKé',Ln ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {6}'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {7}'#' ,'#' ,'#' ,'#' ,'#' ,'…' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,' ' , {8}'A' ,'B' ,'C' ,'D' ,'E' ,'F' ,'G' ,'H' ,'I' ,'J' ,'K' ,'L' ,'M' ,'N' ,'O' ,'P' , {9}'Q' ,'R' ,'S' ,'T' ,'U' ,'V' ,'W' ,'X' ,'Y' ,'Z' ,'#' ,'#' ,':' ,'#' ,'#' ,'#' , {A}'a' ,'b' ,'c' ,'d' ,'e' ,'f' ,'g' ,'h' ,'i' ,'j' ,'k' ,'l' ,'m' ,'n' ,'o' ,'p' , {B}'q' ,'r' ,'s' ,'t' ,'u' ,'v' ,'w' ,'x' ,'y' ,'z' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {C}'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {D}'#' ,'''l' ,'''m' ,'''r' ,'''s' ,'''t' ,'''v' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {E}'''' ,'#' ,'#' ,'-' ,'#' ,'#' ,'?' ,'!' ,'.' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' ,'#' , {F}'#' ,' ' ,'#' ,'#' ,',' ,'#' ,'0' ,'1' ,'2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' ); function GBPtrToFilePos(Bank: Byte; Addr: Word): Integer; overload; function GetAreaName(Area: Byte): string; procedure ReadAreaNames; implementation uses Main; // Converts bank and address to offset function GBPtrToFilePos(Bank: Byte; Addr: Word): Integer; overload; begin Result := (Bank * $4000) + (Addr - $4000); end; function GetAreaName(Area: Byte): string; var W: Word; B: Byte; I: Integer; Capitalize: boolean; Loc: Integer; Bank: Byte; begin Result := ''; if Game = 'Crystal' then begin Loc := $1CA8C9; Bank := $72; end else begin Loc := $92388; Bank := $24; end; Rom.Position := Loc + ((Area - 1) * 4); Rom.Read(W,2); Rom.Position := GBPtrToFilePos(Bank,W); Rom.Read(B,1); while B <> $50 do begin Result := Result + Table[B]; Rom.Read(B,1); end; Result := LowerCase(Result); Capitalize := True; for I := 1 to Length(Result) do begin if Capitalize then begin Result[I] := UpCase(Result[I]); Capitalize := False; end; if (Result[I] = ' ') or (Result[I] = '.') then Capitalize := True; end; end; procedure ReadAreaNames; var I: Integer; begin MainForm.AreaCombo1.Clear; for I := 0 to 94 do begin MainForm.AreaCombo1.AddItem(GetAreaName(I),MainForm.AreaCombo1); end; end; end.
{ Global declarations for the Lazarus Mazes program Copyright (C) 2012 G.A. Nijland (eny @ lazarus forum http://www.lazarus.freepascal.org/) This source 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 code 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. A copy of the GNU General Public License is available on the World Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } unit LazesGlobals; {$mode objfpc}{$H+} interface uses Windows; const // Update message when something in the maze config has changed and needs regeneration C_MAZE_UPDATE_MESSAGE = WM_USER + 67122; // Maximum width/height of the maze C_MIN_MAZE_SIZE = 4; C_MAX_MAZE_SIZE = 80; type // Record structure to send messages around with maze metrics TMazeUpdateInfo = record MazeWidth : integer; MazeHeight: integer; DrawWidth : integer; DrawHeight: integer; end; PMazeUpdateInfo = ^TMazeUpdateInfo; implementation end.
unit uAutonicsTZHeater; interface uses CPort, AssThreadTimer, Contnrs; type TAutonicsTZHeaterCommandType = (atzcmdNone, atzcmdReadPV, atzcmdReadSV, atzcmdWriteSV); TAutonicsTZHeaterCommand = class private FCommand : TAutonicsTZHeaterCommandType; FValue : integer; public property Command : TAutonicsTZHeaterCommandType read FCommand write FCommand; property Value : integer read FValue write FValue; end; TAutonicsTZHeater = class private FCommandQueue : TObjectQueue; FTimer : TAssThreadTimer; FPort : TComPort; FSendCommand : TAutonicsTZHeaterCommandType; FReadCompleted : boolean; FLastSendTime : Int64; FLastReadTime : Int64; FCommunicationError : boolean; FCommunicationTimeout : integer; FReadData : string; FTemperature: double; FTargetTemperature : double; procedure TimerTick(Sender: TObject); procedure ComPortRxChar(Sender: TObject; Count: Integer); procedure SendCommand; procedure PushCommand(command : TAutonicsTZHeaterCommandType); overload; procedure PushCommand(command : TAutonicsTZHeaterCommandType; value : integer); overload; function PopCommand : TAutonicsTZHeaterCommand; function GetPortNo: string; procedure SetPortNo(const Value: string); public constructor Create; destructor Destroy; override; procedure Open; procedure Close; procedure SetTemperature(value : integer); property PortNo : string read GetPortNo write SetPortNo; property Temperature: double read FTemperature; property TargetTemperature : double read FTargetTemperature; property CommunicationError : boolean read FCommunicationError; property CommunicationTimeout : integer read FCommunicationTimeout write FCommunicationTimeout; end; implementation uses SysUtils, TypInfo, uPerformanceCounter, uLogManager; { TAutonicsTZHeater } procedure TAutonicsTZHeater.Close; begin FTimer.Enabled := False; FPort.Close; end; procedure TAutonicsTZHeater.ComPortRxChar(Sender: TObject; Count: Integer); const DATA_LENGTH_LIMIT = 100; var buffer : string; begin FLastReadTime := GetMillisecondsTick; FCommunicationError := false; TComPort(Sender).ReadStr(buffer, Count); FReadData := FReadData + buffer; if Length(FReadData) > DATA_LENGTH_LIMIT then begin FReadData := ''; exit; end; try if (Length(FReadData) >= 17) then begin if (FReadData[1] = Chr($06)) and (Copy(FReadData,3,5) = '02RDP') then begin FTemperature := StrToIntDef(Copy(FReadData, 10, 4), 0); end else if (FReadData[1] = Chr($06)) and (Copy(FReadData,3,5) = '02RDS') then begin FTargetTemperature := StrToIntDef(Copy(FReadData, 10, 4), 0); end; FReadData := ''; end; finally end; FReadCompleted := true; end; constructor TAutonicsTZHeater.Create; begin FCommunicationError := true; CommunicationTimeout := 30000; FCommandQueue := TObjectQueue.Create; FSendCommand := atzcmdReadPV; FTimer := TAssThreadTimer.Create(nil); FTimer.Interval := 300; FTimer.OnTimer := TimerTick; FPort := TComPort.Create(nil); FPort.BaudRate := br9600; FPort.OnRxChar := ComPortRxChar; FPort.EventChar := #3; FPort.DiscardNull := true; FReadCompleted := true; FLastSendTime := GetMillisecondsTick; end; destructor TAutonicsTZHeater.Destroy; begin FTimer.Free; FPort.Free; inherited; end; function TAutonicsTZHeater.GetPortNo: string; begin result := FPort.Port; end; procedure TAutonicsTZHeater.Open; begin FPort.Open; FTimer.Enabled := True; end; function TAutonicsTZHeater.PopCommand: TAutonicsTZHeaterCommand; var obj : TAutonicsTZHeaterCommand; begin obj := TAutonicsTZHeaterCommand(FCommandQueue.Pop); result := obj; end; procedure TAutonicsTZHeater.PushCommand( command: TAutonicsTZHeaterCommandType; value: integer); var obj : TAutonicsTZHeaterCommand; begin obj := TAutonicsTZHeaterCommand.Create; obj.Command := command; obj.Value := value; FCommandQueue.Push(obj); end; procedure TAutonicsTZHeater.PushCommand( command: TAutonicsTZHeaterCommandType); var obj : TAutonicsTZHeaterCommand; begin obj := TAutonicsTZHeaterCommand.Create; obj.Command := command; FCommandQueue.Push(obj); end; procedure TAutonicsTZHeater.SendCommand; const RECEIVE_DATA_TIMEOUT = 5000; var commandObj : TAutonicsTZHeaterCommand; command : string; value : string; i : integer; checkSum : integer; begin if FCommandQueue.Count < 1 then exit; if FReadCompleted = false then begin if (GetMillisecondsTick - FLastSendTime) < RECEIVE_DATA_TIMEOUT then exit; end; value := ''; commandObj := PopCommand; case commandObj.Command of atzcmdReadPV : begin command := chr($02) + '02RXP0' + chr($03) + chr($69); end; atzcmdReadSV : begin command := chr($02) + '02RXS0' + chr($03) + chr($6A); end; atzcmdWriteSV : begin value := Format('%.4d', [commandObj.Value]); command := chr($02) + '02WXS0 ' + value + chr($03); checkSum := 0; for i := 1 to Length(command) do begin checkSum := checkSum xor Ord(command[i]); end; command := command + chr(checkSum); end; end; commandObj.Free; FPort.WriteStr(command); FReadCompleted := false; FLastSendTime := GetMillisecondsTick; end; procedure TAutonicsTZHeater.SetPortNo(const Value: string); begin FPort.Port := Value; end; procedure TAutonicsTZHeater.SetTemperature(value: integer); begin PushCommand(atzcmdWriteSV, value); end; procedure TAutonicsTZHeater.TimerTick(Sender: TObject); var currentCommandNo : integer; begin if (GetMillisecondsTick - FLastReadTime) > CommunicationTimeout then begin FCommunicationError := true; end; SendCommand; if FCommandQueue.Count > 1 then exit; currentCommandNo := Ord(FSendCommand); currentCommandNo := currentCommandNo + 1; if currentCommandNo > Ord(atzcmdReadSV) then currentCommandNo := 1; FSendCommand := TAutonicsTZHeaterCommandType(currentCommandNo); PushCommand(FSendCommand); end; end.
unit uFileSourceListOperation; {$mode objfpc}{$H+} interface uses Classes, SysUtils, uFileSourceOperation, uFileSourceOperationTypes, uFile, uFileSource; type { TFileSourceListOperation } TFileSourceListOperation = class(TFileSourceOperation) private FFileSource: IFileSource; FPath: String; protected FFiles: TFiles; FFlatView: Boolean; function GetFiles: TFiles; function GetID: TFileSourceOperationType; override; procedure UpdateStatisticsAtStartTime; override; property FileSource: IFileSource read FFileSource; public constructor Create(aFileSource: IFileSource; aPath: String); virtual reintroduce; destructor Destroy; override; function GetDescription(Details: TFileSourceOperationDescriptionDetails): String; override; // Retrieves files and revokes ownership of TFiles list. // The result of this function should be freed by the caller. function ReleaseFiles: TFiles; property Files: TFiles read GetFiles; property Path: String read FPath; property FlatView: Boolean write FFlatView; end; implementation uses uLng; constructor TFileSourceListOperation.Create(aFileSource: IFileSource; aPath: String); begin FFileSource := aFileSource; FPath := aPath; inherited Create(FFileSource); end; destructor TFileSourceListOperation.Destroy; begin inherited Destroy; if Assigned(FFiles) then FreeAndNil(FFiles); end; function TFileSourceListOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String; begin case Details of fsoddJobAndTarget: Result := Format(rsOperListingIn, [Path]); else Result := rsOperListing; end; end; function TFileSourceListOperation.GetID: TFileSourceOperationType; begin Result := fsoList; end; function TFileSourceListOperation.GetFiles: TFiles; begin Result := FFiles; end; function TFileSourceListOperation.ReleaseFiles: TFiles; begin Result := FFiles; FFiles := nil; // revoke ownership end; procedure TFileSourceListOperation.UpdateStatisticsAtStartTime; begin // Empty. end; end.
unit AMaterialRotulo; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, formularios, BotaoCadastro, StdCtrls, Buttons, Componentes1, ExtCtrls, PainelGradiente, Db, DBTables, Tabela, CBancoDados, Grids, DBGrids, DBKeyViolation, Localizacao, Mask, DBCtrls, DBClient; type TFMaterialRotulo = class(TFormularioPermissao) PainelGradiente1: TPainelGradiente; PanelColor1: TPanelColor; PanelColor2: TPanelColor; MoveBasico1: TMoveBasico; BotaoCadastrar1: TBotaoCadastrar; BotaoAlterar1: TBotaoAlterar; BotaoExcluir1: TBotaoExcluir; BotaoGravar1: TBotaoGravar; BotaoCancelar1: TBotaoCancelar; BFechar: TBitBtn; MaterialRotulo: TRBSQL; MaterialRotuloCODMATERIALROTULO: TIntegerField; MaterialRotuloNOMMATERIALROTULO: TStringField; DataMaterialRotulo: TDataSource; Label1: TLabel; Label2: TLabel; Label3: TLabel; Bevel1: TBevel; ECodigo: TDBKeyViolation; DBEditColor1: TDBEditColor; EConsulta: TLocalizaEdit; GridIndice1: TGridIndice; procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure BFecharClick(Sender: TObject); procedure MaterialRotuloAfterInsert(DataSet: TDataSet); procedure MaterialRotuloAfterEdit(DataSet: TDataSet); procedure MaterialRotuloAfterPost(DataSet: TDataSet); procedure MaterialRotuloBeforePost(DataSet: TDataSet); private { Private declarations } public { Public declarations } end; var FMaterialRotulo: TFMaterialRotulo; implementation uses APrincipal; {$R *.DFM} { ****************** Na criação do Formulário ******************************** } procedure TFMaterialRotulo.FormCreate(Sender: TObject); begin { abre tabelas } { chamar a rotina de atualização de menus } EConsulta.AtualizaConsulta; end; { ******************* Quando o formulario e fechado ************************** } procedure TFMaterialRotulo.FormClose(Sender: TObject; var Action: TCloseAction); begin { fecha tabelas } { chamar a rotina de atualização de menus } MaterialRotulo.close; Action := CaFree; end; {((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( Ações Diversas )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))} {******************************************************************************} procedure TFMaterialRotulo.BFecharClick(Sender: TObject); begin Close; end; {******************************************************************************} procedure TFMaterialRotulo.MaterialRotuloAfterInsert(DataSet: TDataSet); begin ECodigo.ProximoCodigo; ECodigo.ReadOnly := false; end; {******************************************************************************} procedure TFMaterialRotulo.MaterialRotuloAfterEdit(DataSet: TDataSet); begin ECodigo.ReadOnly := true; end; {******************************************************************************} procedure TFMaterialRotulo.MaterialRotuloAfterPost(DataSet: TDataSet); begin EConsulta.AtualizaConsulta; end; {******************************************************************************} procedure TFMaterialRotulo.MaterialRotuloBeforePost(DataSet: TDataSet); begin if MaterialRotulo.State = dsinsert then ECodigo.VerificaCodigoUtilizado; end; Initialization { *************** Registra a classe para evitar duplicidade ****************** } RegisterClasses([TFMaterialRotulo]); end.
{#################################################################################################################### TINJECT - Componente de comunicação (Não Oficial) www.tinject.com.br Novembro de 2019 #################################################################################################################### Owner.....: Joathan Theiller - jtheiller@hotmail.com - Developer.: Mike W. Lustosa - mikelustosa@gmail.com - +55 81 9.9630-2385 Daniel Oliveira Rodrigues - Dor_poa@hotmail.com - +55 51 9.9155-9228 Robson André de Morais - robinhodemorais@gmail.com #################################################################################################################### Obs: - Código aberto a comunidade Delphi, desde que mantenha os dados dos autores e mantendo sempre o nome do IDEALIZADOR Mike W. Lustosa; - Colocar na evolução as Modificação juntamente com as informaçoes do colaborador: Data, Nova Versao, Autor; - Mantenha sempre a versao mais atual acima das demais; - Todo Commit ao repositório deverá ser declarado as mudança na UNIT e ainda o Incremento da Versão de compilação (último digito); #################################################################################################################### Evolução do Código #################################################################################################################### Autor........: Email........: Data.........: Identificador: Modificação..: #################################################################################################################### } //Remover do componente principal controles e comportamentos //de textos. Uso do Record evita ter que instanciar objeto //devido utilização simples dessa necessidade; unit uTInject.Emoticons; interface type TInjectEmoticons = record const Sorridente = '😄'; const SorridenteLingua = '😝'; const Impressionado = '😱'; const Irritado = '😤'; const Triste = '😢'; const Apaixonado = '😍'; const PapaiNoel = '🎅'; const Violao = '🎸'; const Chegada = '🏁'; const Futebol = '⚽'; const NaMosca = '🎯'; const Dinheiro = '💵'; const EnviarCel = '📲'; const Enviar = '📩'; const Fone = '📞'; const Onibus = '🚍'; const Aviao = '✈'; const Like = '👍🏻'; const Deslike = '👎🏻'; const ApertoDeMao = '🤝🏻'; const PazEAmor = '✌🏻'; const Sono = '😴'; const Palmas = '👏🏻'; const LoiraFazerOq = '🤷‍♀' ; const LoiraMaoNoRosto = '🤦‍♀' ; const LoiraNotebook = '👩🏼‍💻'; const LoiraOla = '🙋🏼‍♀'; const LoiraAteLogo = '💁🏼‍♀'; const LoiraTriste = '🙍🏼‍♀'; const Macarrao = '🍜'; const AtendenteH = '👨🏼‍💼'; const AtendenteM = '👩🏼‍💼'; const Pizza = '🍕'; const Bebida = '🥃'; const Restaurante = '🍽'; const Joystick = '🎮'; const Moto = '🏍'; const Carro = '🚘'; const ABarco = '🚢'; const Hospital = '🏥'; const Igreja = '⛪'; const Cartao = '💳'; const TuboEnsaio = '🧪'; const Pilula = '💊'; const SacolaCompras = '🛍'; const CarrinhoCompras = '🛒'; const Ampulheta = '⏳'; const Presente = '🎁'; const Email = '📧'; const AgendaAzul = '📘'; const AgendaVerde = '📗'; const AgendaVermelha = '📕'; const ClipPapel = '📎'; const CanetaAzul = '🖊'; const Lapis = '✏'; const LapisEPapel = '📝'; const CadeadoEChave = '🔐'; const Lupa = '🔎'; const Corarao = '❤'; const Check = '✅'; const Check2 = '✔'; const Atencao = '⚠'; const Zero = '0️⃣'; const Um = '1️⃣'; const Dois = '2️⃣'; const Tres = '3️⃣'; const Quatro = '4️⃣'; const Cinco = '5️⃣'; const Seis = '6️⃣'; const Sete = '7️⃣'; const Oito = '8️⃣'; const Nove = '9️⃣'; const Dez = '🔟'; const Asterisco = '*⃣'; const SetaDireita = '➡'; const SetaEsquerda = '⬅'; const Relogio = '🕒'; const Conversa = '💬'; const ApontaCima = '👆🏻'; const ApontaBaixo = '👇🏻'; const PanelaComComida = '🥘'; const Estrela = '⭐'; const Erro = '❌'; const Duvida = '⁉'; const robot = '🤖'; const MacaVerde = '🍏'; const MacaVermelha = '🍎'; const Pera = '🍐'; const Hamburger = '🍔'; const Torta1 = '🥧'; const Torta2 = '🍰'; const Bolo = '🎂'; const Cerveja = '🍺'; const Cerveja2 = '🍻'; const Vinho = '🍷'; const CachorroQuente = '🌭'; const FacaEGarfo = '🍽'; const GarfoEFaca = '🍴'; const Leite = '🥛'; const CarrinhoDeCompras= '🛒'; const Martelo = '🔨'; const Telefone = '📞'; const Cadeado = '🔒'; const Tesoura = '✂'; const Calendario = '📆'; const AguaPotavel = '🚰'; const Alfinete = '📌'; const Alfinete2 = '📍'; const Rosario = '📿'; const Chave = '🔑'; // Added by Aurino 14/04/2020 14:54:25 const Sorrindo = '😄'; const Sorrindo1 = '😃'; const Sorrindo2 = '😀'; const Sorrindo3 = '😊'; const Sorrindo4 = '😁'; const Branco = '☺'; const Piscando = '😉'; const Smiling5 = '😍'; const ThrowingaKiss = '😘'; const KissingClosedEyes = '😚'; const Beijando = '😗'; const KissingSmilingEyes = '😙'; const Preso0 = '😜'; const Preso1 = '😝'; const Preso2 = '😛'; const Flushed = '😳'; const Pensativo = '😔'; const Aliviado = '😌'; const Naoutilizado = '😒'; const Decepcionado = '😞'; const Perseverante = '😣'; const Choro = '😢'; const TearsofJoy = '😂'; const LoudlyCrying = '😭'; const Sonolento = '😪'; const DisappointedbutRelieved = '😥'; const OpenMouthandColdSweat = '😰'; const SmilingOpenMouthandColdSweat = '😅'; const ColdSweat = '😓'; const Cansado = '😩'; const Cansado1 = '😫'; const Temivel = '😨'; const ScreaminginFear = '😱'; const Pouting = '😡'; const Triunfo = '😤'; const Confundido = '😖'; const Sorrindo7 = '😆'; const Delicioso = '😋'; const MedicalMask = '😷'; const SmilingSunglasses = '😎'; const Dormindo = '😴'; const Dizzy = '😵'; const Surpreendido = '😲'; const Preocupado = '😟'; const FrowningOpenMouth = '😦'; const Angustiado = '😧'; const SmilingHorns = '😈'; const Imp = '👿'; const OpenMouth = '😮'; const Careta = '😬'; const Neutro = '😐'; const Confuso = '😕'; const Hushed = '😯'; const outMouth = '😶'; const SmilingHalo = '😇'; const Smirking = '😏'; const Expressionless = '😑'; const ManGuaPiMao = '👲'; const ManTurban = '👳'; const PoliceOfficer = '👮'; const ConstructionWorker = '👷'; const Guardsman = '💂'; const Bebe = '👶'; const Boy = '👦'; const Garota = '👧'; const Man = '👨'; const Mulher = '👩'; const OlderMan = '👴'; const OlderWoman = '👵'; const PersonBlondHair = '👱'; const BabyAngel = '👼'; const Princess = '👸'; const JapaneseOgre = '👹'; const JapaneseGoblin = '👺'; const Cranio = '💀'; const ExtraterrestrialAlien = '👽'; const PileofPoo = '💩'; const SmilingCatOpenMouth = '😺'; const GrinningCatSmilingEyes = '😸'; const SmilingCatHeartShapedEyes = '😻'; const KissingCatClosedEyes = '😽'; const CatWrySmile = '😼'; const WearyCat = '🙀'; const CryingCat = '😿'; const CatTearsofJoy = '😹'; const PoutingCat = '😾'; const Macaco = '🐵'; const SeeNoEvilMonkey = '🙈'; const HearNoEvilMonkey = '🙉'; const SpeakNoEvilMonkey = '🙊'; const Dog = '🐶'; const Wolf = '🐺'; const Cat = '🐱'; const Mouse = '🐭'; const Hamster = '🐹'; const Frog = '🐸'; const Tiger = '🐯'; const Koala = '🐨'; const Bear = '🐻'; const Pig = '🐷'; const PigNose = '🐽'; const Cow = '🐮'; const Boar = '🐗'; const Macaco1 = '🐒'; const Cavalo = '🐴'; const Ovelha = '🐑'; const Elefante = '🐘'; const Panda = '🐼'; const Pinguim = '🐧'; const Bird = '🐦'; const BabyChick = '🐤'; const FrontFacingBabyChick = '🐥'; const HatchingChick = '🐣'; const Frango = '🐔'; const Cobra = '🐍'; const Tartaruga = '🐢'; const Bug = '🐛'; const Honeybee = '🐝'; const Ant = '🐜'; const LadyBeetle = '🐞'; const Caracol = '🐌'; const Polvo = '🐙'; const SpiralShell = '🐚'; const TropicalFish = '🐠'; const Peixe = '🐟'; const Dolphin = '🐬'; const SpoutingWhale = '🐳'; const Baleia = '🐋'; const Cow1 = '🐄'; const Ram = '🐏'; const Rato = '🐀'; const WaterBuffalo = '🐃'; const Tiger1 = '🐅'; const Coelho = '🐇'; const Dragao = '🐉'; const Cavalo1 = '🐎'; const Cabra = '🐐'; const Galo = '🐓'; const Dog1 = '🐕'; const Pig1 = '🐖'; const Mouse1 = '🐁'; const Ox = '🐂'; const Dragao1 = '🐲'; const Blowfish = '🐡'; const Crocodilo = '🐊'; const BactrianCamel = '🐫'; const DromedaryCamel = '🐪'; const Leopardo = '🐆'; const Cat1 = '🐈'; const Poodle = '🐩'; const PawPrints = '🐾'; const Bouquet = '💐'; const CherryBlossom = '🌸'; const Tulip = '🌷'; const FourLeafClover = '🍀'; const Rose = '🌹'; const Girassol = '🌻'; const Hibisco = '🌺'; const MapleLeaf = '🍁'; const LeafFlutteringinWind = '🍃'; const FallenLeaf = '🍂'; const Herb = '🌿'; const EarofRice = '🌾'; const Cogumelo = '🍄'; const Cactus = '🌵'; const PalmTree = '🌴'; const EvergreenTree = '🌲'; const DeciduousTree = '🌳'; const Chestnut = '🌰'; const Mudas = '🌱'; const Blossom = '🌼'; const RedApple = '🍎'; const GreenApple = '🍏'; const Tangerina = '🍊'; const Limao = '🍋'; const Cerejas = '🍒'; const Uvas = '🍇'; const Melancia = '🍉'; const Morango = '🍓'; const Peach = '🍑'; const Melão = '🍈'; const Banana = '🍌'; const Pear = '🍐'; const Abacaxi = '🍍'; const RoastedSweetPotato = '🍠'; const Beringela = '🍆'; const Tomate = '🍅'; const EarofMaize = '🌽'; const WhiteFlower = '💮'; const TopHat = '🎩'; const Coroa = '👑'; const WomansHat = '👒'; const AthleticShoe = '👟'; const MansShoe = '👞'; const WomansSandal = '👡'; const HighHeeledShoe = '👠'; const WomansBoots = '👢'; const camiseta = '👕'; const Gravata = '👔'; const WomansClothes = '👚'; const Dress = '👗'; const RunningShirtSash = '🎽'; const Jeans = '👖'; const Quimono = '👘'; const Biquini = '👙'; const Pasta = '💼'; const Bolsa = '👜'; const Pouch = '👝'; const Bolsa1 = '👛'; const Oculos = '👓'; const Ribbon = '🎀'; const ClosedUmbrella = '🌂'; const Batom = '💄'; const YellowHeart = '💛'; const BlueHeart = '💙'; const PurpleHeart = '💜'; const GreenHeart = '💚'; const HeavyBlackHeart = '❤'; const BrokenHeart = '💔'; const GrowingHeart = '💗'; const BeatingHeart = '💓'; const TwoHearts = '💕'; const SparklingHeart = '💖'; const RevolvingHearts = '💞'; const HeartArrow = '💘'; const LoveLetter = '💌'; const KissMark = '💋'; const Ring = '💍'; const GemStone = '💎'; const BustinSilhouette = '👤'; const BustsinSilhouette = '👥'; const SpeechBalloon = '💬'; const Pegadas = '👣'; const ThoughtBalloon = '💭'; const HeartRibbon = '💝'; const ManandWomanHoldingHands = '👫'; const familia = '👪'; const TwoMenHoldingHands = '👬'; const TwoWomenHoldingHands = '👭'; const Kiss = '💏'; const CoupleHeart = '💑'; const HeartDecoration = '💟'; const GlobeMeridians = '🌐'; const Sun = '🌞'; const FullMoon = '🌝'; const NewMoon = '🌚'; const NewMoonSymbol = '🌑'; const WaxingCrescentMoonSymbol = '🌒'; const FirstQuarterMoonSymbol = '🌓'; const WaxingGibbousMoonSymbol = '🌔'; const FullMoonSymbol = '🌕'; const WaningGibbousMoonSymbol = '🌖'; const LastQuarterMoonSymbol = '🌗'; const WaningCrescentMoonSymbol = '🌘'; const LastQuarterMoon = '🌜'; const FirstQuarterMoon = '🌛'; const CrescentMoon = '🌙'; const EarthGlobeEuropaafrica = '🌍'; const EarthGlobeAmericas = '🌎'; const EarthGlobeAsiaAustralia = '🌏'; const Vulcao = '🌋'; const MilkyWay = '🌌'; const ShootingStar = '🌠'; const WhiteMediumStar = '⭐'; const BlackSunRays = '☀'; const SunBehindCloud = '⛅'; const Nuvem = '☁'; const HighVoltageSign = '⚡'; const UmbrellaRainDrops = '☔'; const Flocodeneve = '❄'; const SnowmanoutSnow = '⛄'; const Ciclone = '🌀'; const Foggy = '🌁'; const Arcoiris = '🌈'; const WaterWave = '🌊'; const ClockTwelveOclock = '🕛'; const ClockTwelveThirty = '🕧'; const ClockOneOclock = '🕐'; const ClockOneThirty = '🕜'; const ClockTwoOclock = '🕑'; const ClockTwoThirty = '🕝'; const ClockThreeOclock = '🕒'; const ClockThreeThirty = '🕞'; const ClockFourOclock = '🕓'; const ClockFourThirty = '🕟'; const ClockFiveOclock = '🕔'; const ClockFiveThirty = '🕠'; const ClockSixOclock = '🕕'; const ClockSevenOclock = '🕖'; const ClockEightOclock = '🕗'; const ClockNineOclock = '🕘'; const ClockTenOclock = '🕙'; const ClockElevenOclock = '🕚'; const ClockSixThirty = '🕡'; const ClockSevenThirty = '🕢'; const ClockEightThirty = '🕣'; const ClockNineThirty = '🕤'; const ClockTenThirty = '🕥'; const ClockElevenThirty = '🕦'; const HotBeverage = '☕'; const TeacupoutHandle = '🍵'; const SakeBottleandCup = '🍶'; const BabyBottle = '🍼'; const BeerMug = '🍺'; const ClinkingBeerMugs = '🍻'; const CocktailGlass = '🍸'; const TropicalDrink = '🍹'; const WineGlass = '🍷'; const ForkandKnife = '🍴'; const SliceofPizza = '🍕'; const Hamburguer = '🍔'; const FrenchFries = '🍟'; const PoultryLeg = '🍗'; const MeatonBone = '🍖'; const espaguete = '🍝'; const CurryandRice = '🍛'; const FriedShrimp = '🍤'; const BentoBox = '🍱'; const Sushi = '🍣'; const FishCakeSwirlDesign = '🍥'; const RiceBall = '🍙'; const RiceCracker = '🍘'; const CookedRice = '🍚'; const SteamingBowl = '🍜'; const PotofFood = '🍲'; const Oden = '🍢'; const Dango = '🍡'; const Culinária = '🍳'; const Pão = '🍞'; const Donut = '🍩'; const Creme = '🍮'; const SoftIceCream = '🍦'; const IceCream = '🍨'; const ShavedIce = '🍧'; const BirthdayCake = '🎂'; const Shortcake = '🍰'; const Cookie = '🍪'; const ChocolateBar = '🍫'; const Candy = '🍬'; const pirulito = '🍭'; const HoneyPot = '🍯'; const ArtistPalette = '🎨'; const ClapperBoard = '🎬'; const Microfone = '🎤'; const Headphone = '🎧'; const MusicalScore = '🎼'; const NotaMusical = '🎵'; const MultipleMusicalNotes = '🎶'; const MusicalKeyboard = '🎹'; const Violino = '🎻'; const Trombeta = '🎺'; const saxofone = '🎷'; const Guitar = '🎸'; const AlienMonster = '👾'; const VideoGame = '🎮'; const PlayingCardBlackJoker = '🃏'; const FlowerPlayingCards = '🎴'; const MahjongTileRedDragon = '🀄'; const GameDie = '🎲'; const DirectHit = '🎯'; const AmericanFootball = '🏈'; const BasketballandHoop = '🏀'; const SoccerBall = '⚽'; const Baseball = '⚾'; const TennisRacquetandBall = '🎾'; const Bilhar = '🎱'; const RugbyFootball = '🏉'; const Boliche = '🎳'; const FlaginHole = '⛳'; const MountainBicyclist = '🚵'; const Ciclista = '🚴'; const ChequeredFlag = '🏁'; const HorseRacing = '🏇'; const trofeu = '🏆'; const SkiandSkiBoot = '🎿'; const Snowboarder = '🏂'; const Nadador = '🏊'; const Surfista = '🏄'; const FishingPoleandFish = '🎣'; const HouseBuilding = '🏠'; const HouseGarden = '🏡'; const Escola = '🏫'; const OfficeBuilding = '🏢'; const JapanesePostOffice = '🏣'; const Hospital2 = '🏥'; const banco = '🏦'; const ConvenienceStore = '🏪'; const LoveHotel = '🏩'; const Hotel = '🏨'; const casamento = '💒'; const DepartmentStore = '🏬'; const EuropeanPostOffice = '🏤'; const SunsetoverBuildings = '🌇'; const CityscapeatDusk = '🌆'; const JapaneseCastle = '🏯'; const EuropeanCastle = '🏰'; const Tent = '⛺'; const Fabrica = '🏭'; const TokyoTower = '🗼'; const SilhouetteofJapan = '🗾'; const MountFuji = '🗻'; const SunriseoverMountains = '🌄'; const Nascerdosol = '🌅'; const NightStars = '🌃'; const StatueofLiberty = '🗽'; const BridgeatNight = '🌉'; const CarouselHorse = '🎠'; const FerrisWheel = '🎡'; const fonte = '⛲'; const RollerCoaster = '🎢'; const Ship = '🚢'; const Veleiro = '⛵'; const Lancha = '🚤'; const Rowboat = '🚣'; const Ancora = '⚓'; const Foguete = '🚀'; const Seat = '💺'; const Helicoptero = '🚁'; const SteamLocomotive = '🚂'; const Bonde = '🚊'; const estacao = '🚉'; const MountainRailway = '🚞'; const Train = '🚆'; const HighSpeedTrain = '🚄'; const HighSpeedTrainBulletNose = '🚅'; const LightRail = '🚈'; const Metro = '🚇'; const Monotrilho = '🚝'; const TramCar = '🚋'; const RailwayCar = '🚃'; const Trolebus = '🚎'; const Bus = '🚌'; const OncomingBus = '🚍'; const RecreationalVehicle = '🚙'; const OncomingAutomobile = '🚘'; const Automobile = '🚗'; const Taxi = '🚕'; const OncomingTaxi = '🚖'; const ArticulatedLorry = '🚛'; const DeliveryTruck = '🚚'; const PoliceCarsRevolvingLight = '🚨'; const PoliceCar = '🚓'; const OncomingPoliceCar = '🚔'; const FireEngine = '🚒'; Const Ambulancia = '🚑'; const Minibus = '🚐'; const Bicycle = '🚲'; const AerialTramway = '🚡'; const SuspensionRailway = '🚟'; const MountainCableway = '🚠'; const Trator = '🚜'; const BarberPole = '💈'; const BusStop = '🚏'; const Ticket = '🎫'; const VerticalTrafficLight = '🚦'; const HorizontalTrafficLight = '🚥'; const WarningSign = '⚠'; const ConstructionSign = '🚧'; const JapaneseSymbolforBeginner = '🔰'; const FuelPump = '⛽'; const IzakayaLantern = '🏮'; const SlotMachine = '🎰'; const HotSprings = '♨'; const Moyai = '🗿'; const CircusTent = '🎪'; const PerformingArts = '🎭'; const RoundPushpin = '📍'; const TriangularFlagonPost = '🚩'; const EMailSymbol = '📧'; const InboxTray = '📥'; const OutboxTray = '📤'; const Envelope = '✉'; const EnvelopeDownwardsArrowAbove = '📩'; const IncomingEnvelope = '📨'; const PostalHorn = '📯'; const ClosedMailboxRaisedFlag = '📫'; const ClosedMailboxLoweredFlag = '📪'; const OpenMailboxRaisedFlag = '📬'; const OpenMailboxLoweredFlag = '📭'; const Caixapostal = '📮'; const pacote = '📦'; const Memo = '📝'; const PageFacingUp = '📄'; const PageCurl = '📃'; const BookmarkTabs = '📑'; const BarChart = '📊'; const ChartUpwardsTrend = '📈'; const ChartDownwardsTrend = '📉'; const Scroll = '📜'; const AreaDeTransferencia = '📋'; const TearOffCalendar = '📆'; const CardIndex = '📇'; const FileFolder = '📁'; const OpenFileFolder = '📂'; const BlackScissors = '✂'; const Pino = '📌'; const ClipedePapel = '📎'; const BlackNib = '✒'; const StraightRuler = '📏'; const TriangularRuler = '📐'; const ClosedBook = '📕'; const GreenBook = '📗'; const BlueBook = '📘'; const OrangeBook = '📙'; const Caderno = '📓'; const NotebookDecorativeCover = '📔'; const Ledger = '📒'; const Livros = '📚'; const OpenBook = '📖'; const Marcador = '🔖'; const NameBadge = '📛'; const Microscopio = '📛'; const Telescopio = '🔭'; const Jornal = '📰'; const MoneyBag = '💰'; const BanknoteYenSign = '💴'; const BanknoteDollarSign = '💵'; const BanknotePoundSign = '💷'; const BanknoteEuroSign = '💶'; const CreditCard = '💳'; const MoneyWings = '💸'; const MovieCamera = '🎥'; const Camera = '📷'; const VideoCamera = '📹'; const fitaDeVideo = '📼'; const OpticalDisc = '💿'; const DVD = '📀'; const Minidisc = '💽'; const FloppyDisk = '💾'; const PersonalComputer = '💻'; const MobilePhone = '📱'; const BlackTelephone = '☎'; const TelephoneReceiver = '📞'; const Pager = '📟'; const FaxMachine = '📠'; const SatelliteAntenna = '📡'; const Televisao = '📺'; const Radio = '📻'; const SpeakerThreeSoundWaves = '🔊'; const SpeakerOneSoundWave = '🔉'; const Altofalante = '🔈'; const SpeakerCancellationStroke = '🔇'; const Bell = '🔔'; const BellcancellationStroke = '🔕'; const PublicAddressLoudspeaker = '📢'; const CheeringMegaphone = '📣'; const HourglassFlowingSand = '⏳'; const Hourglass = '⌛'; const AlarmClock = '⏰'; const Watch = '⌚'; const OpenLock = '🔓'; const Lock = '🔒'; const LockInkPen = '🔏'; const ClosedLockKey = '🔐'; const Key = '🔑'; const LeftPointingMagnifyingGlass = '🔎'; const ElectricLightBulb = '💡'; const ElectricTorch = '🔦'; const ElectricPlug = '🔌'; const Bateria = '🔋'; const RightPointingMagnifyingGlass = '🔍'; const Wrench = '🔧'; const NutandBolt = '🔩'; const MobilePhoneRightwardsArrowatLeft = '📲'; const AntennaBars = '📶'; const Cinema = '🎦'; const VibrationMode = '📳'; const MobilePhoneOff = '📴'; const KeycapDigitOne = '⃣'; const KeycapDigitTwo = '⃣'; const KeycapDigitThree = '⃣'; const KeycapDigitFour = '⃣'; const KeycapDigitFive = '⃣'; const KeycapDigitSix = '⃣'; const KeycapDigitSeven = '⃣'; const KeycapDigitEight = '⃣'; const KeycapDigitNine = '⃣'; const KeycapDigitZero = '⃣'; const KeycapTen = '🔟'; const InputSymbolforNumbers = '🔢'; const KeycapNumberSign = '# ⃣'; const InputSymbolforLatinSmallLetters = '🔡'; const InputSymbolforLatinLetters = '🔤'; const InformationSource = 'ℹ'; const SquaredOK = '🆗'; const SquaredNEW = '🆕'; const SquaredUPExclamationMark = '🆙'; const SquaredCool = '🆒'; const SquaredFree = '🆓'; const SquaredNG = '🆖'; const NegativeSquaredLatinCapitalLetterP = '🅿'; const CircledLatinCapitalLetterM = 'Ⓜ'; const SquaredCL = '🆑'; const SquaredSOS = '🆘'; const SquaredID = '🆔'; const SquaredVS = '🆚'; const NegativeSquaredLatinCapitalLetterA = '🅰'; const NegativeSquaredLatinCapitalLetterB = '🅱'; const NegativeSquaredAB = '🆎'; const NegativeSquaredLatinCapitalLetterO = '🅾'; const CopyrightSign = '©'; const RegisteredSign = '®'; const HundredPointsSymbol = '💯'; const TradeMarkSign = '™'; const InputSymbolforLatinCapitalLetters = '🔠'; const AutomatedTellerMachine = '🏧'; const DoubleExclamationMark = '‼'; const ExclamationQuestionMark = '⁉'; const HeavyExclamationMarkSymbol = '❗'; const BlackQuestionMarkOrnament = '❓'; const WhiteExclamationMarkOrnament = '❕'; const WhiteQuestionMarkOrnament = '❔'; const ThumbsUpSign = '👍'; const ThumbsDownSign = '👎'; const OKHandSign = '👌'; const FistedHandSign = '👊'; const RaisedFist = '✊'; const VictoryHand = '✌'; const WavingHandSign = '👋'; const RaisedHand = '✋'; const OpenHandsSign = '👐'; const WhiteUpPointingBackhandIndex = '👆'; const WhiteDownPointingBackhandIndex = '👇'; const WhiteRightPointingBackhandIndex = '👉'; const WhiteLeftPointingBackhandIndex = '👈'; const PersonRaisingBothHandsinCelebration = '🙌'; const PersonFoldedHands = '🙏'; const WhiteUpPointingIndex = '☝'; const ClappingHandsSign = '👏'; const FlexedBiceps = '💪'; const NailPolish = '💅'; const DownwardsBlackArrow = '⬇'; const LeftwardsBlackArrow = '⬅'; const BlackRightwardsArrow = '➡'; const NorthEastArrow = '↗'; const NorthWestArrow = '↖'; const SouthEastArrow = '↘'; const SouthWestArrow = '↙'; const LeftRightArrow = '↔'; const UpDownArrow = '↕'; const Refresh = '🔄'; const BlackLeftPointingTriangle = '◀'; const BlackRightPointingTriangle = '▶'; const UpPointingSmallRedTriangle = '🔼'; const DownPointingSmallRedTriangle = '🔽'; const LeftwardsArrowHook = '↩'; const RightwardsArrowHook = '↪'; const BlackLeftPointingDoubleTriangle = '⏪'; const BlackRightPointingDoubleTriangle = '⏩'; const BlackUpPointingDoubleTriangle = '⏫'; const BlackDownPointingDoubleTriangle = '⏬'; const ArrowPointingRightwardsthenCurvingDownwards = '⤵'; const ArrowPointingRightwardsthenCurvingUpwards = '⤴'; const TwistedRightwardsArrows = '🔀'; const ClockwiseRightwardsandLeftwardsOpenCircleArrows = '🔁'; const ClockwiseRightwardsandLeftwardsOpenCircleArrowsCircledOneOverlay = '🔂'; const TopUpwardsArrowAbove = '🔝'; const EndLeftwardsArrowAbove = '🔚'; const BackLeftwardsArrowAbove = '🔙'; const OnExclamationMarkLeftRightArrowAbove = '🔛'; const SoonRightwardsArrowAbove = '🔜'; const ClockwiseDownwardsandUpwardsOpenCircleArrows = '🔃'; const UpPointingRedTriangle = '🔺'; const DownPointingRedTriangle = '🔻'; const UpwardsBlackArrow = '⬆'; const Aries = '♈'; const Touro = '♉'; const Gemeos = '♊'; const Cancer = '♋'; const Leon = '♌'; const Virgo = '♍'; const Libra = '♎'; const Scorpius = '♏'; const Sagitário = '♐'; const Capricórnio = '♑'; const Aquario = '♒'; const Peixes = '♓'; const Ophiuchus = '⛎'; const FlagforJapan = '🇯🇵'; const FlagforSouthKorea = '🇰🇷'; const FlagforGermany = '🇩🇪'; const FlagforChina = '🇨🇳'; const FlagforUnitedStates = '🇺🇸'; const FlagforFrance = '🇫🇷'; const FlagforSpain = '🇪🇸'; const FlagforItaly = '🇮🇹'; const FlagforRussia = '🇷🇺'; const FlagforUnitedKingdom = '🇬🇧'; const Banheiro = '🚻'; const MensSymbol = '🚹'; const WomensSymbol = '🚺'; const BabySymbol = '🚼'; const WaterCloset = '🚾'; const PotableWaterSymbol = '🚰'; const PutLitterinitsPlaceSymbol = '🚮'; const WheelchairSymbol = '♿'; const NoSmokingSymbol = '🚭'; const PassportControl = '🛂'; const BaggageClaim = '🛄'; const LeftLuggage = '🛅'; const Alfandega = '🛃'; const NoEntrySign = '🚫'; const NoOneUnderEighteenSymbol = '🔞'; const NoMobilePhones = '📵'; const DoNotLitterSymbol = '🚯'; const NonPotableWaterSymbol = '🚱'; const NoBicycles = '🚳'; const NoPedestrians = '🚷'; const ChildrenCrossing = '🚸'; const NoEntry = '⛔'; const BlackUniversalRecyclingSymbol = '♻'; const DiamondShapeaDotInside = '💠'; const DoubleCurlyLoop = '➿'; const PineDecoration = '🎍'; const JapaneseDolls = '🎎'; const SchoolSatchel = '🎒'; const GraduationCap = '🎓'; const CarpStreamer = '🎏'; const Fireworks = '🎆'; const FireworkSparkler = '🎇'; const WindChime = '🎐'; const MoonViewingCeremony = '🎑'; const JackOLantern = '🎃'; const Fantasma = '👻'; const FatherChristmas = '🎅'; const ChristmasTree = '🎄'; const WrappedPresent = '🎁'; const TanabataTree = '🎋'; const PartyPopper = '🎉'; const ConfettiBall = '🎊'; const Balao = '🎈'; const CrossedFlags = '🎌'; const CrystalBall = '🔮'; const HighBrightnessSymbol = '🔆'; const LowBrightnessSymbol = '🔅'; const Banheira = '🛁'; const Bath = '🛀'; const Shower = '🚿'; const WC = '🚽'; const Porta = '🚪'; const SmokingSymbol = '🚬'; const Bomb = '💣'; const Pistola = '🔫'; const Hocho = '🔪'; const Seringa = '💉'; const Fogo = '🔥'; const Sparkles = '✨'; const GlowingStar = '🌟'; const DizzySymbol = '💫'; const CollisionSymbol = '💥'; const AngerSymbol = '💢'; const SplashingSweatSymbol = '💦'; const Gota = '💧'; const SleepingSymbol = '💤'; const DashSymbol = '💨'; const Ear = '👂'; const Olhos = '👀'; const Nariz = '👃'; const Lingua = '👅'; const Boca = '👄'; const Pedestre = '🚶'; const Runner = '🏃'; const Dançarino = '💃'; const WomanBunnyEars = '👯'; const OKGesture = '🙆'; const NoGoodGesture = '🙅'; const InformationDeskPerson = '💁'; const HappyPersonRaisingOneHand = '🙋'; const massagem = '💆'; const Cortedecabelo = '💇'; const BrideVeil = '👰'; const PersonPouting = '🙎'; const PersonFrowning = '🙍'; const PersonBowingDeeply = '🙇'; const SixPointedStarMiddleDot = '🔯'; const ChartUpwardsTrendandYenSign = '💹'; const HeavyDollarSign = '💲'; const CurrencyExchange = '💱'; const CrossMark = '❌'; const HeavyLargeCircle = '⭕'; const HeavyMultiplicationX = '✖'; const HeavyPlusSign = '➕'; const HeavyMinusSign = '➕'; const HeavyDivisionSign = '➗'; const BlackSpadeSuit = '♠'; const BlackHeartSuit = '♥'; const BlackClubSuit = '♣'; const BlackDiamondSuit = '♦'; const HeavyCheckMark = '✔'; const BallotBoxCheck = '☑'; const RadioButton = '🔘'; const LinkSymbol = '🔗'; const CurlyLoop = '➰'; const WavyDash = '〰'; const PartAlternationMark = '〽'; const TridentEmblem = '🔱'; const BlackMediumSquare = '◼'; const WhiteMediumSquare = '◻'; const BlackMediumSmallSquare = '◾'; const WhiteMediumSmallSquare = '◽'; const BlackSmallSquare = '▪'; const WhiteSmallSquare = '▫'; const BlackSquareButton = '🔲'; const WhiteSquareButton = '🔳'; const MediumBlackCircle = '⚫'; const MediumWhiteCircle = '⚪'; const LargeRedCircle = '🔴'; const LargeBlueCircle = '🔵'; const WhiteLargeSquare = '⬜'; const BlackLargeSquare = '⬛'; const LargeOrangeDiamond = '🔶'; const LargeBlueDiamond = '🔷'; const SmallOrangeDiamond = '🔸'; const SmallBlueDiamond = '🔹'; const SquaredKatakanaKoko = '🈁'; const SquaredCJKUnifiedIdeograph = '🈯'; const SquaredCJKUnifiedIdeographaa = '🈳'; const SquaredCJKUnifiedIdeographe = '🈵'; const SquaredCJKUnifiedIdeograph1 = '🈴'; const SquaredCJKUnifiedIdeograph2 = '🈲'; const CircledIdeographAdvantage = '🉐'; const SquaredCJKUnifiedIdeograph3 = '🈹'; const SquaredCJKUnifiedIdeographb = '🈺'; const SquaredCJKUnifiedIdeograph4 = '🈶'; const SquaredCJKUnifiedIdeograph5 = '🈚'; const SquaredCJKUnifiedIdeograph6 = '🈷'; const SquaredCJKUnifiedIdeograph7 = '🈸'; const SquaredKatakanaSa = '🈂'; const CircledIdeographAccept = '🉑'; const circledideographsecret = '㊙'; const circledideographcongratulation = '㊗'; const EightSpokedAsterisk = '✳'; const Sparkle = '❇'; const EightPointedBlackStar = '✴'; const NegativeSquaredCrossMark = '❎'; const WhiteHeavyCheckMark = '✅'; end; implementation end.
{*******************************************************} { } { Borland Delphi Visual Component Library } { } { Copyright (c) 2000-2002 Borland Software Corporation } { } {*******************************************************} unit DBAdapt; interface {$IFDEF MSWINDOWS} uses Classes, Messages, HTTPApp, WebComp, HTTPProd, DB, SiteComp, SysUtils, WebContnrs, Contnrs, AdaptReq, WebAdapt; {$ENDIF} {$IFDEF LINUX} uses Classes, HTTPApp, WebComp, HTTPProd, DB, SiteComp, SysUtils, WebContnrs, Contnrs, AdaptReq, WebAdapt; {$ENDIF} type TDataSetAdapterRequestParamOption = (poLocateParams, poCurrentPage); TDataSetAdapterRequestParamOptions = set of TDataSetAdapterRequestParamOption; TDataSetAdapterMode = (amInsert, amEdit, amBrowse, amQuery); TDataSetAdapterModes = set of TDataSetAdapterMode; const DataSetAdapterModeNames: array[TDataSetAdapterMode] of string = ('Insert', 'Edit', 'Browse', 'Query'); type TLocateParamsList = class; TLocateParams = class(TObject) private FAdapterName: string; FParams: TStrings; function GetCount: Integer; function GetParamName(I: Integer): string; function GetParamValue(I: Integer): string; function GetItem(I: Integer): string; public constructor Create(AList: TLocateParamsList); destructor Destroy; override; property AdapterName: string read FAdapterName write FAdapterName; property Count: Integer read GetCount; procedure AddParam(const ANameValue: string); overload; procedure AddParam(const AName, AValue: string); overload; property ParamNames[I: Integer]: string read GetParamName; property ParamValues[I: Integer]: string read GetParamValue; property Items[I: Integer]: string read GetItem; default; end; TLocateParamsList = class(TObject) private FList: TObjectList; function GetCount: Integer; function GetItem(I: Integer): TLocateParams; public constructor Create; destructor Destroy; override; procedure Clear; function Add: TLocateParams; property Count: Integer read GetCount; property Items[I: Integer]: TLocateParams read GetItem; default; function ItemByAdapterName(const AName: string): TLocateParams; end; IKeyParams = interface function Count: Integer; function GetName(I: Integer): string; function GetValue(I: Integer): string; property Names[I: Integer]: string read GetName; property Values[I: Integer]: string read GetValue; end; IGetDataSetKeyName = interface ['{A9F1BBDE-9B0A-49E6-AFB9-C19E52A84E83}'] function GetKeyName: string; property KeyName: string read GetKeyName; end; IAdapterDataSetComponent = interface ['{D62DBBC1-2C40-11D4-A46E-00C04F6BB853}'] function GetDataSet: TDataSet; procedure SetDataSet(Value: TDataSet); property DataSet: TDataSet read GetDataSet write SetDataSet; end; IPrepareDataSet = interface ['{444E2D2E-F1A6-485D-B0E3-1CF925A4713B}'] procedure PrepareDataSet; end; TCustomDataSetAdapter = class(TDefaultFieldsPagedAdapter, IAdapterMode, IAdapterDataSetComponent, IGetDesigntimeWarnings, IGetAdapterModeNames, IGetRecordKeys, IFullyQualifyInputNames) private FDataSet: TDataSet; FBookMark: Pointer; FDesignerDataLink: TDataLink; FLocateParamsList: TLocateParamsList; FOnPrepareDataSet: TNotifyEvent; FDataSetPrepared: Boolean; FMode: TDataSetAdapterMode; FDataSetRecNo: Integer; FInIterator: Boolean; FMasterAdapter: TCustomDataSetAdapter; FDetailAdapters: TComponentList; FAdapterRowNotFound: TCustomDataSetAdapter; FInDefaultMode: Boolean; FRefreshAfterPost: Boolean; function GetMode: TDataSetAdapterMode; procedure CreateDataLink; procedure SetMasterAdapter(const Value: TCustomDataSetAdapter); procedure SetInDefaultMode(const Value: Boolean); protected procedure ImplSetEchoActionFieldValues(AValue: Boolean); override; function GetDefaultMode: TDataSetAdapterMode; virtual; function GetMasterDetailAdapters: TComponentList; procedure GetKeyParamStrings(AValues: TStrings); function LocateKeyParams(AParams: IKeyParams): Boolean; function LocateRequestRecord(AActionRequest: IActionRequest): Boolean; procedure OnDataSetStateChange(Sender: TObject); virtual; // Paging support function GetNextRecord: Boolean; override; function GetFirstRecord: Boolean; override; function GetEOF: Boolean; override; function GetRecordIndex: Integer; override; function GetRecordCount: Integer; override; { IFullyQualifyInputNames } function FullyQualifyInputNames: Boolean; { IIteratorIndex } function ImplGetIteratorIndex: Integer; override; function ImplInIterator: Boolean; override; function ImplStartIterator(var OwnerData: Pointer): Boolean; override; procedure ImplEndIterator(OwnerData: Pointer); override; procedure SetMode(const Value: TDataSetAdapterMode); virtual; function GetHiddenFieldOptions: TAdapterHiddenFieldOptions; override; procedure AddDefaultFields(AComponents: TWebComponentList); override; procedure AddDefaultActions(AComponents: TWebComponentList); override; function GetKeyFields: string; function GetProviderSupport: IProviderSupport; procedure GetKeyParams(AParams: TLocateParamsList; ARecurse: Boolean); procedure UpdateFieldsValidateValues(AActionRequest: IActionRequest; AAdapterFields: TObjectList); override; function UpdateFieldsGetAnyChanges(AActionRequest: IActionRequest; AAdapterFields: TObjectList): Boolean; override; procedure UpdateFieldsUpdateValues(AActionRequest: IActionRequest; AAdapterFields: TObjectList); override; procedure UpdateFieldsExecuteValues(AActionRequest: IActionRequest; AAdapterFields: TObjectList); override; { IGetDesigntimeWarnings } procedure GetDesigntimeWarnings(AWarnings: TAbstractDesigntimeWarnings); { IAdapterEditor } function ImplCanAddFieldClass(AParent: TComponent; AClass: TClass): Boolean; override; function ImplCanAddActionClass(AParent: TComponent; AClass: TClass): Boolean; override; { INotifyWebActivate } procedure ImplNotifyDeactivate; override; { IGetAdapterModeNames } procedure GetAdapterModeNames(AStrings: TStrings); { IGetRecordKeys } procedure GetRecordKeys(AValues: TStrings; var AFullyQualify: Boolean); procedure ImplGetRecordKeys(AValues: TStrings; var AFullyQualify: Boolean); virtual; { IAdapterMode } function GetAdapterMode: string; procedure SetAdapterMode(const AValue: string); procedure RestoreDefaultAdapterMode; function GetNeedAdapterMode: Boolean; { IAdapterDataSetComponent } function GetDataSet: TDataSet; { IWebDataFields } procedure ImplGetFieldsList(AList: TStrings); override; { IWebActionsList } procedure ImplGetActionsList(AList: TStrings); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure SetDataSet(ADataSet: TDataSet); procedure PrepareDataSet; virtual; property DataSetPrepared: Boolean read FDataSetPrepared write FDataSetPrepared; property AdapterRowNotFound: TCustomDataSetAdapter read FAdapterRowNotFound write FAdapterRowNotFound; public function StringToMode(const AValue: string): TDataSetAdapterMode; procedure ExtractRequestParams(ARequest: IUnknown); override; procedure EncodeActionParams(AParams: IAdapterItemRequestParams); override; procedure ExtractRequestParamsFlags(ARequest: IUnknown; AOptions: TDataSetAdapterRequestParamOptions); procedure EncodeActionParamsFlags(AParams: IAdapterItemRequestParams; AOptions: TDataSetAdapterRequestParamOptions); function Locate: Boolean; function SilentLocate(AParams: TLocateParamsList; ARecurse: Boolean): Boolean; procedure ApplyAdapterMode(AActionRequest: IActionRequest); function LocateAndApply(AActionRequest: IActionRequest): Boolean; constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure RaiseFieldNotFound(const AFieldName: string); procedure RaiseFieldChangedByAnotherUser(const AFieldName: string); procedure RaiseRowNotFound; procedure RaiseNilDataSet; property DataSet: TDataSet read GetDataSet write SetDataSet; property DetailAdapters: TComponentList read FDetailAdapters; property InDefaultMode: Boolean read FInDefaultMode write SetInDefaultMode; property LocateParamsList: TLocateParamsList read FLocateParamsList; property MasterAdapter: TCustomDataSetAdapter read FMasterAdapter write SetMasterAdapter; property Mode: TDataSetAdapterMode read GetMode write SetMode; property OnPrepareDataSet: TNotifyEvent read FOnPrepareDataSet write FOnPrepareDataSet; property RefreshAfterPost: Boolean read FRefreshAfterPost write FRefreshAfterPost default False; end; TDataSetAdapter = class(TCustomDataSetAdapter) published property DataSet; property Data; property Actions; property ViewAccess; property ModifyAccess; property OnPrepareDataSet; property OnBeforeUpdateFields; property OnAfterUpdateFields; property OnBeforeValidateFields; property OnAfterValidateFields; property OnBeforeExecuteAction; property OnAfterExecuteAction; property OnBeforeGetActionResponse; property OnAfterGetActionResponse; property OnGetActionParams; property OnGetRecordCount; property PageSize; property MasterAdapter; property RefreshAfterPost; end; IDataSetAdapterFieldClass = interface ['{C42812E6-D7AD-490B-80C6-3834CE31B66C}'] end; TDataSetAdapterFieldGetValueEvent = procedure (Sender: TObject; Field: TField; var Value: Variant) of object; TDataSetAdapterFieldGetStringEvent = procedure (Sender: TObject; Field: TField; var Value: string) of object; TDataAdapterFieldValidateValueEvent = procedure(Sender: TObject; Field: TField; Value: IActionFieldValue; var Handled: Boolean) of object; TDataSetAdapterFieldValueEvent = procedure (Sender: TObject; Field: TField; Value: Variant) of object; TDataSetAdapterFieldFlag = (ffInKey, ffInOrigValues); TDataSetAdapterFieldFlags = set of TDataSetAdapterFieldFlag; TBaseDataSetAdapterField = class(TAdapterNamedField, IGetHTMLStyle, IUpdateValue, ICheckValueChange, IDataSetAdapterFieldClass, IGetDataSetKeyName, IPrepareDataSet) private FField: TField; FDataSetField: string; FFieldModes: TDataSetAdapterModes; FFieldFlags: TDataSetAdapterFieldFlags; FOnGetDisplayText: TDataSetAdapterFieldGetStringEvent; FOnGetValue: TDataSetAdapterFieldGetValueEvent; protected function FullyQualifyInputName: Boolean; override; function GetDataSetFieldValue(Field: TField): Variant; virtual; procedure SetDataSetField(const Value: string); function GetDataSet: TDataSet; procedure GetKeyParams(Params: TLocateParamsList); function GetReadOnly: Boolean; { IPrepareDataSet } procedure PrepareDataSet; { IGetDataSetKeyName} function GetKeyName: string; { IAdapterFieldAttributes } function ImplGetVisible: Boolean; override; function ImplGetRequired: Boolean; override; { IUpdateValue } procedure UpdateValue(AActionRequest: IActionRequest; AFieldIndex: Integer); procedure ImplUpdateValue(AActionRequest: IActionRequest; AFieldIndex: Integer); virtual; { ICheckOrigValue } procedure CheckOrigValue(AActionRequest: IActionRequest; AFieldIndex: Integer); procedure ImplCheckOrigValue(AActionRequest: IActionRequest; AFieldIndex: Integer); virtual; { ICheckValueChange } function CheckValueChange(AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; function ImplCheckValueChange(AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; virtual; { IGetHTMLStyle } function GetViewMode(const AAdapterMode: string): string; function GetDisplayStyle(const AAdapterMode: string): string; function GetInputStyle(const AAdapterMode: string): string; function GetInputStyleType(const AAdapterMode: string): TAdapterInputHTMLElementType; virtual; function GetDisplayStyleType(const AAdapterMode: string): TAdapterDisplayHTMLElementType; virtual; function GetViewModeType(const AAdapterMode: string): TAdapterDisplayViewModeType; virtual; { IWebAsFormatted } function ImplAsFormatted: string; override; { IWebGetFieldValue } procedure ImplSetFieldName(const Value: string); override; function ImplGetValue: Variant; override; { IWebGetDisplayWidth } function ImplGetDisplayWidth: Integer; override; { IWebGetDisplayLabel } function ImplGetDisplayLabel: string; override; function GetAdapter: TCustomDataSetAdapter; procedure Notification(AComponent: TComponent; Operation: TOperation); override; property Adapter: TCustomDataSetAdapter read GetAdapter; property DataSetField: string read FDataSetField write SetDataSetField; public constructor Create(AOwner: TComponent); override; function FindField: TField; property FieldModes: TDataSetAdapterModes read FFieldModes write FFieldModes default [amInsert, amEdit, amBrowse, amQuery]; property FieldFlags: TDataSetAdapterFieldFlags read FFieldFlags write FFieldFlags default [ffInOrigValues]; property OnGetValue: TDataSetAdapterFieldGetValueEvent read FOnGetValue write FOnGetValue; property OnGetDisplayText: TDataSetAdapterFieldGetStringEvent read FOnGetDisplayText write FOnGetDisplayText; end; TBaseDataSetAdapterInputField = class(TBaseDataSetAdapterField, IValidateValue) private FEchoActionFieldValue: Boolean; FOnValidateValue: TDataAdapterFieldValidateValueEvent; FOnUpdateValue: TDataSetAdapterFieldValueEvent; protected { IValidateValue } procedure ValidateValue(AActionRequest: IActionRequest; AFieldIndex: Integer); procedure ImplValidateValue(AActionRequest: IActionRequest; AFieldIndex: Integer); virtual; { IEchoActionFieldValue } procedure ImplSetEchoActionFieldValue(AValue: Boolean); override; function ImplGetEchoActionFieldValue: Boolean; override; function TestValueChange(AField: TField; const ANewValue: string): Boolean; public property OnUpdateValue: TDatasetAdapterFieldValueEvent read FOnUpdateValue write FOnUpdateValue; property OnValidateValue: TDataAdapterFieldValidateValueEvent read FOnValidateValue write FOnValidateValue; end; TCustomDataSetAdapterField = class(TBaseDataSetAdapterInputField, IWebGetFieldPrevValue, IGetAdapterValuesList, ICheckOrigValue) private FValuesList: IValuesListAdapter; procedure SetValuesList(const Value: IValuesListAdapter); protected function ImplGetValue: Variant; override; { IUpdateValue } procedure ImplUpdateValue(AActionRequest: IActionRequest; AFieldIndex: Integer); override; { ICheckOrigValue } procedure ImplCheckOrigValue(AActionRequest: IActionRequest; AFieldIndex: Integer); override; { ICheckValueChange } function ImplCheckValueChange(AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; override; { IGetHTMLStyle } function GetInputStyleType(const AAdapterMode: string): TAdapterInputHTMLElementType; override; { IGetAdapterValuesList } function GetAdapterValuesList: IValuesListAdapter; { IWebGetFieldPrevValue } function GetPrevValue: Variant; function ImplGetPrevValue: Variant; virtual; function GetNeedPrevValue: Boolean; function ImplGetNeedPrevValue: Boolean; virtual; procedure Notification(AComponent: TComponent; Operation: TOperation); override; public property ValuesList: IValuesListAdapter read FValuesList write SetValuesList; end; TDataSetAdapterField = class(TCustomDataSetAdapterField) published property DataSetField; property ValuesList; property ViewAccess; property ModifyAccess; property FieldModes; property FieldFlags; property OnGetValue; property OnUpdateValue; property OnValidateValue; property OnGetDisplayText; end; TCustomDataSetAdapterMemoField = class(TBaseDataSetAdapterInputField) protected function CheckOrUpdateValue(AActionRequest: IActionRequest; AFieldIndex: Integer; AUpdate: Boolean): Boolean; { IUpdateValue } procedure ImplUpdateValue(AActionRequest: IActionRequest; AFieldIndex: Integer); override; function ImplAsFormatted: string; override; { IGetHTMLStyle } function GetInputStyleType(const AAdapterMode: string): TAdapterInputHTMLElementType; override; { ICheckValueChange } function ImplCheckValueChange(AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; override; { IWebGetFieldPrevValue } function ImplGetValue: Variant; override; end; TDataSetAdapterMemoField = class(TCustomDataSetAdapterMemoField) published property DataSetField; property ViewAccess; property ModifyAccess; property FieldModes; property FieldFlags; property OnGetValue; property OnUpdateValue; property OnValidateValue; property OnGetDisplayText; end; TCustomDataSetAdapterAction = class(TImplementedAdapterAction) private FActionModes: TDataSetAdapterModes; FOnGetEnabled: TActionGetEnabledEvent; FOnExecute: TActionExecuteEvent; protected function GetDataSet: TDataSet; { IAdapterActionAttributes } function ImplGetVisible: Boolean; override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetAdapter: TCustomDataSetAdapter; property Adapter: TCustomDataSetAdapter read GetAdapter; public constructor Create(AOwner: TComponent); override; property DataSet: TDataSet read GetDataSet; property ActionName; property OnExecute: TActionExecuteEvent read FOnExecute write FOnExecute; property OnGetEnabled: TActionGetEnabledEvent read FOnGetEnabled write FOnGetEnabled; property ActionModes: TDataSetAdapterModes read FActionModes write FActionModes default [amInsert, amEdit, amBrowse, amQuery]; end; TCustomDataSetAdapterRowAction = class(TCustomDataSetAdapterAction) protected { IGetAdapterItemRequestParams } procedure ImplGetAdapterItemRequestParams(var AIdentifier: string; Params: IAdapterItemRequestParams); override; { IWebEnabled } function ImplWebEnabled: Boolean; override; public constructor Create(AOwner: TComponent); override; end; // For user defined row actions TDataSetAdapterRowAction = class(TCustomDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IGetAdapterItemRequestParams } procedure ImplGetAdapterItemRequestParams(var AIdentifier: string; Params: IAdapterItemRequestParams); override; published property OnGetParams; property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property RedirectOptions; property ActionModes default [amInsert, amEdit, amBrowse {, amQuery}]; end; TDataSetAdapterDeleteRowAction = class(TCustomDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; function GetDefaultActionName: string; override; published property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; end; TDataSetAdapterMoveRowAction = class(TCustomDataSetAdapterRowAction) protected { IWebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; end; TDataSetAdapterNextRowAction = class(TDataSetAdapterMoveRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; end; TDataSetAdapterPrevRowAction = class(TDataSetAdapterMoveRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; end; TDataSetAdapterFirstRowAction = class(TDataSetAdapterMoveRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; end; TDataSetAdapterLastRowAction = class(TDataSetAdapterMoveRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; end; TDataSetAdapterNewRowAction = class(TDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published constructor Create(AOwner: TComponent); override; property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property ActionModes default [amInsert, amEdit, amBrowse, amQuery]; end; TDataSetAdapterCancelRowAction = class(TCustomDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published constructor Create(AOwner: TComponent); override; property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; property ActionModes default [amInsert, amEdit{amBrowse , amQuery}]; end; TDataSetAdapterApplyRowAction = class(TCustomDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published constructor Create(AOwner: TComponent); override; property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; property ActionModes default [amInsert, amEdit {amBrowse , amQuery}]; end; TDataSetAdapterRefreshRowAction = class(TCustomDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { WebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property RedirectOptions; end; TDataSetAdapterEditRowAction = class(TCustomDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published constructor Create(AOwner: TComponent); override; property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property ActionModes default [amInsert, amEdit, amBrowse, amQuery]; end; TDataSetAdapterBrowseRowAction = class(TCustomDataSetAdapterRowAction) protected procedure ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); override; { IWebIsDefaultAction } function ImplIsDefaultAction(ADisplay: TObject): Boolean; override; { IWebEnabled } function ImplWebEnabled: Boolean; override; function GetDefaultActionName: string; override; published constructor Create(AOwner: TComponent); override; property DisplayLabel; property ExecuteAccess; property OnBeforeExecute; property OnAfterExecute; property OnBeforeGetResponse; property OnAfterGetResponse; property OnGetParams; property ActionModes default [amInsert, amEdit, amBrowse, amQuery]; end; TDataSetAdapterDataLink = class(TDataLink) private FAdapter: TComponent; FOnDataSetStateChange: TNotifyEvent; protected procedure RecordChanged(Field: TField); override; procedure DataEvent(Event: TDataEvent; Info: Longint); override; public constructor Create(AAdapter: TComponent); property OnDataSetStateChange: TNotifyEvent read FOnDataSetStateChange write FOnDataSetStateChange; end; TCustomDataSetValuesList = class(TBaseValuesListAdapter, IGetDesigntimeWarnings) private FDataSet: TDataSet; FNameField: string; FValueField: string; FCache: TNamedVariantsList; FCacheInUse: Boolean; FIndex: Integer; FOnPrepareDataSet: TNotifyEvent; FDataSetPrepared: Boolean; procedure SetDataSet(const Value: TDataSet); procedure CacheValuesList; function GetDataSet: TDataSet; procedure PrepareDataSet; protected procedure Notification(AComponent: TComponent; Operation: TOperation); override; function GetNameFieldClass: TComponentClass; override; function GetValueFieldClass: TComponentClass; override; { IGetDesigntimeWarnings } procedure GetDesigntimeWarnings(AWarnings: TAbstractDesigntimeWarnings); { INotifyWebActivate } procedure ImplNotifyDeactivate; override; { IValueListAdapter } function ImplGetListValue: Variant; override; function ImplGetListName: string; override; function ImplGetListNameOfValue(Value: Variant): string; override; { IIteratorAdapter } function ImplStartIterator(var OwnerData: Pointer): Boolean; override; function ImplNextIteration(var OwnerData: Pointer): Boolean; override; procedure ImplEndIterator(OwnerData: Pointer); override; property DataSetPrepared: Boolean read FDataSetPrepared write FDataSetPrepared; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; property NameField: string read FNameField write FNameField; property ValueField: string read FValueField write FValueField; property DataSet: TDataSet read GetDataSet write SetDataSet; property OnPrepareDataSet: TNotifyEvent read FOnPrepareDataSet write FOnPrepareDataSet; end; TDataSetValuesList = class(TCustomDataSetValuesList) published property NameField; property ValueField; property DataSet; property OnPrepareDataSet; property Data; property Actions; end; TBaseDataSetAdapterImageField = class(TBaseDataSetAdapterField); TDataSetAdapterImageFieldClass = class of TBaseDataSetAdapterImageField; procedure AddLocateParamsString(AAdapterName, AKeyName, AKeyValue: string; AParams: TLocateParamsList); var DataSetAdapterImageFieldClass: TDataSetAdapterImageFieldClass; const AllActionParamOptions = [poLocateParams, poCurrentPage]; AllImageParamOptions = [poLocateParams]; implementation uses Variants, WebCntxt, AutoAdap, WebDisp, SiteConst; { TCustomDataSetAdapter } function TCustomDataSetAdapter.GetDataSet: TDataSet; begin if not (csLoading in ComponentState) and not DataSetPrepared then PrepareDataSet; Result := FDataSet; end; procedure TCustomDataSetAdapter.SetDataSet(ADataSet: TDataSet); begin if FDataSet <> ADataSet then begin if Assigned(FDataSet) then FDataSet.RemoveFreeNotification(Self); if ADataSet <> nil then ADataSet.FreeNotification(Self); FDataSet := ADataSet; // Dataset affects list of default fields Data.ClearDefaultComponents; if not (csLoading in ComponentState) then NotifyAdapterChange; if FDesignerDataLink <> nil then FDesignerDataLink.DataSource.DataSet := FDataSet; end; end; procedure TCustomDataSetAdapter.Notification(AComponent: TComponent; Operation: TOperation); begin inherited Notification(AComponent, Operation); if (Operation = opRemove) and (AComponent = FDataSet) then begin FDataSet := nil; Data.ClearDefaultComponents; if not (csLoading in ComponentState) then NotifyAdapterChange; end; if (Operation = opRemove) and (AComponent = FMasterAdapter) then FMasterAdapter := nil; end; procedure ListDataSetFields(AAdapter: TCustomDataSetAdapter; AList: TStrings); var I: Integer; begin AList.Clear; if (AAdapter.DataSet <> nil) then with AAdapter.Dataset do begin if not DesigningComponent(AAdapter) then AAdapter.DataSet.Open; for I := 0 to FieldCount - 1 do if Fields[I].InheritsFrom(TMemoField) then AList.AddObject(Fields[I].FullName, TObject(TDataSetAdapterMemoField)) else if (Fields[I].DataType in [ftGraphic, ftTypedBinary]) then begin if DataSetAdapterImageFieldClass <> nil then AList.AddObject(Fields[I].FullName, TObject(DataSetAdapterImageFieldClass)) end else if not (Fields[I].DataType in [ftADT, ftArray, ftDataSet]) then AList.AddObject(Fields[I].FullName, TObject(TDataSetAdapterField)); for I := 0 to AggFields.Count - 1 do AList.AddObject(AggFields[I].FullName, TObject(TDataSetAdapterField)) end; end; const sDataSetAdapterDeleteAction = 'DeleteRow'; // Do not localize sDataSetAdapterNextAction = 'NextRow'; // Do not localize sDataSetAdapterPrevAction = 'PrevRow'; // Do not localize sDataSetAdapterLastAction = 'LastRow'; // Do not localize sDataSetAdapterFirstAction = 'FirstRow'; // Do not localize sDataSetAdapterNewAction = 'NewRow'; // Do not localize sDataSetAdapterCancelAction = 'Cancel'; // Do not localize sDataSetAdapterApplyAction = 'Apply'; // Do not localize sDataSetAdapterRefreshAction = 'RefreshRow'; // Do not localize sDataSetAdapterEditAction = 'EditRow'; // Do not localize sDataSetAdapterBrowseAction = 'BrowseRow'; // Do not localize procedure ListDataSetActions(AAdapter: TCustomDataSetAdapter; AList: TStrings); begin Assert(AList.Count = 0); AList.AddObject(sDataSetAdapterDeleteAction, TObject(TDataSetAdapterDeleteRowAction)); AList.AddObject(sDataSetAdapterFirstAction, TObject(TDataSetAdapterFirstRowAction)); AList.AddObject(sDataSetAdapterPrevAction, TObject(TDataSetAdapterPrevRowAction)); AList.AddObject(sDataSetAdapterNextAction, TObject(TDataSetAdapterNextRowAction)); AList.AddObject(sDataSetAdapterLastAction, TObject(TDataSetAdapterLastRowAction)); AList.AddObject(sDataSetAdapterEditAction, TObject(TDataSetAdapterEditRowAction)); AList.AddObject(sDataSetAdapterBrowseAction, TObject(TDataSetAdapterBrowseRowAction)); AList.AddObject(sDataSetAdapterNewAction, TObject(TDataSetAdapterNewRowAction)); AList.AddObject(sDataSetAdapterCancelAction, TObject(TDataSetAdapterCancelRowAction)); AList.AddObject(sDataSetAdapterApplyAction, TObject(TDataSetAdapterApplyRowAction)); AList.AddObject(sDataSetAdapterRefreshAction, TObject(TDataSetAdapterRefreshRowAction)); if AAdapter.PageSize > 0 then begin AList.AddObject(sPrevPageAction, TObject(TAdapterPrevPageAction)); AList.AddObject(sGotoPageAction, TObject(TAdapterGotoPageAction)); AList.AddObject(sNextPageAction, TObject(TAdapterNextPageAction)); end; end; procedure TCustomDataSetAdapter.ImplGetFieldsList(AList: TStrings); begin ListDataSetFields(Self, AList); end; procedure AddDefaultDataSetFields(AAdapter: TCustomDataSetAdapter; AComponents: TWebComponentList); var List: TStrings; begin if (AAdapter.DataSet <> nil) then begin List := TStringList.Create; try ListDataSetFields(AAdapter, List); AddDefaultFields(List, AComponents); finally List.Free; end; end; end; procedure AddDefaultDataSetActions(AAdapter: TCustomDataSetAdapter; AComponents: TWebComponentList); var List: TStrings; begin List := TStringList.Create; try ListDataSetActions(AAdapter, List); AddDefaultActions(List, AComponents); finally List.Free; end; end; destructor TCustomDataSetAdapter.Destroy; var DS: TDataSource; begin inherited; FLocateParamsList.Free; if FDesignerDataLink <> nil then begin TDataSetAdapterDataLink(FDesignerDataLink).OnDataSetStateChange := nil; DS := FDesignerDataLink.DataSource; // Prevent notifications FDesignerDataLink.DataSource := nil; FDesignerDataLink.Free; DS.Free; end; FDetailAdapters.Free; end; { TBaseDataSetAdapterField } function TBaseDataSetAdapterField.ImplAsFormatted: string; var DataSet: TDataSet; Field: TField; begin Result := ''; if FDataSetField <> '' then begin DataSet := GetDataSet; DataSet.Open; Field := FindField; if Field <> nil then begin if DataSet.Active or not DesigningComponent(Self) then begin DataSet.Open; if Assigned(OnGetDisplayText) then OnGetDisplayText(Self, Field, Result) else Result := Field.DisplayText; end end; end; end; function TBaseDataSetAdapterField.GetDataSet: TDataSet; begin if Adapter <> nil then Result := Adapter.DataSet else Result := nil; end; function TBaseDataSetAdapterField.GetDataSetFieldValue(Field: TField): Variant; begin Result := Field.Value end; function TBaseDataSetAdapterField.ImplGetValue: Variant; var DataSet: TDataSet; Field: TField; begin Result := Unassigned; if FDataSetField <> '' then begin CheckViewAccess; DataSet := GetDataSet; DataSet.Open; Field := FindField; if Field <> nil then begin if DataSet.Active or not DesigningComponent(Self) then begin DataSet.Open; if Assigned(OnGetValue) then OnGetValue(Self, Field, Result) else Result := GetDataSetFieldValue(Field) end; end; end; end; function TBaseDataSetAdapterField.ImplGetDisplayLabel: string; var Field: TField; begin Result := ''; Field := FindField; if Field <> nil then Result := Field.DisplayLabel end; function TBaseDataSetAdapterField.ImplGetDisplayWidth: Integer; var Field: TField; begin Result := -1; Field := FindField; if Field <> nil then Result := Field.DisplayWidth end; function TBaseDataSetAdapterField.FindField: TField; var DataSet: TDataSet; begin if FField = nil then if FDataSetField <> '' then begin DataSet := GetDataSet; if Assigned(DataSet) then begin FField := DataSet.FindField(FDataSetField); if FField <> nil then FField.FreeNotification(Self); end; end; Result := FField; end; function TBaseDataSetAdapterField.GetReadOnly: Boolean; var Field: TField; begin Result := False; Field := FindField; if Field <> nil then Result := Field.ReadOnly end; procedure TBaseDataSetAdapterField.ImplSetFieldName(const Value: string); begin FDataSetField := Value; inherited ImplSetFieldName(MakeValidAdapterFieldName(FDataSetField)); end; function TBaseDataSetAdapterField.GetDisplayStyle(const AAdapterMode: string): string; begin Result := AdapterDisplayHTMLElementTypeNames[GetDisplayStyleType(AAdapterMode)] end; function TBaseDataSetAdapterField.GetInputStyle(const AAdapterMode: string): string; begin Result := AdapterInputHTMLElementTypeNames[GetInputStyleType(AAdapterMode)]; end; function TBaseDataSetAdapterField.GetAdapter: TCustomDataSetAdapter; begin if (inherited Adapter <> nil) and (inherited Adapter is TCustomDataSetAdapter) then Result := TCustomDataSetAdapter(inherited Adapter) else Result := nil; end; procedure TBaseDataSetAdapterField.SetDataSetField(const Value: string); begin if FDataSetField <> Value then begin FieldName := Value; end; end; procedure TBaseDataSetAdapterField.GetKeyParams(Params: TLocateParamsList); begin if (Adapter <> nil) then Adapter.GetKeyParams(Params, True) end; procedure TBaseDataSetAdapterField.CheckOrigValue( AActionRequest: IActionRequest; AFieldIndex: Integer); begin ImplCheckOrigValue(AActionRequest, AFieldIndex); end; procedure TBaseDataSetAdapterField.ImplCheckOrigValue( AActionRequest: IActionRequest; AFieldIndex: Integer); begin // Do nothing end; function TBaseDataSetAdapterField.CheckValueChange( AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; begin Result := ImplCheckValueChange(AActionRequest, AFieldIndex); end; function TBaseDataSetAdapterField.ImplCheckValueChange( AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; begin // Do nothing Result := False; end; procedure TBaseDataSetAdapterField.ImplUpdateValue( AActionRequest: IActionRequest; AFieldIndex: Integer); begin // Do nothing end; procedure TBaseDataSetAdapterField.UpdateValue( AActionRequest: IActionRequest; AFieldIndex: Integer); begin ImplUpdateValue(AActionRequest, AFieldIndex); end; function TBaseDataSetAdapterField.GetDisplayStyleType(const AAdapterMode: string): TAdapterDisplayHTMLElementType; begin Result := htmldText; end; function TBaseDataSetAdapterField.GetInputStyleType(const AAdapterMode: string): TAdapterInputHTMLElementType; begin Result := htmliTextInput; end; function TBaseDataSetAdapterField.GetViewModeType(const AAdapterMode: string): TAdapterDisplayViewModeType; var M: TDataSetAdapterMode; begin if GetReadOnly then Result := htmlvmDisplay else begin if Adapter <> nil then M := Adapter.StringToMode(AAdapterMode) else M := amBrowse; if M in [amBrowse] then Result := htmlvmDisplay else Result := htmlvmInput; end; end; function TBaseDataSetAdapterField.GetViewMode(const AAdapterMode: string): string; begin Result := AdapterDisplayViewModeTypeNames[GetViewModeType(AAdapterMode)] end; constructor TBaseDataSetAdapterField.Create(AOwner: TComponent); begin inherited; FieldModes := [amInsert, amEdit, amBrowse, amQuery]; FieldFlags := [ffInOrigValues]; end; function TBaseDataSetAdapterField.ImplGetRequired: Boolean; var Field: TField; begin Field := FindField; if Field <> nil then Result := Field.Required else Result := False; end; function TBaseDataSetAdapterField.ImplGetVisible: Boolean; var Field: TField; begin Result := Adapter.Mode in FieldModes; if Result then begin Field := FindField; if Field <> nil then Result := Field.Visible; end; end; procedure TBaseDataSetAdapterField.Notification(AComponent: TComponent; Operation: TOperation); begin inherited; if (Operation = opRemove) and (FField = AComponent) then FField := nil; end; { TCustomDataSetAdapterField } function TCustomDataSetAdapterField.ImplGetPrevValue: Variant; var DataSet: TDataSet; Field: TField; Value: IActionFieldValue; begin Result := Unassigned; if EchoActionFieldValue then begin Value := ActionOrigValue; if (Value <> nil) and (Value.ValueCount > 0) then Result := Value.Values[0] else Result := Unassigned; end else if FDataSetField <> '' then begin DataSet := GetDataSet; if Assigned(DataSet) then begin if DesigningComponent(Self) and not DataSet.Active then Field := nil else begin DataSet.Open; Field := DataSet.FindField(FDataSetField); end; if Assigned(Field) then Result := Field.Value else Result := Unassigned; end; end; end; function TCustomDataSetAdapterField.GetAdapterValuesList: IValuesListAdapter; begin Result := FValuesList; end; procedure TCustomDataSetAdapterField.Notification(AComponent: TComponent; Operation: TOperation); begin inherited Notification(AComponent, Operation); if (Operation = opRemove) and AComponent.IsImplementorOf(FValuesList) then FValuesList := nil; end; procedure TCustomDataSetAdapterField.SetValuesList( const Value: IValuesListAdapter); begin ReferenceInterface(FValuesList, opRemove); FValuesList := Value; ReferenceInterface(FValuesList, opInsert); end; function TCustomDataSetAdapterField.ImplGetValue: Variant; var Value: IActionFieldValue; begin CheckViewAccess; if EchoActionFieldValue then begin Value := ActionValue; if Value <> nil then if Value.ValueCount > 0 then Result := Value.Values[0] else // No values passed. Get data value Result := inherited ImplGetValue else Result := Unassigned; end else if Adapter.Mode <> amQuery then Result := inherited ImplGetValue; end; function GetActionFieldValues(AActionRequest: IActionRequest): IActionFieldValues; begin if not Supports(AActionRequest, IActionFieldValues, Result) then Assert(False); end; procedure TCustomDataSetAdapterField.ImplCheckOrigValue( AActionRequest: IActionRequest; AFieldIndex: Integer); var Field: TField; OrigValue: OleVariant; FieldValue: WideString; OrigFieldValue: IActionFieldValue; begin if ffInOrigValues in FieldFlags then begin Assert(Adapter <> nil); if Adapter.DataSet = nil then Adapter.RaiseNilDataSet; with GetActionFieldValues(AActionRequest) do OrigFieldValue := OrigValues[AFieldIndex]; if OrigFieldValue.ValueCount > 0 then begin Adapter.DataSet.Open; Field := Adapter.DataSet.FindField(DataSetField); if Field = nil then Adapter.RaiseFieldNotFound(DataSetField); if (Field.FieldKind <> fkCalculated) and (OrigFieldValue.ValueCount = 1) then begin OrigValue := OrigFieldValue.Values[0]; if not VarIsEmpty(OrigValue) then begin if VarIsNull(Field.Value) then FieldValue := '' else FieldValue := Field.Value; if (OrigValue <> FieldValue) then Adapter.RaiseFieldChangedByAnotherUser(FieldName); end; end; end; end; end; procedure TCustomDataSetAdapterField.ImplUpdateValue( AActionRequest: IActionRequest; AFieldIndex: Integer); var Field: TField; FieldValue: IActionFieldValue; begin Assert(Adapter <> nil); CheckModifyAccess; with GetActionFieldValues(AActionRequest) do FieldValue := Values[AFieldIndex]; if Adapter.Mode <> amQuery then begin if FieldValue.ValueCount > 0 then begin Field := FindField; if Field = nil then Adapter.RaiseFieldNotFound(DataSetField); if (Field.FieldKind <> fkCalculated) and (FieldValue.ValueCount = 1) then begin if Assigned(OnUpdateValue) then OnUpdateValue(Self, Field, FieldValue.Values[0]) else if TestValueChange(Field, FieldValue.Values[0]) then Field.Value := FieldValue.Values[0] end else RaiseMultipleValuesException(FieldName) end else if FieldValue.FileCount > 0 then RaiseFileUploadNotSupported(FieldName); end; end; function TCustomDataSetAdapterField.ImplCheckValueChange( AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; var OrigFieldValue, FieldValue: IActionFieldValue; I: Integer; begin if ffInOrigValues in FieldFlags then begin with GetActionFieldValues(AActionRequest) do begin OrigFieldValue := OrigValues[AFieldIndex]; FieldValue := Values[AFieldIndex]; end; if FieldValue.ValueCount = OrigFieldValue.ValueCount then begin Result := False; for I := 0 to FieldValue.ValueCount - 1 do if FieldValue.Values[I] <> OrigFieldValue.Values[I] then begin Result := True; break; end end else Result := False; end else // Assume value has been changed Result := True; end; function TCustomDataSetAdapterField.GetInputStyleType(const AAdapterMode: string): TAdapterInputHTMLElementType; begin if ValuesList <> nil then Result := htmliSelect else Result := inherited GetInputStyleType(AAdapterMode); end; function TCustomDataSetAdapterField.GetPrevValue: Variant; begin Result := ImplGetPrevValue; end; function TCustomDataSetAdapterField.GetNeedPrevValue: Boolean; begin Result := ImplGetNeedPrevValue; end; function TCustomDataSetAdapterField.ImplGetNeedPrevValue: Boolean; begin case Adapter.Mode of amQuery, amInsert, amBrowse: Result := False; amEdit: Result := ffInOrigValues in FieldFlags; else Result := False; Assert(False); end; end; { TCustomDataSetAdapter } procedure TCustomDataSetAdapter.ImplGetActionsList(AList: TStrings); begin ListDataSetActions(Self, AList); end; procedure TCustomDataSetAdapter.AddDefaultFields(AComponents: TWebComponentList); begin AddDefaultDataSetFields(Self, AComponents); CreateDataLink; // Need a datalink to monitor changes to dataset end; procedure TCustomDataSetAdapter.OnDataSetStateChange(Sender: TObject); begin Data.ClearDefaultComponents; end; procedure TCustomDataSetAdapter.AddDefaultActions(AComponents: TWebComponentList); begin AddDefaultDataSetActions(Self, AComponents); end; function TCustomDataSetAdapter.GetAdapterMode: string; begin if InDefaultMode then Result := '' else Result := DataSetAdapterModeNames[GetMode]; end; procedure TCustomDataSetAdapter.SetAdapterMode(const AValue: string); begin if AValue = '' then InDefaultMode := True else Mode := StringToMode(AValue); end; procedure TCustomDataSetAdapter.RestoreDefaultAdapterMode; begin InDefaultMode := True; end; constructor TCustomDataSetAdapter.Create(AOwner: TComponent); begin inherited; FInIterator := False; FDetailAdapters := TComponentList.Create(False {Not owned}); FLocateParamsList := TLocateParamsList.Create; InDefaultMode := True; CreateDataLink; end; procedure TCustomDataSetAdapter.CreateDataLink; begin if FDesignerDataLink = nil then begin if Assigned(NotifyPossibleHTMLChange) or (DesigningComponent(Self) and (Data.WebFields.Count = 0)) then begin FDesignerDataLink := TDataSetAdapterDataLink.Create(nil); FDesignerDataLink.Datasource := TDataSource.Create(nil); FDesignerDataLink.DataSource.DataSet := FDataSet; TDataSetAdapterDataLink(FDesignerDataLink).OnDataSetStateChange := OnDataSetStateChange; end; end; end; procedure TCustomDataSetAdapter.SetMode( const Value: TDataSetAdapterMode); begin FInDefaultMode := False; if Value <> Mode then begin if DataSetPrepared then if DataSet <> nil then DataSet.Cancel; FMode := Value; DataSetPrepared := False; end; end; function TCustomDataSetAdapter.StringToMode(const AValue: string): TDataSetAdapterMode; var I: TDataSetAdapterMode; begin if AValue = '' then Result := GetDefaultMode else begin for I := Low(TDataSetAdapterMode) to High(TDataSetAdapterMode) do begin if SameText(DataSetAdapterModeNames[I], AValue) then begin Result := I; Exit; end; end; raise EAdapterException.CreateFmt(sUnknownAdapterMode, [AValue]); end; end; function TCustomDataSetAdapter.GetMode: TDataSetAdapterMode; var Mode: string; AdapterModes: IAdapterModes; begin if GetEchoActionFieldValues then begin if Supports(WebContext.AdapterRequest, IAdapterModes, AdapterModes) and AdapterModes.FindAdapterMode(Self, Mode) then Result := StringToMode(Mode) else Result := GetDefaultMode end else begin if InDefaultMode then Result := GetDefaultMode else Result := FMode; end; end; function TCustomDataSetAdapter.GetDefaultMode: TDataSetAdapterMode; begin Result := amBrowse; end; procedure TCustomDataSetAdapter.ImplNotifyDeactivate; begin inherited; if FDataSet <> nil then FDataSet.Close; InDefaultMode := True; DataSetPrepared := False; LocateParamsList.Clear; FInIterator := False; FDataSetRecNo := 0; CurrentPage := 0; AdapterRowNotFound := nil; end; function TCustomDataSetAdapter.ImplCanAddActionClass( AParent: TComponent; AClass: TClass): Boolean; begin Result := inherited ImplCanAddActionClass(AParent, AClass) or AClass.InheritsFrom(TCustomDataSetAdapterAction); end; function TCustomDataSetAdapter.ImplCanAddFieldClass(AParent: TComponent; AClass: TClass): Boolean; begin Result := inherited ImplCanAddFieldClass(AParent, AClass) or Supports(AClass, IDataSetAdapterFieldClass) end; function TCustomDataSetAdapter.GetProviderSupport: IProviderSupport; begin Result := nil; if DataSet <> nil then Result := IProviderSupport(DataSet); end; function TCustomDataSetAdapter.GetKeyFields: string; var ProviderSupport: IProviderSupport; GetKeyName: IGetDataSetKeyName; I: Integer; S: string; ComponentList: TWebComponentList; begin if DataSet <> nil then begin ComponentList := GetVisibleFields; for I := 0 to ComponentList.Count - 1 do begin if Supports(ComponentList.WebComponents[I], IGetDataSetKeyName, GetKeyName) then begin S := GetKeyName.GetKeyName; if S <> '' then begin if Result <> '' then Result := Result + ';'; Result := Result + S; end; end; end; if Result = '' then begin ProviderSupport := GetProviderSupport; if Assigned(ProviderSupport) then Result := ProviderSupport.PSGetKeyFields else Result := ''; end; end; end; procedure TCustomDataSetAdapter.GetKeyParams(AParams: TLocateParamsList; ARecurse: Boolean); var I: Integer; List: TComponentList; S: TStrings; begin if ARecurse then begin List := GetMasterDetailAdapters; try if List <> nil then for I := 0 to List.Count - 1 do (List[I] as TCustomDataSetAdapter).GetKeyParams(AParams, False) else ARecurse := False; finally List.Free; end; end; if not ARecurse then begin S := TStringList.Create; try GetKeyParamStrings(S); if S.Count > 0 then with AParams.Add do begin AdapterName := Self.Name; for I := 0 to S.Count - 1 do AddParam(S[I]); end; finally S.Free; end; end; end; procedure TCustomDataSetAdapter.GetKeyParamStrings(AValues: TStrings); var KeyFields: string; FieldList: TList; Field: TField; I: Integer; begin KeyFields := GetKeyFields; if KeyFields <> '' then begin FieldList := TList.Create; try if DataSet.Active or not DesigningComponent(Self) then begin DataSet.Open; DataSet.GetFieldList(FieldList, KeyFields); end; if FieldList.Count > 0 then try for I := 0 to FieldList.Count - 1 do begin Field := TField(FieldList[I]); AValues.Add(Format('%s=%s', [Field.FieldName, Field.AsString])); end; except // Use an exception to catch EOF end; finally FieldList.Free; end; end; end; function TCustomDataSetAdapter.Locate: Boolean; begin try if DataSet = nil then RaiseNilDataSet; if not SilentLocate(LocateParamsList, True) then RaiseRowNotFound except // Add to error list on E: Exception do begin Errors.AddError(E); Result := False; Exit; end; end; Result := True; end; procedure TCustomDataSetAdapter.ApplyAdapterMode(AActionRequest: IActionRequest); var Mode: string; Intf: IAdapterModes; List: TComponentList; C: TCustomDataSetAdapter; I: Integer; begin if Supports(AActionRequest, IAdapterModes, Intf) then begin List := GetMasterDetailAdapters; if List <> nil then try for I := 0 to List.Count - 1 do begin C := (List[I] as TCustomDataSetAdapter); if Intf.FindAdapterMode(C, Mode) then C.SetAdapterMode(Mode) else C.RestoreDefaultAdapterMode; end; finally List.Free; end else if Intf.FindAdapterMode(Self, Mode) then SetAdapterMode(Mode) else RestoreDefaultAdapterMode; end else Assert(False); // interface not supported end; function TCustomDataSetAdapter.LocateAndApply(AActionRequest: IActionRequest): Boolean; function CalcAdapterMode: TDataSetAdapterMode; var List: TComponentList; I: Integer; begin Result := Mode; if Mode = amBrowse then begin List := GetMasterDetailAdapters; if List <> nil then try for I := 0 to List.Count - 1 do begin if (List[I] as TCustomDataSetAdapter).Mode = amEdit then begin Result := amEdit; break; end; end; finally List.Free; end end; end; var Found: Boolean; List: TComponentList; I: Integer; ActionFieldValuesOfAdapter: IActionFieldValuesOfAdapter; LMode: TDataSetAdapterMode; begin ExtractRequestParams(AActionRequest); Result := True; try ApplyAdapterMode(AActionRequest); LMode := CalcAdapterMode; if LMode in [amInsert, amEdit] then begin if DataSet = nil then Self.RaiseNilDataSet; Found := SilentLocate(LocateParamsList, True); if LMode = amInsert then begin if DataSet = nil then Self.RaiseNilDataSet; DataSet.Open; DataSet.Insert; // Update even if locate fails Result := UpdateRecords(AActionRequest); end else begin if Found then begin if Supports(AActionRequest, IActionFieldValuesOfAdapter, ActionFieldValuesOfAdapter) then begin List := GetMasterDetailAdapters; try if List <> nil then begin for I := 0 to List.Count - 1 do if ActionFieldValuesOfAdapter.LocateActionFieldValuesOfAdapter(List[I] as TComponent) then begin Result := (List[I] as TCustomDataSetAdapter).UpdateRecords(AActionRequest); if not Result then Break; end end else Result := UpdateRecords(AActionRequest); finally List.Free; end end else Result := UpdateRecords(AActionRequest); // Relocate in case we updated repositioned during update SilentLocate(LocateParamsList, False); end; if not Found then Self.RaiseRowNotFound end end else begin if DataSet = nil then Self.RaiseNilDataSet; DataSet.Open; if not DataSet.EOF then Result := Locate; end; except on E: Exception do begin Self.Errors.AddError(E); Result := False; Exit; end; end; if Result then begin if (LMode = amInsert) then Mode := amEdit; if (FDataSet <> nil) and (not DataSet.Active) then Dataset.Open; end; end; function TCustomDataSetAdapter.GetMasterDetailAdapters: TComponentList; procedure Add(AMaster: TCustomDataSetAdapter); var I: Integer; begin Result.Add(AMaster); for I := 0 to AMaster.DetailAdapters.Count - 1 do Add(AMaster.DetailAdapters[I] as TCustomDataSetAdapter); end; var Master: TCustomDataSetAdapter; begin Result := nil; if (MasterAdapter <> nil) or (DetailAdapters.Count > 0) then begin Result := TComponentList.Create(False {Not owned}); try Master := Self; while Master.MasterAdapter <> nil do Master := Master.MasterAdapter; Add(Master) except Result.Free; end; end; end; type TLocateParamsWrapper = class(TInterfacedObject, IKeyParams) private FLocateParams: TLocateParams; protected function Count: Integer; function GetName(I: Integer): string; function GetValue(I: Integer): string; public constructor Create(ALocateParams: TLocateParams); end; function TLocateParamsWrapper.Count: Integer; begin Result := FLocateParams.Count; end; constructor TLocateParamsWrapper.Create(ALocateParams: TLocateParams); begin inherited Create; FLocateParams := ALocateParams; end; function TLocateParamsWrapper.GetName(I: Integer): string; begin Result := FLocateParams.GetParamName(I); end; function TLocateParamsWrapper.GetValue(I: Integer): string; begin Result := FLocateParams.GetParamValue(I); end; function TCustomDataSetAdapter.SilentLocate(AParams: TLocateParamsList; ARecurse: Boolean): Boolean; var I: Integer; L: TLocateParams; List: TComponentList; A: TCustomDataSetAdapter; begin Result := True; if ARecurse then begin List := GetMasterDetailAdapters; try if List <> nil then for I := 0 to List.Count - 1 do begin A := (List[I] as TCustomDataSetAdapter); if A.Mode = amInsert then break; Result := A.SilentLocate(AParams, False); if not Result then begin AdapterRowNotFound := (List[I] as TCustomDataSetAdapter); break; end; end else ARecurse := False; finally List.Free; end; end; if (not ARecurse) and (Mode <> amInsert) then begin L := AParams.ItemByAdapterName(Self.Name); if L <> nil then Result := LocateKeyParams(TLocateParamsWrapper.Create(L)) else Result := True; end; end; procedure TCustomDataSetAdapter.RaiseNilDataSet; begin raise EAdapterException.Create(sNilAdapterDataSet); end; procedure TCustomDataSetAdapter.RaiseRowNotFound; var DS: TDataSet; begin if AdapterRowNotFound <> nil then DS := AdapterRowNotFound.DataSet else DS := Self.DataSet; raise EAdapterException.CreateFmt(sAdapterRowNotFound, [DS.Name]); end; procedure TCustomDataSetAdapter.RaiseFieldChangedByAnotherUser( const AFieldName: string); begin raise EAdapterFieldException.Create(sFieldChangedByAnotherUser, AFieldName); end; procedure TCustomDataSetAdapter.RaiseFieldNotFound( const AFieldName: string); begin raise EAdapterException.CreateFmt(sAdapterFieldNotFound, [AFieldName]); end; procedure TCustomDataSetAdapter.GetDesigntimeWarnings( AWarnings: TAbstractDesigntimeWarnings); begin if DataSet = nil then AWarnings.AddString(Format(sDataSetPropertyIsNil, [Self.Name])); if (DataSet <> nil) and (DataSet.Active = True) then if GetKeyFields = '' then AWarnings.AddString(Format(sDataSetUnknownKeyFields, [Self.Name, DataSet.Name])); if (DataSet <> nil) and (not DataSet.Active) then AWarnings.AddString(Format(sDataSetNotActive, [Self.Name, DataSet.Name])); end; function TCustomDataSetAdapter.LocateKeyParams(AParams: IKeyParams): Boolean; var I: Integer; KeyFields: string; FieldList: TStrings; Field: TField; FieldName: string; KeyValues: OleVariant; begin Result := DataSet <> nil; if Result then begin DataSet.Open; FieldList := TStringList.Create; try for I := 0 to AParams.Count - 1 do begin FieldName := AParams.Names[I]; Field := DataSet.FindField(FieldName); if Assigned(Field) then FieldList.AddObject(AParams.Values[I], Field); end; if FieldList.Count <> 0 then begin if FieldList.Count > 1 then begin KeyValues := VarArrayCreate([0, FieldList.Count-1], varVariant); for I := 0 to FieldList.Count - 1 do begin Field := TField(FieldList.Objects[I]); if KeyFields <> '' then KeyFields := KeyFields + ';'; KeyFields := KeyFields + Field.FieldName; if FieldList[I] = '' then KeyValues[I] := Null else KeyValues[I] := FieldList[I]; end; end else begin KeyFields := TField(FieldList.Objects[0]).FieldName; if FieldList[0] = '' then KeyValues := Null else KeyValues := FieldList[0]; end; Result := DataSet.Locate(KeyFields, KeyValues, []); end else Result := True; // No locate params finally FieldList.Free; end; end; end; type TAdapterRecordKeysWrapper = class(TInterfacedObject, IKeyParams) private FKeys: IAdapterRecordKeys; protected function Count: Integer; function GetName(I: Integer): string; function GetValue(I: Integer): string; public constructor Create(AKeys: IAdapterRecordKeys); end; function TAdapterRecordKeysWrapper.Count: Integer; begin Result := FKeys.GetRecordKeyCount; end; constructor TAdapterRecordKeysWrapper.Create(AKeys: IAdapterRecordKeys); begin inherited Create; FKeys := AKeys; end; function TAdapterRecordKeysWrapper.GetName(I: Integer): string; begin Result := FKeys.RecordKeyNames[I]; end; function TAdapterRecordKeysWrapper.GetValue(I: Integer): string; begin Result := FKeys.RecordKeyValues[I]; end; function TCustomDataSetAdapter.LocateRequestRecord(AActionRequest: IActionRequest): Boolean; var AdapterRecordKeys: IAdapterRecordKeys; begin Result := True; try if Supports(AActionRequest, IAdapterRecordKeys, AdapterRecordKeys) then if AdapterRecordKeys.GetRecordKeyCount > 0 then Result := LocateKeyParams(TAdapterRecordKeysWrapper.Create(AdapterRecordKeys)); except on E: Exception do begin Errors.AddError(E); Result := False; Exit; end; end; end; procedure TCustomDataSetAdapter.UpdateFieldsValidateValues( AActionRequest: IActionRequest; AAdapterFields: TObjectList); var I: Integer; CheckOrigValue: ICheckOrigValue; begin if Mode = amQuery then begin end else if DataSet.State <> dsInsert then if LocateRequestRecord(AActionRequest) then for I := 0 to AAdapterFields.Count - 1 do try if Supports(AAdapterFields[I], ICheckOrigValue, CheckOrigValue) then CheckOrigValue.CheckOrigValue(AActionRequest, I); except on E: Exception do Errors.AddError(E); end; if Errors.ErrorCount = 0 then inherited UpdateFieldsValidateValues(AActionRequest, AAdapterFields); end; function TCustomDataSetAdapter.UpdateFieldsGetAnyChanges( AActionRequest: IActionRequest; AAdapterFields: TObjectList): Boolean; begin if Mode = amQuery then Result := True else if DataSet.State = dsInsert then Result := True else Result := LocateRequestRecord(AActionRequest) and inherited UpdateFieldsGetAnyChanges(AActionRequest, AAdapterFields); end; procedure TCustomDataSetAdapter.UpdateFieldsUpdateValues( AActionRequest: IActionRequest; AAdapterFields: TObjectList); begin if Mode = amQuery then begin inherited UpdateFieldsUpdateValues(AActionRequest, AAdapterFields); end else begin if LocateRequestRecord(AActionRequest) then begin DataSet.Edit; inherited UpdateFieldsUpdateValues(AActionRequest, AAdapterFields); if (Errors.ErrorCount = 0) and (DataSet.State in [dsEdit, dsInsert]) then begin DataSet.Post; if FRefreshAfterPost then DataSet.Refresh; end; DataSet.Cancel; end; end; end; procedure TCustomDataSetAdapter.UpdateFieldsExecuteValues( AActionRequest: IActionRequest; AAdapterFields: TObjectList); begin if Mode = amQuery then begin inherited UpdateFieldsUpdateValues(AActionRequest, AAdapterFields); end else begin if LocateRequestRecord(AActionRequest) then begin inherited UpdateFieldsExecuteValues(AActionRequest, AAdapterFields); end; end; end; function TCustomDataSetAdapter.GetNeedAdapterMode: Boolean; begin Result := True; end; procedure TCustomDataSetAdapter.GetAdapterModeNames(AStrings: TStrings); var I: TDataSetAdapterMode; begin for I := Low(TDataSetAdapterMode) to High(TDataSetAdapterMode) do AStrings.Add(DataSetAdapterModeNames[I]); end; const sQueryParam = '_q'; // Do not localize sLocateParam = '_l'; // Do not localize procedure TCustomDataSetAdapter.EncodeActionParams( AParams: IAdapterItemRequestParams); begin EncodeActionParamsFlags(AParams, AllActionParamOptions); end; procedure TCustomDataSetAdapter.EncodeActionParamsFlags( AParams: IAdapterItemRequestParams; AOptions: TDataSetAdapterRequestParamOptions); var I, J: Integer; L: TLocateParamsList; P: TLocateParams; begin if poCurrentPage in AOptions then inherited EncodeActionParams(AParams); if poLocateParams in AOptions then begin L := nil; try if (DataSet <> nil) and (DataSet.State = dsInsert) then L := LocateParamsList else if DataSet <> nil then begin L := TLocateParamsList.Create; GetKeyParams(L, True); end; if L <> nil then begin for I := 0 to L.Count - 1 do begin P := L[I]; for J := 0 to P.Count - 1 do begin if (P.AdapterName = '') or (P.AdapterName = Self.Name) then AParams.ParamValues.Add(Format('%s%s', [sLocateParam, P[J]])) else AParams.ParamValues.Add(Format('%s-%s-%s', [sLocateParam, P.AdapterName, P[J]])); end; end; end; finally if L <> LocateParamsList then L.Free; end; end; end; function GetAdapterRequestParamsIntf(AAdapterRequest: IUnknown): IAdapterRequestParams; begin if not Supports(AAdapterRequest, IAdapterRequestParams, Result) then Assert(False); end; procedure AddLocateParamsString(AAdapterName, AKeyName, AKeyValue: string; AParams: TLocateParamsList); var P: Integer; Item: TLocateParams; begin if AKeyName[1] = '-' then begin Delete(AKeyName, 1, 1); P := Pos('-', AKeyName); if (P >= 1) and (Length(AKeyName) > 1) then begin AAdapterName := Copy(AKeyName, 1, P-1); AKeyName := Copy(AKeyName, P+1, MaxInt); end else Assert(False); // Expected '-' end; Item := AParams.ItemByAdapterName(AAdapterName); if Item = nil then begin Item := AParams.Add; Item.AdapterName := AAdapterName; end; with Item do AddParam(AKeyName, AKeyValue); end; procedure TCustomDataSetAdapter.ExtractRequestParams( ARequest: IUnknown); begin ExtractRequestParamsFlags(ARequest, AllActionParamOptions); end; procedure TCustomDataSetAdapter.ExtractRequestParamsFlags( ARequest: IUnknown; AOptions: TDataSetAdapterRequestParamOptions); var Params: IAdapterRequestParams; I: Integer; S: string; AdapterName: string; P: Integer; Item: TLocateParams; begin Params := GetAdapterRequestParamsIntf(ARequest); Assert((not (poLocateParams in AOptions)) or (LocateParamsList.Count = 0)); Assert((not (poCurrentPage in AOptions)) or (CurrentPage = 0)); if poLocateParams in AOptions then begin if MasterAdapter <> nil then MasterAdapter.ExtractRequestParamsFlags(ARequest, [poLocateParams]); for I := 0 to Params.ParamCount - 1 do begin if Copy(Params.ParamNames[I], 1, Length(sLocateParam)) = sLocateParam then begin AdapterName := Self.Name; S := Copy(Params.ParamNames[I], Length(sLocateParam)+1, MaxInt); if S[1] = '-' then begin Delete(S, 1, 1); P := Pos('-', S); if (P >= 1) and (Length(S) > 1) then begin AdapterName := Copy(S, 1, P-1); S := Copy(S, P+1, MaxInt); end else Assert(False); // Expected '-' end; Item := LocateParamsList.ItemByAdapterName(AdapterName); if Item = nil then begin Item := LocateParamsList.Add; Item.AdapterName := AdapterName; end; with Item do AddParam(S, Params.ParamValues[I]); (* AddLocateParamsString(AdapterName, S, Params.ParamValues[I], LocateParamsList); *) end; end; end; if poCurrentPage in AOptions then begin inherited ExtractRequestParams(ARequest); end; end; procedure TCustomDataSetAdapter.PrepareDataSet; var ComponentList: TWebComponentList; I: Integer; PrepareDataSet: IPrepareDataSet; begin DataSetPrepared := True; if Assigned(OnPrepareDataSet) then OnPrepareDataSet(Self); if Assigned(DataSet) then DataSet.Cancel; ComponentList := GetVisibleFields; for I := 0 to ComponentList.Count - 1 do if Supports(ComponentList.WebComponents[I], IPrepareDataSet, PrepareDataSet) then PrepareDataSet.PrepareDataSet; end; function TCustomDataSetAdapter.GetHiddenFieldOptions: TAdapterHiddenFieldOptions; begin case Mode of amInsert: Result := [hoMode]; amQuery: Result := [hoMode]; amBrowse: Result := [hoMode]; amEdit: Result := [hoMode, hoOrigValues, hoRecordKeys]; else Assert(False); // Unknown mode end; end; function TCustomDataSetAdapter.GetEOF: Boolean; begin Result := (FDataSet = nil) or FDataSet.EOF; end; function TCustomDataSetAdapter.GetFirstRecord: Boolean; begin Result := (FDataSet <> nil) and (FDataSet.Active or not DesigningComponent(Self)); if Result then begin DataSet.Open; FDataSet.First; FDataSetRecNo := 0; FInIterator := True; Result := not FDataSet.EOF; end; end; function TCustomDataSetAdapter.GetNextRecord: Boolean; begin Result := FDataSet <> nil; if Result then begin if not FDataSet.EOF then FDataSet.Next; Result := not FDataSet.EOF; if Result then Inc(FDataSetRecNo); end; end; function TCustomDataSetAdapter.GetRecordCount: Integer; begin Result := 0; if Assigned(OnGetRecordCount) then OnGetRecordCount(Self, Result) else begin if FDataSet <> nil then begin if DataSet.Active or not DesigningComponent(Self) then begin FDataSet.Open; Result := FDataSet.RecordCount; end end end; end; function TCustomDataSetAdapter.GetRecordIndex: Integer; begin Result := FDataSetRecNo; end; procedure TCustomDataSetAdapter.ImplEndIterator(OwnerData: Pointer); begin if (FDataSet <> nil) then FDataSet.GotoBookMark(FBookMark); inherited; end; function TCustomDataSetAdapter.ImplStartIterator( var OwnerData: Pointer): Boolean; begin if FDataSet <> nil then FBookMark := FDataSet.GetBookmark; Result := inherited ImplStartIterator(OwnerData); end; { TCustomDataSetAdapterAction } function TCustomDataSetAdapterAction.GetAdapter: TCustomDataSetAdapter; begin if (inherited Adapter <> nil) and (inherited Adapter is TCustomDataSetAdapter) then Result := TCustomDataSetAdapter(inherited Adapter) else Result := nil; end; function TCustomDataSetAdapterAction.GetDataSet: TDataSet; begin if Adapter <> nil then Result := Adapter.DataSet else Result := nil; end; function TCustomDataSetAdapterAction.ImplWebEnabled: Boolean; begin Result := DataSet <> nil; if Assigned(OnGetEnabled) then OnGetEnabled(Self, Result); end; constructor TCustomDataSetAdapterAction.Create(AOwner: TComponent); begin inherited; ActionModes := [amInsert, amEdit, amBrowse, amQuery]; end; function TCustomDataSetAdapterAction.ImplGetVisible: Boolean; begin Result := Adapter.Mode in FActionModes; end; { TCustomDataSetAdapterRowAction } constructor TCustomDataSetAdapterRowAction.Create(AOwner: TComponent); begin inherited; ActionModes := [amInsert, amEdit, amBrowse {, amQuery}]; end; procedure TCustomDataSetAdapterRowAction.ImplGetAdapterItemRequestParams( var AIdentifier: string; Params: IAdapterItemRequestParams); begin Adapter.EncodeActionParams(Params); inherited ImplGetAdapterItemRequestParams(AIdentifier, Params); end; function TCustomDataSetAdapterRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled and (Adapter.GetKeyFields <> ''); end; { TDataSetAdapterRowAction } procedure TDataSetAdapterRowAction.ImplExecuteActionRequest(AActionRequest: IActionRequest; AActionResponse: IActionResponse); var S: TStrings; begin if Assigned(OnExecute) then begin S := AdapterRequestParamsAsStrings(AActionRequest); try Adapter.ExtractRequestParams(AActionRequest); Adapter.ApplyAdapterMode(AActionRequest); OnExecute(Self, S); finally S.Free; end; end else begin if not Adapter.LocateAndApply(AActionRequest) then Adapter.EchoActionFieldValues := True; end; end; procedure TDataSetAdapterRowAction.ImplGetAdapterItemRequestParams(var AIdentifier: string; Params: IAdapterItemRequestParams); begin Assert(Params.ParamValues.Count = 0); inherited ImplGetAdapterItemRequestParams(AIdentifier, Params); end; { TDataSetAdapterDeleteRowAction } function TDataSetAdapterDeleteRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterDeleteAction; end; procedure TDataSetAdapterDeleteRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); function DeleteRow: Boolean; begin Result := True; try DataSet.Delete except // Add to error list on E: Exception do begin Errors.AddError(E); Result := False; end; end; end; begin Adapter.ExtractRequestParams(AActionRequest); // Extract mode and preserve for response Adapter.ApplyAdapterMode(AActionRequest); if Adapter.Mode in [amInsert] then begin Adapter.Locate; Adapter.Mode := amEdit; end else if Adapter.Locate and DeleteRow then else Adapter.EchoActionFieldValues := True; end; function TDataSetAdapterDeleteRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; var Intf: IGetAdapterDisplayCharacteristics; begin Result := Adapter.Mode <> amQuery; if Result then if Supports(ADisplay, IGetAdapterDisplayCharacteristics, Intf) then Result := dcCurrentRecordView in Intf.GetAdapterDisplayCharacteristics else Result := True; end; { TDataSetAdapterNextRowAction } function TDataSetAdapterNextRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterNextAction; end; function TDataSetAdapterNextRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled and (DataSet <> nil) and (not DataSet.Eof); end; procedure TDataSetAdapterNextRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin if Adapter.LocateAndApply(AActionRequest) then DataSet.Next else Adapter.EchoActionFieldValues := True; end; { TDataSetAdapterPrevRowAction } function TDataSetAdapterPrevRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterPrevAction; end; function TDataSetAdapterPrevRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled and (DataSet <> nil) and (not DataSet.Bof); end; procedure TDataSetAdapterPrevRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin if Adapter.LocateAndApply(AActionRequest) then DataSet.Prior else Adapter.EchoActionFieldValues := True; end; { TDataSetAdapterFirstRowAction } function TDataSetAdapterFirstRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterFirstAction; end; function TDataSetAdapterFirstRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled and (DataSet <> nil) and (not DataSet.Bof); end; procedure TDataSetAdapterFirstRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin if Adapter.LocateAndApply(AActionRequest) then DataSet.First else Adapter.EchoActionFieldValues := True; end; { TDataSetAdapterLastRowAction } function TDataSetAdapterLastRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterLastAction; end; function TDataSetAdapterLastRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled and (DataSet <> nil) and (not DataSet.Eof); end; procedure TDataSetAdapterLastRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin if Adapter.LocateAndApply(AActionRequest) then DataSet.Last else Adapter.EchoActionFieldValues := True; end; { TDataSetAdapterLastRowAction } function TDataSetAdapterNewRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterNewAction; end; function TDataSetAdapterNewRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled end; procedure TDataSetAdapterNewRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin if Adapter.LocateAndApply(AActionRequest) then begin Adapter.Mode := amInsert; DataSet.Open; DataSet.Insert; end else Adapter.EchoActionFieldValues := True; end; { TDataSetAdapterCancelRowAction } function TDataSetAdapterCancelRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterCancelAction; end; function TDataSetAdapterCancelRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled and (Adapter.Mode <> amBrowse); end; procedure TDataSetAdapterCancelRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin Adapter.ExtractRequestParams(AActionRequest); Adapter.InDefaultMode := True; if DataSet = nil then Adapter.RaiseNilDataSet; DataSet.Open; if not DataSet.EOF then Adapter.Locate; end; function TDataSetAdapterCancelRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; var Intf: IGetAdapterDisplayCharacteristics; C: TAdapterDisplayCharacteristics; begin Result := Adapter.Mode <> amQuery; if Result then if Supports(ADisplay, IGetAdapterDisplayCharacteristics, Intf) then begin C := Intf.GetAdapterDisplayCharacteristics; Result := (dcCurrentRecordView in C) and not (dcMultipleRecordView in C); end else Result := True; end; { TDataSetAdapterRefreshRowAction } function TDataSetAdapterRefreshRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterRefreshAction; end; function TDataSetAdapterRefreshRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled end; procedure TDataSetAdapterRefreshRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin Adapter.ExtractRequestParams(AActionRequest); Adapter.ApplyAdapterMode(AActionRequest); case Adapter.Mode of amInsert: begin if DataSet = nil then Adapter.RaiseNilDataSet; Adapter.Locate; DataSet.Open; DataSet.Insert end; amBrowse, amEdit: Adapter.Locate; // May raise exception else Assert(False); end; end; function TDataSetAdapterRefreshRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; var Intf: IGetAdapterDisplayCharacteristics; C: TAdapterDisplayCharacteristics; begin Result := Adapter.Mode <> amQuery; if Result then if Supports(ADisplay, IGetAdapterDisplayCharacteristics, Intf) then begin C := Intf.GetAdapterDisplayCharacteristics; Result := (dcCurrentRecordView in C) and not (dcMultipleRecordView in C); end else Result := True; end; { TDataSetAdapterEditRowAction } function TDataSetAdapterEditRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterEditAction; end; function TDataSetAdapterEditRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled end; procedure TDataSetAdapterEditRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin if Adapter.LocateAndApply(AActionRequest) then Adapter.Mode := amEdit else Adapter.EchoActionFieldValues := True; end; function TDataSetAdapterEditRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; var Intf: IGetAdapterDisplayCharacteristics; C: TAdapterDisplayCharacteristics; begin if Supports(ADisplay, IGetAdapterDisplayCharacteristics, Intf) then begin C := Intf.GetAdapterDisplayCharacteristics; Result := (dcCurrentRecordView in C) and (dcMultipleRecordView in C); end else Result := True; end; { TDataSetAdapterBrowseRowAction } function TDataSetAdapterBrowseRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterBrowseAction; end; function TDataSetAdapterBrowseRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled end; procedure TDataSetAdapterBrowseRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin if Adapter.LocateAndApply(AActionRequest) then Adapter.Mode := amBrowse else Adapter.EchoActionFieldValues := True; end; function TDataSetAdapterBrowseRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; var Intf: IGetAdapterDisplayCharacteristics; C: TAdapterDisplayCharacteristics; begin if Supports(ADisplay, IGetAdapterDisplayCharacteristics, Intf) then begin C := Intf.GetAdapterDisplayCharacteristics; Result := (dcCurrentRecordView in C) and (dcMultipleRecordView in C); end else Result := True; end; { TDataSetAdapterApplyRowAction } function TDataSetAdapterApplyRowAction.GetDefaultActionName: string; begin Result := sDataSetAdapterApplyAction; end; function TDataSetAdapterApplyRowAction.ImplWebEnabled: Boolean; begin Result := inherited ImplWebEnabled and (Adapter.Mode <> amBrowse); end; procedure TDataSetAdapterApplyRowAction.ImplExecuteActionRequest( AActionRequest: IActionRequest; AActionResponse: IActionResponse); begin // LocateAndApply leaves adapter in edit mode if Adapter.LocateAndApply(AActionRequest) then else Adapter.EchoActionFieldValues := True; end; function TDataSetAdapterApplyRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; var Intf: IGetAdapterDisplayCharacteristics; C: TAdapterDisplayCharacteristics; begin Result := Adapter.Mode <> amQuery; if Result then if Supports(ADisplay, IGetAdapterDisplayCharacteristics, Intf) then begin C := Intf.GetAdapterDisplayCharacteristics; Result := (dcCurrentRecordView in C) and not (dcMultipleRecordView in C); end else Result := True; end; { TDataSetAdapterDataLink } constructor TDataSetAdapterDataLink.Create(AAdapter: TComponent); begin FAdapter := AAdapter; inherited Create; end; procedure TDataSetAdapterDataLink.DataEvent(Event: TDataEvent; Info: Integer); begin inherited; case Event of (* We don't get these when the tablename is changed because the table has already been deactivated deLayoutChange, dePropertyChange, deFieldListChange, *) deUpdateState: begin if Assigned(OnDataSetStateChange) then OnDataSetStateChange(Self); if Assigned(NotifyPossibleHTMLChange) then NotifyPossibleHTMLChange; end; end; end; procedure TDataSetAdapterDataLink.RecordChanged(Field: TField); begin // Current record changed if Assigned(NotifyPossibleHTMLChange) then NotifyPossibleHTMLChange; end; { TCustomDataSetValuesList } constructor TCustomDataSetValuesList.Create(AOwner: TComponent); begin inherited; FCache := TNamedVariantsList.Create; end; procedure TCustomDataSetValuesList.PrepareDataSet; begin DataSetPrepared := True; if Assigned(OnPrepareDataSet) then OnPrepareDataSet(Self); if Assigned(DataSet) then DataSet.Cancel; end; destructor TCustomDataSetValuesList.Destroy; begin inherited; FCache.Free; end; function TCustomDataSetValuesList.GetNameFieldClass: TComponentClass; begin Result := TValuesListNameField; end; function TCustomDataSetValuesList.GetValueFieldClass: TComponentClass; begin Result := TValuesListValueField; end; procedure TCustomDataSetValuesList.ImplEndIterator(OwnerData: Pointer); begin if FIndex >= FCache.Count then begin FIndex := 0; FCache.Clear; FCacheInUse := False; end; end; function TCustomDataSetValuesList.ImplGetListNameOfValue(Value: Variant): string; var I: Integer; begin if not FCacheInUse then CacheValuesList; for I := 0 to FCache.Count - 1 do begin Result := FCache.Names[I]; if Result <> '' then try if FCache.Variants[I] = Value then Exit; except end; end; Result := ''; end; function TCustomDataSetValuesList.ImplGetListName: string; begin if FIndex < FCache.Count then Result := FCache.Names[FIndex] else Result := ''; end; function TCustomDataSetValuesList.ImplGetListValue: Variant; begin if FIndex < FCache.Count then Result := FCache.Variants[FIndex] else Result := Unassigned; if VarIsEmpty(Result) then Result := ImplGetListName; end; function TCustomDataSetValuesList.ImplNextIteration( var OwnerData: Pointer): Boolean; begin Inc(FIndex); Result := FIndex < FCache.Count; end; function TCustomDataSetValuesList.ImplStartIterator( var OwnerData: Pointer): Boolean; begin FIndex := 0; CacheValuesList; FCacheInUse := True; Result := FIndex < FCache.Count; end; procedure TCustomDatasetValuesList.CacheValuesList; var DSValueField: TField; DSNameField: TField; N: string; V: Variant; begin FCache.Clear; if DataSet <> nil then begin if not DesigningComponent(Self) then DataSet.Open; if DataSet.Active then begin DSValueField := DataSet.FindField(ValueField); DSNameField := DataSet.FindField(NameField); DataSet.First; while not DataSet.EOF do begin if Assigned(DSNameField) and not VarIsNull(DSNameField.Value) then N := DSNameField.Value else N := ''; if Assigned(DSValueField) then V := DSValueField.Value else V := Unassigned; FCache.Add(N, V); DataSet.Next; end; end; end; end; procedure TCustomDataSetValuesList.SetDataSet( const Value: TDataSet); begin if FDataSet <> Value then begin if Value <> nil then Value.FreeNotification(Self); FDataSet := Value; end; end; procedure TCustomDataSetValuesList.Notification(AComponent: TComponent; Operation: TOperation); begin inherited Notification(AComponent, Operation); if (Operation = opRemove) and (AComponent = FDataSet) then FDataSet := nil; end; function TCustomDataSetValuesList.GetDataSet: TDataSet; begin if not (csLoading in ComponentState) and not DataSetPrepared then PrepareDataSet; Result := FDataSet; end; procedure TCustomDataSetValuesList.ImplNotifyDeactivate; begin inherited; if FDataSet <> nil then FDataSet.Close; DataSetPrepared := False; end; procedure TCustomDataSetValuesList.GetDesigntimeWarnings( AWarnings: TAbstractDesigntimeWarnings); begin if DataSet = nil then AWarnings.AddString(Format(sDataSetPropertyIsNil, [Self.Name])); if (DataSet <> nil) and (not DataSet.Active) then AWarnings.AddString(Format(sDataSetNotActive, [Self.Name, DataSet.Name])); if (Self.ValueField = '') then AWarnings.AddString(Format(sValueFieldIsBlank, [Self.Name])); end; { TCustomDataSetAdapterMemoField } function TCustomDataSetAdapterMemoField.ImplAsFormatted: string; var DataSet: TDataSet; Field: TField; begin Result := Unassigned; if FDataSetField <> '' then begin DataSet := GetDataSet; if Assigned(DataSet) then begin if DataSet.Active or not DesigningComponent(Self) then begin DataSet.Open; Field := DataSet.FindField(FDataSetField); end else Field := nil; if Assigned(Field) then if Assigned(OnGetDisplayText) then OnGetDisplayText(Self, Field, Result) else if Field is TMemoField then Result := Field.AsString else Result := Field.DisplayText else Result := ''; end; end; end; function TCustomDataSetAdapterMemoField.ImplGetValue: Variant; var Value: IActionFieldValue; begin CheckViewAccess; if EchoActionFieldValue then begin Value := ActionValue; if Value <> nil then Result := Value.Values[0] else Result := Unassigned; end else if Adapter.Mode <> amQuery then Result := inherited ImplGetValue; end; function TCustomDataSetAdapterMemoField.CheckOrUpdateValue( AActionRequest: IActionRequest; AFieldIndex: Integer; AUpdate: Boolean): Boolean; var Field: TField; FieldValue: IActionFieldValue; begin Result := False; Assert(Adapter <> nil); with GetActionFieldValues(AActionRequest) do FieldValue := Values[AFieldIndex]; if FieldValue.ValueCount > 0 then begin // Make sure the dataset is open and set if Adapter.DataSet = nil then Adapter.RaiseNilDataSet; Adapter.DataSet.Open; Field := FindField; if Field = nil then Adapter.RaiseFieldNotFound(DataSetField); if FieldValue.ValueCount = 1 then begin if AUpdate and Assigned(OnUpdateValue) then OnUpdateValue(Self, Field, FieldValue.Values[0]) else begin Result := TestValueChange(Field, FieldValue.Values[0]); if Result and AUpdate then Field.Value := FieldValue.Values[0] end; end else RaiseMultipleValuesException(FieldName) end else if FieldValue.FileCount > 0 then RaiseFileUploadNotSupported(FieldName); end; procedure TCustomDataSetAdapterMemoField.ImplUpdateValue( AActionRequest: IActionRequest; AFieldIndex: Integer); begin CheckModifyAccess; CheckOrUpdateValue(AActionRequest, AFieldIndex, True); end; function TCustomDataSetAdapterMemoField.ImplCheckValueChange( AActionRequest: IActionRequest; AFieldIndex: Integer): Boolean; begin Result := CheckOrUpdateValue(AActionRequest, AFieldIndex, False); end; function TCustomDataSetAdapterMemoField.GetInputStyleType(const AAdapterMode: string): TAdapterInputHTMLElementType; begin Result := htmliTextArea; end; { TDataSetAdapterMoveRowAction } function TDataSetAdapterMoveRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; var Intf: IGetAdapterDisplayCharacteristics; begin Result := Adapter.Mode <> amQuery; if Result then if Supports(ADisplay, IGetAdapterDisplayCharacteristics, Intf) then Result := dcChangeCurrentRecordView in Intf.GetAdapterDisplayCharacteristics else Result := True; end; function TDataSetAdapterNewRowAction.ImplIsDefaultAction( ADisplay: TObject): Boolean; begin Result := True; end; constructor TDataSetAdapterNewRowAction.Create(AOwner: TComponent); begin inherited; ActionModes := [amInsert, amEdit, amBrowse, amQuery]; end; constructor TDataSetAdapterEditRowAction.Create(AOwner: TComponent); begin inherited; ActionModes := [amInsert, amEdit, amBrowse, amQuery]; end; constructor TDataSetAdapterBrowseRowAction.Create(AOwner: TComponent); begin inherited; ActionModes := [amInsert, amEdit, amBrowse, amQuery]; end; constructor TDataSetAdapterCancelRowAction.Create(AOwner: TComponent); begin inherited; ActionModes := [amInsert, amEdit]; end; constructor TDataSetAdapterApplyRowAction.Create(AOwner: TComponent); begin inherited; ActionModes := [amInsert, amEdit]; end; procedure TCustomDataSetAdapter.SetMasterAdapter( const Value: TCustomDataSetAdapter); begin if MasterAdapter <> Value then begin if FMasterAdapter <> nil then FMasterAdapter.DetailAdapters.Remove(Self); FMasterAdapter := Value; if Value <> nil then begin Value.FreeNotification(Self); Value.DetailAdapters.Add(Self); end; end; end; { TLocateParamsList } function TLocateParamsList.Add: TLocateParams; begin Result := TLocateParams.Create(Self); end; procedure TLocateParamsList.Clear; begin FList.Clear; end; constructor TLocateParamsList.Create; begin inherited; FList := TObjectList.Create(True {Owned} ); end; destructor TLocateParamsList.Destroy; begin inherited; FList.Free; end; function TLocateParamsList.GetCount: Integer; begin Result := FList.Count; end; function TLocateParamsList.GetItem(I: Integer): TLocateParams; begin Result := TLocateParams(FList[I]); end; { TLocateParams } procedure TLocateParams.AddParam(const ANameValue: string); begin FParams.Add(ANameValue) end; procedure TLocateParams.AddParam(const AName, AValue: string); begin FParams.Add(Format('%s=%s', [AName, AValue])); end; constructor TLocateParams.Create(AList: TLocateParamsList); begin inherited Create; FParams := TStringList.Create; if AList <> nil then AList.FList.Add(Self); end; destructor TLocateParams.Destroy; begin inherited; FParams.Free; end; function TLocateParams.GetCount: Integer; begin Result := FParams.Count; end; function TLocateParams.GetItem(I: Integer): string; begin Result := FParams[I]; end; function TLocateParams.GetParamName(I: Integer): string; begin Result := FParams.Names[I]; end; function TLocateParams.GetParamValue(I: Integer): string; begin Result := ExtractStringValue(FParams[I]); end; function TLocateParamsList.ItemByAdapterName( const AName: string): TLocateParams; var I: Integer; begin for I := 0 to Count - 1 do begin Result := Items[I]; if SameText(Result.AdapterName, AName) then Exit; end; Result := nil; end; function TCustomDataSetAdapter.ImplGetIteratorIndex: Integer; begin Result := FDataSetRecNo; end; function TCustomDataSetAdapter.ImplInIterator: Boolean; begin Result := FInIterator; end; procedure TCustomDataSetAdapter.GetRecordKeys(AValues: TStrings; var AFullyQualify: Boolean); begin ImplGetRecordKeys(AValues, AFullyQualify); end; procedure TCustomDataSetAdapter.ImplGetRecordKeys(AValues: TStrings; var AFullyQualify: Boolean); begin GetKeyParamStrings(AValues); AFullyQualify := FullyQualifyInputNames; end; function TCustomDataSetAdapter.FullyQualifyInputNames: Boolean; begin Result := (MasterAdapter <> nil) or (DetailAdapters.Count >= 1); end; function TBaseDataSetAdapterField.FullyQualifyInputName: Boolean; begin Result := (Adapter <> nil) and (Adapter.FullyQualifyInputNames); end; function TBaseDataSetAdapterField.GetKeyName: string; begin if ffInKey in FieldFlags then Result := DataSetField else Result := ''; end; { TBaseDataSetAdapterInputField } function TBaseDataSetAdapterInputField.ImplGetEchoActionFieldValue: Boolean; begin Result := FEchoActionFieldValue; end; procedure TBaseDataSetAdapterInputField.ImplSetEchoActionFieldValue( AValue: Boolean); begin FEchoActionFieldValue := AValue; end; procedure TBaseDataSetAdapterInputField.ValidateValue( AActionRequest: IActionRequest; AFieldIndex: Integer); begin ImplValidateValue(AActionRequest, AFieldIndex); end; procedure TBaseDataSetAdapterInputField.ImplValidateValue( AActionRequest: IActionRequest; AFieldIndex: Integer); var Handled: Boolean; Field: TField; begin if Assigned(OnValidateValue) then begin // When validating values, make sure the dataset is not nil, and Open if Adapter.DataSet = nil then Adapter.RaiseNilDataSet; Adapter.DataSet.Open; Field := FindField; with GetActionFieldValues(AActionRequest) do OnValidateValue(Self, Field, Values[AFieldIndex], Handled) end; end; function TBaseDataSetAdapterInputField.TestValueChange(AField: TField; const ANewValue: string): Boolean; var OrigValue: Variant; begin OrigValue := AField.Value; if (VarIsEmpty(OrigValue)) or (VarIsNull(OrigValue)) then Result := Length(ANewValue) <> 0 else try Result := ANewValue <> OrigValue; except Result := True; end; end; procedure TCustomDataSetAdapter.SetInDefaultMode(const Value: Boolean); begin FInDefaultMode := Value; FMode := amBrowse; end; procedure TCustomDataSetAdapter.ImplSetEchoActionFieldValues( AValue: Boolean); var I: Integer; C: TCustomDataSetAdapter; List: TComponentList; begin if (AValue = True) and (GetEchoActionFieldValues <> AValue) then begin if Mode <> amBrowse then inherited ImplSetEchoActionFieldValues(AValue); List := GetMasterDetailAdapters; if List <> nil then try for I := 0 to List.Count - 1 do begin C := (List[I] as TCustomDataSetAdapter); if (C <> Self) and (C.Mode <> amBrowse) then C.ImplSetEchoActionFieldValues(AValue); end finally List.Free; end else if Mode <> amBrowse then inherited ImplSetEchoActionFieldValues(AValue) end else inherited ImplSetEchoActionFieldValues(AValue); end; procedure TBaseDataSetAdapterField.PrepareDataSet; begin if Assigned(FField) then FField.RemoveFreeNotification(Self); FField := nil; end; end.
unit Ths.Erp.Database.Table.BankaSubesi; interface {$I ThsERP.inc} uses SysUtils, Classes, Dialogs, Forms, Windows, Controls, Types, DateUtils, FireDAC.Stan.Param, System.Variants, Data.DB, Ths.Erp.Database, Ths.Erp.Database.Table, Ths.Erp.Database.Table.Banka, Ths.Erp.Database.Table.SysCity; type TBankaSubesi = class(TTable) private FBankaID: TFieldDB; FSubeKodu: TFieldDB; FSubeAdi: TFieldDB; FSubeIlID: TFieldDB; protected published constructor Create(OwnerDatabase:TDatabase);override; public procedure SelectToDatasource(pFilter: string; pPermissionControl: Boolean=True); override; procedure SelectToList(pFilter: string; pLock: Boolean; pPermissionControl: Boolean=True); override; procedure Insert(out pID: Integer; pPermissionControl: Boolean=True); override; procedure Update(pPermissionControl: Boolean=True); override; function Clone():TTable;override; Property BankaID: TFieldDB read FBankaID write FBankaID; Property SubeKodu: TFieldDB read FSubeKodu write FSubeKodu; Property SubeAdi: TFieldDB read FSubeAdi write FSubeAdi; Property SubeIlID: TFieldDB read FSubeIlID write FSubeIlID; end; implementation uses Ths.Erp.Constants, Ths.Erp.Database.Singleton; constructor TBankaSubesi.Create(OwnerDatabase:TDatabase); begin inherited Create(OwnerDatabase); TableName := 'banka_subesi'; SourceCode := '1010'; FBankaID := TFieldDB.Create('banka_id', ftInteger, 0); FSubeKodu := TFieldDB.Create('sube_kodu', ftInteger, 0); FSubeAdi := TFieldDB.Create('sube_adi', ftString, ''); FSubeIlID := TFieldDB.Create('sube_il_id', ftInteger, 0); end; procedure TBankaSubesi.SelectToDatasource(pFilter: string; pPermissionControl: Boolean=True); begin if IsAuthorized(ptRead, pPermissionControl) then begin with QueryOfDS do begin Close; SQL.Clear; SQL.Text := Database.GetSQLSelectCmd(TableName, [ TableName + '.' + Self.Id.FieldName, TableName + '.' + FBankaID.FieldName, TableName + '.' + FSubeKodu.FieldName, TableName + '.' + FSubeAdi.FieldName, TableName + '.' + FSubeIlID.FieldName ]) + 'WHERE 1=1 ' + pFilter; Open; Active := True; Self.DataSource.DataSet.FindField(Self.Id.FieldName).DisplayLabel := 'ID'; Self.DataSource.DataSet.FindField(FBankaID.FieldName).DisplayLabel := 'Banka ID'; Self.DataSource.DataSet.FindField(FSubeKodu.FieldName).DisplayLabel := 'Şube Kodu'; Self.DataSource.DataSet.FindField(FSubeAdi.FieldName).DisplayLabel := 'Şube Adı'; Self.DataSource.DataSet.FindField(FSubeIlID.FieldName).DisplayLabel := 'Şube İl ID'; end; end; end; procedure TBankaSubesi.SelectToList(pFilter: string; pLock: Boolean; pPermissionControl: Boolean=True); begin if IsAuthorized(ptRead, pPermissionControl) then begin if (pLock) then pFilter := pFilter + ' FOR UPDATE OF ' + TableName + ' NOWAIT'; with QueryOfList do begin Close; SQL.Text := Database.GetSQLSelectCmd(TableName, [ TableName + '.' + Self.Id.FieldName, TableName + '.' + FBankaID.FieldName, TableName + '.' + FSubeKodu.FieldName, TableName + '.' + FSubeAdi.FieldName, TableName + '.' + FSubeIlID.FieldName ]) + 'WHERE 1=1 ' + pFilter; Open; FreeListContent(); List.Clear; while NOT EOF do begin Self.Id.Value := FormatedVariantVal(FieldByName(Self.Id.FieldName).DataType, FieldByName(Self.Id.FieldName).Value); FBankaID.Value := FormatedVariantVal(FieldByName(FBankaID.FieldName).DataType, FieldByName(FBankaID.FieldName).Value); FSubeKodu.Value := FormatedVariantVal(FieldByName(FSubeKodu.FieldName).DataType, FieldByName(FSubeKodu.FieldName).Value); FSubeAdi.Value := FormatedVariantVal(FieldByName(FSubeAdi.FieldName).DataType, FieldByName(FSubeAdi.FieldName).Value); FSubeIlID.Value := FormatedVariantVal(FieldByName(FSubeIlID.FieldName).DataType, FieldByName(FSubeIlID.FieldName).Value); List.Add(Self.Clone()); Next; end; end; end; end; procedure TBankaSubesi.Insert(out pID: Integer; pPermissionControl: Boolean=True); begin if IsAuthorized(ptAddRecord, pPermissionControl) then begin with QueryOfInsert do begin Close; SQL.Clear; SQL.Text := Database.GetSQLInsertCmd(TableName, QUERY_PARAM_CHAR, [ FBankaID.FieldName, FSubeKodu.FieldName, FSubeAdi.FieldName, FSubeIlID.FieldName ]); NewParamForQuery(QueryOfInsert, FBankaID); NewParamForQuery(QueryOfInsert, FSubeKodu); NewParamForQuery(QueryOfInsert, FSubeAdi); NewParamForQuery(QueryOfInsert, FSubeIlID); Open; if (Fields.Count > 0) and (not Fields.FieldByName(Self.Id.FieldName).IsNull) then pID := Fields.FieldByName(Self.Id.FieldName).AsInteger else pID := 0; EmptyDataSet; Close; end; Self.notify; end; end; procedure TBankaSubesi.Update(pPermissionControl: Boolean=True); begin if IsAuthorized(ptUpdate, pPermissionControl) then begin with QueryOfUpdate do begin Close; SQL.Clear; SQL.Text := Database.GetSQLUpdateCmd(TableName, QUERY_PARAM_CHAR, [ FBankaID.FieldName, FSubeKodu.FieldName, FSubeAdi.FieldName, FSubeIlID.FieldName ]); NewParamForQuery(QueryOfUpdate, FBankaID); NewParamForQuery(QueryOfUpdate, FSubeKodu); NewParamForQuery(QueryOfUpdate, FSubeAdi); NewParamForQuery(QueryOfUpdate, FSubeIlID); NewParamForQuery(QueryOfUpdate, Id); ExecSQL; Close; end; Self.notify; end; end; function TBankaSubesi.Clone():TTable; begin Result := TBankaSubesi.Create(Database); Self.Id.Clone(TBankaSubesi(Result).Id); FBankaID.Clone(TBankaSubesi(Result).FBankaID); FSubeKodu.Clone(TBankaSubesi(Result).FSubeKodu); FSubeAdi.Clone(TBankaSubesi(Result).FSubeAdi); FSubeIlID.Clone(TBankaSubesi(Result).FSubeIlID); end; end.
(******************************************************************************* Author: -> Jean-Pierre LESUEUR (@DarkCoderSc) https://github.com/DarkCoderSc https://gist.github.com/DarkCoderSc https://www.phrozen.io/ License: -> MIT *******************************************************************************) unit UntPEBDebug; interface uses Windows; const PROCESS_QUERY_LIMITED_INFORMATION = $1000; PROCESS_BASIC_INFORMATION = 0; // https://docs.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntqueryinformationprocess var _NtQueryInformationProcess : function( ProcessHandle : THandle; ProcessInformationClass : DWORD; ProcessInformation : Pointer; ProcessInformationLength : ULONG; ReturnLength : PULONG) : LongInt; stdcall; hNTDLL : THandle; {$IFDEF WIN64} type PProcessBasicInformation = ^TProcessBasicInformation; TProcessBasicInformation = record ExitStatus : Int64; PebBaseAddress : Pointer; AffinityMask : Int64; BasePriority : Int64; UniqueProcessId : Int64; InheritedUniquePID : Int64; end; {$ELSE} type PProcessBasicInformation = ^TProcessBasicInformation; TProcessBasicInformation = record ExitStatus : DWORD; PebBaseAddress : Pointer; AffinityMask : DWORD; BasePriority : DWORD; UniqueProcessId : DWORD; InheritedUniquePID : DWORD; end; {$ENDIF} function GetProcessDebugStatus(AProcessID : Cardinal; var ADebugStatus : boolean) : Boolean; function SetProcessDebugStatus(AProcessID : Cardinal; ADebugStatus : Boolean) : Boolean; implementation {------------------------------------------------------------------------------- Open a process and retrieve the point of debug flag from PEB. If function succeed, don't forget to call close process handle. -------------------------------------------------------------------------------} function GetDebugFlagPointer(AProcessID : Cardinal; var AProcessHandle : THandle) : Pointer; var PBI : TProcessBasicInformation; ARetLen : Cardinal; begin result := nil; /// AProcessHandle := 0; if NOT Assigned(_NtQueryInformationProcess) then Exit(); /// AProcessHandle := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_WRITE or PROCESS_VM_READ, false, AProcessID); if (AProcessHandle = 0) then Exit; if _NtQueryInformationProcess(AProcessHandle, PROCESS_BASIC_INFORMATION, @PBI, sizeOf(TProcessBasicInformation), @ARetLen) = ERROR_SUCCESS then result := Pointer(NativeUInt(PBI.PebBaseAddress) + (SizeOf(Byte) * 2)) else CloseHandle(AProcessHandle); end; {------------------------------------------------------------------------------- Retrieve the target process debug status from PEB. ADebugStatus = True : Target process debug flag is set. ADebugStatus = False : Target process debug flag is not set. -------------------------------------------------------------------------------} function GetProcessDebugStatus(AProcessID : Cardinal; var ADebugStatus : boolean) : Boolean; var hProcess : THandle; pDebugFlagOffset : Pointer; pDebugFlag : pByte; ABytesRead : SIZE_T; begin result := false; /// pDebugFlagOffset := GetDebugFlagPointer(AProcessID, hProcess); if not Assigned(pDebugFlagOffset) then Exit(); /// try getMem(pDebugFlag, sizeOf(Byte)); try if NOT ReadProcessMemory(hProcess, pDebugFlagOffset, pDebugFlag, sizeOf(Byte), ABytesRead) then Exit; /// ADebugStatus := (pDebugFlag^ = 1); finally FreeMem(pDebugFlag); end; /// result := (ABytesRead = SizeOf(Byte)); finally CloseHandle(hProcess); end; end; {------------------------------------------------------------------------------- Update target process debug flag. ADebugStatus = True : Set target process debug flag. ADebugStatus = False : Unset target process debug flag. -------------------------------------------------------------------------------} function SetProcessDebugStatus(AProcessID : Cardinal; ADebugStatus : Boolean) : Boolean; var hProcess : THandle; pDebugFlagOffset : Pointer; ADebugFlag : Byte; ABytesWritten : SIZE_T; begin result := false; /// pDebugFlagOffset := GetDebugFlagPointer(AProcessID, hProcess); if not Assigned(pDebugFlagOffset) then Exit(); /// try if ADebugStatus then ADebugFlag := 1 else ADebugFlag := 0; if NOT WriteProcessMemory(hProcess, pDebugFlagOffset, @ADebugFlag, SizeOf(Byte), ABytesWritten) then Exit; /// result := (ABytesWritten = SizeOf(Byte)); finally CloseHandle(hProcess); end; end; initialization { Load NtQueryInformationProcess from NTDLL.dll } _NtQueryInformationProcess := nil; hNTDLL := LoadLibrary('ntdll.dll'); if (hNTDLL <> 0) then @_NtQueryInformationProcess := GetProcAddress(hNTDLL, 'NtQueryInformationProcess'); finalization _NtQueryInformationProcess := nil; if (hNTDLL <> 0) then FreeLibrary(hNTDLL); end.
unit upublictype; {$mode objfpc}{$H+} interface uses Classes, SysUtils, Forms; type TZhiXingSQL=function(const ASQL:string):NativeInt; TChaXunSQL=function(const ASQL:string; AStream:TStream):NativeInt; TShangChuanFile=function(const AClientFile,AServerFile:string):NativeInt; TXiaZaiFile=function(const AClientFile,AServerFile:string):NativeInt; TFaSongStr=function(const AStr:string):string; {$H+} { TPublicFunctionType } TPublicFunctionType=class(TObject) private FChaJianPointer:NativeInt; procedure InitFunction; public ZhiXingSQL:TZhiXingSQL; ChaXunSQL:TChaXunSQL; ShangChuanFile:TShangChuanFile; XiaZaiFile:TXiaZaiFile; FaSongStr:TFaSongStr; constructor Create(AModelName:PChar);virtual; destructor Destroy;override; end; {$H-} PInitChaJianType=^TInitChaJianType; TInitChaJianType=record App:TApplication; end; TGetPublicFunction=function(APublicFunction:TPublicFunctionType):Boolean; TInitChaJian=function(const AInitChaJianType:TInitChaJianType):Boolean; TFinalizChaJian=function():Boolean; PInitType=^TInitType; TInitType=record App:TApplication; TongXinChaJianList:TStrings; MoKuaiID:NativeInt; MoKuaiMing:string; ShouCan:string; MoKuaiLeiXing:NativeInt; end; TInitModel=function(const AInitType:TInitType):Boolean; TGetModelClass=function():NativeInt; TFinalizModel=function():Boolean; PPublicModelType=^TPublicModelType; TPublicModelType=record InitModel:TInitModel; GetModelClass:TGetModelClass; FinalizModel:TFinalizModel; end; implementation uses upublicfunction,upublicconst; { TPublicFunctionType } procedure TPublicFunctionType.InitFunction; var LGetPublicFunction:TGetPublicFunction; begin LGetPublicFunction:=TGetPublicFunction(HuoQuChaJianHanShu(FChaJianPointer,tx_chajian_getpublicfunction)); LGetPublicFunction(Self); end; constructor TPublicFunctionType.Create(AModelName: PChar); const Error_Nil=0; var LInitChaJian:TInitChaJian; LInitChaJianType:TInitChaJianType; begin FChaJianPointer:=JiaZaiChaJian(AModelName); if FChaJianPointer=Error_Nil then begin raise Exception.Create(error_chuangjiantongxinshibai); end; LInitChaJian:=TInitChaJian(HuoQuChaJianHanShu(FChaJianPointer,tx_chajian_initchajian)); LInitChaJianType.App:=Application; LInitChaJian(LInitChaJianType); InitFunction; end; destructor TPublicFunctionType.Destroy; var LFinalizChaJian:TFinalizChaJian; begin LFinalizChaJian:=TFinalizChaJian(HuoQuChaJianHanShu(FChaJianPointer,tx_chajian_finalizchajian)); LFinalizChaJian(); ShiFangChaJian(FChaJianPointer); inherited Destroy; end; end.
(****************************************************************************) (* *) (* REV97.PAS - The Relativity Emag (coded in Borland Pascal 7.0) *) (* *) (* "The Relativity Emag" was originally written by En|{rypt, |MuadDib|. *) (* This source may not be copied, distributed or modified in any shape *) (* or form. Some of the code has been derived from various sources and *) (* units to help us produce a better quality electronic magazine to let *) (* the scene know that we are THE BOSS. *) (* *) (* Program Notes : This program presents "The Relativity Emag" *) (* *) (* ASM/BP70 Coder : xxxxx xxxxxxxxx (MuadDib) - xxxxxx@xxxxxxxxxx.xxx *) (* ------------------------------------------------------------------------ *) (* Older Coder : xxxxx xxxxxxxxx (En|{rypt) - xxxxxx@xxxxxxxxxx.xxx :))) *) (* *) (****************************************************************************) {컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴} (****************************************************************************) (* Reserved Words - The Heading Specifies The Program Name And Parameters. *) (****************************************************************************) Program The_Relativity_Electronic_Magazine_issue4; {컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴} (****************************************************************************) (* Compiler Directives - These Directives Are Not Meant To Be Modified. *) (****************************************************************************) {$M 65320,000,653600} {$S 65535} {컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴} (****************************************************************************) (* Reserved Words - Statements To Be Executed When The Program Runs. *) (****************************************************************************) {-plans for the future in the coding- -------------------------------------- * initializing screen * compression * f1 search in memory (bin) * more command lines * vga inroduction * fonts onoff, bright onoff {컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴} (****************************************************************************) (* Reserved Words - Each Identifier Names A Unit Used By The Program. *) (****************************************************************************) { i used the rev-non pointer dat.. .. i wonder.. pointers or not ???} uses Crt,Dos,REVCOM, revconst,revinit,revmenu,revint,revcfgr, revhelp,revpoint,revdos,detectso,revwin, revfnt,revrad,revtech,revgfx,revansi, revdat,revsmth; Begin {Begin The Best Emag In The Scene} {---------------------------} checkbreak:=false; vercheck; checkfordat; cc:=1; {menu option} {---------------------------} if DetSoundBlaster then adlib:=true else adlib:=false; if not adlib then mustype:=2 else mustype:=1; if adlib then InstallRADTimer; {---------------------------} randomize; initconfigpointer; read_config; Initcommand; fontload(config^.font[config^.curfnt]); RevCommand; InitTag; { InitBright; initfonts; InitMusic; InitTag;} initavail; InitradVol; Initcd; {-----------------} {adlib:=false;} {vga:=false; { cd:=false;} {-----------------} PhazePre; hidecursor; chbrght; ExtractFileFromDat('MUADDIB.BIN'); smoothscroll('MUADDIB.BIN',0,0); if keypressed then readkey; FadedownRGBScreen; Reset80x25VideoScreen; HideCursor; ExtractFileFromDat(config^.DEFMENUFILE); Displayansi(config^.DEFMENUFILE); StartMainMenuPhase; end.
{$A+,B-,D+,E-,F-,G+,I+,L+,N+,O-,P-,Q-,R-,S-,T-,V+,X+,Y+} {$M 1024,0,0} { by Behdad Esfahbod Algorithmic Problems Book September '1999 Problem 38 O(N3) Bfs Method } program MinimumDiameterSpanningTree; const MaxN = 100; var N, E : Integer; A, T : array [1 .. MaxN, 0 .. MaxN] of Integer; M : array [1 .. MaxN] of Boolean; P, B, H : array [0 .. MaxN] of Integer; I, J, K, V, D : Integer; F : Text; var Q : array [1 .. MaxN] of Integer; QL, QR : Integer; function EnQueue (V : Integer) : Integer; begin Inc(QR); Q[QR] := V; EnQueue := Q[QR]; M[V] := True; end; function DeQueue : Integer; begin DeQueue := Q[QL]; Inc(QL); end; function IsEmpty : Boolean; begin IsEmpty := QL > Qr; end; function Diameter (V : Integer) : Integer; var I, J, D, Te : Integer; begin D := 0; H[V] := 0; for I := 1 to T[V, 0] do begin Te := Diameter(T[V, I]); if Te > D then D := Te; if H[T[V, I]] + 1 > H[V] then H[V] := H[T[V, I]] + 1; end; for I := 1 to T[V, 0] do for J := 1 to I - 1 do if H[T[V, I]] + H[T[V, J]] + 2 > D then D := H[T[V, I]] + H[T[V, J]] + 2; Diameter := D; end; function Bfs (V : Integer) : Integer; var I, J : Integer; begin FillChar(M, SizeOf(M), 0); FillChar(P, SizeOf(P), 0); FillChar(B, SizeOf(B), 0); FillChar(T, SizeOf(T), 0); QL := 1; QR := 0; EnQueue(V); while not IsEmpty do begin J := DeQueue; for I := 1 to N do if (A[I, J] = 1) and not M[I] then begin EnQueue(I); P[I] := J; Inc(T[J, 0]); T[J, T[J, 0]] := I; B[I] := B[J] + 1; end; end; Bfs := Diameter(V); end; procedure Solve; begin D := MaxInt; for I := 1 to N do begin J := Bfs(I); if J < D then begin D := J; V := I; end; end; Bfs(V); end; procedure ReadInput; begin Assign(F, 'input.txt'); Reset(F); Readln(F, N, E); for I := 1 to E do begin Readln(F, J, K); A[J, K] := 1; A[K, J] := 1; end; Close(F); end; procedure WriteOutput; begin Assign(F, 'output.txt'); ReWrite(F); Writeln(F, N, ' ', D); for I := 1 to N do if P[I] <> 0 then Writeln(F, I, ' ', P[I]); Close(F); end; begin ReadInput; Solve; WriteOutput; end.
unit IdHashCRC; { 2001-Oct-23 Pete Mee - Fixed CRC-32. } interface uses Classes, IdHash; type TIdHashCRC16 = class(TIdHash16) public function HashValue(AStream: TStream): Word; override; end; TIdHashCRC32 = class(TIdHash32) public function HashValue(AStream: TStream): LongWord; override; end; implementation uses SysUtils; const CRC16Table: array[0..255] OF WORD = ($0000,$C0C1,$C181,$0140,$C301,$03C0,$0280,$C241,$C601,$06C0,$0780, $C741,$0500,$C5C1,$C481,$0440,$CC01,$0CC0,$0D80,$CD41,$0F00,$CFC1, $CE81,$0E40,$0A00,$CAC1,$CB81,$0B40,$C901,$09C0,$0880,$C841,$D801, $18C0,$1980,$D941,$1B00,$DBC1,$DA81,$1A40,$1E00,$DEC1,$DF81,$1F40, $DD01,$1DC0,$1C80,$DC41,$1400,$D4C1,$D581,$1540,$D701,$17C0,$1680, $D641,$D201,$12C0,$1380,$D341,$1100,$D1C1,$D081,$1040,$F001,$30C0, $3180,$F141,$3300,$F3C1,$F281,$3240,$3600,$F6C1,$F781,$3740,$F501, $35C0,$3480,$F441,$3C00,$FCC1,$FD81,$3D40,$FF01,$3FC0,$3E80,$FE41, $FA01,$3AC0,$3B80,$FB41,$3900,$F9C1,$F881,$3840,$2800,$E8C1,$E981, $2940,$EB01,$2BC0,$2A80,$EA41,$EE01,$2EC0,$2F80,$EF41,$2D00,$EDC1, $EC81,$2C40,$E401,$24C0,$2580,$E541,$2700,$E7C1,$E681,$2640,$2200, $E2C1,$E381,$2340,$E101,$21C0,$2080,$E041,$A001,$60C0,$6180,$A141, $6300,$A3C1,$A281,$6240,$6600,$A6C1,$A781,$6740,$A501,$65C0,$6480, $A441,$6C00,$ACC1,$AD81,$6D40,$AF01,$6FC0,$6E80,$AE41,$AA01,$6AC0, $6B80,$AB41,$6900,$A9C1,$A881,$6840,$7800,$B8C1,$B981,$7940,$BB01, $7BC0,$7A80,$BA41,$BE01,$7EC0,$7F80,$BF41,$7D00,$BDC1,$BC81,$7C40, $B401,$74C0,$7580,$B541,$7700,$B7C1,$B681,$7640,$7200,$B2C1,$B381, $7340,$B101,$71C0,$7080,$B041,$5000,$90C1,$9181,$5140,$9301,$53C0, $5280,$9241,$9601,$56C0,$5780,$9741,$5500,$95C1,$9481,$5440,$9C01, $5CC0,$5D80,$9D41,$5F00,$9FC1,$9E81,$5E40,$5A00,$9AC1,$9B81,$5B40, $9901,$59C0,$5880,$9841,$8801,$48C0,$4980,$8941,$4B00,$8BC1,$8A81, $4A40,$4E00,$8EC1,$8F81,$4F40,$8D01,$4DC0,$4C80,$8C41,$4400,$84C1, $8581,$4540,$8701,$47C0,$4680,$8641,$8201,$42C0,$4380,$8341,$4100, $81C1,$8081,$4040); CRC32Table : array[0..255] of longword = ( $00000000, $77073096, $ee0e612c, $990951ba, $076dc419, $706af48f, $e963a535, $9e6495a3, $0edb8832, $79dcb8a4, $e0d5e91e, $97d2d988, $09b64c2b, $7eb17cbd, $e7b82d07, $90bf1d91, $1db71064, $6ab020f2, $f3b97148, $84be41de, $1adad47d, $6ddde4eb, $f4d4b551, $83d385c7, $136c9856, $646ba8c0, $fd62f97a, $8a65c9ec, $14015c4f, $63066cd9, $fa0f3d63, $8d080df5, $3b6e20c8, $4c69105e, $d56041e4, $a2677172, $3c03e4d1, $4b04d447, $d20d85fd, $a50ab56b, $35b5a8fa, $42b2986c, $dbbbc9d6, $acbcf940, $32d86ce3, $45df5c75, $dcd60dcf, $abd13d59, $26d930ac, $51de003a, $c8d75180, $bfd06116, $21b4f4b5, $56b3c423, $cfba9599, $b8bda50f, $2802b89e, $5f058808, $c60cd9b2, $b10be924, $2f6f7c87, $58684c11, $c1611dab, $b6662d3d, $76dc4190, $01db7106, $98d220bc, $efd5102a, $71b18589, $06b6b51f, $9fbfe4a5, $e8b8d433, $7807c9a2, $0f00f934, $9609a88e, $e10e9818, $7f6a0dbb, $086d3d2d, $91646c97, $e6635c01, $6b6b51f4, $1c6c6162, $856530d8, $f262004e, $6c0695ed, $1b01a57b, $8208f4c1, $f50fc457, $65b0d9c6, $12b7e950, $8bbeb8ea, $fcb9887c, $62dd1ddf, $15da2d49, $8cd37cf3, $fbd44c65, $4db26158, $3ab551ce, $a3bc0074, $d4bb30e2, $4adfa541, $3dd895d7, $a4d1c46d, $d3d6f4fb, $4369e96a, $346ed9fc, $ad678846, $da60b8d0, $44042d73, $33031de5, $aa0a4c5f, $dd0d7cc9, $5005713c, $270241aa, $be0b1010, $c90c2086, $5768b525, $206f85b3, $b966d409, $ce61e49f, $5edef90e, $29d9c998, $b0d09822, $c7d7a8b4, $59b33d17, $2eb40d81, $b7bd5c3b, $c0ba6cad, $edb88320, $9abfb3b6, $03b6e20c, $74b1d29a, $ead54739, $9dd277af, $04db2615, $73dc1683, $e3630b12, $94643b84, $0d6d6a3e, $7a6a5aa8, $e40ecf0b, $9309ff9d, $0a00ae27, $7d079eb1, $f00f9344, $8708a3d2, $1e01f268, $6906c2fe, $f762575d, $806567cb, $196c3671, $6e6b06e7, $fed41b76, $89d32be0, $10da7a5a, $67dd4acc, $f9b9df6f, $8ebeeff9, $17b7be43, $60b08ed5, $d6d6a3e8, $a1d1937e, $38d8c2c4, $4fdff252, $d1bb67f1, $a6bc5767, $3fb506dd, $48b2364b, $d80d2bda, $af0a1b4c, $36034af6, $41047a60, $df60efc3, $a867df55, $316e8eef, $4669be79, $cb61b38c, $bc66831a, $256fd2a0, $5268e236, $cc0c7795, $bb0b4703, $220216b9, $5505262f, $c5ba3bbe, $b2bd0b28, $2bb45a92, $5cb36a04, $c2d7ffa7, $b5d0cf31, $2cd99e8b, $5bdeae1d, $9b64c2b0, $ec63f226, $756aa39c, $026d930a, $9c0906a9, $eb0e363f, $72076785, $05005713, $95bf4a82, $e2b87a14, $7bb12bae, $0cb61b38, $92d28e9b, $e5d5be0d, $7cdcefb7, $0bdbdf21, $86d3d2d4, $f1d4e242, $68ddb3f8, $1fda836e, $81be16cd, $f6b9265b, $6fb077e1, $18b74777, $88085ae6, $ff0f6a70, $66063bca, $11010b5c, $8f659eff, $f862ae69, $616bffd3, $166ccf45, $a00ae278, $d70dd2ee, $4e048354, $3903b3c2, $a7672661, $d06016f7, $4969474d, $3e6e77db, $aed16a4a, $d9d65adc, $40df0b66, $37d83bf0, $a9bcae53, $debb9ec5, $47b2cf7f, $30b5ffe9, $bdbdf21c, $cabac28a, $53b39330, $24b4a3a6, $bad03605, $cdd70693, $54de5729, $23d967bf, $b3667a2e, $c4614ab8, $5d681b02, $2a6f2b94, $b40bbe37, $c30c8ea1, $5a05df1b, $2d02ef8d); { TIdHashCRC16 } function TIdHashCRC16.HashValue(AStream: TStream): Word; var i: Integer; Buf: byte; begin Result := 0; for i := 1 to AStream.Size do begin AStream.ReadBuffer(Buf, SizeOf(Buf)); Result := Hi(Result) xor CRC16Table[ Buf xor Lo(Result)]; end; end; { TIdHashCRC32 } function TIdHashCRC32.HashValue(AStream: TStream): LongWord; var i: Integer; LByte: Byte; begin Result := $FFFFFFFF; // Faster than a while - While would read .Size which is slow for i := 1 to AStream.Size do begin //TODO: See if this and Elf would be faster by reading into a larger buffer and scanning that //buffer. AStream.ReadBuffer(LByte, SizeOf(LByte)); Result := ((Result shr 8) and $00FFFFFF) xor CRC32Table[(Result xor LByte) and $FF]; end; Result := Result xor $FFFFFFFF; end; end.
unit fElevation; {$mode objfpc}{$H+} interface uses Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, ExtCtrls, uShowMsg; type { TfrmElevation } TfrmElevation = class(TForm) btnOK: TBitBtn; btnCancel: TBitBtn; chkElevateAll: TCheckBox; imgShield: TImage; lblText: TLabel; public function ShowModal: Integer; override; end; function ShowElevation(const ATitle, AText: String): TMyMsgResult; implementation {$R *.lfm} {$IF DEFINED(MSWINDOWS)} uses Windows, uBitmap; {$ENDIF} type TElevationData = class FResult: TMyMsgResult; FTitle, FText: String; procedure ShowElevation; public constructor Create(const ATitle, AText: String); end; function ShowElevation(const ATitle, AText: String): TMyMsgResult; begin with TElevationData.Create(ATitle, AText) do try TThread.Synchronize(nil, @ShowElevation); Result:= FResult; finally Free end; end; { TElevationData } procedure TElevationData.ShowElevation; begin with TfrmElevation.Create(Application) do try Caption:= FTitle; lblText.Caption:= FText; ShowModal; if (ModalResult <> mrOK) then begin if chkElevateAll.Checked then FResult:= mmrSkipAll else FResult:= mmrSkip end else begin if chkElevateAll.Checked then FResult:= mmrAll else FResult:= mmrOK; end; finally Free; end; end; constructor TElevationData.Create(const ATitle, AText: String); begin FText:= AText; FTitle:= ATitle; end; { TfrmElevation } function TfrmElevation.ShowModal: Integer; {$IF DEFINED(MSWINDOWS)} const IDI_SHIELD = PAnsiChar(32518); var hIcon: THandle; AIcon: Graphics.TBitmap; {$ENDIF} begin {$IF DEFINED(MSWINDOWS)} hIcon:= LoadImage(0, IDI_SHIELD, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE or LR_SHARED); if (hIcon <> 0) then begin AIcon:= BitmapCreateFromHICON(hIcon); imgShield.Picture.Assign(AIcon); AIcon.Free; end; {$ENDIF} Result:= inherited ShowModal; end; end.
{***********************************************} { TArrowSeries (derived from TPointSeries) } { Copyright (c) 1995-2004 by David Berneda } {***********************************************} unit ArrowCha; {$I TeeDefs.inc} interface { TArrowSeries derives from standard TPointSeries. Each point in the series is drawn like an Arrow. Each arrow has initial and end X,Y values that are used to draw the Arrow with its corresponding screen size. Inherits all functionality from TPointSeries and its ancestor TCustomSeries. } Uses {$IFNDEF LINUX} Windows, Messages, {$ENDIF} {$IFDEF CLX} QGraphics, Types, {$ELSE} Graphics, {$ENDIF} {$IFDEF CLR} Types, {$ENDIF} Classes, Chart, Series, TeEngine; Type //!<summary>Series to display arrows.</summary> TArrowSeries=class(TPointSeries) private FEndXValues : TChartValueList; FEndYValues : TChartValueList; { <-- Arrows end X,Y values } Procedure SetEndXValues(Value:TChartValueList); Procedure SetEndYValues(Value:TChartValueList); Function GetArrowHeight:Integer; procedure SetArrowHeight(Value:Integer); Function GetArrowWidth:Integer; procedure SetArrowWidth(Value:Integer); Function GetStartXValues:TChartValueList; Procedure SetStartXValues(Value:TChartValueList); Function GetStartYValues:TChartValueList; Procedure SetStartYValues(Value:TChartValueList); protected Procedure AddSampleValues(NumValues:Integer; OnlyMandatory:Boolean=False); override; { <-- to add random arrow values } class Function CanDoExtra:Boolean; override; { <-- for sub-gallery } class Procedure CreateSubGallery(AddSubChart:TChartSubGalleryProc); override; procedure DrawValue(ValueIndex:Integer); override; { <-- main draw method } class Function GetEditorClass:String; override; Procedure PrepareForGallery(IsEnabled:Boolean); override; public Constructor Create(AOwner: TComponent); override; Function AddArrow(Const X0,Y0,X1,Y1:Double; Const ALabel:String=''; AColor:TColor=clTeeColor):Integer; Function IsValidSourceOf(Value:TChartSeries):Boolean; override; Function MaxXValue:Double; override; Function MinXValue:Double; override; Function MaxYValue:Double; override; Function MinYValue:Double; override; published property Active; property ColorEachPoint; property ColorSource; property Cursor; property HorizAxis; property Marks; property ParentChart; property DataSource; property PercentFormat; property SeriesColor; property ShowInLegend; property Title; property ValueFormat; property VertAxis; property XLabelsSource; { events } property AfterDrawValues; property BeforeDrawValues; property OnAfterAdd; property OnBeforeAdd; property OnClearValues; property OnClick; property OnDblClick; property OnGetMarkText; property OnMouseEnter; property OnMouseLeave; property ArrowHeight:Integer read GetArrowHeight write SetArrowHeight stored False; property ArrowWidth:Integer read GetArrowWidth write SetArrowWidth stored False; property EndXValues:TChartValueList read FEndXValues write SetEndXValues; property EndYValues:TChartValueList read FEndYValues write SetEndYValues; property StartXValues:TChartValueList read GetStartXValues write SetStartXValues; property StartYValues:TChartValueList read GetStartYValues write SetStartYValues; end; implementation Uses Math, SysUtils, TeeProcs, TeeConst, TeCanvas; type TValueListAccess=class(TChartValueList); { TArrowSeries } Constructor TArrowSeries.Create(AOwner: TComponent); Begin inherited; CalcVisiblePoints:=False; TValueListAccess(XValues).InitDateTime(True); FEndXValues :=TChartValueList.Create(Self,TeeMsg_ValuesArrowEndX); TValueListAccess(FEndXValues).InitDateTime(True); FEndYValues :=TChartValueList.Create(Self,TeeMsg_ValuesArrowEndY); Pointer.InflateMargins:=False; Marks.Frame.Hide; Marks.Transparent:=True; end; Procedure TArrowSeries.SetEndXValues(Value:TChartValueList); Begin SetChartValueList(FEndXValues,Value); { standard method } end; Procedure TArrowSeries.SetEndYValues(Value:TChartValueList); Begin SetChartValueList(FEndYValues,Value); { standard method } end; { Helper method, special to Arrow series } Function TArrowSeries.AddArrow( Const X0,Y0,X1,Y1:Double; Const ALabel:String; AColor:TColor):Integer; Begin FEndXValues.TempValue:=X1; FEndYValues.TempValue:=Y1; result:=AddXY(X0,Y0,ALabel,AColor); end; Procedure TArrowSeries.AddSampleValues(NumValues:Integer; OnlyMandatory:Boolean=False); Var tmpDifX : Integer; tmpDifY : Integer; t : Integer; tmpX0 : Double; tmpY0 : Double; Begin With RandomBounds(NumValues) do begin tmpDifY:=Round(DifY); tmpDifX:=Round(StepX*NumValues); for t:=1 to NumValues do { some sample values to see something in design mode } Begin tmpX0:=tmpX+RandomValue(tmpDifX); tmpY0:=MinY+RandomValue(tmpDifY); AddArrow( tmpX0,tmpY0, tmpX0+RandomValue(tmpDifX), { X1 } tmpY0+RandomValue(tmpDifY) { Y1 } ); end; end; end; Function TArrowSeries.GetArrowWidth:Integer; Begin result:=Pointer.HorizSize; end; Function TArrowSeries.GetArrowHeight:Integer; Begin result:=Pointer.VertSize; end; procedure TArrowSeries.SetArrowWidth(Value:Integer); Begin Pointer.HorizSize:=Value; End; procedure TArrowSeries.SetArrowHeight(Value:Integer); Begin Pointer.VertSize:=Value; End; procedure TArrowSeries.DrawValue(ValueIndex:Integer); Var p0 : TPoint; p1 : TPoint; tmpColor : TColor; Begin { This overrided method is the main paint for Arrow points. } P0.x:=CalcXPos(ValueIndex); P0.y:=CalcYPos(ValueIndex); P1.x:=CalcXPosValue(EndXValues.Value[ValueIndex]); P1.y:=CalcYPosValue(EndYValues.Value[ValueIndex]); tmpColor:=ValueColor[ValueIndex]; With ParentChart do begin if View3D then Pointer.PrepareCanvas(Canvas,tmpColor) else Canvas.AssignVisiblePenColor(Pointer.Pen,tmpColor); Canvas.Arrow(View3D,P0,P1,Pointer.HorizSize,Pointer.VertSize,MiddleZ); end; end; Function TArrowSeries.MaxXValue:Double; Begin result:=Math.Max(inherited MaxXValue,FEndXValues.MaxValue); end; Function TArrowSeries.MinXValue:Double; Begin result:=Math.Min(inherited MinXValue,FEndXValues.MinValue); end; Function TArrowSeries.MaxYValue:Double; Begin result:=Math.Max(inherited MaxYValue,FEndYValues.MaxValue); end; Function TArrowSeries.MinYValue:Double; Begin result:=Math.Min(inherited MinYValue,FEndYValues.MinValue); end; class Function TArrowSeries.GetEditorClass:String; Begin result:='TArrowSeriesEditor'; { <-- dont translate ! } end; Function TArrowSeries.GetStartXValues:TChartValueList; Begin result:=XValues; End; Procedure TArrowSeries.SetStartXValues(Value:TChartValueList); Begin SetXValues(Value); End; Function TArrowSeries.GetStartYValues:TChartValueList; Begin result:=YValues; End; Procedure TArrowSeries.SetStartYValues(Value:TChartValueList); Begin SetYValues(Value); End; Procedure TArrowSeries.PrepareForGallery(IsEnabled:Boolean); Begin inherited; FillSampleValues(3); ArrowWidth :=12; ArrowHeight:=12; if not IsEnabled then SeriesColor:=clSilver; end; Function TArrowSeries.IsValidSourceOf(Value:TChartSeries):Boolean; begin result:=Value is TArrowSeries; end; class procedure TArrowSeries.CreateSubGallery(AddSubChart: TChartSubGalleryProc); begin inherited; end; // For sub-gallery only. Arrow series do not allow sub-styles. class function TArrowSeries.CanDoExtra: Boolean; begin result:=False; end; initialization RegisterTeeSeries(TArrowSeries, {$IFNDEF CLR}@{$ENDIF}TeeMsg_GalleryArrow, {$IFNDEF CLR}@{$ENDIF} {$IFDEF TEELITE}TeeMsg_GalleryStandard{$ELSE}TeeMsg_GalleryExtended{$ENDIF},2); end.
unit MainForm; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, System.Hash, IdHashMessageDigest; type TForm1 = class(TForm) btnIndyMD5: TButton; memInput: TMemo; memOutput: TMemo; btnDM5: TButton; Button1: TButton; Button2: TButton; procedure btnIndyMD5Click(Sender: TObject); procedure btnDM5Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function IndyMD5Str(const Value: string): string; var MD5 : TIdHashMessageDigest5; begin MD5 := TIdHashMessageDigest5.Create; try Result := MD5.HashStringAsHex(Value); finally MD5.Free; end; end; procedure TForm1.btnDM5Click(Sender: TObject); begin memOutput.Text := THashMD5.GetHashString(memInput.Text); end; procedure TForm1.btnIndyMD5Click(Sender: TObject); begin memOutput.Text := IndyMD5Str(memInput.Text); end; procedure TForm1.Button1Click(Sender: TObject); begin memOutput.Text := THashSHA1.GetHashString(memInput.Text); end; procedure TForm1.Button2Click(Sender: TObject); begin memOutput.Text := THashSHA2.GetHashString(memInput.Text); end; end.
{ Oracle Deploy System ver.1.0 (ORDESY) by Volodymyr Sedler aka scribe 2016 Desc: wrap/deploy/save objects of oracle database. No warranty of using this program. Just Free. With bugs, suggestions please write to justscribe@yahoo.com On Github: github.com/justscribe/ORDESY Dialog for editing database item, not body! } unit uItemOptions; interface uses // ORDESY Modules uORDESY, uErrorHandle, // Delphi Modules Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TfmItemOptions = class(TForm) gbxName: TGroupBox; edtName: TEdit; gbxInfo: TGroupBox; lbxBase: TListBox; lblBase: TLabel; lbxScheme: TListBox; lblScheme: TLabel; gbxTypeInfo: TGroupBox; cbxType: TComboBox; lblType: TLabel; chbxValid: TCheckBox; edtHash: TEdit; lblHash: TLabel; pnlSystem: TPanel; btnSave: TButton; btnCancel: TButton; btnFolder: TButton; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure btnSaveClick(Sender: TObject); private procedure VisualizeItemType(aType: TOraItemType); procedure LoadBases(aItem: TOraItem); procedure LoadSchemes(aItem: ToraItem); end; function ShowItemOptionsDialog(aItem: TOraItem): boolean; implementation {$R *.dfm} function ShowItemOptionsDialog(aItem: TOraItem): boolean; begin with TfmItemOptions.Create(Application) do try Result:= false; edtName.Text:= aItem.Name; chbxValid.Checked:= aItem.Valid; VisualizeItemType(aItem.ItemType); LoadBases(aItem); LoadSchemes(aItem); edtHash.Text:= inttostr(aItem.Hash); if ShowModal = mrOk then begin aItem.Name:= edtName.Text; aItem.ItemType:= TOraItem.GetItemType(cbxType.Items.Strings[cbxType.ItemIndex]); aItem.BaseId:= TOraBase(lbxBase.Items.Objects[lbxBase.ItemIndex]).Id; aItem.SchemeId:= TOraScheme(lbxScheme.Items.Objects[lbxScheme.ItemIndex]).Id; end; Result:= true; finally Free; end; end; procedure TfmItemOptions.btnSaveClick(Sender: TObject); begin if (edtName.Text = '') or (Length(edtName.Text) > 255) then ModalResult:= mrNone; end; procedure TfmItemOptions.FormClose(Sender: TObject; var Action: TCloseAction); begin Action:= caFree; end; procedure TfmItemOptions.LoadBases(aItem: TOraItem); var iProjectList: TORDESYProjectList; i: integer; begin try lbxBase.Items.BeginUpdate; lbxBase.Clear; iProjectList:= TORDESYProjectList(TORDESYProject(TORDESYModule(aItem.ModuleRef).ProjectRef).ProjectListRef); for i := 0 to iProjectList.OraBaseCount - 1 do lbxBase.AddItem(iProjectList.GetOraBaseNameByIndex(i), iProjectList.GetOraBaseByIndex(i)); for i := 0 to lbxBase.Count - 1 do if TOraBase(lbxBase.Items.Objects[i]).Id = aItem.BaseId then lbxBase.ItemIndex:= i; lbxBase.Items.EndUpdate; except on E: Exception do HandleError([ClassName, 'LoadBases', E.Message]); end; end; procedure TfmItemOptions.LoadSchemes(aItem: TOraItem); var iProjectList: TORDESYProjectList; i: integer; begin try lbxScheme.Items.BeginUpdate; lbxScheme.Clear; iProjectList:= TORDESYProjectList(TORDESYProject(TORDESYModule(aItem.ModuleRef).ProjectRef).ProjectListRef); for i := 0 to iProjectList.OraSchemeCount - 1 do lbxScheme.AddItem(iProjectList.GetOraSchemeLoginByIndex(i), iProjectList.GetOraSchemeByIndex(i)); for i := 0 to lbxScheme.Count - 1 do if TOraScheme(lbxScheme.Items.Objects[i]).Id = aItem.SchemeId then lbxScheme.ItemIndex:= i; lbxScheme.Items.EndUpdate; except on E: Exception do HandleError([ClassName, 'LoadSchemes', E.Message]); end; end; procedure TfmItemOptions.VisualizeItemType(aType: TOraItemType); begin case aType of OraProcedure: cbxType.ItemIndex:= 0; OraFunction: cbxType.ItemIndex:= 1; OraPackage: cbxType.ItemIndex:= 2 else cbxType.ItemIndex:= 0; end; end; end.
unit AES_XTS; (************************************************************************* DESCRIPTION : AES XTS mode functions REQUIREMENTS : TP5-7, D1-D7/D9-D10/D12, FPC, VP EXTERNAL DATA : --- MEMORY USAGE : --- DISPLAY MODE : --- REMARKS : 1. The IV and buf fields of the main contexts are used for temparary buffers. Tweak context IV holds enc(tweak)*a^j. 2. Quote from the IEEE Draft: "Attention is called to the possibility that implementation of this standard may require use of subject matter covered by patent rights." Before using this source/mode read the patent section in legal.txt! REFERENCES : [1] IEEE P1619, Draft Standard for Cryptographic Protection of Data on Block-Oriented Storage Devices. Available from http://ieee-p1619.wetpaint.com/page/IEEE+Project+1619+Home Version Date Author Modification ------- -------- ------- ------------------------------------------ 0.10 23.09.07 we Initial version like ECB (BP7+, encrypt) 0.11 24.09.07 we BP7+ decrypt 0.12 24.09.07 we TP5-TP6 0.13 27.09.07 we ILen now longint 0.14 27.09.07 we Check ILen+ofs if BIT16 and $R+ 0.15 16.11.08 we Use Ptr2Inc from BTypes 0.16 27.07.10 we AES_Err_Invalid_16Bit_Length **************************************************************************) (*------------------------------------------------------------------------- (C) Copyright 2007-2010 Wolfgang Ehrhardt This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ----------------------------------------------------------------------------*) {$i STD.INC} interface uses BTypes, AES_Type, AES_Base, AES_Encr, AES_Decr; type TAES_XTSContext = packed record main : TAESContext; {Main context} tweak: TAESContext; {Tweak context} end; function AES_XTS_Init_Encr({$ifdef CONST}const{$else}var{$endif} K1,K2; KBits: word; var ctx: TAES_XTSContext): integer; {-Init XTS encrypt context (key expansion), error if invalid key size} {$ifdef DLL} stdcall; {$endif} function AES_XTS_Encrypt(ptp, ctp: Pointer; ILen: longint; {$ifdef CONST}const{$else}var{$endif} twk: TAESBlock; var ctx: TAES_XTSContext): integer; {-Encrypt data unit of ILen bytes from ptp^ to ctp^ in XTS mode, twk: tweak of data unit} {$ifdef DLL} stdcall; {$endif} function AES_XTS_Init_Decr({$ifdef CONST}const{$else}var{$endif} K1,K2; KBits: word; var ctx: TAES_XTSContext): integer; {-Init XTS decrypt context (key expansion), error if invalid key size} {$ifdef DLL} stdcall; {$endif} function AES_XTS_Decrypt(ctp, ptp: Pointer; ILen: longint; {$ifdef CONST}const{$else}var{$endif} twk: TAESBlock; var ctx: TAES_XTSContext): integer; {-Decrypt data unit of ILen bytes from ptp^ to ctp^ in XTS mode, twk: tweak of data unit} {$ifdef DLL} stdcall; {$endif} implementation {---------------------------------------} procedure mul_a(var T: TAESBlock); {-Multiply tweak block by the primitive element a from GF(2^128)} var i: integer; cin,cout: byte; const masks: array[0..1] of byte = (0,$87); begin cin := 0; {Turn off range checking for byte shifts} {$ifopt R+} {$define SetRPlus} {$else} {$undef SetRPlus} {$endif} {$R-} for i:=0 to AESBLKSIZE-1 do begin cout := T[i] shr 7; T[i] := (T[i] shl 1) or cin; cin := cout; end; T[0] := T[0] xor masks[cin]; {$ifdef SetRPlus} {$R+} {$endif} end; {---------------------------------------------------------------------------} function AES_XTS_Init_Encr({$ifdef CONST}const{$else}var{$endif} K1,K2; KBits: word; var ctx: TAES_XTSContext): integer; {-Init XTS encrypt context (key expansion), error if invalid key size} var err: integer; begin fillchar(ctx, sizeof(ctx), 0); err := AES_Init(K1, KBits, ctx.main); if err=0 then err := AES_Init(K2, KBits, ctx.tweak); AES_XTS_Init_Encr := err; end; {---------------------------------------------------------------------------} function AES_XTS_Init_Decr({$ifdef CONST}const{$else}var{$endif} K1,K2; KBits: word; var ctx: TAES_XTSContext): integer; {-Init XTS decrypt context (key expansion), error if invalid key size} {$ifdef DLL} stdcall; {$endif} var err: integer; begin fillchar(ctx, sizeof(ctx), 0); err := AES_Init_Decr(K1, KBits, ctx.main); if err=0 then err := AES_Init(K2, KBits, ctx.tweak); AES_XTS_Init_Decr := err; end; {---------------------------------------------------------------------------} function AES_XTS_Encrypt(ptp, ctp: Pointer; ILen: longint; {$ifdef CONST}const{$else}var{$endif} twk: TAESBlock; var ctx: TAES_XTSContext): integer; {-Encrypt data unit of ILen bytes from ptp^ to ctp^ in XTS mode, twk: tweak of data unit} var i,n: longint; m: word; begin AES_XTS_Encrypt := 0; if ILen<0 then ILen := 0; if ctx.main.Decrypt<>0 then begin AES_XTS_Encrypt := AES_Err_Invalid_Mode; exit; end; if (ptp=nil) or (ctp=nil) then begin if ILen>0 then begin AES_XTS_Encrypt := AES_Err_NIL_Pointer; exit; end; end; {$ifdef BIT16} if (ILen+ofs(ptp^) > $FFFF) or (ILen+ofs(ctp^) > $FFFF) then begin AES_XTS_Encrypt := AES_Err_Invalid_16Bit_Length; exit; end; {$endif} n := ILen div AESBLKSIZE; {Full blocks} m := ILen mod AESBLKSIZE; {Remaining bytes in short block} if m<>0 then begin if n=0 then begin AES_XTS_Encrypt := AES_Err_Invalid_Length; exit; end; dec(n); {CTS: special treatment of last TWO blocks} end; {encrypt the tweak twk, tweak.IV = enc(twk)} AES_Encrypt(ctx.tweak, twk, ctx.tweak.IV); with ctx.main do begin {process full blocks} for i:=1 to n do begin AES_XorBlock(PAESBlock(ptp)^, ctx.tweak.IV, buf); AES_Encrypt(ctx.main, buf, buf); AES_XorBlock(buf, ctx.tweak.IV, PAESBlock(ctp)^); mul_a(ctx.tweak.IV); inc(Ptr2Inc(ptp),AESBLKSIZE); inc(Ptr2Inc(ctp),AESBLKSIZE); end; if m<>0 then begin {Cipher text stealing, encrypt last full plaintext block} AES_XorBlock(PAESBlock(ptp)^, ctx.tweak.IV, buf); AES_Encrypt(ctx.main, buf, buf); AES_XorBlock(buf, ctx.tweak.IV, buf); mul_a(ctx.tweak.IV); inc(Ptr2Inc(ptp),AESBLKSIZE); {pad and encrypt final short block} IV := buf; move(PAESBlock(ptp)^, IV, m); AES_XorBlock(IV, ctx.tweak.IV, IV); AES_Encrypt(ctx.main, IV, IV); AES_XorBlock(IV, ctx.tweak.IV, PAESBlock(ctp)^); inc(Ptr2Inc(ctp),AESBLKSIZE); move(buf,PAESBlock(ctp)^,m); end; end; end; {---------------------------------------------------------------------------} function AES_XTS_Decrypt(ctp, ptp: Pointer; ILen: longint; {$ifdef CONST}const{$else}var{$endif} twk: TAESBlock; var ctx: TAES_XTSContext): integer; {-Decrypt data unit of ILen bytes from ptp^ to ctp^ in XTS mode, twk: tweak of data unit} var i,n: longint; m: word; begin AES_XTS_Decrypt := 0; if ILen<0 then ILen := 0; if ctx.main.Decrypt=0 then begin AES_XTS_Decrypt := AES_Err_Invalid_Mode; exit; end; if (ptp=nil) or (ctp=nil) then begin if ILen>0 then begin AES_XTS_Decrypt := AES_Err_NIL_Pointer; exit; end; end; {$ifdef BIT16} if (ILen+ofs(ptp^) > $FFFF) or (ILen+ofs(ctp^) > $FFFF) then begin AES_XTS_Decrypt := AES_Err_Invalid_16Bit_Length; exit; end; {$endif} n := ILen div AESBLKSIZE; {Full blocks} m := ILen mod AESBLKSIZE; {Remaining bytes in short block} if m<>0 then begin if n=0 then begin AES_XTS_Decrypt := AES_Err_Invalid_Length; exit; end; dec(n); {CTS: special treatment of last TWO blocks} end; {encrypt the tweak twk, tweak.IV = enc(twk)} AES_Encrypt(ctx.tweak, twk, ctx.tweak.IV); with ctx.main do begin for i:=1 to n do begin AES_XorBlock(PAESBlock(ctp)^, ctx.tweak.IV, buf); AES_Decrypt(ctx.main, buf, buf); AES_XorBlock(buf, ctx.tweak.IV, PAESBlock(ptp)^); mul_a(ctx.tweak.IV); inc(Ptr2Inc(ptp),AESBLKSIZE); inc(Ptr2Inc(ctp),AESBLKSIZE); end; if m<>0 then begin {Cipher text stealing, "increment" tweak because} {final short plaintext is padded in this block} IV := ctx.tweak.IV; mul_a(IV); {Decrypt last full ciphertext block <-> final short plaintext} AES_XorBlock(PAESBlock(ctp)^, IV, buf); AES_Decrypt(ctx.main, buf, buf); AES_XorBlock(buf, IV, buf); inc(Ptr2Inc(ctp),AESBLKSIZE); {pad and decrypt short CT block to last full PT block} IV := buf; move(PAESBlock(ctp)^, IV, m); AES_XorBlock(IV, ctx.tweak.IV, IV); AES_Decrypt(ctx.main, IV, IV); AES_XorBlock(IV, ctx.tweak.IV, PAESBlock(ptp)^); inc(Ptr2Inc(ptp),AESBLKSIZE); move(buf,PAESBlock(ptp)^,m); end; end; end; end.
unit Finance.Currency; interface uses Finance.interfaces, System.JSON; type TFinanceCurrency = class(TInterfacedObject, iFinanceCurrency) private FParent : iFinanceCurrencies; FCode : string; FName : string; FBuy : string; FSell : string; FVariation : string; public constructor Create (Parent : iFinanceCurrencies); destructor Destroy; override; function Code : string; overload; function Name : string; overload; function Buy : string; overload; function Sell : string; overload; function Variation : string; overload; function Code (value : string) : iFinanceCurrency; overload; function Name (value : string) : iFinanceCurrency; overload; function Buy (value : string) : iFinanceCurrency; overload; function Sell (value : string) : iFinanceCurrency; overload; function Variation (value : string) : iFinanceCurrency; overload; function &End : iFinanceCurrencies; function SetJSON( value : TJSONPair) : iFinanceCurrency; function getJSON : TJSONObject; end; implementation uses Injection, System.Generics.Collections; { TFinanceCurrency } function TFinanceCurrency.Buy: string; begin Result := FBuy; end; function TFinanceCurrency.Buy(value: string): iFinanceCurrency; begin Result := Self; FBuy := value; end; function TFinanceCurrency.Code(value: string): iFinanceCurrency; begin Result := Self; FCode := value; end; function TFinanceCurrency.Code: string; begin Result := FCode; end; constructor TFinanceCurrency.Create(Parent: iFinanceCurrencies); begin TInjection.Weak(@FParent, Parent); end; destructor TFinanceCurrency.Destroy; begin inherited; end; function TFinanceCurrency.&End: iFinanceCurrencies; begin Result := FParent; end; function TFinanceCurrency.getJSON: TJSONObject; var JSONObject : TJSONObject; begin JSONObject := TJSONObject.Create; JSONObject.AddPair( 'Code', TJSONString.Create(FCode)); JSONObject.AddPair( 'Name', TJSONString.Create(FName)); JSONObject.AddPair( 'Buy', TJSONString.Create(FBuy)); JSONObject.AddPair( 'Sell', TJSONString.Create(FSell)); JSONObject.AddPair( 'Variation', TJSONString.Create(FVariation)); Result := JSONObject; end; function TFinanceCurrency.Name(value: string): iFinanceCurrency; begin Result := Self; FName := value; end; function TFinanceCurrency.Name: string; begin Result := FName; end; function TFinanceCurrency.Sell(value: string): iFinanceCurrency; begin Result := Self; FSell := value; end; function TFinanceCurrency.SetJSON(value: TJSONPair): iFinanceCurrency; var JSONCurrency : TJSONObject; begin Result := Self; FCode := value.JsonString.Value; JSONCurrency := value.JsonValue as TJSONObject; FName := JSONCurrency.Pairs[0].JsonValue.Value; FBuy := JSONCurrency.Pairs[1].JsonValue.Value; FSell := JSONCurrency.Pairs[2].JsonValue.Value; FVariation := JSONCurrency.Pairs[3].JsonValue.Value; end; function TFinanceCurrency.Sell: string; begin Result := FSell; end; function TFinanceCurrency.Variation(Value: string): iFinanceCurrency; begin Result := Self; FVariation := Value end; function TFinanceCurrency.Variation: string; begin Result := FVariation; end; end.
unit kwicDescriptor; interface uses nxllStreams, nxsdDataDictionaryFullText; type (* TnxKwicDescriptor = class; TnxKwicDescriptorclass = class of TnxKwicDescriptor; TnxKwicTokenExtractor = class; TnxKwicTokenExtractorclass = class of TnxKwicTokenExtractor; *) TnxKwicTokenExtractorDescriptor = class(TnxFieldTokenExtractorDescriptor) protected {private} kcedKeywordSeparator : WideString; procedure SetkcedKeywordSeparator(aSeparator: WideString); public procedure SaveToWriter(aWriter: TnxWriter; aClientVersion: Integer); override; procedure LoadFromReader(aReader: TnxReader); override; property KeywordSeparator: WideString read kcedKeywordSeparator write SetkcedKeywordSeparator; end; implementation uses nxllBde; { TnxKwicTokenExtractorDescriptor } procedure TnxKwicTokenExtractorDescriptor.LoadFromReader(aReader: TnxReader); var Version: integer; begin inherited; Version := aReader.ReadInteger; if Version <> 1 then raise EnxFulltextIndexDescriptorException.nxCreate(DBIERR_NX_INCOMPATSTREAM); end; procedure TnxKwicTokenExtractorDescriptor.SaveToWriter(aWriter: TnxWriter; aClientVersion: Integer); begin inherited; aWriter.WriteInteger(1); end; procedure TnxKwicTokenExtractorDescriptor.SetkcedKeywordSeparator( aSeparator: WideString); begin kcedKeywordSeparator := aSeparator; end; initialization TnxKwicTokenExtractorDescriptor.Register(); finalization TnxKwicTokenExtractorDescriptor.Unregister; end.
{ Ultibo Custom Font Creator. Copyright (C) 2016 - Kerry Shipman. Licence ======= LGPLv2.1 with static linking exception (See COPYING.modifiedLGPL.txt) Credits ======= Parts and pieces for this program were found on many blogs and forum posts. Many thanks to the great Delphi and ObjectPascal community. Windows Fonts ============= Please note this program will export any Windows font in any selected size as a fixed width font in a simple text based file format with a .ufnt extension. The file may be parsed using the standard TIniFiles interface. These are intended to be used with the Ultibo.org Raspberry Pi project. NOTE: Please respect all font copyright restrictions when exporting fonts for embedded use in your Ultibo application. Not all fonts, including some free ones, allow for use in embedded systems. } unit Unit1; {$mode objfpc}{$H+} interface uses Windows, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Spin; type TFontType = (ftRaster, ftDevice, ftTrueType); TFontInfo = class private FShortName : string; FFullName : string; FStyle : string; FLF : TLogFont; FFontType : TFontType; FTM : TNewTextMetric; public property FullName : string read FFullName ; property ShortName : string read FShortName; property Style : string read FStyle ; property FontType : TFontType read FFontType ; property TM : TNewTextMetric read FTM ; property LF : TLogFont read FLF ; end; TFontList = class private procedure ClearList; procedure AddFont(EnumLogFont: TEnumLogFont; TextMetric: TNewTextMetric; FontType: Integer); public List : TStringList; constructor Create; destructor Destroy; override; procedure RefreshFontInfo; end; { TFontList } { TForm1 } TForm1 = class(TForm) btnExport: TButton; cbFont: TComboBox; cbUFontMode: TComboBox; cbUFontType: TComboBox; edMaxFWidth: TEdit; edFHeight: TEdit; Image1: TImage; Label1: TLabel; Label10: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; lbH: TLabel; lbH1: TLabel; lbW: TLabel; lbChar: TLabel; lbW1: TLabel; Memo1: TMemo; mmoData: TMemo; mmoSample: TMemo; seFontSize: TSpinEdit; seChar: TSpinEdit; Timer1: TTimer; Timer2: TTimer; Timer3: TTimer; procedure btnDrawCharClick(Sender: TObject); procedure btnExportClick(Sender: TObject); procedure cbFontChange(Sender: TObject); procedure FormCreate(Sender: TObject); procedure seCharChange(Sender: TObject); procedure seFontSizeChange(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Timer2Timer(Sender: TObject); procedure Timer3Timer(Sender: TObject); private { private declarations } public { public declarations } procedure GetFontDim; procedure DrawChar(code: byte); procedure GetCharData; procedure DrawCharExp(code: byte); procedure GetCharDataExp; procedure CharExport; end; var Form1: TForm1; TexWidth, TexHeight: integer; FileName: string; ExpChar: byte; doExport, doSave, inExport: boolean; implementation {$R *.lfm} { TForm1 } procedure TForm1.GetCharData; var s: string; x, y, w, h, z: integer; begin w := lbChar.Width - 1; h := lbChar.Height - 1; s := 'w = ' + IntToStr(lbChar.Width) + ', h = ' + IntToStr(lbChar.Height); mmoData.Lines.Add(s); s := ''; for y := 0 to h do begin for x := 0 to w do begin z := lbChar.Canvas.Pixels[x, y]; if z = clWhite then s := s + '0' else s := s + '1'; end; mmoData.Lines.Add(s); s := ''; end; end; procedure TForm1.GetCharDataExp; var s: string; x, y, w, h, z: integer; begin w := lbChar.Width - 1; h := lbChar.Height - 1; s:='[S' + IntToStr(ExpChar) + ']'; mmoData.Lines.AddStrings(s); s := 'Width=' + IntToStr(lbChar.Width); mmoData.Lines.Add(s); s := 'Height=' + IntToStr(lbChar.Height); mmoData.Lines.Add(s); s:='[C' + IntToStr(ExpChar) + ']'; mmoData.Lines.Add(s); s:=''; for y := 0 to h do begin for x := 0 to w do begin z := lbChar.Canvas.Pixels[x, y]; if z = clWhite then s := s + '0' else s := s + '1'; end; mmoData.Lines.Add(s); s := ''; end; end; procedure TForm1.DrawChar(code: byte); Var S:string; begin S := Chr(code); lbChar.Width := TexWidth; lbChar.Height := TexHeight; lbChar.Caption:=S; lbW.Caption:=IntToStr(lbChar.Width); lbH.Caption:=IntToStr(lbChar.Height); mmoData.Clear; Timer1.Enabled:=true; end; procedure TForm1.DrawCharExp(code: byte); Var S:string; begin S := Chr(code); lbChar.Width := TexWidth; lbChar.Height := TexHeight; lbChar.Caption:=S; lbW.Caption:=IntToStr(lbChar.Width); lbH.Caption:=IntToStr(lbChar.Height); Timer2.Enabled:=true; end; procedure TForm1.GetFontDim; var w, h, maxw, maxh: integer; x: byte; s: string; begin maxw := 0; maxh := 0; w := 0; h := 0; with Image1.Canvas do begin for x := 0 to 255 do begin s := Chr(x); w := TextWidth(s); h := TextHeight(s); if w > maxw then maxw := w; if h > maxh then maxh := h; end; end; edMaxFWidth.Text:= IntToStr(maxw); edFHeight.Text:= IntToStr(maxh); TexWidth := maxw; TexHeight := maxh; lbChar.Width:= maxw; lbChar.Height:= maxh; Image1.Width:= maxw; Image1.Height:= maxh; end; procedure TForm1.FormCreate(Sender: TObject); var FontList : TFontList; begin cbFont.Clear; FontList := TFontList.Create; try FontList.RefreshFontInfo; cbFont.Items.AddStrings(FontList.List); finally FontList.Free; end; cbFont.ItemIndex:= cbFont.Items.IndexOf('Arial'); mmoSample.Font.Name:=cbFont.Text; mmoSample.Font.Size:=seFontSize.Value; mmoSample.Repaint; Image1.Canvas.Font.Name:=cbFont.Text; Image1.Canvas.Font.Size:=seFontSize.Value; lbChar.Font.Name:=cbFont.Text; lbChar.Font.Size:=seFontSize.Value; lbChar.Font.Quality:=fqNonAntialiased; GetFontDim; lbChar.Width:= TexWidth; lbChar.Height:= TexHeight; Image1.Width:=TexWidth; Image1.Height:=TexHeight; Image1.Canvas.Font.Color:=clWhite; DrawChar(seChar.Value); end; procedure TForm1.seCharChange(Sender: TObject); var c: byte; begin if inExport = false then begin c := byte(seChar.Value); DrawChar(c); end; end; procedure TForm1.seFontSizeChange(Sender: TObject); begin mmoSample.Font.Name:=cbFont.Text; mmoSample.Font.Size:=seFontSize.Value; mmoSample.Repaint; Image1.Canvas.Font.Name:=cbFont.Text; Image1.Canvas.Font.Size:=seFontSize.Value; GetFontDim; lbChar.Font.Name:=cbFont.Text; lbChar.Font.Size:=seFontSize.Value; lbChar.Width:= TexWidth; lbChar.Height:= TexHeight; DrawChar(seChar.Value); end; procedure TForm1.Timer1Timer(Sender: TObject); begin GetCharData; Timer1.Enabled:=false; end; procedure TForm1.Timer2Timer(Sender: TObject); begin Timer2.Enabled:=false; GetCharDataExp; end; procedure TForm1.Timer3Timer(Sender: TObject); begin Timer3.Enabled:=false; CharExport; end; procedure TForm1.cbFontChange(Sender: TObject); begin mmoSample.Font.Name:=cbFont.Text; mmoSample.Font.Size:=seFontSize.Value; mmoSample.Repaint; Image1.Canvas.Font.Name:=cbFont.Text; Image1.Canvas.Font.Size:=seFontSize.Value; GetFontDim; lbChar.Font.Name:=cbFont.Text; lbChar.Font.Size:=seFontSize.Value; lbChar.Font.Quality:= fqNonAntialiased; lbChar.Width:= TexWidth; lbChar.Height:= TexHeight; DrawChar(seChar.Value); end; procedure TForm1.btnDrawCharClick(Sender: TObject); var c: byte; begin c := byte(seChar.Value); DrawChar(c); end; procedure TForm1.CharExport; begin if ((doExport) or (doSave)) and (ExpChar < 255) then ExpChar:= ExpChar + 1; if (doExport = false) and (ExpChar = 0) then doExport := true; Timer3.Enabled:=false; if doSave then begin doSave := false; mmoData.Lines.SaveToFile(FileName); inExport := false; cbFont.Enabled := true; seFontSize.Enabled := true; exit; end; if ExpChar = 255 then begin doExport := false; doSave := true; end; seChar.Value:= ExpChar; DrawCharExp(ExpChar); if doExport or doSave then Timer3.Enabled:=true; end; procedure TForm1.btnExportClick(Sender: TObject); var s: string; begin inExport := true; cbFont.Enabled:=false; seFontSize.Enabled:=false; doSave := false; FileName := Application.Location + cbFont.Text + '_' + seFontSize.Text + '.ufnt'; mmoData.Clear; mmoData.Lines.Add('[Font]'); s := 'FontName=' + cbFont.Text + '_' + seFontSize.Text; mmoData.Lines.Add(s); mmoData.Lines.Add('Mode=1Bpp'); mmoData.Lines.Add('Type=Fixed'); s := 'Width=' + IntToStr(TexWidth); mmoData.Lines.Add(s); s := 'Height=' + IntToStr(TexHeight); mmoData.Lines.Add(s); ExpChar := 0; Timer3.Enabled:=true; end; constructor TFontList.Create; begin inherited Create; List := TStringList.Create; List.Sorted := True; end; destructor TFontList.Destroy; begin ClearList; inherited Destroy; end; procedure TFontList.ClearList; begin while List.Count > 0 do begin TFontInfo(List.Objects[0]).Free; List.Delete(0); end; end; function EnumFontsProc(var EnumLogFont: TEnumLogFont; var TextMetric: TNewTextMetric; FontType: Integer; Data: LPARAM): Integer; stdcall; var FontList : TFontList; begin FontList := TFontList(Data); FontList.AddFont(EnumLogFont, TextMetric, FontType); Result := 1; end; procedure TFontList.AddFont(EnumLogFont: TEnumLogFont; TextMetric: TNewTextMetric; FontType: Integer); var FI : TFontInfo; begin FI := TFontInfo.Create; FI.FShortName := StrPas(EnumLogFont.elfLogFont.lfFaceName); FI.FFullName := StrPas(EnumLogFont.elfFullName); FI.FStyle := StrPas(EnumLogFont.elfStyle); FI.FLF := EnumLogFont.elfLogFont; case FontType of RASTER_FONTTYPE : FI.FFontType := ftRaster; DEVICE_FONTTYPE : FI.FFontType := ftDevice; TRUETYPE_FONTTYPE : FI.FFontType := ftTrueType; end; FI.FTM := TextMetric; List.AddObject(FI.FShortName, FI); end; procedure TFontList.RefreshFontInfo; var DC: HDC; begin ClearList; DC := GetDC(0); try EnumFontFamilies(DC, nil, @EnumFontsProc, PtrUInt(Self)); finally ReleaseDC(0, DC); end; end; end.
unit ufrmSysPermissionSource; interface {$I ThsERP.inc} uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, StrUtils, Vcl.AppEvnts, Vcl.Menus, Vcl.Samples.Spin, Ths.Erp.Helper.Edit, Ths.Erp.Helper.Memo, Ths.Erp.Helper.ComboBox, ufrmBase, ufrmBaseInputDB, Ths.Erp.Database.Table.SysPermissionSourceGroup; type TfrmSysPermissionSource = class(TfrmBaseInputDB) cbbSourceGroup: TComboBox; edtSourceCode: TEdit; edtSourceName: TEdit; lblSourceCode: TLabel; lblSourceGroup: TLabel; lblSourceName: TLabel; destructor Destroy; override; procedure FormCreate(Sender: TObject);override; procedure Repaint(); override; procedure RefreshData();override; private vpSourceGroup: TSysPermissionSourceGroup; public protected published procedure FormShow(Sender: TObject); override; procedure btnAcceptClick(Sender: TObject); override; end; implementation uses Ths.Erp.Database.Table.SysPermissionSource; {$R *.dfm} procedure TfrmSysPermissionSource.btnAcceptClick(Sender: TObject); begin if (FormMode = ifmNewRecord) or (FormMode = ifmCopyNewRecord) or (FormMode = ifmUpdate) then begin if (ValidateInput) then begin TSysPermissionSource(Table).SourceCode.Value := edtSourceCode.Text; TSysPermissionSource(Table).SourceName.Value := edtSourceName.Text; TSysPermissionSource(Table).SourceGroup.Value := TSysPermissionSourceGroup(cbbSourceGroup.Items.Objects[cbbSourceGroup.ItemIndex]).SourceGroup.Value; TSysPermissionSource(Table).SourceGroupID.Value := TSysPermissionSourceGroup(cbbSourceGroup.Items.Objects[cbbSourceGroup.ItemIndex]).Id.Value; inherited; end; end else inherited; end; Destructor TfrmSysPermissionSource.Destroy; begin vpSourceGroup.Free; inherited; end; procedure TfrmSysPermissionSource.FormCreate(Sender: TObject); var n1: Integer; begin TSysPermissionSource(Table).SourceCode.SetControlProperty(Table.TableName, edtSourceCode); TSysPermissionSource(Table).SourceName.SetControlProperty(Table.TableName, edtSourceName); TSysPermissionSource(Table).SourceGroup.SetControlProperty(Table.TableName, cbbSourceGroup); inherited; vpSourceGroup := TSysPermissionSourceGroup.Create(Table.Database); vpSourceGroup.SelectToList('', False, False); cbbSourceGroup.Items.Clear; for n1 := 0 to vpSourceGroup.List.Count-1 do cbbSourceGroup.Items.AddObject(TSysPermissionSourceGroup(vpSourceGroup.List[n1]).SourceGroup.Value, TSysPermissionSourceGroup(vpSourceGroup.List[n1])); end; procedure TfrmSysPermissionSource.FormShow(Sender: TObject); begin inherited; // end; procedure TfrmSysPermissionSource.Repaint(); begin inherited; // end; procedure TfrmSysPermissionSource.RefreshData(); var n1: Integer; begin //control içeriğini table class ile doldur edtSourceCode.Text := TSysPermissionSource(Table).SourceCode.Value; edtSourceName.Text := TSysPermissionSource(Table).SourceName.Value; for n1 := 0 to cbbSourceGroup.Items.Count-1 do if TSysPermissionSourceGroup(cbbSourceGroup.Items.Objects[n1]).Id.Value = TSysPermissionSource(Table).SourceGroupID.Value then begin cbbSourceGroup.ItemIndex := n1; Break; end; end; end.