I've noticed quite a few Batlib conversations recently. Please discuss it here.
Unlocking a whole bunch of special characters not normally available:
"?
For(A,111,245)
Ans+dim(67,{187,A
End
sub(Ans,1,length(Ans)-1)→Str0
Str0 will have a whole bunch of characters not normally available by themselves, such as %, $, @, ~, ;, &, #, |, \, Σ, ▶, Δ, ∠, ∫
and bunches more including letters with accents. Use Rcl to put Str0 into a program. I wrote my own short applet to let you choose a single character to store in Ans.
Nice :D This kind of program is actually why I originally added the ability to use complex lists :D Check this out:
dim(67,187+iseq(x,x,111,245
:D
Basically, the format in memory of a complex lists looks like a real list of the real and complex parts. If you have {a+bi,c+di,e+fi,…} looks like {a,b,c,d,e,f,…}. 187+iseq(x,x,111,245 looks like {187,111,187,112,187,113,…} in RAM.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Nice! Well written! Actually, this program was more difficult than I expected, mainly because I had no idea what numbers (such as 98) needed two elements to turn into a string. If you type dim(67,{98 into your calc and hit enter, well sucks for you :) sucked for me too, I cleared my RAM like, 3 times in a single math class. so I did this:
For(A,1,300)
dim(67,{A,1
If length(Ans)=1:Disp A
End
Which helped a lot :)
Xeda, big huge error in BatLib! Using dim(84,* will not parse BatLib commands. For example running Test:
PrgmT:
dim(26
PrgmTest:
dim(84,"ET
Will cause the calculator to crash and reset. :(
Yeah, that is weird. I think it is actually a bug with the OS because dim(84 is a tiny code that simply calls an OS routine. That is a pretty interesting find, there.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
But on the other hand, I just noticed that expr( will accept BatLib commands. :)
expr("dim(26 works :)
Here's a kind of cool code:
1→A
dim(118
While not(inString(Ans,".DNE
Ans+dim(67,{63})+dim(118,0,A→Str0
A+1→A
Str0
End
"dim(109,1,1,47,"+dim(67,{42})+"Programs"+dim(67,{42})+",
For(A,1,dim(54,63,0,"DStr0
Ans+dim(67,{42})+dim(54,63,A,"DStr0")+dim(67,{42})+",
End
sub(Ans,1,length(Ans)-8
expr(Ans
This will create a popup menu of all of the programs you have installed. On the other hand, the dim(118 command gets slower and slower the higher the program you look for. "dim118,0,15" takes a significant amount of time to run while "dim(118" runs acceptably fast. This kinda sucks since it means that with the 20 something programs I have, running this program takes at least 15 seconds to parse. Also, something with the dim(109 program is messed up as well…it tends to somehow cause the program to loop back on itself. If I run dim(109 from the homescreen, it will continously, run over and over again, no matter how many times I pick an option. Eventually it seems to make its way out of it but this is definitely not what is supposed to happen.
Huh, that is really weird o_O As to the issue with the pop-up command, it is because it registers keys much faster than the OS does. If you put :getKey after it, that should solve your problem. Basically, when you press Enter to select an option, you don't have enough time to depress the button, so the OS reads it as yo pressing Enter, again.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Oh I see that makes sense. But then how would you know which option the person chose? Doesn't popup store to Ans?
Yes, good point >.>
In that case, before exiting the program, maybe do this:
If getKey
Usually, since I use a popup menu in the program to direct it elsewhere, it doesn't exit immediately.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Actually…I found that I could just do this…
dim(…….popup command
Ans→A
getkey
And it worked fine. :)
You could also just do dim(«stuff»→A
Z80 Assembly>English>TI-BASIC>Python>French>C>0
When and where to get this applet? It sounds great.
Coffee + Radiohead = ^^
Sorry, I didn't ever notice this post or your other one (it was probably on a day when there was lots of activity). Here is the latest version (go to the end of that post).
Z80 Assembly>English>TI-BASIC>Python>French>C>0
How does Bat-lib work? Every time I ask in the other threads, the response is as follows:
To use dim(52…
What do any of those dim( commands do? I geus they assume I already know how to use hex and sprites, but I do not. Any help explaining?
Coffee + Radiohead = ^^
New Errors:
One, using dim(64 to write to an archived program causes the calculator to crash.
Two, using dim(60.1,Str1 or Str2 or Ans etc. to archive a variable will archive, but will proceed to crash on return and exit. The calc doesn't crash, but the OS generates either an undefined error or syntax error.
One, using dim(64 to write to an archived program causes the calculator to crash.
This is bothersome. Looking at the code, there is nothing that should be going wrong x.x I'll have to debug that because it seems like another undocumented problem :/
Two, using dim(60.1,Str1 or Str2 or Ans etc. to archive a variable will archive, but will proceed to crash on return and exit. The calc doesn't crash, but the OS generates either an undefined error or syntax error.
I could not replicate this. I didn't get an error or anything, but I tried using Ans and Str1 as the argument. I also tried different name lengths (sometimes I won't notice an issue because I use short program names and in certain circumstances, longer names make a special case).
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Hrrmm, I'll mess with the dim(60 later…that's odd though. I did do it originally out of a program and with Str3, so maybe that might replicate the problem. Funny, even clearing the RAM didn't work.
In the other post, I gave a link to the latest update of BatLib. If you read the readme, it has whole sections devoted to explaining:
-Hexadecimal and binary
-Sprites, how to use them, and methods of drawing sprites
-How data is handled at the low level (editing bytes, how to understand offsets, and other stuff)
There is also a small section going over a few terms (I should expand on that section a bit more in the next update). Further, there are sections for reference, such as prefixes for the different variable types (like programs versus strings or GDBs), the key values since they are different from how BASIC handles it (BatLib has a command to read two key presses at once). There is a reference to how to edit flags (though this is more advanced), and there is a section explaining any errors returned, since BatLib uses its own error handling for many cases.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Okay so I took some more time to check out the dim(60 issue and found it mainly occurred for me when archiving AppVars with a period as the first character. I was still having the problem, even with programs, but clearing the RAM fixed that problem. It's really odd since the error seems to vary, like sometime it'll be syntax other times undefined, other times data type…it's really odd.
Hmm, I'm going to be gone with no internet and no computer for two weeks after tomorrow and I have a lot of stuff to get around, but hopefully I can find time to figure out all of these bugs before the start of next semester ._.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Sounds good, you can probably make a list out of all the ones I've now mentioned. :)
Would it be at all possible to do something like the following:
try
*some code*
on error
*more code*
end
Where in the try-on error block, any error thrown is ignored and the offending line is ignored, and once an error is thrown, then it skips to the on error portion of the block, possible with the number of the line and error type stored into ans. This could be used to prevent potential syntax errors and such in programs.
In BatLib, there is not enough room, I do not believe, to do something like this. I could be mistaken, since I do not know how the app error handler works. However, if I had more coding space, I am pretty sure I could implement it. I did that in Grammer so that a subroutine could parse any errors. I will have to look into two specific OS routines to see if I can come up with some trick.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
It was just something I thought up when playing around in C#'s visual studio, since they have a function similar to this. I wasn't really execting it to work since it sounds like it'll be complicated to implement…
That is actually possible on the TI-89 calcs in 68K BASIC. On the z80 calcs in assembly, there is an OS routine that allows apps to install an error handler instead of letting the OS handle the error. If it works the way I hope it does, I could probably make a command that sets up an error handler that redirects to a label in a BASIC program in about a hundred bytes (to be optimistic).
Hmm, I will have to compare this to the rest of the ToDo list, it could be interesting.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Celtic III has an error handler I know. That might be worth looking into.
Wow, really o.o Back when I was a Celtic 3 pro, it didn't have that, but I never had the latest version D: That would be awesome, I don't think I have the source for the latest version. How does it work?
Z80 Assembly>English>TI-BASIC>Python>French>C>0