Infobasic - 1
Infobasic - 1
Technical Courses
Agenda & Objective
Session-wise plan
Session – I & II
• Introduction to Infobasic Programming
• Navigation with JED
• Infobasic Programming
Session – III & IV
• Control structures
• Array
EDITING NEW
WORKING RECORDS
EDITING
WITH
EXISTING
BLOCKS
RECORDS
DELETING jBASE
TEXT EDITOR STARTING
THE EDITOR
REPLACING
TEXT SAVING AND
MOVING
ADDING EXITING THE
AROUND
TEXT EDITOR
WITHIN THE
EDITOR
Text Prompt
• Ctrl X -> Exits without saving
Command Prompt
• EX & EXIT -> Exits without saving
• EXK -> Exits from group of records
• FI -> Saves changes
• FS -> Saves changes and resume edit
1 To go to beginning of Line
9 To go to end of Line
9
nn To go to Line (nn)
Up one line
Block
• Ctrl+g -> To select line from text prompt
• After pasting, paste buffer (or the position of the block) is lost
Locate
•L -> Locate the 1st word of the text entered
•/ -> Locates the whole text
UNIX
• PATH=$PATH:/apps/bin
• Export PATH
Windows
• SET PATH=%PATH%;D:\apps\bin
• export JBCOBJECTLIST
Windows
• SET JBCOBJECTLIST=%HOME%\lib;C:\dev\TESTBASE\lib
NOTE: All system variables are prefixed with $ in Unix and % in
windows
Export JBCDEV_BIN=$HOME/bin
Export JBCDEV_LIB =$HOME/bin
Infobasic Programming
Program Subroutine
PROGRAM SUBROUTINE
Write Program/Subroutine
Compile and catalog the Program/Subroutine
Execute the Program/Subroutine
*Comments
PROGRAM <Program name>
Statement 1
Statement 2
Statement 3
END
*Comments
SUBROUTINE <Subroutine name>
Statement 1
Statement 2
Statement 3
RETURN
END
Program
• Execute in database (jshell) prompt
• Enter Program name in database prompt & press Enter key
Subroutine
• Execute in Globus prompt
• Log into T24 classical mode
• Enter Subroutine name in Globus prompt & press Enter key
NOTE: For Subroutine execution in Globus prompt, make a
PGM entry of the program with type as M
Subroutine called
IF..THEN
IF..END ELSE..END
CASE
FOR
LOOP WHILE
LOOP REPEAT
IF <condition> THEN
<statements>
END ELSE
<statements>
END
IF expression THEN
statements
END ELSE
IF expression THEN
statements
END ELSE
statements
END
END
BEGIN CASE
CASE <variable> = <value>
<statements>
CASE <variable> = <value>
<statements>
CASE <variable> = <value>
<statements>
CASE 1
<statements>
END CASE
LOOP <statements>
WHILE/UNTIL <expression>
<statement>
REPEAT
Loop <statement>
UNTIL <expression>
<statement>
REPEAT
LOOP-WHILE LOOP-UNTIL-REPEAT
Facilitates repeated
Facilitates repeated execution
execution of a set of
of a set of statements, control
statements, control exits from
exits from structure when
structure when condition
condition evaluates to false
evaluates to true
T H E S Y S
1 2 3 4 5 6
Array Types
Dynamic Dimensioned
E.g. R.CUSTOMER E.g. ID.NEW
Dynamic in nature
Variable length
Need not be declared
Can hold any type of data
All variables in Infobasic are dynamic arrays
Dynamic Array
Dimensioned Array
Initialization of variable
Can store any type and any amount of data
E.g.
• CUSTOMER.CODE = ‘’
• WORKING.BAL =0
• DATE = “110602”
DIM ARRAY1(4,3)
4 – Rows
3 – Columns
DIM ARRAY2(4)
4 – Rows
Unlimited columns