arrays can now be printed

This commit is contained in:
Arne Döring 2017-05-29 17:53:20 +02:00
commit 1f7fc7f279
5 changed files with 81 additions and 25 deletions

View file

@ -23,7 +23,7 @@ proc toStrMaxPrecision*(f: BiggestFloat, literalPostfix = ""): string =
else:
var buf: array[0..80, char]
c_sprintf(buf, "%#.16e" & literalPostfix, f)
result = $buf
result = newString(buf)
proc encodeStr*(s: string, result: var string) =
for i in countup(0, len(s) - 1):
@ -133,4 +133,3 @@ iterator decodeStrArray*(s: cstring): string =
while s[i] != '\0':
yield decodeStr(s, i)
if s[i] == ' ': inc i