Author |
Message |
|
tyskis
Member
Joined: 20 Nov 2003 Posts: 238
|
|
Back to top |
|
|
Fr0sty
Member
Joined: 27 Nov 2003 Posts: 202
|
Posted: 22 Feb 2004 03:20:30 pm Post subject: |
|
|
I'd assume so if you had sumthin like this:
PROGRAM:TEST
AsmPrgmOFF
Stop
And then had PrgmOFF turn off the calc and then return back to PrgmTest. |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 22 Feb 2004 03:27:09 pm Post subject: |
|
|
Hmm, newbie, do you mean with breaking that you get an err:break when you turn on your calc again?
I'm afraid you'll either need to check the disable the on key topic for possible leads or write the whole thing in asm to get around that. |
|
Back to top |
|
|
tyskis
Member
Joined: 20 Nov 2003 Posts: 238
|
Posted: 22 Feb 2004 03:35:42 pm Post subject: |
|
|
Fr0sty wrote: I'd assume so if you had sumthin like this:
PROGRAM:TEST
AsmPrgmOFF
Stop
And then had PrgmOFF turn off the calc and then return back to PrgmTest.
But it can't continue execute when the calc is off, can it? Doesn't Shutting the calc off mean all programexecutions are cut off? |
|
Back to top |
|
|
Fr0sty
Member
Joined: 27 Nov 2003 Posts: 202
|
Posted: 22 Feb 2004 04:25:03 pm Post subject: |
|
|
I think I've played some BASIC games where when you turned off the calc it still resumed when you turned it back on. Also, what about those Mirage games that turn off the calc when you press the on key and then resume gameplay when you turn the calc back on? It'd use ASM to turn it off, so wouldn't the same result apply? |
|
Back to top |
|
|
Newbie
Bandwidth Hog
Joined: 23 Jan 2004 Posts: 2247
|
Posted: 22 Feb 2004 06:12:19 pm Post subject: |
|
|
ClrHome
For(A,1,30
getKeyüK
A(not(K))+30(K>0üA
End
If K=105
Goto 1
Asm(prgmSHUTSRC
Stop
Lbl 1
Repeat Ans
Input "PASSCODE: ",A
ClrHome
If A=30213
Stop
If Aø30213
Asm(prgmSHUTSRC
Stop
If Ans=21 or 22
Asm(prgmSHUTSRC
How would you get it so that if you press key 21 or 22 it could execute that program, because what I got does not work.
EDIT BY ARCANE WIZARD: Woops, pressed the edit button instead of the quote button and replaced your post with mine, sorry, fixed it now.
Last edited by Guest on 23 Feb 2004 07:40:21 am; edited 1 time in total |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 22 Feb 2004 07:33:01 pm Post subject: |
|
|
could you please explain clearly what the guay you want this to do.
Edit:
Turning the calculator off
Not really possible. The calculator keeps running no matter what. But there are 3 things you can do:
1. Turn the screen off. This does not stop the calculator from executing, and any pixel changes done will take effect when the screen is turned off.
2. Pause all tasks until a condition is met, for example [on] is pressed. The calculator is still on, but is not doing anything. The LCD will stay the same and not do anything.
3. Stop the program currently running and return to the home screen.
You could also do all 3. This is what the TI OS does when you turn the calculator off. Essentially, nothing will happen until you press [on]. Then, you will see the home screen. However, nothing stops you from doing only one or two of these.
Last edited by Guest on 22 Feb 2004 07:42:30 pm; edited 1 time in total |
|
Back to top |
|
|
Fr0sty
Member
Joined: 27 Nov 2003 Posts: 202
|
Posted: 22 Feb 2004 07:35:33 pm Post subject: |
|
|
During the time limit? Or during the whole program? Or doing the "passcode enter"? |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 23 Feb 2004 07:40:45 am Post subject: |
|
|
Newbie wrote: How would you get it so that if you press key 21 or 22 it could execute that program, because what I got does not work.
EDIT BY ARCANE WIZARD: Woops, pressed the edit button instead of the quote button and replaced your post with mine, sorry, fixed it now.
You would have to write your own getkey routine thingamajic to get the password and keypress 21 or 22 because otherwise the getkey loop would get distorted by the input statement.
Something like this:
0->A
" "->Str0 //input will go here
"123456"->Str1 //password
Output(1,1,"Password?
Repeat K=105 or Str0=Str1
getKey->K
If Ans>71 and Ans<75:Ans-65->A //7-9 typed
If Ans>81 and Ans<85:Ans-78->A //4-6 typed
If Ans>91 and Ans<95:Ans-91->A //1-3 typed
If Ans=102:0->A //0 typed
If K:Then
If Str0=" ":Then
sub("0123456789",A+1,1->Str0 //replace " " in input string with typed number
Else
Str0+sub("0123456789",A+1,1->Str0 //add typed number to Str0
End
Output(2,1,Str0
If K=21 or K=22:Then
//do stuff if [2nd] or [MODE] is pressed.
End
End //end if K
End //end repeat K=105 or Str0=Str1
Disp "YAY, YOU GOT THE PASSWORD!
Last edited by Guest on 23 Feb 2004 07:43:04 am; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 23 Feb 2004 12:55:49 pm Post subject: |
|
|
Code: Lbl A
For(A,1,30 //for loop
getKey->B
A(B!=21 and B!=22 and B!=105)+30(B=22 or B=21 or B=105->A //scan for 21,22, or 105
End
If not(B //user didnt press a key
Then
Asm(prgmSHUTDOWN //turn calc off (if you need a non-breaking one, tell me;) )
Stop //stop the program
End
If B=21 //user pressed 2nd
Then
//duh
End
If B=21 //cant goto in a if-then-end, so use if-command
Goto A
If B=22 //user pressed mode
Then
//duh
End
If B=22 //cant goto in a if-then-end, so use if-command
Goto A
If B=105 //user pressed enter
Then
Input "PASSWORD?",A //get password
If A!=32103 //check password
Stop //wrong password
End
//user entered the correct pasword
Last edited by Guest on 23 Feb 2004 12:56:21 pm; edited 1 time in total |
|
Back to top |
|
|
Newbie
Bandwidth Hog
Joined: 23 Jan 2004 Posts: 2247
|
Posted: 23 Feb 2004 08:28:51 pm Post subject: |
|
|
Darth Android your code did not work when you would react to key 21 or 22 at the password screen. |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 23 Feb 2004 08:42:39 pm Post subject: |
|
|
oh...i thought you mean react while it was doing the for loop... give me an hour or too... |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 24 Feb 2004 08:14:42 am Post subject: |
|
|
Darth Android wrote: oh...i thought you mean react while it was doing the for loop... give me an hour or too...
Give hmi some time to firgure it out hmiself, I already posted an example of how to get the password and still be able to detect key 21/22. |
|
Back to top |
|
|
Awesome1
Advanced Member
Joined: 28 Jan 2004 Posts: 269
|
Posted: 12 Mar 2004 11:24:36 pm Post subject: |
|
|
In the mean time i suggest the topic starter on trying to figure it out urself. U have plenty of code to build off and mess with to get it to do what u want. Just my opinion but i hate it when people ask for help and expect people to come up with the code for them without messing it with it and such. Not that im accusing him of it but im sure u guys get my point. Unless of the helper don't mind it of course...
Not trying to be a prick, but the only way to learn is to try it urself, then post the code u developed, and ask questions if it don't work... I'm no pro but i try and try to do things on my own. Just me though...
Last edited by Guest on 12 Mar 2004 11:25:29 pm; edited 1 time in total |
|
Back to top |
|
|
Newbie
Bandwidth Hog
Joined: 23 Jan 2004 Posts: 2247
|
Posted: 14 Mar 2004 10:51:30 am Post subject: |
|
|
I figured it out a long time ago. |
|
Back to top |
|
|
Awesome1
Advanced Member
Joined: 28 Jan 2004 Posts: 269
|
Posted: 14 Mar 2004 01:31:50 pm Post subject: |
|
|
cool.... |
|
Back to top |
|
|
|