0% found this document useful (0 votes)
35 views2 pages

Prog Zol

This program opens a file called "TR.ZOL" and displays a menu with options to insert a new student record or exit. Selecting insert prompts the user to enter student data like ID, name, classification, region, tests written, and specialization. The data is then written as a new record to the "TR.ZOL" file.

Uploaded by

zel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views2 pages

Prog Zol

This program opens a file called "TR.ZOL" and displays a menu with options to insert a new student record or exit. Selecting insert prompts the user to enter student data like ID, name, classification, region, tests written, and specialization. The data is then written as a new record to the "TR.ZOL" file.

Uploaded by

zel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

>JED TRG.BP PROG.

ZOL
File TRG.BP , Record 'PROG.ZOL'
Insert 03:49:36
Command->
0001 PROGRAM PROG.ZOL
0002
0003 * opening the file
0004 OPEN "TR.ZOL" TO T.TR.ZOL THEN CRT "FILE OPEN-SUCCESSFUL" ELSE CRT "UNABLE
TO OPEN FILE"
0005 *Display the menu
0006 CRT "Key in your choice:"
0007 CRT "*******************"
0008 CRT "Choice 1: Insert"
0009 CRT "Choice 2: Exit"
0010 INPUT CHOICE.ZOL
0011 BEGIN CASE
0012 CASE CHOICE.ZOL = 1
0013 GOSUB PERFORM.INSERT.ZOL
0014 CASE CHOICE.ZOL = 2
0015 EXIT(1)
0016 CASE 1
0017 EXIT(1)
0018 END CASE
0019 RETURN
0020 *###############################
0021 PERFORM.INSERT.ZOL:
0022 CRT "Enter a new record"
0023 Z.TRAINER = ' '
0024 CRT "STUDENT ID:"
0025 INPUT Z.STUDENT.ID
0026 CRT "ENTER NAME: "
0027 INPUT Z.NAME
0028 Z.TRAINER<-1> = Z.NAME
0029 CRT " ENTER CLASSIFICATION:"
0030 INPUT Z.CLASSIFICATION
0031 Z.TRAINER<-1> = Z.CLASSIFICATION
0032 CRT"ENTER REGION: "
0033 INPUT Z.REGION
0034 Z.TRAINER<-1> =Z.REGION
0035 CRT "ENTER TESTS WRITTEN:"
0036 CRT "IF THERE ARE MORE THAN ONE VALUE, SEPARATE USING SEMI-COLON(;) AND
ENTER VALUES :"
0037 INPUT Z.TESTS.WRITTEN
0038 Z.TEST.COUNT = DCOUNT(Z.TESTS.WRITTEN,';')
0039 FOR Z.T.COUNT = 1 TO Z.TEST.COUNT
0040 Z.TC = FIELD(Z.TESTS.WRITTEN,';',Z.T.COUNT,1)
0041 Z.TRAINER<4,-1> = Z.TC
0042 NEXT Z.T.COUNT
0043 CRT "ENTER SPECIALIZATION"
0044 CRT "IF THERE ARE MORE THAN ONE VALUE, SEPARTE USING AT (@) AND ENTER
VALUES: "
0045 INPUT Z.SPECIALIZATION
0046 Z.SPEC = DCOUNT(Z.SPECIALIZATION,'!')
0047 FOR Z.SPECIAL = 1 TO Z.SPEC
0048 Z.SP = FIELD(Z.SPECIALIZATION,'!',Z.SPECIAL,1)
0049 Z.TRAINER<5,-1> = Z.SP
0050 NEXT Z.SPECIAL
0051 WRITE Z.TRAINER TO T.TR.ZOL,Z.STUDENT.ID SETTING V.ERR.VAR ON ERROR
0052 CRT "RECORD COULD NOT BE WRITTEN"
0053 CRT "REASON": V.ERR.VAR
0054 END
0055 RETURN
0056 END

>BASIC TRG.BP PROG.ZOL


jsh t24train ~ -->BASIC TRG.BP PROG.ZOL
PROG.ZOL
Source file PROG.ZOL compiled successfully
jsh t24train ~ -->

jsh t24train ~ -->CATALOG TRG.BP PROG.ZOL


PROG.ZOL
Object PROG.ZOL cataloged successfully
jsh t24train ~ -->
jsh t24train ~ -->PROG.ZOL
FILE OPEN-SUCCESSFUL
Key in your choice:
*******************
Choice 1: Insert
Choice 2: Exit
?
##################################

You might also like