Update a configuration file: Difference between revisions

m
Line 2,059:
function cleansyntax(line)
line = strip(line)
if length(line) == 0 || line[1] == '#'""
return "#=blank line=#"
elseif line[1] == '#'
return line
elseif line[1] == ';'
Line 2,163 ⟶ 2,165:
for li in cfglines
if li != ""
if li == "#=blank line=#"
li = ""
end
write(cfgh, li * "\n")
end
Line 2,172 ⟶ 2,177:
# Lines begininning with a hash or a semicolon are ignored by the application
# program. Blank lines are also ignored by the application program.
# The first word on each non comment line is the configuration option.
# Remaining words or numbers on the line are configuration parameter
# data fields.
# Note that configuration option names are not case sensitive. However,
# configuration parameter data is case sensitive and the lettercase must
# be preserved.
# This is a favourite fruit
FAVOURITEFRUIT banana
# This is a boolean that should be set
;NEEDSPEELING
# This boolean is commented out
; SEEDSREMOVED
# How many bananas we have
NUMBEROFBANANAS 1024
4,108

edits