REM ********************************************************** REM PROGRAM *************jrdn-CUD.BAS************************* REM ********************************************************** REM Program to merge SEASOFT files from the JORDAN with cudls data CLS 0 REM Input files to be merged 7 PRINT "Input path and name of SEASOFT file. " INPUT "example c:\tmp\9210\9210.asc >", s$ ' s$ = "ds96-20.asc" PRINT "Input path and name of the CUDLS file. " INPUT "example c:\tmp\9210\sum10 >", c$ 'c$ = "av109603.txt" PRINT "Input a path and prefix for the output file" INPUT "example c:\tmp\9210\cc9210 ", o$ 'o$ = "salida" o$ = o$ + ".out" blank$ = " ": REM Blank line in the output files. c1 = 0: REM set counter to zero range = .0002 REM open files for input and output OPEN o$ FOR OUTPUT AS #1 OPEN s$ FOR INPUT AS #2: REM ieh table file OPEN c$ FOR INPUT AS #3: REM cudls file LINE INPUT #2, srec$ LINE INPUT #3, crec$ 'LOCATE 1, 1: PRINT srec$ 'LOCATE 2, 1: PRINT crec$ DO sjul# = VAL(MID$(srec$, 15, 8)) cjul# = VAL(MID$(crec$, 17, 7)) 'LOCATE 5, 1: PRINT "SEASOFT :"; sjul# 'LOCATE 6, 1: PRINT "CUDLS :"; cjul# diff# = cjul# - sjul#: 'LOCATE 7, 1: PRINT "Difference:"; diff# 'LOCATE 8, 1: PRINT ABS(diff#) IF (diff# <= .0002 AND diff# >= -.0002) THEN REM transfer values from string to variables clat# = VAL(MID$(crec$, 1, 6)) clon# = VAL(MID$(crec$, 8, 8)) stem# = VAL(MID$(srec$, 49, 7)) ssal# = VAL(MID$(srec$, 60, 7)) cchl# = VAL(MID$(crec$, 24, 6)) LOCATE 10, 1: PRINT "CUDLS "; clat#, clon#, cjul#, cchl# LOCATE 15, 1: PRINT "SEASOFT"; sjul#, stem#, ssal# PRINT #1, USING "###.###,###.####,###.###,#####.###,###.###,###.###,##.###"; sjul#; cjul#; clat#; clon#; stem#; ssal#; cchl# ' SOUND 1900, 1.8: SOUND 4000, 1 LINE INPUT #2, srec$ LINE INPUT #3, crec$ END IF IF ((diff#) < -.0002) THEN LINE INPUT #3, srec$ LOCATE 20, 10: PRINT "skipping CUDLS" LOCATE 20, 10: PRINT " " END IF IF (diff# > .0002) THEN LINE INPUT #2, srec$ END IF LOOP UNTIL (EOF(2) OR EOF(3)) LOCATE 18, 20: PRINT "EXITING....." CLOSE (3) CLOSE (2) CLOSE (1) END