Comma quibbling: Difference between revisions
Content deleted Content added
Line 2,133:
}
\\ we use ? for Print
? f$({[]})
? f$({["ABC"]})
? f$({["ABC", "DEF"]})
? f$({["ABC","DEF", "G", "H"]})
}
Checkit
</lang>
===Using String functions only===
<lang M2000 Interpreter>
Module Checkit {
function f$ {
what$=filter$(trim$(letter$), chr$(34))
what$=Mid$(what$, 2, len(what$)-2)
count=Len(what$)-Len(filter$(what$,","))
if count>2 then m=rinstr(what$, ", ") : insert m, 2 what$=" and "
="{"+what$+"}"
}
? f$({[]})
? f$({["ABC"]})
Line 2,160 ⟶ 2,179:
=resp$+"}"
}
? f$((,))
? f$(("ABC",))
|