rochus-keller / Oberon

Oberon parser, code model & browser, compiler and IDE with debugger, and an implementation of the Oberon+ programming language
GNU General Public License v2.0
464 stars 30 forks source link

Out.String goes past 0x mark #13

Closed tenko closed 2 years ago

tenko commented 2 years ago

The following code:

module TestDate
import Out
var
    a : [32]char
begin 
    a := "abc123"
    Out.String(a) Out.Ln()
    a[0] := 0x
    Out.String(a) Out.Ln()
end TestDate

Outputs:

Starting application...

abc123
bc123

The application finished with code 0

This is with the Mono backend.

rochus-keller commented 2 years ago

Fixed in next commit. System.WriteLine(char[]) apparently doesn't care if there is a zero char; now I converti it to string and use WriteLine(string)..

rochus-keller commented 2 years ago

Commit is up.