home *** CD-ROM | disk | FTP | other *** search
-
-
- ______________________________________________________________________
-
- ! REM Basic Program : bas-exam.spe !
-
- ! REM Date written : 19.3.86 !
-
- ! REM Author : vom Bovert !
-
- ! REM Structogram saved on disk : 35 !
-
- ! REM Basicsource saved on disk : 35 !
-
- ! REM !
-
- ! REM main program !
-
- ! REM !
- ______________________________________________________________________
-
- ! REM assignments !
-
- ! t1$ = "Program Name: bas-exam" !
-
- ! t2$ = "Create file (1), display file (2)?" !
- ______________________________________________________________________
-
- ! PRINT t1$ !
-
- ! REM an unconditioned loop is following !
- ______________________________________________________________________
-
- ! !
- ___________________________________________________________________
-
- ! ! PRINT t2$ !
-
- ! ! INPUT zchen$ !
- ___________________________________________________________________
-
- ! ! REM case !
-
- ! ! IF zchen$ !
- ___________________________________________________________________
-
- ! ! = "1" ! = "2" ! REM else-case !
- ___________________________________________
-
- ! ! REM case 1 ! REM case 2 ! REM end !
-
- ! ! REM create file ! REM display file ! EXIT !
-
- ! ! GOSUB basbsp ! GOSUB zweite ! !
- ______________________________________________________________________
-
- ! REM end of program !
-
- ! END !
- ______________________________________________________________________
-
- ! zweite subroutine !
-
- ! !
-
- ! s u b r o u t i n e display file !
-
- ! !
- ___________________________________________________________________
-
- ! ! REM assignment !
-
- ! ! t3$ = "Display another record (y/n)?" !
- ___________________________________________________________________
-
- ! ! REM open file !
-
- ! ! OPEN "basbsp1.dat" FOR INPUT AS 1 !
-
- ! ! a = 1 : REM initiate !
-
- ! ! REM condition !
- ___________________________________________________________________
-
- ! ! REM conditioned loop !
-
- ! ! WHILE a = 1 !
- ________________________________________________________________
-
- ! ! ! REM reading sucessful ? !
-
- ! ! ! IF eof(1) !
- ________________________________________________________________
-
- ! ! ! REM End of file ! LINE INPUT #1,eins$ : REM input line !
-
- ! ! ! EXIT ! PRINT eins$ : REM display line !
-
- ! ! ! ! PRINT t3$ !
- ______________________________________________
-
- ! ! ! ! REM another record ? !
-
- ! ! ! ! INPUT zchen$ !
-
- ! ! ! ! IF zchen$ = "y" !
- ______________________________________________
-
- ! ! ! ! REM yes ! REM no !
-
- ! ! ! ! ! a = 0 !
- ___________________________________________________________________
-
- ! ! REM close file !
-
- ! ! CLOSE 1 !
- ___________________________________________________________________
-
- ! !
- ______________________________________________________________________
-
- ! basbsp subroutine !
-
- ! !
-
- ! s u b r o u t i n e write file !
-
- ! !
- ___________________________________________________________________
-
- ! ! REM assignment !
-
- ! ! t4$ = "How many records are to be written?" !
- ___________________________________________________________________
-
- ! ! REM create file !
-
- ! ! OPEN "basbsp1.dat" FOR OUTPUT AS 1 !
-
- ! ! PRINT t4$ !
-
- ! ! INPUT anzahl : REM input number of records !
- ___________________________________________________________________
-
- ! ! REM indexed loop !
-
- ! ! REM !
-
- ! ! FOR zaehl = 1 TO anzahl !
- ________________________________________________________________
-
- ! ! ! INPUT auss$ : REM input record !
-
- ! ! ! PRINT auss$ : REM display record !
-
- ! ! ! PRINT #1,auss$ : REM write record !
- ___________________________________________________________________
-
- ! ! REM close file !
-
- ! ! CLOSE 1 !
- ___________________________________________________________________
-
- ! !
- ______________________________________________________________________
-
- 14.06.1987 14.06.1987 0001000F
-