TextOutputStream syntax error

I am having a hard time figuring out where this syntax error is coming from.

      Dim cr as String = Chr(9)
      Stream.Write(rs.Field("last_name").StringValue+cr)
      Stream.Write(rs.Field("first_name").StringValue+cr)
      Stream.Write (cr)  //Middle Initial
      Stream.Write (cr)  //Suffix
      Stream.Write(rs.Field("salutation").StringValue+cr)   //Title   <----this line generates an error
      Stream.Write (cr)  //Company Name
      Stream.Write(rs.Field("street").StringValue+cr)    //Street  <---this line generates an error

Could something else be going on somewhere that causes lines like these to generate a syntax error?

Try removing the space before the open paren on the two lines that precede the one with the first error and the one the precedes the one with the second error.

You need a space after Write.

Stream.Write(rs.Field("salutation").StringValue+cr)

should be

Stream.Write (rs.Field("salutation").StringValue+cr)

The parentheses are not necessary and this is valid code:

Stream.Write rs.Field("salutation").StringValue+cr

There appears to be no difference in

Stream.Write (cr)

and

Stream.Write(cr)

Removing the parentheses had no effect either.

      Dim s as String
      s = rs.Field("street").StringValue
      Stream.Write (s)  //Street  <-----This line generates a syntax error

Is Stream and rs defined?

Agh!!! You won’t believe this.

I copied the code from my other software to adapt to Xojo. There was some extraneous invisible character before each //.

I just backspaced it out and retyped the comments ( // Street ) and the error is gone.

Yes, I can’t believe it !

Xojo IDE Code Editor have a running method to clear these kind of things (Gremlins) at paste time. I do not know if this also works at project read time.