summaryrefslogtreecommitdiff
path: root/tmplate.bas
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2016-10-19 20:07:17 -0400
committerJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2016-10-19 20:07:17 -0400
commit5185d4e34e362d183a2c88a894ecb6f76db437f0 (patch)
tree94845ecf4af6f7fd414438ab70db921ae00b444c /tmplate.bas
parent2f3562beb4bfe459b14188bad1fe340ba4363cac (diff)
downloadgwblog-5185d4e34e362d183a2c88a894ecb6f76db437f0.tar.gz
gwblog-5185d4e34e362d183a2c88a894ecb6f76db437f0.zip
Additional bug fixes for blog engine. Batch file now launches site generator.
Diffstat (limited to 'tmplate.bas')
-rw-r--r--tmplate.bas18
1 files changed, 5 insertions, 13 deletions
diff --git a/tmplate.bas b/tmplate.bas
index 4a4331f..ca83c31 100644
--- a/tmplate.bas
+++ b/tmplate.bas
@@ -1,12 +1,3 @@
-100 TMPLATE$ = "TEST.TXT"
-110 DIM LBL$[1]
-120 DIM REPL$[1]
-130 LBL$[1] = "title"
-140 REPL$[1] = "JEFFS BLOG"
-150 ILBL = 1
-160 GOSUB 18000
-165 PRINT TTEXT$
-170 STOP
18000 REM ============================
18001 REM Template processing
18002 REM
@@ -22,14 +13,16 @@
18030 WHILE NOT EOF(3)
18040 LINE INPUT#3, L$
18050 GOSUB 18100
-18060 TTEXT$ = TTEXT$ + CHR$(13) + L$
+18060 TTEXT$ = TTEXT$ + CHR$(13) + CHR$(10) + L$
18070 WEND
18080 CLOSE #3
+18085 TTEXT$ = TTEXT$ + CHR$(13) + CHR$(10)
18090 RETURN
18100 REM Search for key
+18102 ILSTART = 1
18105 IF LEN(L$) < 7 THEN RETURN
-18110 FOR IL = 1 TO LEN(L$)-2
-18120 IF MID$(L$, IL, 3) = "{% " THEN GOSUB 18150:GOTO 18100
+18110 FOR IL = ILSTART TO LEN(L$)-2
+18120 IF MID$(L$, IL, 3) = "{% " THEN GOSUB 18150:ILSTART=IL+1:GOTO 18105
18130 NEXT IL
18140 RETURN
18150 REM Find the end of the string
@@ -46,4 +39,3 @@
18260 LNEW$ = LEFT$(L$, IL-1) + REPL$[LBLINDEX] + RIGHT$(L$, LEN(L$)-IJ-2)
18270 L$ = LNEW$
18280 RETURN
- \ No newline at end of file