Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,34 @@
EnableExplicit
Procedure.s CommaQuibble(Input$)
Protected i, count
Protected result$, word$
Input$ = RemoveString(Input$, "[")
Input$ = RemoveString(Input$, "]")
Input$ = RemoveString(Input$, #DQUOTE$)
count = CountString(Input$, ",") + 1
result$ = "{"
For i = 1 To count
word$ = StringField(Input$, i, ",")
If i = 1
result$ + word$
ElseIf Count = i
result$ + " and " + word$
Else
result$ + ", " + word$
EndIf
Next
ProcedureReturn result$ + "}"
EndProcedure
If OpenConsole()
; As 3 of the strings contain embedded quotes these need to be escaped with '\' and the whole string preceded by '~'
PrintN(CommaQuibble("[]"))
PrintN(CommaQuibble(~"[\"ABC\"]"))
PrintN(CommaQuibble(~"[\"ABC\",\"DEF\"]"))
PrintN(CommaQuibble(~"[\"ABC\",\"DEF\",\"G\",\"H\"]"))
PrintN("")
PrintN("Press any key to close the console")
Repeat: Delay(10) : Until Inkey() <> ""
CloseConsole()
EndIf