From 10de5bbde13317ef19255573722015a217812ad9 Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 12 Oct 2016 15:11:47 -0400 Subject: Code for generating posts and pages --- post.bas | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 3 deletions(-) (limited to 'post.bas') diff --git a/post.bas b/post.bas index 06e30a0..4385413 100644 --- a/post.bas +++ b/post.bas @@ -1,4 +1,88 @@ -5000 REM ======================== +5000 REM =============================== 5001 REM Build a post page -5002 REM INPUT - FL$ File list -5003 REM FLCOUNT List length \ No newline at end of file +5002 REM INPUT - SFL$ File list +5003 REM TIT$ Title list +5004 REM LC List length +5005 REM FINDEX File to build +5006 REM HFILE$ Header template +5007 REM FFILE$ Footer template +5008 REM OUTFILE$ Output file +5009 REM LBL$ Template labels +5010 REM REPL$ Template +5011 REM replacements +5012 REM ILBL Length of template +5013 REM labels +5009 REM =============================== +5020 OPEN OUTFILE$ FOR OUTPUT AS #13 + +5030 REM Header template right now +5040 TMPLATE$ = HFILE$ +5050 FOR I = 1 TO ILBL +5060 IF LBL$[I] = "title" THEN LBL$[I] = TIT$[FINDEX]:GOTO 5080 +5070 NEXT I +5080 GOSUB 18000 +5090 PRINT#13, TTEXT$ + +5500 REM Process textile now +5510 TFILE$ = SFL$[FINDEX] +5520 HFILE$ = "WORK.TMP" +5530 GOSUB 10000 +5540 OPEN "WORK.TMP" FOR INPUT AS #1 +5550 WHILE NOT EOF(1) +5560 LINE INPUT#1, ONEL$ +5570 PRINT#13, ONEL$ +5580 WEND +5590 CLOSE #1 +5600 SHELL "DEL WORK.TMP" + +5700 REM Process the footer +5710 TMPLATE$ = FFILE$ +5720 GOSUB 18000 +5730 PRINT#13, TTEXT$ + +5770 REM And close our post! +5780 CLOSE #13 +5790 RETURN + +6000 REM =============================== +6001 REM Build a regular page +6002 REM INPUT - TFILE$ Page file +6003 REM PTITL$ Page title +6004 REM HFILE$ Header template +6005 REM FFILE$ Footer template +6006 REM OUTFILE$ Output file +6007 REM LBL$ Template labels +6008 REM REPL$ Template +6009 REM replacements +6010 REM ILBL Length of template +6011 REM labels +6012 REM =============================== +6020 OPEN OUTFILE$ FOR OUTPUT AS #13 + +6030 REM Header template right now +6040 TMPLATE$ = HFILE$ +6050 FOR I = 1 TO ILBL +6060 IF LBL$[I] = "title" THEN LBL$[I] = PTITL$:GOTO 5080 +6070 NEXT I +6080 GOSUB 18000 +6090 PRINT#13, TTEXT$ + +6100 REM Process textile now +6110 HFILE$ = "WORK.TMP" +6120 GOSUB 10000 +6130 OPEN "WORK.TMP" FOR INPUT AS #1 +6140 WHILE NOT EOF(1) +6150 LINE INPUT#1, ONEL$ +6160 PRINT#13, ONEL$ +6170 WEND +6180 CLOSE #1 +6190 SHELL "DEL WORK.TMP" + +6200 REM Process the footer +6210 TMPLATE$ = FFILE$ +6220 GOSUB 18000 +6230 PRINT#13, TTEXT$ + +6250 REM And close our post! +6260 CLOSE #13 +6270 RETURN -- cgit v1.2.3