'|-----------------------------------------------| '|------------ WorkWG.BAS ---------------------| '|---- Copyright 1997 by Richard R. Lindquist ---| '|-----------------------------------------------| '|--------This is Current Ver--------------------| '|-----------------------------------------------| ' ' ' HTLM variables ' ' comma is CHR$(44) ' / is (47) ' = is (61) ' quote is (34) ' single quote is (39) ' count% = 0 imageurl$ = "ImageURL" system$ = "System" pathweb$ = "http://155.37.1.60/Images/" html$ = "" htmlEnd$ = "" title$ = "" titleEnd$ = "" body$ = "" bodyEnd$ = "" href$ = "" imageheight$ = "230" imagewidth$ = "290" imgsrc1$ = " "z" THEN caserec$ = "zzz" 'DO SELECT CASE LEFT$(caserec$, 3) CASE IS = "zx1" ' PRINT "1"; rec$ x = LEN(rec$) x = x - 3 uid$ = MID$(rec$, 4, x) ' uid$ = RIGHT$(rec$, 4) 'uid$ = rec$ GOTO 10 'Need to read in all fields before wrinting file CASE IS = "zx2" 'PRINT "2"; rec$ x = LEN(rec$) x = x - 3 ss$ = MID$(rec$, 4, x) 'ss$ = rec$ GOTO 10 CASE IS = "zx3" 'PRINT "3"; rec$ x = LEN(rec$) x = x - 3 url$ = MID$(rec$, 4, x) 'url$ = RIGHT$(rec$, 4) 'url$ = rec$ GOTO 10 CASE IS = "zx4" 'PRINT "4"; rec$ x = LEN(rec$) x = x - 3 organ$ = MID$(rec$, 4, x) 'Organ$ = RIGHT$(rec$, 4) 'Organ$ = rec$ GOTO 10 CASE IS = "zx5" 'PRINT "5"; rec$ x = LEN(rec$) x = x - 3 ic$ = MID$(rec$, 4, x) 'IC$ = RIGHT$(rec$, 4) 'IC$ = rec$ GOTO 10 CASE IS = "zx6" 'PRINT "6"; rec$ x = LEN(rec$) x = x - 3 sd$ = MID$(rec$, 4, x) 'SD$ = RIGHT$(rec$, 4) 'sd$ = rec$ GOTO 10 CASE IS = "zx7" 'PRINT "6"; rec$ x = LEN(rec$) x = x - 3 process$ = MID$(rec$, 4, x) 'SD$ = RIGHT$(rec$, 4) 'sd$ = rec$ GOTO 10 CASE IS = "zx8" 'PRINT "6"; rec$ x = LEN(rec$) x = x - 3 tcode$ = MID$(rec$, 4, x) CLS PRINT "before: "; tcode$ tcode$ = RTRIM$(tcode$) tcode$ = LTRIM$(tcode$) tcode$ = MID$(tcode$, 2, 3) GOTO 10 CASE IS = "zx9" 'PRINT "6"; rec$ x = LEN(rec$) x = x - 3 mcode$ = MID$(rec$, 4, x) PRINT "before: "; mcode$ mcode$ = RTRIM$(mcode$) mcode$ = LTRIM$(mcode$) mcode$ = MID$(mcode$, 2, 5) PRINT tcode$ PRINT mcode$ 'INPUT o$ GOTO 10 CASE IS = "zx0" 'PRINT "6"; rec$ x = LEN(rec$) x = x - 3 gorm$ = MID$(rec$, 4, x) 'SD$ = RIGHT$(rec$, 4) 'sd$ = rec$ GOTO 10 CASE IS = "zy1" 'PRINT "6"; rec$ x = LEN(rec$) x = x - 3 iby$ = MID$(rec$, 4, x) 'SD$ = RIGHT$(rec$, 4) 'sd$ = rec$ IF LEN(rec$) < 4 THEN iby$ = " " GOTO 10 CASE IS = "zy2" 'PRINT "6"; rec$ x = LEN(rec$) x = x - 3 ibyh$ = MID$(rec$, 4, x) 'SD$ = RIGHT$(rec$, 4) 'sd$ = rec$ GOTO 10 'LOOP UNTIL rec$ = "zzz" CASE IS = "zzz" ' zzz is sentinal for Long Image Description DIM LongD$(125) ' set up string array for all the lines in Long D LongD$(0) = rec$ PRINT LongD$(0) u = 0 DO UNTIL rec$ = "|" 'keep reading Long D lines until end of field | LINE INPUT #1, rec$ IF LEN(rec$) > 1 THEN ' Do not process blank lines or | line u = u + 1 LongD$(u) = rec$ PRINT u, LongD$(u) ' screen out to see progress END IF LOOP 'INPUT k$ END SELECT ' ' All Vars Set ' Ready to Write *.htm file ' ' ' Clean out leading & trailing blanks ' uid$ = RTRIM$(uid$) uid$ = LTRIM$(uid$) url$ = RTRIM$(url$) organ$ = RTRIM$(organ$) sd$ = RTRIM$(sd$) ss$ = RTRIM$(ss$) ic$ = RTRIM$(ic$) url$ = LTRIM$(url$) organ$ = LTRIM$(organ$) sd$ = LTRIM$(sd$) ss$ = LTRIM$(ss$) ic$ = LTRIM$(ic$) tcode$ = LTRIM$(tcode$) mcode$ = LTRIM$(mcode$) gorm$ = LTRIM$(gorm$) iby$ = LTRIM$(iby$) ibyh$ = LTRIM$(ibyh$) tcode$ = RTRIM$(tcode$) mcode$ = RTRIM$(mcode$) gorm$ = RTRIM$(gorm$) iby$ = RTRIM$(iby$) ibyh$ = RTRIM$(ibyh$) ' ' Sreen Out for debugging ' 'PRINT "Uid="; uid$ 'PRINT "Url="; url$ 'PRINT "Organ="; organ$ 'PRINT "SD="; sd$ 'PRINT "Ss="; ss$ 'PRINT "ic="; ic$ 'PRINT "Process = "; process$ 'PRINT "Tcode= "; tcode$ 'PRINT "Mcode= "; mcode$ 'PRINT "GorM = "; gorm$ 'PRINT "By = "; iby$ 'PRINT "Hosp= "; ibyh$ 'PRINT "LongD="; longd$ ' ' Name the generated html page by uid ss$ = LTRIM$(ss$) ss$ = RTRIM$(ss$) Lss% = LEN(ss$) IF Lss% < 1 THEN ss$ = "Junk" fileout$ = quote$ + "c:\eAtlas\" + ss$ + "/" + uid$ + ".htm" + quote$ imgsrc$ = "" PRINT #2, body$ ' ' Nav Bar Generation ' PRINT #2, "" PRINT #2, "
" PRINT #2, "" PRINT #2, "
[Search Frames]" PRINT #2, "[Search No frames]" PRINT #2, "[PathWeb Home]" PRINT #2, "[©]" PRINT #2, "[Feed Back]" PRINT #2, "[About]" 'PRINT #2, "[" + tcode$ + mcode$ + "]" PRINT #2, "
" PRINT #2, "
" PRINT #2, "
" ' ' Nav Bar Done ' '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ' ' Nav Bar Above is Finished ' PRINT #2, "
" PRINT #2, "" PRINT #2, "" PRINT #2, "" PRINT #2, "" PRINT #2, "
" ' 'Copy from ' PRINT #2, "" + imgsrc$ + "" PRINT #2, "" PRINT #2, "" PRINT #2, "
" + sd$ + ", " + organ$ + "" PRINT #2, "
" + ic$ PRINT #2, "
" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '' ' Write out Long Description ' IF LEN(LongD$(0)) > 1 THEN PRINT #2, LongD$(0) PRINT LongD$(0) END IF IF u > 0 THEN w = u u = 0 FOR I = 1 TO w u = u + 1 Flet$ = LEFT$(LongD$(u), 1) PRINT Flet$; "------>"; ASC(Flet$) IF ASC(Flet$) = 149 THEN LongD$(u) = "
" + LongD$(u) IF LongD$(u) <> "|" THEN PRINT #2, LongD$(u) IF LongD$(u) <> "|" THEN PRINT "Writing Now "; LongD$(u) NEXT I ' INPUT o$ CLS END IF ' ' End writing out long description ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' PRINT #2, "
Contrib. by:" + iby$ + " " + ibyh$ PRINT #2, "
" PRINT #2, "" PRINT #2, "" PRINT #2, "" PRINT #2, "
Etiology, Pathogenesis, Clinical, and More Info " PRINT #2, "
" PRINT #2, "
" PRINT #2, "" PRINT #2, "" '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ CLOSE #2 count% = count% + 1 PRINT "HTML Generation Completed" PRINT count%; " html pages have been generated" LOOP UNTIL EOF(1) CLOSE #1 END