Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Looking awesome merth! Very Happy Updated my computer and TIFW archives Smile
Alright, there was an issue with backslashes, still, and I have made some more improvements with how they're handled. Not sure how "\r" will get handled if it's actually in a token.xml file, but for now that's not a huge deal since the calcs don't use it. Here's a screen shot:

The backslashes seem to be behaving.
Download at the normal spot: http://merthsoft.com/Tokens.zip
I know this is soon for a double post, but I thought it important to let everyone know of a bug I found: If you press ctrl+s after having opened an .8xp or .8xv file, it will overwrite the file with a text-version of the program. On top of that, saving makes it have double new lines. I'm working on making this work right, but I'm at the airport right now and my battery is about to die. So, just be careful saving things Smile

Also, a user was seeing issues with it loading in extra tokens at the end. This has now been fixed.
Did you upload a new version when you fixed the extra tokens issue? Because I downloaded the newest, and it still does it.
Hmm, I thought I did. The other user hasn't reported if it's working or not, so I guess I'm not positive. I'll make sure to upload one when I get home. Sorry!
Alright, I've updated a new version that should have this and the saving issue fixed. If it's still not working, please let me know.
Thanks to some help from Deep Though, I've fixed (once again) how saving is handled. Note that any programs you had previously compiled with tokens may now have those extra bytes at the end, but cleaning and rebuilding should fix it. Download at the normal place:

Smile <3
I had some bugs that I fixed:
Hayleia wrote:
- The feature I'd like to see added is to display the number of selected characters. It is useful for example when moving sprites who don't have individual square brackets.
I can see why that would be useful, so I added it. Now when you highlight a section, it tells you how many characters, tokens, and bytes it takes up:

- I noticed that the IDE changes the indentation of a line to make it the same as the previous line. Keeping the indentation of the previous line when creating a new line is very useful, but automatically changing the indentation of an existing line when it is edited is annoying in my opinion.
That is annoying, I didn't even know it did that. I've changed auto-indent off entirely until I can invest some more time into figuring out what's going on there.
- Also, the cursor seems to always blink at the same frequency, while a true text editor cursor sees its cycle changed when it is moved. I mean that when I press a key, the cursor should appear, whatever was its state right before the click. Whereas in your prog, when I press a key, it only moves the cursor but doesn't set the cursor's state as black.
(Not sure if you understood what I mean so when answering me, in the textbox, keep the down key pressed, you'll see that it never blinks until you release the key. Now, do that in TokenIDE, you see that it continues blinking, and when it disappears, it continues moving down but you don't see where it is).
This has been fixed.
tifreak on irc wrote:
The bytes label doesn't update with the current count when you re-check "Live Update"
This has been fixed.
tifreak on irc wrote:
SourceCoder and TokenIDE don't agree about a file when loading it in. SourceCoder puts in two exta characters
I looked into this, and here's what I found:
<Merth_> I'm trying to investigate this issue tifreak_ reported where SC and TokenIDE aren't agreeing on how a file should look. I've made a program on my calc and put it on my computer. I then made the same program on Tokens and made it. I then opened them up in a hex editor and they are identical. I then made an appvar, and they are identical except for the type byte.
<Merth_> And SC handles it just fine as well.
<benryves> Is that with the file he supplied?
<Merth_> I don't I have that file.
<benryves> I guess that's what you need him for. Sad
<Merth_> But if it was a file that he made using an older version of Tokens, it's possible it has some weird data in it if he hasn't built it since upgrading tokens.
<benryves> That would make sense.
<KermM> quite so.
So I need the specific file this is happening on, assuming it still happens if you update to this most recent release.

Download in the normal place:
Heh, just a few days ago I was stumped wishing one of the many TI-BASIC editors out there would have a count-tokens-in-selection feature. I really like the updates here—the features TokenIDE has aren't really standard code editor features, but they're perfect for TI-BASIC.

As for the last bug you mentioned in your post, I'm not sure if this is related (it might even be fixed by now and I hadn't noticed), but I noticed a few months ago that if you import a program containing three consecutive periods (\.\.\.), TokenIDE converted them into the ellipsis character (\xBB\xDB) because it failed to add the backslashes between the dots that would separate them into three characters instead of one. (It caused some problems with formatting of homescreen graphics, but again I haven't checked since then and I don't know if it's been fixed or not.)
It's not related, and it's not a bug, per se, but it is something I've been meaning to fix. As it stands now, there's really no way for it to know if you mean "\.\.\." or "...". I plan on adding the functionality to determine it--it shouldn't be terribly difficult. Thanks for reminding me that it needs to be added Smile
Due to some rather incessant nagging on tifreak's part (thank you, Daniel Smile), I have added the functionality to count blocks, such as While/End etc. Here's an example:

You can specify any number of groups. It's under Tools > Block Counts.
- It currently doesn't handle "Else" gracefully. It just treats it as another token. Ideally it would unindent the "else" line and indent the following line:

- The indentation is automatic, so if you're doing this with Axe and have included your own indentation, it'll extra indent it.
- The AxeTokens.xml file doesn't have any groups defined, so check out Tokens.xml and see how it's doing it if you want to add them to it. I don't know if Axe does it the same way or what.
- Eventually this will be integrated into the main editor so that you don't have to go to a tool to use it. For now, though, it's separate.

Technical details:
There are two new tags that you'll use in the XML:
- indentGroup - String - Which group this token belongs in.
- indentGroupTerminator - Boolean - If it's a terminator.

For example, here's what the Tokens.xml looks like:

   <Token byte="$CE" string="If " />
   <Token byte="$CF" string="Then" indentGroup="End Group" />
   <Token byte="$D0" string="Else" />
   <Token byte="$D1" string="While " indentGroup="End Group" />
   <Token byte="$D2" string="Repeat " indentGroup="End Group" />
   <Token byte="$D3" string="For(" indentGroup="End Group" />
   <Token byte="$D4" string="End" indentGroup="End Group" indentGroupTerminator="true" />

I hope that makes sense!

Download in the normal spot:
Looks fantastic. I hope it doesn't try to indent when code is all on a single line, because then that might cause some issues (Like ZITU)

Can't wait to play with it!
It won't try to indent in-line, but if you're unbalanced and start a new line it may indent, if that makes sense. Here's what it would look like:

Which is a good way to see if it's not balanced.

Also, this doesn't ignore strings, which is, I'm pretty sure, how you want it to behave. What I mean is that it will count tokens within strings, so the actual string "While 1:End" will be balanced, but if it's part of text you're displaying ("While the world came crumbling down" or whatever), it will be unbalanced. The only good way around that for you, since you do generated code, would be to escape the While ("\While").
But that eliminates the five-byte optimization of actually using the token, a trick I use in my programs all over the place! Sad There's no way to do easy syntactic detection of which ones are in strings and which are not?
There is (and you can, of course, remove the escaping once you're sure you're balanced), but he generates code using strings, so that would defeat the whole point.
merthsoft wrote:
There is (and you can, of course, remove the escaping once you're sure you're balanced), but he generates code using strings, so that would defeat the whole point.
Ohhh yeah, excellent point. I don't suppose this is an important enough issue to provide a checkbox specifying whether you want it to read into strings or not?
Generally I wait to see people's workflows before introducing complexity and configurability. If there's enough of a demand for it, I'll add it, but I imagine people will generally just escape it where need-be.
I've made another update. This has two things that are important to tifreak:
1. You can now toggle the indentation in the Block Counts tool. If you toggle it with ZITU note that it'll need a second to update (maybe I should add the Live Update checkbox, too)
2. The Live Update checkbox was broken in the last release. It's fixed now.

As always:
Just for fun, here's a little call graph of the program. The size is "Time in Method", so it shows me what's taking to most amount of time (which is drawing the tokens):

This program is neat because it does it all in real time and shows you he calls and stuff. I want to put it through a full profiler to hopefully optimize it some more.
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 30 of 32
» All times are GMT - 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