| Here's a command file that I stole from this conference a while ago (probably
MUSIC_V2). Works great for me, I use it all the time...
alan
$
$! LABEL.COM
$
$! This program will read a data file of song titles, artist
$! and record title and produce a Postscript file for cassette labels
$
$! 19-JAN-1989 Nigel Barker
$! 28-NOV-1989 NB
$
$
$INIT:
$
$ gosub symbols
$ on control_y then goto close_files
$ on error then goto close_files
$
$START:
$ say clear_screen
$ say program_title
$ say ""
$
$! If 'P1' is passed this is the name of an input file
$ if p1 .eqs. "" then goto read_filename
$ input_file = p1
$! if we pass p2 it defines if we want prompts as we go through the source file
$ notinteractive = p2
$ goto open
$
$READ_FILENAME:
$! Get the name of the input file we are going to use
$ read sys$command/end_of_file=exit/prompt=-
"Input filename : <NO FILE EXISTS> " input_file
$! if a file name is given then skip to actually create output file
$ if input_file .nes. "" then goto open
$
$
$READ:
$! Read in details of album
$ read sys$command/prompt="Artist name : <EXIT> " artist
$ if artist .eqs. "" then goto close_source
$ read sys$command/prompt="Album title : " title
$ read sys$command/prompt="Set number : " set_number
$ read sys$command/prompt="Songlist heading : <''title'>" heading
$ if heading .eqs. "" then heading = title
$
$! define name of source file we are going to write to
$ source_file := source.txt
$! open new source file for write
$ open/write source 'source_file'
$
$ write source artist
$ write source title
$ write source heading
$ write source set_number
$
$! Loop around collecting songtitles & write them to output file
$SONG_LOOP:
$ read sys$command/prompt="Song title : <EXIT> " songtitle
$! exit out of loop if <RET> is hit
$ if songtitle .eqs. "" then goto song_loop_exit
$ write source songtitle
$ goto song_loop
$
$SONG_LOOP_EXIT:
$!Last songtitle should be % character
$ write source "%"
$
$! Go back and read some more titles
$ goto read
$
$CLOSE_SOURCE:
$! Close the file
$ close source
$! Rename it to a name made up from title
$ input_file = f$extract(0,f$locate("'",title),title)
$ input_file =input_file + f$extract(f$locate("'",title)+1,20,title)
$ input_file = f$edit(input_file,"collapse") + ".label"
$ rename/nolog 'source_file' 'input_file'
$
$ say ""
$ say "Details stored in file ''input_file'"
$ say ""
$
$! Check whether this newly created input file should be processed
$ prompt = "Do you want to make a label from this new file ? <Y> "
$ read sys$command/end_of_file=close_files/prompt="''prompt'" rep
$ if rep .eqs. "" then rep = "Y"
$ if .not. rep then goto exit
$
$OPEN:
$! if there is no . then append .label to filename
$ if f$locate(".",input_file) .eq. f$length(input_file) then -
input_file = input_file + ".LABEL"
$! Open input file
$ open/read infile 'input_file'
$! Open the output filename is 'input_file'.ps
$
$OPEN_OUTPUT_FILE:
$ output_file = f$element(0,".",input_file) + ".PS"
$ open/write outfile 'output_file'
$
$! Actually start writing the output file
$WRITE_LABEL:
$! Write out the initial macro for postscript printers defining x,y origin
$ outrec = " /inch {72 mul} def 20 20 translate"
$ write outfile outrec
$
$! Start off doing side A
$ side = "A"
$! Counter for number of labels on one sheet
$ label_count = 0
$
$! Read first 3 lines
$READ_TITLES:
$! Counter for number of songs. Zeroized if side A
$ if side .eqs. "A" then count = 0
$ read/end_of_file=close_files infile artist'side'
$ read/end_of_file=close_files infile title'side'
$ read/end_of_file=close_files infile heading'side'
$ read/end_of_file=close_files infile set_number'side'
$ read/end_of_file=close_files infile first_song'side'
$! Only accept set_number for side A & only 3 characters
$ set_number = f$extract(0,3,set_numbera)
$
$! Display lines on screen
$ if side .eqs. "A" then say clear_screen
$ if side .nes. "A" then say ""
$ say "''bold'SIDE ''side'''off'"
$ say "''bold'Artist : ''off'" + artist'side'
$ say "''bold'Title : ''off'" + title'side'
$ say "''bold'Heading ''off'" + heading'side'
$ say "''bold'First song ''off'" + first_song'side'
$ if set_numbera .nes. "" .and. side .eqs. "A" -
then say "''bold'Set number : ''off'" + set_number
$ say ""
$
$! If we are running non-interactively then skip the prompts
$ if notinteractive then goto read_songs
$
$! Check that this is the correct one to print
$ prompt = "Is this the correct artist & title etc ? <Y> "
$ read sys$command/end_of_file=close_files/prompt="''prompt'" rep
$ if rep .eqs. "" then rep = "Y"
$
$! If correct then go on to start collecting these titles into local symbols
$ if rep then goto read_songs
$
$! Not the correct one so keep reading through until next set of titles
$READ_TITLE_LOOP:
$ read infile test
$ if test .eqs. "%" then goto read_title_loop_end
$ goto read_title_loop
$
$! Found the next set so skip back to see if this is correct
$READ_TITLE_LOOP_END:
$ goto read_titles
$
$! Read input file & get songtitles into symbols - song1 -> song'n'
$READ_SONGS:
$ count = count + 1
$ song'count' = first_song'side'
$READ_SONGS_LOOP:
$ count = count + 1
$ read/end_of_file=close_files infile test
$ song'count' = test
$! if we read in a % then that is end of songs for this side
$ if test .eqs. "%" then goto read_songs_loop_exit
$! loop around for next song title
$ goto read_songs_loop
$
$READ_SONGS_LOOP_EXIT:
$! Increment count of labels if this is side A
$ if side .eqs. "A" then label_count = label_count + 1
$
$!Change from side A to side B and vice versa
$ if side .eqs. "B" then goto move_origin
$ side = "B"
$ goto read_titles
$
$
$! If not first label then must reset the origin of label
$MOVE_ORIGIN:
$! display actual label
$ gosub display_label
$! display message on screen
$ say "''flash'Working...''off' Writing label number ''label_count' to file"
$ if label_count .eq. 1 then goto song_title_box
$
$! postion label on page
$ position := "0.0 inch 3.7 inch"
$! if this is fourth label then we must set print position across page
$ if label_count .eq. 4 then position := "3.96 inch -7.31 inch"
$
$ outrec = " ''position' translate"
$ write outfile outrec
$
$! Draw a box for the song titles
$SONG_TITLE_BOX:
$ outrec = " 0.0 inch 0.0 inch moveto"
$ write outfile outrec
$ outrec = " 3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0.0 inch 2.47 inch rlineto"
$ write outfile outrec
$ outrec = " -3.94 inch 0.0 inch rlineto"
$ write outfile outrec
$ outrec = " 0.0 inch -2.47 inch rlineto"
$ write outfile outrec
$ outrec = " 1 setlinewidth"
$ write outfile outrec
$ outrec = " closepath"
$ write outfile outrec
$ outrec = " 1 setgray"
$ write outfile outrec
$ outrec = " fill"
$ write outfile outrec
$ outrec = " 0 setgray"
$ write outfile outrec
$ outrec = " newpath"
$ write outfile outrec
$ outrec = " 1.97 inch 0 inch moveto"
$ write outfile outrec
$ outrec = " 1.97 inch 2.47 inch lineto"
$ write outfile outrec
$ outrec = " 1 setlinewidth"
$ write outfile outrec
$ outrec = " closepath"
$ write outfile outrec
$ outrec = " stroke"
$ write outfile outrec
$ outrec = " newpath"
$ write outfile outrec
$ outrec = " 0.0 inch 2.2 inch moveto"
$ write outfile outrec
$ outrec = " 3.94 inch 2.2 inch lineto"
$ write outfile outrec
$ outrec = " 1 setlinewidth"
$ write outfile outrec
$ outrec = " closepath"
$ write outfile outrec
$ outrec = " stroke"
$ write outfile outrec
$ outrec = " 0 setgray"
$ write outfile outrec
$
$! Draw a box above the songtitles for artist information/title etc.
$ outrec = " 0.0 inch 2.47 inch translate"
$ write outfile outrec
$ outrec = " 0.0 inch 0.0 inch moveto"
$ write outfile outrec
$ outrec = " 3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0 0.5 inch rlineto"
$ write outfile outrec
$ outrec = " -3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0 0.5 inch rlineto"
$ write outfile outrec
$ outrec = " closepath"
$ write outfile outrec
$ outrec = " 1 setgray"
$ write outfile outrec
$ outrec = " fill"
$ write outfile outrec
$
$! Now draw the boxes on the spine
$SPINE_BOXES:
$ outrec = " 0.0 inch 0.0 inch moveto"
$ write outfile outrec
$ outrec = " 3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0 0.5 inch rlineto"
$ write outfile outrec
$ outrec = " -3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0 0.5 inch rlineto"
$ write outfile outrec
$ outrec = " closepath"
$ write outfile outrec
$ outrec = " 0 setgray"
$ write outfile outrec
$ outrec = " stroke"
$ write outfile outrec
$
$! Print first artist & title on spine
$SPINE_ARTISTA:
$ spine_font := 11
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
f$edit(titleb,"collapse") .eqs. "" then spine_font := 15
$ if (f$len(artista)+f$len(titlea)) .ge. 45 then spine_font := 10
$ spine_pos := 3
$ if f$edit(artista,"collapse") .eqs. "" .and. -
f$edit(titlea,"collapse") .eqs. "" then goto spine_artistb
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
f$edit(titleb,"collapse") .eqs. "" then spine_pos := 17
$ outrec = " /AvantGarde-Demi findfont ''spine_font' scalefont setfont"
$ write outfile outrec
$ outrec = " 0.1 inch 0.''spine_pos' inch moveto"
$ write outfile outrec
$ outrec = " (''artista') show"
$ write outfile outrec
$ outrec = " ( - ''titlea') show"
$ write outfile outrec
$
$
$! Print titles on spine
$SPINE_ARTISTB:
$ spine_font := 11
$ if f$edit(artista,"collapse") .eqs. "" .and. -
f$edit(titlea,"collapse") .eqs. "" then spine_font := 15
$ if (f$len(artistb)+f$len(titleb)) .ge. 45 then spine_font := 10
$ spine_pos := "07"
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
f$edit(titleb,"collapse") .eqs. "" then goto set_number
$ if f$edit(artista,"collapse") .eqs. "" .and. -
f$edit(titlea,"collapse") .eqs. "" then spine_pos := 17
$ outrec = " /AvantGarde-Demi findfont ''spine_font' scalefont setfont"
$ write outfile outrec
$ outrec = " 0.1 inch 0.''spine_pos' inch moveto"
$ write outfile outrec
$ outrec = " (''artistb') show"
$ write outfile outrec
$ outrec = " ( - ''titleb') show"
$ write outfile outrec
$
$! Print tape number in set only from side a- skip if it is a null
$SET_NUMBER:
$ if set_number .eqs. "" then goto flap_box
$ outrec = " /Times-Bold findfont 30 scalefont setfont"
$ write outfile outrec
$! print position slightly different for set I or set II
$ set_pos = "3.7"
$ if f$length(set_number) .eq. 2 then set_pos = "3.6"
$ if f$length(set_number) .eq. 3 then set_pos = "3.5"
$ outrec = " ''set_pos' inch 0.1 inch moveto"
$ write outfile outrec
$ outrec = " (''set_number') show"
$ write outfile outrec
$
$! Now a box for small flap
$FLAP_BOX:
$ outrec = " 0.0 inch 0.5 inch translate"
$ write outfile outrec
$ outrec = " 0.0 inch 0.0 inch moveto"
$ write outfile outrec
$ outrec = " 3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0.0 inch 0.62 inch rlineto"
$ write outfile outrec
$ outrec = " -3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0.0 inch -0.62 inch rlineto"
$ write outfile outrec
$ outrec = " closepath"
$ write outfile outrec
$ outrec = " 0.9 setgray"
$ write outfile outrec
$ outrec = " fill"
$ write outfile outrec
$ outrec = " 0 setgray"
$ write outfile outrec
$
$! Print artist and title on small flap
$
$SMALL_ARTISTA:
$ small_font := 11
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
f$edit(titleb,"collapse") .eqs. "" then small_font := 15
$ if (f$len(artista)+f$len(titlea)) .ge. 45 then small_font := 10
$ small_pos := 4
$ if f$edit(artista,"collapse") .eqs. "" .and. -
f$edit(titlea,"collapse") .eqs. "" then goto small_artistb
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
f$edit(titleb,"collapse") .eqs. "" then small_pos := 25
$ outrec = " /AvantGarde-Book findfont ''small_font' scalefont setfont"
$ write outfile outrec
$ outrec = " 0.1 inch 0.''small_pos' inch moveto"
$ write outfile outrec
$ outrec = " (''artista') show"
$ write outfile outrec
$ outrec = " ( - ''titlea') show"
$ write outfile outrec
$
$! Do it again for other artist and title
$
$SMALL_ARTISTB:
$ small_font := 11
$ if f$edit(artista,"collapse") .eqs. "" .and. -
f$edit(titlea,"collapse") .eqs. "" then small_font := 15
$ if (f$len(artistb)+f$len(titleb)) .ge. 45 then small_font := 10
$ small_pos := 1
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
f$edit(titleb,"collapse") .eqs. "" then goto small_box
$ if f$edit(artista,"collapse") .eqs. "" .and. -
f$edit(titlea,"collapse") .eqs. "" then small_pos := 25
$ outrec = " /AvantGarde-Book findfont ''small_font' scalefont setfont"
$ write outfile outrec
$ outrec = " 0.1 inch 0.''small_pos' inch moveto"
$ write outfile outrec
$ outrec = " (''artistb') show"
$ write outfile outrec
$ outrec = " ( - ''titleb') show"
$ write outfile outrec
$
$! Now a box around the whole thing
$SMALL_BOX:
$ outrec = " 0.0 inch -3.00 inch translate"
$ write outfile outrec
$ outrec = " 0.0 inch 0.0 inch moveto"
$ write outfile outrec
$ outrec = " 3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0.0 inch 3.63 inch rlineto"
$ write outfile outrec
$ outrec = " -3.94 inch 0 rlineto"
$ write outfile outrec
$ outrec = " 0.0 inch -3.63 inch rlineto"
$ write outfile outrec
$ outrec = " 3.94 setlinewidth"
$ write outfile outrec
$ outrec = " 0 setgray"
$ write outfile outrec
$ outrec = " closepath"
$ write outfile outrec
$ outrec = " stroke"
$ write outfile outrec
$
$! Label side A and side B with heading
$WRITE_HEADINGA:
$ heading_font := 9
$ if f$len(headinga) .ge. 30 then heading_font := 8
$ outrec = " /AvantGarde-DemiOblique findfont ''heading_font' scalefont setfont"
$ write outfile outrec
$ outrec = " 0.1 inch 2.3 inch moveto"
$ write outfile outrec
$ outrec = " (''headinga') show"
$ write outfile outrec
$WRITE_HEADINGB:
$ heading_font := 9
$ if f$len(headinga) .ge. 30 then heading_font := 8
$ outrec = " /AvantGarde-DemiOblique findfont ''heading_font' scalefont setfont"
$ write outfile outrec
$ outrec = " 2.05 inch 2.3 inch moveto"
$ write outfile outrec
$ outrec = " (''headingb') show"
$ write outfile outrec
$
$! Set x & y coordinates for songtitles
$! Fiddled as DCL is integer only arithmetic
$ x = "0.1"
$ y = 215
$
$! Now print out the songtitles
$! Loop around picking up titles previously read into symbols songtitle'side''n'
$ song_count = 0
$READ_SONGTITLE:
$ partb = ""
$ song_count = song_count + 1
$ if song_count .eq. count then goto end_of_label
$ songtitle = song'song_count'
$
$! Check if end of side A
$ if songtitle .eqs. "%" then goto side_b
$
$! Set font for songtitles
$! If the first character is not a bullet i.e. not a songtitle then switch
$! to an italic font. If the next character (1st or 2nd) is a ~ then use a
$! smaller font.
$ if f$extract(0,1,songtitle) .eqs. "�" then gosub song_italic_font
$ if f$extract(0,1,songtitle) .nes. "�" then gosub song_normal_font
$
$! call subroutine to split up songtitle if more than 30 characters
$ gosub split
$
$! decrement y coordinate
$ gosub y_dec
$
$! Actually print songtitle
$WRITE_SONGTITLE:
$ outrec = " ''x' inch ''z' inch moveto"
$ write outfile outrec
$ outrec = " (" + songtitle + ") show"
$ write outfile outrec
$
$! if songtitle > 30 characters then it will have been split so print 2nd part
$ if partb .eqs. "" then goto read_songtitle
$
$! decrement y coordinate
$ gosub y_dec
$
$ outrec = " ''x' inch ''z' inch moveto"
$ write outfile outrec
$ outrec = " (" + " " + partb + ") show"
$ write outfile outrec
$
$! loop around for next songtitle
$ goto read_songtitle
$
$! Change x coordinate and loop back to print titles on side B
$SIDE_B:
$ x = "2.05"
$ y = 215
$ goto read_songtitle
$
$END_OF_LABEL:
$
$! Print six labels on one page
$! First check whether we have already printed 6 labels
$ if label_count .eq. 6 then goto output_page
$
$! Go back to beginning for next label
$NEXT_LABEL:
$! reset to side A
$ side = "A"
$ goto read_titles
$
$! Tell printer to output the page
$OUTPUT_PAGE:
$ outrec = " showpage"
$ write outfile outrec
$
$! Write out the initial macro
$ outrec = " /inch {72 mul} def 20 20 translate"
$ write outfile outrec
$
$! Reset counter for number of labels on one sheet
$ label_count = 0
$
$! reset to side A
$ side = "A"
$! Go around again to see if there are more labels to process
$ goto read_titles
$
$! Close files but make sure we output page to printer
$CLOSE_FILES:
$ if input_file .nes. "" then close infile
$ if output_file .eqs. "" then goto exit
$ outrec = " showpage"
$ write outfile outrec
$ close outfile
$ say ""
$ say "Labels written to output file ''bold'''output_file'''off'"
$
$EXIT:
$ exit
$
$! SUBROUTINES
$
$SYMBOLS:
$! Define some symbols for use in the procedure
$ say := write sys$output
$ esc[0,7] = 27
$ bell[0,7] = 7
$! Some escape sequences for ANSI-fancy output; names are self explanatory
$ bold := "''esc'[1m"
$ inv := "''esc'[7m"
$ under := "''esc'[4m"
$ flash := "''esc'[5m"
$ double := "''esc'#6"
$ single := "''esc'#5"
$ off := "''esc'[m"
$
$ clear_screen := "''esc'[H''esc'[2J"
$ program_title := "''double'''inv'''space10'TAPE LABEL PROGRAM''space10'''off'"
$ line := "''esc'(0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq''esc'(B"
$ line_t := "''esc'(0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq''esc'(B"
$ line_b := "''esc'(0qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq''esc'(B"
$ spaces := " "
$
$ output_file = ""
$ input_file = ""
$ notinteractive = "N"
$ song_font = 7
$
$ return
$
$SPLIT:
$! Split songtitle up if longer than 30 characters for 7 point font
$ split_count = 30
$ if song_font .eq. 6 then split_count =40
$ if f$length(songtitle) .le. split_count then goto write_bullet
$ parta = f$extract(0,split_count,songtitle)
$ partb = f$extract(split_count,255,songtitle)
$SPLIT_LOOP:
$ if f$extract(split_count,1,parta) .eqs. " " then goto split_loop_exit
$ partb = f$extract(split_count,1,parta) + partb
$ parta = f$extract(0,split_count,parta)
$ split_count = split_count - 1
$ goto split_loop
$
$SPLIT_LOOP_EXIT:
$ partb = f$extract(split_count,1,parta) + partb
$ parta = f$extract(0,split_count,parta)
$ songtitle = parta
$
$WRITE_BULLET:
$! Put a bullet before each songtitle NB This is a bullet� not a full stop.
$! If there is already a bullet there then we remove it
$! if f$extract(0,1,songtitle) .eqs. "�" then bullet = ""
$ bullet = ""
$ if (f$extract(0,1,songtitle) .nes. "�") .and. -
(f$edit(songtitle,"collapse") .nes. "") then bullet = "� "
$ if f$extract(0,1,songtitle) .eqs. "�" then -
songtitle = f$extract(1,255,songtitle)
$ songtitle = bullet + songtitle
$
$ return
$
$DISPLAY_LABEL:
$! Display an approximation of the label on the screen
$ line_cnt = 1
$! clear the screen
$ say clear_screen
$
$ line_a = f$extract(0,40,"''artista' - ''titlea'''spaces'")
$ line_b = f$extract(0,40,"''artistb' - ''titleb'''spaces'")
$ if f$edit(artista,"collapse") .eqs. "" .and. -
(f$edit(titlea,"collapse") .eqs. "") then -
line_a = f$extract(0,40,"''spaces'")
$ say "''double'''inv'''line_a'''off'"
$ line_cnt = line_cnt + 1
$ if f$edit(artistb,"collapse") .eqs. "" .and. -
(f$edit(titleb,"collapse") .eqs. "") then -
line_b = f$extract(0,40,"''spaces'")
$ say "''double'''inv'''line_b'''off'"
$ line_cnt = line_cnt + 1
$ say "''single'''line'"
$ line_cnt = line_cnt + 1
$ say "''double'''bold'''line_a'''off'"
$ line_cnt = line_cnt + 1
$ say "''double'''bold'''line_b'''off'"
$ line_cnt = line_cnt + 1
$ say "''esc'[''line_cnt';38;H''set_number'"
$ line_cnt = line_cnt + 1
$ say "''single'''line'"
$ line_cnt = line_cnt + 1
$ say "''esc'[''line_cnt';H ''headinga'''esc'[''line_cnt';42H''headingb'"
$ line_cnt = line_cnt + 1
$ say "''single'''line_t'"
$ line_cnt = line_cnt + 1
$ song_line = line_cnt
$ display_count = 0
$ column = 0
$ vert = "''esc'(0x''esc'(B"
$DISPLAY_SONG_LOOP:
$ display_count = display_count + 1
$ songtitle = song'display_count'
$ if songtitle .eqs. "%" then goto display_song_end_side
$ partb = ""
$ gosub split
$ say "''esc'[''line_cnt';''column'H''songtitle'''esc'[''line_cnt';40H''vert'"
$ line_cnt = line_cnt + 1
$ if partb .eqs. "" then goto display_song_loop
$ say "''esc'[''line_cnt';''column'H ''partb'''esc'[''line_cnt';40H''vert'"
$ line_cnt = line_cnt + 1
$
$ goto display_song_loop
$
$DISPLAY_SONG_END_SIDE:
$! have finished sidea so change column etc for sideb
$ if column .eq. 42 then goto display_song_loop_exit
$ column = 42
$ line_cnt = song_line
$ goto display_song_loop
$
$DISPLAY_SONG_LOOP_EXIT:
$ say "''esc'[23;80H"
$
$SET NOVER
$! reset terminal setting
$ set terminal/wrap
$return
$
$SONG_NORMAL_FONT:
$! Set the font for the song titles
$ song_font = 7
$! set to a smaller font if specified in source file by a ~ as 3rd character
$ if f$locate("~",songtitle) .eqs. 0 then song_font = 6
$ outrec = " /Helvetica findfont ''song_font' scalefont setfont"
$ write outfile outrec
$ if f$locate("~",songtitle) .eqs. 0 then -
songtitle = f$extract(1,255,songtitle)
$ return
$
$SONG_ITALIC_FONT:
$! Set the font for the song titles
$ song_font = 7
$! set to a smaller font if specified in source file by a ~ as 1st character
$ if f$locate("~",songtitle) .eqs. 1 then song_font = 6
$ outrec = " /Helvetica-Oblique findfont ''song_font' scalefont setfont"
$ write outfile outrec
$ if f$locate("~",songtitle) .eqs. 1 then -
songtitle = f$extract(0,1,songtitle) + f$extract(2,255,songtitle)
$ return
$
$Y_DEC:
$! decrement y coordinate depending on what size font was used
$ y_dec = 12
$ if song_font .eq. 6 then y_dec = 10
$ y = y - y_dec
$
$! Convert y to a decimal in string form
$
$ z = "0''y'"
$ z = f$extract(f$len(z)-3,1,z)+"."+f$extract(f$len(z)-2,2,z)
$
$! check if songtitle is off bottom of label
$ if y .le. 10 then gosub too_many_songs
$
$ return
$
$! Too many songs to fit on label
$TOO_MANY_SONGS:
$ say "''bell'"
$ say "''esc'[10;20H''inv' Too many songtitles to fit on label ''off'"
$ read sys$command/end_of_file=close_files/prompt=-
"''esc'[23;25H''inv' Press <RETURN> to continue''off'" rep
$ say ""
$
$ return
|