PANTHEON™ manual

 Categories
 PANTHEON Help - Welcome
[Collapse]PANTHEON
 [Collapse]Guides for PANTHEON
  [Collapse]Guide for PANTHEON
   [Collapse]Settings
    [Expand]Subjects
    [Expand]Items
    [Expand]POS
    [Expand]Manufacturing
    [Expand]Personnel
     Calendar
    [Expand]Financials
    [Expand]Customs
    [Collapse]Program
     [Expand]Document Types
     [Collapse]Reports in PANTHEON
       Settings in Administration Panel
      [Expand]Reports Register
       Print Preview
      [Expand]Report Designer
      [Expand]Creating Reports
      [Expand]Groups and Aggregates
      [Expand]Formatting and Highlighting
       Nested Reports (Subreports)
      [Expand]Specifics of Printouts in PANTHEON
      [Expand]Script
       Report Design Considerations
      Document Texts
      Delivery Methods
     [Expand]Loyalty Cards
     [Expand]Administration Panel
     [Expand]Dashboard Components
      Dashboard Reports
      Ad-hoc analysis
     [Expand]ARES
      SQL urejevalnik
    [Expand]Documentation
    [Expand]Change User
   [Expand]Orders
   [Expand]Goods
   [Expand]Manufacturing
   [Expand]POS
   [Expand]Service
   [Expand]Financials
   [Expand]Personnel
   [Expand]Analytics
   [Expand]Desktop
   [Expand]Help
   [Expand]Messages and Warnings
   [Expand]Additional programs
   [Expand]Old products
  [Expand]Guide for PANTHEON Retail
  [Expand]Guide for PANTHEON Vet
  [Expand]Guide for PANTHEON Farming
 [Expand]User Manuals for PANTHEON
[Expand]PANTHEON Web
[Expand]PANTHEON Granules
[Expand]User Site

Load Time: 687.512 ms
print   |
Label

Script

A script is a program, written in a high-level language, which is part of a report. As the report runs, the script runs as well. A script can handle data in ways that are not possible just using the normal operations of the FastReport core; for example, a script can hide redundant data depending on a predefined condition. A script can also be used for controlling the properties of dialogue forms which are part of a report.

A script is written in one of the languages supported by the script engine (FastScript). These are: PascalScript, C++Script, BasicScript, and JScript.

We will write all example in PascalScript. When a new report is created this language is selected by default.

The following features are supported by the FastScript engine:

- standard language set: variables, constants, procedures, functions (which may be nested and having variables, constants, default parameters), all standard operators (including case, try, finally, except, with), types (integral, fractional, logical, character, line, multi-dimensional arrays, variant), classes (with methods, events, properties, indexes and default properties)

- type compatibility checking

- access to any of the report’s objects

FastScript, however does not support the following:

- declarations of  these types : records, classes

- pointers, sets (but the 'IN' operator can be used in expressions such as "a in ['a'..'c','d']")

- shortstring type

- unconditional jumps (GOTO)

Scripts can be created in the FastReport designer, which contains a script editor.

Shortcut Keys

List of the shortcut keys which can be used in the script editor:

Key

Meaning

Cursor arrows

move cursor

PageUp, PageDown

go to previous/next page

Ctrl+PageUp

go to beginning of the text

Ctrl+PageDown

go to end of the text

Home

go to beginning of the line

End

go to end of the line

Enter

go to next line

Delete

delete symbol at cursor position; delete selected text

Backspace

delete symbol to the left of the cursor

Ctrl+Y

delete current line

Ctrl+Z

undo last action (up to 32 events)

Shift+Cursor arrows

select a text block

Ctrl+A

select whole text

Ctrl+U

shift selected block by 2 symbols to the left

Ctrl+I

shift selected block by 2 symbols to the right

Ctrl+C, Ctrl+Insert

copy selected block to the clipboard

Ctrl+V, Shift+Insert

paste text from the clipboard

Ctrl+X, Shift+Delete

cut selected block to the clipboard

Ctrl+F

search a line

Ctrl+R

replace a line

F3

repeated search/replacement from the cursor position

F9

run the script (Run)

Ctrl + Space

show list of methods and properties of object

Ctrl+Shift+Delete

delete word to right of cursor

Ctrl+Shift+Backspace

delete word to left of cursor

Structure of a Script

var                   // the “variables” chapter can be placed anywhere

 i, j: Integer;

const                 // “constants” chapter

 pi = 3.14159;

procedure p1;         // procedures and functions

var

 i: Integer;

procedure p2;       // nested procedure

begin

end;

 

begin

end;

 

begin                 // main procedure.

end.



Rate this topic
Was this topic usefull?
Comments
Comment will also bo visible in forum!