TPaxDebugger Methods

Public Published

Public procedure AddCodeFromRepository;
Public procedure AddCodeToRepository(CodeAlias: string; CodeGroup: string; Language: TPaxLanguage; var ResAlias: TPaxDebuggerCodeAlias);
Public function AddGroupToRepository(NewGroupName: string; var OUTGroup: TStringList): boolean;
Public function AddModule(ModuleName: string; Language: TPaxLanguage; GroupName: string; var ResModule: TPaxDebuggerModule): boolean;
Public function AddModulesGroup(const GroupName: string): boolean;
Public function AddWatch(WatchExpression: string): boolean;
Public function ChangeModuleGroup(const Module: TPaxDebuggerModule; const NewGroupName: string): boolean;
Public procedure ChooseDebuggerLayouts;
Public procedure ClearRepository;
Public procedure CloseAllModuleTabs;
Public procedure CloseProject;
Public procedure Compile;
Public procedure CopyToClipboard;
Public constructor Create(AOwner: TComponent); override;
Public procedure CutToClipboard;
Public destructor Destroy; override;
Public function Evaluate(const Expression: string; var Res: variant): boolean;
Public procedure Execute;
Public procedure ExecuteProcedureAsync(ProcedureName: string; const Params: array of variant);
Public procedure ExecuteSyncFunction(FunctionName: string; const Params: array of variant; var FuncRes: variant);
Public function GetModuleByName(ModuleName: string): TPaxDebuggerModule;
Public procedure HideModuleTab(const PaxModule: TPaxDebuggerModule);
Public procedure ImposeProjectLoaded;
Public procedure ImposeRepositoryLoaded;
Public function LoadCompiledFromFile(const FileName: string): boolean;
Public function MethodExists(const MethodName: string): boolean;
Public procedure MoveDownModuleItem(const Module: TPaxDebuggerModule);
Public procedure MoveModuleFirstItem(const Module: TPaxDebuggerModule);
Public procedure MoveModuleLastItem(const Module: TPaxDebuggerModule);
Public procedure MoveUpModuleItem(const Module: TPaxDebuggerModule);
Public procedure NewProject(const ProjectName: string; IsOnFile: boolean); overload;
Public procedure NewProject(IsOnFile: boolean); overload;
Public procedure OpenProject; overload;
Public procedure OpenProject(const FileName: string); overload;
Public procedure OpenRepositoryEditor;
Public procedure PasteFromClipboard;
Public procedure Redo;
Public procedure RefreshSymbolsViews; overload;
Public procedure RegisterConstant(const Name: string; Value: variant; Owner: integer = -1);
Public procedure RegisterField(const ObjectName: string; ObjectType: string; FieldName, FieldType: string; Address: pointer);
Public procedure RegisterObject(const Name: string; Instance: TObject; Owner: integer = -1);
Public procedure RegisterVariable(const Name, TypeName: string; Address: pointer; Owner: integer = -1);
Public procedure RemoveCodeFromRepository(CodeAlias, CodeGroup: string);
Public procedure RemoveGroupFromRepository(GroupName: string);
Public function RemoveModule(ModuleName: string): boolean;
Public function RemoveModulesGroup(const GroupName: string): boolean;
Public function RenameModulesGroup(CurrentName: string=''; NewName: string=''): boolean;
Public procedure Replace;
Public procedure ResetDebugger;
Public procedure RunToCursor;
Public function SaveCompiledToFile(const FileName: string; ForceOverwrite: boolean = TRUE): boolean;
Public procedure SaveProject;
Public procedure SaveProjectAs(SuggestedFileName: string = '');
Public procedure Search;
Public procedure SearchAgain;
Public procedure SearchInProject;
Public procedure SelectAll;
Public function ShowModuleTab(const PaxModule: TPaxDebuggerModule): TTabSheet;
Public procedure StepOver;
Public procedure ToggleBreakpoint(const Module: TPaxDebuggerModule; LineNumber: integer = -1);
Public procedure TraceInto;
Public procedure Undo;

Description

Public procedure AddCodeFromRepository;

Opens the repository form. From there you can add code to the edited module.

Public procedure AddCodeToRepository(CodeAlias: string; CodeGroup: string; Language: TPaxLanguage; var ResAlias: TPaxDebuggerCodeAlias);

Adds code into repository. If the specified group does not exist, a new one is automatically created. ResAlias is the created alias. If nil the alias cannot be created.

Public function AddGroupToRepository(NewGroupName: string; var OUTGroup: TStringList): boolean;

Adds a new group to repository. The return value is true if the group has been created new, it's false if the group already exists.

Public function AddModule(ModuleName: string; Language: TPaxLanguage; GroupName: string; var ResModule: TPaxDebuggerModule): boolean;

Adds a module to the current project. If Language is nil the default language will be used. ResModule is the module created. If nil it means that creation wan not possible. The return value is true if the module has been created new, it's false if the module already exists.

Public function AddModulesGroup(const GroupName: string): boolean;

Adds a new modules group. The return value is true if the group has been created new, it's false if the group already exists.

Public function AddWatch(WatchExpression: string): boolean;

Adds a watch expression to watches list. The return value is true if the expression has been created new, it's false if the expression already exists.

Public function ChangeModuleGroup(const Module: TPaxDebuggerModule; const NewGroupName: string): boolean;

Changes the containing group of a module. The return value is true if change has been possible and was done, else it's false.

Public procedure ChooseDebuggerLayouts;

Opens the settings form.

Public procedure ClearRepository;

Clears (empty) the entire code repository.

Public procedure CloseAllModuleTabs;

Closes all open module tabs in the editor IDE section.

Public procedure CloseProject;

Closes the current project. If the project need to be saved a confirm dialog will be shown.

Public procedure Compile;

Compiles the current project.

Public procedure CopyToClipboard;

Copy selected text into the clipboard.

Public constructor Create(AOwner: TComponent); override;

Component constructor.

Public procedure CutToClipboard;

Cut selected text into the clipboard. It works only if the current selected text belongs to a non readonly module.

Public destructor Destroy; override;

Component destructor.

Public function Evaluate(const Expression: string; var Res: variant): boolean;

Evaluates a script expression. Res is the value obtained from evaluation.

Public procedure Execute;

Runs the paused script procedure (or function).

Public procedure ExecuteProcedureAsync(ProcedureName: string; const Params: array of variant);

Executes a script function asynchronously in a separed thread. After this method call, the caller returns immediately. This method is a sort of batch-call, when a return value is not needed.

Public procedure ExecuteSyncFunction(FunctionName: string; const Params: array of variant; var FuncRes: variant);

Executes a script procedure (or function). If the engine was running another procedure this method raises an OnError event.

Public function GetModuleByName(ModuleName: string): TPaxDebuggerModule;

Gets a module given its name. Return value is false if a module with the specified name does not exist.

Public procedure HideModuleTab(const PaxModule: TPaxDebuggerModule);

Hides the editor tab of a module.

Public procedure ImposeProjectLoaded;

NB: Use this method with db-based project only! Take a look at the embed tutorial. This method signs the whole project as not changed. After thi call, any changes (modules code, groups renamed and so on) will be tracked.

Public procedure ImposeRepositoryLoaded;

This function has the same role of ImposeProjectLoaded, but it works on repository. NB: Use this method with db-based project only!

Public function LoadCompiledFromFile(const FileName: string): boolean;

This function load a compiled project (in binary format) from an external file. If the file has been loaded without errors, this function returns a TRUE value. Else a FALSE value is returned.

Public function MethodExists(const MethodName: string): boolean;

Returns true if a procedure (or function) with the specified name exists.

Public procedure MoveDownModuleItem(const Module: TPaxDebuggerModule);

Moves one step down the module item in the project tree view representation.

Public procedure MoveModuleFirstItem(const Module: TPaxDebuggerModule);

Moves at first position the module item in the project tree view representation.

Public procedure MoveModuleLastItem(const Module: TPaxDebuggerModule);

Moves at last position the module item in the project tree view representation.

Public procedure MoveUpModuleItem(const Module: TPaxDebuggerModule);

Moves one step up the module item in the project tree view representation.

Public procedure NewProject(const ProjectName: string; IsOnFile: boolean); overload;

Use this method to create a new project.

Public procedure NewProject(IsOnFile: boolean); overload;

Use this method to create a new project. In this case a dilog will be opened to ask the user for a project name.

Public procedure OpenProject; overload;

Closes the current project and load a new one from file. File name will be choosen with a dialog form.

Public procedure OpenProject(const FileName: string); overload;

Closes the current project and loads a new one from file.

Public procedure OpenRepositoryEditor;

Opens the repository editor fom.

Public procedure PasteFromClipboard;

It pastes the clipboard content into the code editor. It works only if the editor contains a non readonly module.

Public procedure Redo;

Performs a 're do' operation in the code editor. The final effect is the same that click on Edit --> Redo menu item.

Public procedure RefreshSymbolsViews; overload;

Refreshes the symbols list views.

Public procedure RegisterConstant(const Name: string; Value: variant; Owner: integer = -1);

Adds a host-defined constant to script, it's the same method present in PaxScripter. Take a look at the relative documentation.

Public procedure RegisterField(const ObjectName: string; ObjectType: string; FieldName, FieldType: string; Address: pointer);

Allows to assign address of field of a script-defined structure, it's the same method present in PaxScripter. Take a look at the relative documentation.

Public procedure RegisterObject(const Name: string; Instance: TObject; Owner: integer = -1);

Adds a host-defined object to script, it's the same method present in PaxScripter. Take a look at the relative documentation.

Public procedure RegisterVariable(const Name, TypeName: string; Address: pointer; Owner: integer = -1);

Adds a host-defined variable to script, it's the same method present in PaxScripter. Take a look at the relative documentation.

Public procedure RemoveCodeFromRepository(CodeAlias, CodeGroup: string);

Removes a codealias from repository.

Public procedure RemoveGroupFromRepository(GroupName: string);

Removes an entire group of codealias from repository.

Public function RemoveModule(ModuleName: string): boolean;

Removes a module from the current project.

Public function RemoveModulesGroup(const GroupName: string): boolean;

Removes an entire modules group from current project. If the group contains one or more modules, it cannot be removed. A True return value means that the group has been successfully removed.

Public function RenameModulesGroup(CurrentName: string=''; NewName: string=''): boolean;

Renames a modules group. A return value of true means that group has been successfully renamed.

Public procedure Replace;

Opens the search&replace form.

Public procedure ResetDebugger;

Resets debugger and stop current execution.

Public procedure RunToCursor;

Runs the current paused script procedure (or function) until cursor has been reached.

Public function SaveCompiledToFile(const FileName: string; ForceOverwrite: boolean = TRUE): boolean;

This function save to current compiled project to an external file. The ForceOverwrite parameter can be used to force the writing in the case of an already present file with the same FileName specified. If the file is saved without errors, a TRUE value is returned. In case of errors, a FALSE value is returned.

Public procedure SaveProject;

Saves the current project.

Public procedure SaveProjectAs(SuggestedFileName: string = '');

Saves the current project with a different filename. NB: if the project was on database, after this method call it becomes on file.

Public procedure Search;

Opens the search form.

Public procedure SearchAgain;

It searches again the expression typed in the search form.

Public procedure SearchInProject;

Not yet implemented.

Public procedure SelectAll;

Performs the selection of all text currently present in the code editor. The final effect is the same that click on Edit --> SelectAll menu item.

Public function ShowModuleTab(const PaxModule: TPaxDebuggerModule): TTabSheet;

Makes a module tab visible. It has the same result as PaxModule.Visible := True.

Public procedure StepOver;

It steps over the next line in the current paused script procedure (or function).

Public procedure ToggleBreakpoint(const Module: TPaxDebuggerModule; LineNumber: integer = -1);

Toggles a breakpoint in the specified module at the specified line number. If linenumber is less than zero the current caret line is used.

Public procedure TraceInto;

Traces into the next line in the current paused script procedure (or function).

Public procedure Undo;

Performs an 'un do' operation in the code editor. The final effect is the same that click on Edit --> Undo menu item.