0 Members and 7 Guests are viewing this topic.
Do I need to make space for it, or can I just copy a program directly to it?Copying it directly doesn't work.Never mind, I messed up the copy statement.Edit: the program runs fine but crashes when exited (the program in e9D93 not the one who ran it)
Quote from: E37 on December 13, 2015, 04:42:05 pmIs there any useful uses of it?I am assuming that the OS has a flag for whether the enter key is pressed on the home screen.It there a way I can "activate the flag" and execute anything it has. I am looking for a way to implement floating point math (It doesn't have to be fast) into my editor as a feature.Basically I am tired of quitting my program to do a math operation on the home screen. (and I don't want to do long math in my head)Thanks!(the whole home screen is a program thing BLEW MY MIND)However you'd end up doing such a thing, you'd need some things beyond the capabilities of pure Axe. My inclination would be to let the user select a line, or some more specific selection, and then press a button to request that it be replaced with its evaluation. I've never done anything like this before, but it might work something like this (DISCLAIMER: COMPLETELY UNTESTED):(Optional) Save the value of Ans. This gets rather tricky for lists and matrices.Create a temporary equation with the same size as the selection. The clean way to do this in assembly would be to use B_CALL(_CreateTempEqu). But a pure Axe solution would be to use a fixed temporary equation name, like [03FFFF00], and create it with GetCalc(<name>,size).Copy the selection into the temporary equation.Install an error handler around the next step in case an error occurs while parsing the equation. DrDnar's axiom meant for running assembly programs seems to provide this functionality.Execute the temporary equation by putting its name in OP1 and using B_CALL(_ParseInp) (in Axe: <name>Asm(E7EF9B4A)).If an error occurred, handle it as you wish. Perhaps append "=ERROR" to the selection.If no error occurred, convert the result to a string representation. Thankfully, Mateo recently demonstrated how this could be done. In Axe (returns a pointer to the variable's size word): Asm(210000EF2443D5EF6949EF524BEFAB49EF6C49E1).If no error occurred, delete the selection and insert the result's string representation into the program at that location.(Not sure if necessary) Clean up temporary variables with B_CALL(_CleanAll) (in Axe: Asm(EF5041)).(Optional) Restore the original value of Ans.
Is there any useful uses of it?I am assuming that the OS has a flag for whether the enter key is pressed on the home screen.It there a way I can "activate the flag" and execute anything it has. I am looking for a way to implement floating point math (It doesn't have to be fast) into my editor as a feature.Basically I am tired of quitting my program to do a math operation on the home screen. (and I don't want to do long math in my head)Thanks!(the whole home screen is a program thing BLEW MY MIND)