0 Members and 3 Guests are viewing this topic.
I am not sure whether to go with writing out programs by letters (which would be easier to display and make the editor smaller) or by tokens (which would make the editor much bigger but the saved files smaller).It looks like reading and writing the programs will be the hardest part (so I can compile code written in the editor or edit it in the basic editor also).
It would be really cool if it could display code like "{L1 +8}" as "boss1hp" if the user declares the name. That way variables can have really long custom names and there (theoretically) is not a name limit.
Is there any way to convert between the program editor tokens and the display tokens without way too many if statements?
For the tokens I have decided to have the program written out in letters so it is easier to display and have it convert each command to token form when the user quits.
As I understand Axe has a limit on the number of named variables (around 150?) and this would bypass that since when it is written to the program it would be written as {L1 +8}
I must be missing something on the >Tok command. When I ask it to display {A} (or {A}r) >Tok, it displays a completely different token.
Quote from: E37 on November 03, 2015, 07:54:13 pmI must be missing something on the >Tok command. When I ask it to display {A} (or {A}r) >Tok, it displays a completely different token.The OS calls for displaying tokens require a pointer to the token to be displayed. And Axe uses these calls to implement ▶Tok, so the same applies. I presume this decision was made because tokens are almost always displayed as part of a program or string in RAM, and putting the read in the call saves callers from having to do so. Since you're also editing a program in RAM, this decision should actually make your code simpler. Just drop the curly brackets for the memory read.
How would I write tokens back to the program? "token" -> A doesn't work
Is there a way to tell if a token is one or two byte when you display it?
Awesome! The only other thing I need to know (for now) is what is the best way to find a program's size?Is it with the length( command or with {ptr - 2}?
edit: is there a way to get (not set) the cursor's position?
Is there a way to display the custom tokens? I can't seem to find a good way to choose tokens without creating a program with them or by chaining if statements.