Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - +----------------------------+ http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+----------------------------+
|dBsee Template Language     |
+----------------------------+

Contained  in this chapter you will  find all the necessary information and
explanations to utilize the power of the dBsee Template Language (dBTL).

+----------------------------+
|The method of generation    |
+----------------------------+

The development of a project with dBsee foresees an interactive phase. This
phase is imposed by the data dictionary of the application and the designed
operational   environments   (Fields,  Objects   and  tems).  The  combined
information  is stored in the project repository. The files that constitute
the repository are of the *.dbf type and are easily managed in Clipper.

The  method  of generation, dBsee operates  through  a method of generation
that excutes the statements that are written in template files.

A  template  can  therefore be defined like  a  file of text containing the
commands of the generation.

dBsee associates the relative template for generation to each object.

The mechanism of generation is very simple.

The  generator,  while following the  contained  directives in the Template
files,  implements  the  scanning of  the  information  introduced from the
programmer  located in the repository and  then produces the program source
in the resulting (*.prg) format.

For  good  comprehension  of the mechanism  of  generation a deliminator is
necessary to identify the information contained inside the repository.

They are identified in two categories:

+----------------------------+
|(1) Data Dictionary         |
+----------------------------+

Contains the relative information to the organization of the data.

Dictionary objects contain relative Information to the objects that compose
the project of the application.

The  data dictionary contains all the information reguarding files, fields,
indexes  and relationships. The dictionary objects contain the structure of
menu  for  the  entire project, as  well  as  the hierarchical of controls,
objects and items.

+----------------------------+
|(2) The Template files      |
+----------------------------+

A template is a file in ASCII format with the necessary commands to produce
a controled computer program resulting in a formated (.prg).

A template is generally in partnership with a object.

The  production  of  the programs happens  through  a  phase of reading and
interpretation of the contained instructions of the template.

All  lines  will be interpreted and  executed  as instructions, other lines
will simply be transfered, exactly as written, constituting the skeleton of
the source being produced.

+----------------------------+
|The structure of a template |
+----------------------------+

The template file is composed of lines of code of a different type.

Comments        Each comment line of text in the computer program
                are the lines preceded by ".*" ( Asterisk ).

Commands        Every insturction of the language dBTL is preceded
                by a period "." .

Functions       Each line of text concantenented with the delimiter " # "
                (ASCII 219) which allows to implement a macro subtisutition
                before the writing of the line of output (.prg).

Line of text    All the lines with text whose first character is not blank
                and different from "." is understood as lines to transfer as
                output.  if the line containes a function (see preceding
                period) it will be resolved before transfer as output.



+----------------------------+
|The commands dBTL           |
+----------------------------+

Described  below  are the commands  available  within the Template, listing
them  in alphabetical order. For  each suitable command, the functionality,
the syntax and proposed example.

Many  of those commands from preceding  version of dBTL are managed through
the  use  of  functions.  The  description  of  each  of  the functions are
contained in this manual.

".'             (ASCII 240) it allows to position a comment in column 40.


.*              Line of comment.


.breakgrab      Terminates the active state of grab.  see .grab command.


.block BlockId  Defines a point of injection by type block.
                A BlockId is an any sequence of 3 characters unique to the
                inside of the same template.

                EXAMPLE:

                .block [xxx yyyyyyyyyyyyyyyyyyyyyyyy]
                   command [template]
                   command [template]
                .endblock

                The  block  consents to manage  the injections of the first
                code and/or after a certain block of template instructions.

                The  part identified with xxx is  the name of the block and
                must be unique within the same template

                The   part  identified  with  [yyyyyyyyyyyyyyyyyy]  is  the
                description of the synthetic block that will be transferred
                at the phase of generation.

                When found the indenifier .block command the generator will
                search  in the file [oo_cod.dbf]  for the block of relative
                code  in  the  control+ current  object+  [xxx]+ initiate a
                search  if  a block of source  code exists to reference the
                beginning of the block.

                The   generation  proceeds  with  the  formulation  of  the
                following lines until the .endblock command is encountered,
                at  which time the generator refers to the code source with
                end block.


.close          This command closes the file of current generation.

.case           See .do command case.

.do             This  command  provides  the  ability  of  (branching)  the
                execution  of  another template during  the  execution of a
                template.  It  is also possible  to  pass parameters to the
                called template.

                It  is possible pass parameters  to the named template. The
                system  variable  TmpMaxPar,  normally  formulated  to (4),
                assigns  the  maximum number of  parameters that can can be
                pasted.  At each call, the interpreter reads the parameters
                on  the  command  line. This  operation  will slow down the
                execution, therefore the maximum number has been fixed to 4
                but  it  can be, however modified  assigning a new value to
                the variable TmpMaxPar.


.do case        A  conditional structure by which a branch can occur when a
                condition  results in true. Terminated with the compleation
                of  the  commands  contents, the  program  will execute the
                insturctions after the .endcase.

                EXAMPLE:

                .do case
                    .case condition 1
                        commands
                        commands
                    .case condition 2
                        commands
                        commands
                    .otherwise
                        commands
                .endcase

.do while       Structure to perform a cycle of instructions until the
                specified condition is verified.

                EXAMPLE:

               .do while condition
                   commands
                   commands
               .enddo


.endgrab        End area [grab], see .grab command.



.else           Branch if see command .if

.endif          End if,   see command .if

.endcase        End do case, see .do command case.

.endblock       Finish block,  see .block command.

.enddo          Completion of a cycle started with a do while / enddo,
                see .do while command.

.foreach        Cycle which allows to scan an entity in the repository

.foreach "[selector]"
                The  .foreach  command performs  together  with the command
                .next  provides for scanning of the present entities in the
                repository  of  a  project. The  parameter  of the .foreach
                command  is the selector that indicates the entity to scan.
                The selector refers to a table for the list of the commands
                of the dBTl language.

.grab           Instructs  the generator not to  produce code by output but
                to  consider only what will  follow in the arising template
                up  to the .endgrab command. This  part of the template has
                been  assigned to the  definition of varying environmental,
                initializations, setup, etc.

.gettext        Receives the content of a field [memo] in the produced source
                or with a variable string.

.if             The .if command allows to perform instructions to the check
                of a condition.

.inj            The .inj command allows for define a point of injection by
                type [inj].

                           .inj [xxx yyyyyyyyyyyyyyyyyyyyyyyy]

.msg            Visualizes a message in row (22 or 24) during the generation.

.next           The   .next   command  tries   to   position  the  upcoming
                [selector].  If  successful,  return  to  execute  the line
                immediately  following  at the  .foreach otherwise jumps to
                the line. following to the .next command

.out            Creates a line of output durring generation the flow is
                is addressed by the generator.

.otherwise      See .do command case.

.parameter      Allows to pass parameters to the template.

                .parameter var1, var2, var3, var4

                The template, in case structure receives the parameters, it
                will contain this command at the header. The maximum number
                of   parameters,  contained  in   the  variable  depend  on
                TmpMaxPar,an has been fixed at four.

.return         Unconditional Return to the called template.

.scrdump        Transfers what is present in video memory in the generated
                Program screen with semi-graphic characters.

                This function withdraws the data from the video memory,
                therefore it is necessary to display on the screen the
                information to be dumped, prior to the call.

.set            Elaborate the commands type [set]. The commands are exactly
                the same as those in Clipper.

+----------------------------+
|Table selectors             |
+----------------------------+

In  this table below, listed are  the possible selectors that are available
for use in a .foreach command.

browseboxon     Scans for the List Boxs in relationship with the List Boxs
                currently selected.

control         Scans for the Controls of a object. The object must be
                positioned.

exe             Scans for the subprograms of the project

field           Scans for the fields of the current file. The file must be
                positioned.

files           Scan for the rows of the Data Dictionary.

get             Scans for the item of type [get] in the current object.

index           Scans for the indexes of the file. The line must be
                positioned

inhlookup       Scans the control whose values are inherited through
                relationships: N:1 in the current object.

inhvalue        Scans for the fields inherited through the positioned
                relationship.

integritysons   Scans for the files in children through relationships 1:N
                and 1:1. The parent file must be positioned.

item            Scans for the Control of the object. The object must be
                positioned.

itemgroup       Scans for the controls inside of a Group Box or the
                inside of a List Box.

itmpth          Insures the alignment of the file for which the control
                belongs with the virtual record.

keyfield        Scans for the fields keys of the index.
                The index must be positioned.

makelink        Scans the files of compilation ([make]) and of ([link]).

management      Scans for the managements under the selected selected
                project.

menuentry       Scans for the [entry] of the selected menu.

nullifyvalue    Scans the [link] for relationship to render void.
                It requires that the relationship has positioned.

pfkitem         Program function key, you scan all the subjects function
                associate to a item. Object and item must be positioned.

repgrp          Scans for the groups defined in the positioned file to the
                interior of the positioned report.

repmst          Scans for the record of all the master files in the
                positioned report.

reportprc       Scans the variable used for calculation, in the general
                defined position for the report.

reportgroup     Scans for the files and the complete grouping defined for
                the report currently positioned.

reprel          Scans the file relationships related to the positioned
                master file.

special         Scans for the specialized files of the subprogram

symbol          Scans for the Symbols of the Dictionary.

symfie          Scans for the Symbols of type Field in alphabetical order.

symudf          Scans for the Symbols of type Function in alphabetical order.

symudfobj       Scans for the Symbols of type Function defined in the
                positioned object.

symvar          Scans for the Symbols of Variable type in alphabetical order.

tranmov         Scans the Transactions of Append type in the object. The
                object must be positioned.

tranpos         Scans the directives of positioning for the Transactions on
                the object. The object must be positioned.

trantot         Scans the Transactions of Replace type on the object. The
                object  must be positioned.

vallookup       Scans the control for a value before an edit, in the
                positioned object.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson