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,36 @@
EnableExplicit
DataSection
STR1:
Data.s ""
STR2:
Data.s "'If I were two-faced, would I be wearing this one?' --- Abraham Lincoln "
STR3:
Data.s "..1111111111111111111111111111111111111111111111111111111111111117777888"
STR4:
Data.s "I never give 'em hell, I just tell the truth, and they think it's hell. "
STR5:
Data.s " --- Harry S Truman "
EndDataSection
Procedure.s collapse(txt$)
Define *c.Character=@txt$, last.c=0, result$
While *c\c
If *c\c<>last
result$+Chr(*c\c)
last=*c\c
EndIf
*c+SizeOf(Character)
Wend
ProcedureReturn result$
EndProcedure
OpenConsole("")
Define *p_data=?STR1, buf$
While *p_data<=?STR4+StringByteLength(PeekS(?STR4))+2
buf$=PeekS(*p_data)
PrintN("Before collapse: «««"+buf$+"»»» (length: "+Str(Len(buf$))+")")
buf$=collapse(PeekS(*p_data))
PrintN("After collapse: «««"+buf$+~"»»» (length: "+Str(Len(buf$))+~")\n")
*p_data+StringByteLength(PeekS(*p_data))+2
Wend
Input()