I tried to use comments in SC3. Using the normal format:
//Comment
As shown below is a piece of my math program. In SC3 the comments are showing as this light pink color, So I assume it understands that it is a comment.

Code:
//Adding the Factor to table of factors
If [C](1,2)=0:Then//Form: X=+A,X-A
[C](2,2)->[D]([D](1,1),1)
~1*[C](2,1)->[D]([D](1,1),2)
[D](1,1)+1->[D](1,1)
Else
If [C](1,3)=0:Then//Form: X=-A,X+A
~1*[C](2,1)->[C](2,1)
[C](2,2)->[D]([D](1,1),1)
[C](2,1)->[D]([D](1,1),2)
[D](1,1)+1->[D](1,1)
Else//Didn't find a factor

When I transfer the code over to jsTIfied it has put the comments into the code also, therefore the program runs into a syntax error every time. The same goes for if I export the code.

Since Ti-BASIC doesnt actually support comments, I'm pretty sure that they shouldnt be in the compiled code.
For the comments that are on the same line as a TI-BASIC statement, you need to have at least one piece of whitespace, like a space or a tab, between the code and the comment. For example, on the second line, you could have a few tabs between Then and // to make the comment get removed during exporting. Even a single space between Then and // would do the trick.
Oh ok, Thanks.
KermMartian wrote:
For the comments that are on the same line as a TI-BASIC statement, you need to have at least one piece of whitespace, like a space or a tab, between the code and the comment. For example, on the second line, you could have a few tabs between Then and // to make the comment get removed during exporting. Even a single space between Then and // would do the trick.


Why?
Runer112 wrote:
KermMartian wrote:
For the comments that are on the same line as a TI-BASIC statement, you need to have at least one piece of whitespace, like a space or a tab, between the code and the comment. For example, on the second line, you could have a few tabs between Then and // to make the comment get removed during exporting. Even a single space between Then and // would do the trick.


Why?

Because the tokenizer needs a space in order to keep things easier to implement, if you want to be picky the comment start is actually " //" and not just "//" it makes sense and makes it easier to have // inline in a string.
  
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