Sei sulla pagina 1di 32

T3TAFJ-Working with Design Studio-R15 1

T3TAFJ-Working with Design Studio-R15 2


T3TAFJ-Working with Design Studio-R15 3
You can use Design Studio to develop, compile, execute and debug your Basic code
on the TAFJ runtime. Click on EDST24.exe in the Design studio folder to launch DS
and start_H2.cmd in the T24 folder of your DEV area to start the H2 database. If you
are working from the TAFJ workshop area that you installed, then double click on
Command prompt and at the prompt type tafj_shell e. The sql prompt shows the
successful start of the H2 database on port 9007.

T3TAFJ-Working with Design Studio-R15 4


To create a TAFJ Project, you need to create a General eclipse project and promote it
to a TAFJ Project (which is a specialized Java project).
The steps below outline how to create a project using many of the default settings to
make it easy to get started.
From the main workbench window, click File > New > Project. The New Project
wizard opens. Select General > Project.
In the Project name field, type a name for your new project, like T24_Dev
Click the Next button, then Finish.
Now you have a project in Design Studio

T3TAFJ-Working with Design Studio-R15 5


To promote to a TAFJ Project, select your project and right click on it, and
select Toggle TAFJ project Nature• .
The TAFJ Project wizard opens. Every project is associated with a property file which
gets created in the <TAFJ_HOME>\conf. Using a property file we can define settings
for the project like directory path for source, inserts, generated java and class files,
database setup, compiler properties, locking, runtime parameters etc. The project
creates the property file name in the format <Project_Name>.properties.
The Group "To do"•in the dialog box gives you choices about the property file.
Use existing properties - A property file with the name of the project already exits.
The project will use the settings in this property file.
New project TAFJ - A new property file will be created, even if there is an existing
property file by the name of the project. New property files are based on the template
file .property in the < TAFJ_HOME >/conf.
Import from a TAFJ Property file - Import settings from another property file into a
property file by the name of <project name>.properties. You have to specify the
property file to import from. For the purpose of this demo select this option and
browse to <TAFJ_HOME>/conf and select an existing property file for eg
DEV.properties as shown in the snapshot. This will copy the contents of
DEV.properties into T24_Dev. Properties.
The Group "Variables“ - Before doing anything you have to set to the project the <
TAFJ_HOME > variable. Each project can have a different <TAFJ_HOME>. All
settings related to the project are set to <TAFJ_HOME>.
The group "Default“ - If you check the box "Default project"• , this project will be made
the default one. The file .default will contain the name of this project.

T3TAFJ-Working with Design Studio-R15 6


Click Next.

T3TAFJ-Working with Design Studio-R15 6


In the window shown, there are three sections,
1) Basic Folder section – specify a folder on your disk where you want to store your
jBC code for the project.
2) Insert Folder section – must point to the folder(s) (or jar(s)) where your inserts are
present. This is optional. If insert directories are not mentioned then Basic paths
are checked for inserts.
3) Precompile Folder Section – must specify the folder(s)/jar(s) where the T24
precompiled jars or Enterprise jar files are present
Note: For your dev area the precompile folder(or .jar) can be found at the location
D:/Temenos/Development/Dev/T24/lib. An existing property file selected in the
previous step, would auto populate the three sections with the properties set in that
file. Use the Add/Remove folder to add the folders you want in the relevant section
You may also specify the location to store the java source code and the classes
generated during compilation or take the default. They follow the folder structure of
<TAFJ_HOME>\data\<project name dir>\<java/classes>
Click Next and Finish

T3TAFJ-Working with Design Studio-R15 7


Indicate the database properties like the database driver, database URL, tcp port,
database name, username and password.

T3TAFJ-Working with Design Studio-R15 8


You will see the tAF icon beside the project and automatically you will work in a TAFJ
Perspective. The console displays the linkings

T3TAFJ-Working with Design Studio-R15 9


You may want to edit the settings in your properties file once the project is created. To
change the project properties, right click on the project and click on Properties. On the
tree, click on the type "TAFJ“
If you click on TAFJ, you can change the TAFJ_HOME and toggle the default project.
The window also displays the properties file used by the current project, and the
classes' directory.
TAFJ Compiler - you can edit your compiler settings in your properties file.
TAFJ Database - you can edit the database settings.
TAFJ Logger - you can change the log level for different Loggers. Log Levels ->
DEBUG, INFO, ERROR, ALL, FATAL, WARN, OFF.
The DEBUG Level designates fine-grained informational events that are most
useful to debug an application.
The INFO level designates informational messages that highlight the progress of
the application at coarse-grained level.
The ERROR level designates error events that might still allow the application to
continue running.
The ALL has the lowest possible rank and is intended to turn on all logging.
The FATAL level designates very severe error events that will presumably lead the
application to abort.
The WARN level designates potentially harmful situations.
The OFF has the highest possible rank and is intended to turn off logging.
TAFJ Paths - you can edit your Basic, insert, precompiled, java and classes paths.

T3TAFJ-Working with Design Studio-R15 10


TAFJ Runtime- you can edit runtime directory, como directory, runtime process parameters.

T3TAFJ-Working with Design Studio-R15 10


T3TAFJ-Working with Design Studio-R15 11
To add a Basic file to the project you have to
1. Right-click on the folder where to add the file and choose New -> T24 routine.
2. Name the new Basic File. As file name, give any valid BASIC file name, and give
the extension “.b”. (e.g., MY.FIRST.PROGRAM.b). Note that this is not mandatory
to give the '.b' extension.
3. Select the type of routine that you intend to write and click finish.

T3TAFJ-Working with Design Studio-R15 12


A Tab opens for AC.PAYMENTS.b in the main Editor window. Type in the program.
To compile the code do a <ctrl>+S, which does a save and compile.
Alternatively, expand the basic folder in your project, select the file, right click on it and
select Compile Basic File• .
A small report on the compilation is printed on the console. All errors are reported in
the Problems tab. Double click on a problem reported, it will automatically take your
cursor to highlight the line which raised the error / warning.

T3TAFJ-Working with Design Studio-R15 13


To build a Basic Folder, expand your project, right click on it and select Compile
Basic Folder
All basic files in the folder will get compiled. It could take more than 45 minutes if the
entire T24 source code (more 17'000 files) is in your Basic directory
The console reports the compilation result. Compilation error details can be viewed in
the tab "problem”. Double click on one for Design Studio to automatically show the
basic file containing the error, in the editor.
After a compilation, the generated java files are automatically deleted and the class
files are stored in the classes directory.

T3TAFJ-Working with Design Studio-R15 14


After compilation, the next step is to run it.

Right-click on the program in the Package Explorer and choose "Run as ...."•or "Debug
as ..."as shown. The program output will be displayed on the console. You can ‘re-
launch’ your program at any time by using the DEBUG / RUN menu (or button) on the
Design Studio menubar (or toolbar). The Debug/run menu on the Design Studio
toolbar is shown in the snapshot.

Note : If you do not have the Run/Debug as BASIC Program, this is certainly because
you are pointing on a Subroutine instead of a "PROGRAM".

Debugging allows you to run a program interactively while watching the source code
and the variables during the execution. To debug the program you need to define
breakpoints. By adding breakpoints in the source code you can specify where the
execution of the program should stop. To set breakpoints in your source code double
click on the small left margin in your source code editor. You can toggle breakpoint by
double clicking on it again. In the snapshot, we have added the breakpoint at Line 7. If
you have not defined any breakpoints and you use the Debug as … option, this will run
your program as normal and give the output on the console (output is sent to console
only if it is a console application).

T3TAFJ-Working with Design Studio-R15 15


Start the debugger
Design Studio allows you the run your basic code in the debug mode.
To Debug … use the Debug As -> Basic program option to run the basic code in
debug mode. By doing so, Design Studio will automatically switch on the Debugger
View. The program will be launched and it will break on the first breakpoint. Once the
program is stopped you can investigate variables, change their content, etc. The snap
shot shows the execution paused at Line 7 where the break point was added.
The BASIC Launcher uses the Eclipse standard for debugging.
Step Over : F6
Step In : F5
Step Out : F7
Continue : F8
We will discuss each view in detail.
[Note: The Debug As… option is also available in the Design Studio menubar and the
toolbar.]

T3TAFJ-Working with Design Studio-R15 16


The Debug window displays the call stack which shows the parts of the program which
are currently executed and how they relate to each other. It
gives a detailed hierarchical tree view of the current routine that is executing, the line
no, the calling routine, called routine etc. This information is dynamically updated
based on your current line of execution.
You can re-launch your program at any time by using the context menu. Right click in
the Debug window to invoke the context menu as shown.
Controlling the program execution
Design Studio provides buttons in the toolbar (are also available as options in the
context menu) for controlling the execution of the program you are debugging.
Typically it is easier to use the corresponding keys to control this execution. You can
use the F5, F6, F7 and F8 key to step through your coding. The meaning of these keys
is explained below

F5 - Executes the currently selected line and goes to the next line in your program. If
the selected line is a method call, the debugger steps into the called code.
F6 - F6 steps over the call, i.e. it executes the method call (eg CALL SUBROUTINE.B)
without stepping into the method code in the debugger.
F7 - F7 steps out to the caller of the currently executed method. This finishes the
execution of the current method and returns to the caller of this method.
F8 - F8 tells the Eclipse debugger to resume the execution of the program code until is
reaches the next breakpoint. If there are no breakpoints, it completes the execution.

T3TAFJ-Working with Design Studio-R15 17


Variables view
The Variables view displays variables from the current executing stack. Please note
you need to run the debugger to see the variables in this view. The Variables view
allows you to change the values assigned to your variable at runtime. Click on the
Value cell of the variable whose value you want to change. The cell becomes editable.
Alternatively right click on the cell for a context menu and select ‘Change Value’. Note
that if a COMMON variable is not used in the program, it will not be shown in the
variable list (Variables tab in the variables and expressions view).

The Expression Watch point


Sometimes, there are too many variables and this is tricky to find them. You can, by
right-clicking on the variable, choose the “Add Watch” option. Then the variable you
want to watch will be in the Expression view. If the expression view is unavailable on
your IDE, you can add it from window->show view->expressions

Breakpoints view and deactivating breakpoints


The Breakpoints view allows you to delete and deactivate breakpoints.
To deactivate a breakpoint, remove the corresponding checkbox in the Breakpoints
view . To delete it you can use the corresponding buttons in the view toolbar. These
options are depicted in the screenshot. If you want to deactivate all your breakpoints
you can press the Skip all breakpoints button. If you press it again, your breakpoints
are reactivated. This button is highlighted in the screenshot.

T3TAFJ-Working with Design Studio-R15 18


T3TAFJ-Working with Design Studio-R15 19
Outline view
When you edit a basic file with the basic editor, the outline view is automatically
activated. To open a basic file with the TAFJ Basic editor, right click on the file ->
Open With -> “Other...” Click on “Basic editor” and click “OK”. Your Basic file is edited
in Design Studio with the Basic editor.
If the outline view is not in your workspace you can activate it. From the main
workbench window, click “Window” menu > Show view >Outline.
The “Outline view” is a Tree. The tree has nine different branches.
Basic Labels
Jumps JBase Functions
User Functions Inserts
Equates Calls
Problems
Each of these are discussed in the ensuing slides.

T3TAFJ-Working with Design Studio-R15 20


Basic Branch - It contains the information about the Basic routine like Routine Name,
Rating and Grammar level
Rating Branch - It contains the information about the code rating.
Labels Branch - All labels in the code are listed in the labels branch with information
about their presence and where they are used.
An icon front of it is to indicate is status.
Blue - information : this is a good label
Orange - warning : this label is not used in the code
Red - bad : This label is in a loop and makes the compiler grammar to dropdown to
level 0 (see the chapter on Compiler)
If the labels are in current routine then, click on the name of the label and it will be
selected in the editor.
If the Label is in another file then, you can double click on and the Basic file will be
opened in the basic editor.

T3TAFJ-Working with Design Studio-R15 21


All Jumps (GOTO, ON...GOTO, RETURN TO) in the code are listed in the Jumps
branch with their information. This information is important because, these branch
statement will downgrade the compiler level to 1 or even 0. You can therefore revisit
the code logic and improve it by avoiding the branch so that the grammar level can be
raised to 3. If you click on the jump (E.g., Use at: tSM: 273:13) the cursor will select
the corresponding statement.

T3TAFJ-Working with Design Studio-R15 22


JBase Functions Branch
All core JBase Functions in the routine are listed. If you click on the jbase function, the
corresponding statement will be selected in the editor.

T3TAFJ-Working with Design Studio-R15 23


Users Functions Branch
All DEFFUN Functions used in the code are listed. An icon in front of it indicates its
status.
Blue - information: this function is used.
Orange - warning: this function is not used
If you click on the name then, the editor will be jump to it and select it. The DEFFUN
statement identifies a user-written function to the jBASE BASIC compiler, which must
be present in each program that calls the function, before the function is called
Inserts Branch
All $INSERT files in the code are listed.
If you click on the insert file name listed here, the cursor in the editor will highlight the
line where it appears
If you double click on the name the, INSERT file will be opened in the basic editor.

T3TAFJ-Working with Design Studio-R15 24


Equate Branch
All defined EQUATE TO in the code are listed.
The insert file I_DESIGN.STUDIO.TAGS is used in the routine
DSBuildEnquiryRecord.b. In the insert DS$ALIGNMENT is equated to ‘ alignment= ‘.
The list of all the EQUATE TO’s in the routine and where they are used in the routine
is seen in the snapshot.

T3TAFJ-Working with Design Studio-R15 25


Calls Branch
All defined CALLs in the code are listed.
If you click on “Use at...” the cursor in the editor will select the line where it appears.
If you double click on the routine name, the routine will be opened in the basic editor.
Variables
All the common variables used in the routine are listed here. The insert file is also
identified in the bracket. For Eg., B.FILES refers to the insert file I_BATCH.FILES,
THE.GLOBUS.COMMON is I_COMMON.
Problems Branch
All errors and warnings from a compilation are reported. An icon in front of it indicates
its status.
Blue - information: Information about the compilation.
Orange - warning: A warning about the compilation.
Red - error: An error about the compilation.
If you click on the problem, the cursor in the editor will select the line where it appears.

T3TAFJ-Working with Design Studio-R15 26


When you right click on the editor or on the main menu/toolbar, you will find some 8
editor functionalities:
Collapse all Regions
Expand all Regions
Create Region
Create GOSUB
Insert Comment line
Format Code
Block Comment
Block Uncomment

T3TAFJ-Working with Design Studio-R15 27


The Region : The region is part of code decorated by some tags ignored by the
compiler. In the annotation bar you can collapse or expand it.

Comment code: You can add a comment line in the code using “Insert comment Line”

You can comment or uncomment a block of code using “Block comment” or “Block
uncomment”

T3TAFJ-Working with Design Studio-R15 28


Format Code – Use the format code option to indent your code

GOSUB - In the code a GOSUB and a Region with the label provided in the dialog box
will be created.

T3TAFJ-Working with Design Studio-R15 29


T3TAFJ-Working with Design Studio-R15 30

Potrebbero piacerti anche