I inputted these lines to a TI-BASIC file in SourceCoder but it never passes the check.

"450-485 NM "->Str1
"COLOR WAVELENGTH VIOLET NM BLUE 450-485 NM CYAN 485-500 NM GREEN 500-565 NM YELLOW 565-590 NM ORANGE 590-625 NM RED 625-740 NM "->Str1

The error message is as follows:
Error on line 1 at "... NM "->S...".<br />Error on line 2 at "... NM CYAN...".<br />Error on line 2 at "... NM GREE...".<br />Error on line 2 at "... NM YELL...".<br />Error on line 2 at "... NM ORAN...".<br />Error on line 2 at "... NM RED ...".<br />Error on line 2 at "... NM "->S...".<br />

I made sure that there are no tabs in the code by putting it in Sublime Text and checking implicit spaces. And for whatever reason Cemetech doesn't display my text right and omits lots of spaces in between.


Here's a screenshot of my post editor so you can see what I mean:
Did you copy and paste this from something? It seems to think the "N" is an invalid character, perhaps something that looks like "N" but isn't. Please try to type a regular "N" over those.
I tried that but I don't think it's the reason. I feel my strings contains invisible/undistinguishable weird encodings/characters that confuse the tokenizer. For example, this string throws an error in SourceCoder:

"COLOR 380450 *485"->Str1

SourceCoder error: Error on line 1 at "... *485"->Str1...".<br />

But if the string works when I paste it from the posted message and try it again in SourceCoder. I have no idea why this happens.
I can't replicate, it works fine for me. Can you click on "Share" and PM the link to me? Maybe I can find the issue or something. Smile
This is my SourceCoder project: http://sc.cemetech.net/?hash=9iRkovo/vQ5swIaHqmdntD+Y4qOt
Your space in front of each "NM" is a weird one, that's not a normal space but rather the ASCII char 0xA0, which is a No-Break Space. Replace them with normal spaces (0x20) and everything is fine Smile
@PT_ Thank you so much.Very Happy I will never think about that. Do you know any way to visualize those weird characters? Is there a good way to detect and handle unsupported characters before compilation?
The real question is, how did you get No Break spaces in the first place, in your programming?
alienk wrote:
@PT_ Thank you so much.Very Happy I will never think about that. Do you know any way to visualize those weird characters? Is there a good way to detect and handle unsupported characters before compilation?
It *would* be nice to give SourceCoder a way to highlight where in the program errors were found. P_T and I will confer about that. Smile
This new feature will be great. And by the way, can you add a replace all option so that
1. it's easier to replace all unsupported characters like em dash, etc.
2. it's easier to convert from TI-BASIC notation to SourceCoder notation (like from → to ->)
Thank you.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement