Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 03:32:27 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Isn't the 'input' function rather useless? - ...with variable length tokens  (Read 368 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
PickleMan
LV0 Newcomer (Next: 5)

Offline Offline

Last Login: 06 June, 2012, 02:49:08
Date Registered: 10 March, 2012, 18:26:19
Posts: 3

Topic starter
Total Post Ratings: 0

View Profile
« on: 14 April, 2012, 13:51:49 »
0

I don't know much about Axe Parser and TI-83/84s, but when I did something like:


1
2
3
4
5
6
input->A
for(I,0,length(A)-1)
    {A+I}->B
    Disp B->DEC,i
end

and looked at the bytes it printed out, 1 byte tokens were encoded as 1 byte, and 2 byte tokens were encoded as 2 bytes, rather than both being 2.
If this *is indeed* the case, how are you supposed to know where one token ends and another starts if each token is a variable length?

Also, a semi-related question, given a pointer returned from input, how can I draw that string to the buffer?
Logged
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Yesterday at 00:24:25
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3705


Total Post Ratings: +260

View Profile
« Reply #1 on: 14 April, 2012, 22:07:47 »
0

I'm just wondering but what kind of value can input take?
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 02:53:38
Date Registered: 02 July, 2009, 06:38:05
Posts: 1696


Total Post Ratings: +499

View Profile
« Reply #2 on: 14 April, 2012, 23:10:09 »
+1

In the current state of Axe, I agree, the input comamnd is a little lacking in terms of supporting commands. It returns a string of tokens, but there are no Axe commands to handle strings of tokens...


However, you can always make your own. Smiley Here's a routine I whipped up to return 1 if a token pointed to is a 2-byte token, or 0 if it's a 1-byte token.


1
2
3
4
.INPUT=pointer to token
Lbl Is2B
Return inData({},[BB5C5D5E606162637EAAEF00])+255/256

You could then call this routine from another routine, like this routine I wrote to print a length-prefixed string of tokens (that's what the input command returns) to the screen/buffer:


1
2
3
4
5
6
7
8
.INPUT=pointer to first token
Lbl Print
→r₁+{-2}ʳ→r₂
Lbl PL
Return!If -r₁
Text Select(r₁,+Is2B()+1→r₁)►Tok
r₂:Goto PL
« Last Edit: 14 April, 2012, 23:11:27 by Runer112 » Logged
kindermoumoute
LV8 Addict (Next: 1000)
********
Offline Offline

Last Login: 15 June, 2013, 17:17:59
Date Registered: 15 May, 2010, 17:53:56
Posts: 837


Total Post Ratings: +51

View Profile
« Reply #3 on: 15 April, 2012, 00:12:01 »
0

 I must have had too much radiation for breakfast...

That's so usefull, why Axe haven't this feature ?

Here a screen of runer'code.


EDIT : how to know when tokens exceed screen to jump to the next line ?

* test.8xp (0.31 KB - downloaded 12 times.)

* test.gif (46.72 KB, 192x128 - viewed 93 times.)
« Last Edit: 15 April, 2012, 00:13:54 by kindermoumoute » Logged

Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.165 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.