Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 03:39:18 *
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] 2   Go Down
  Print  
Author Topic: Text Data -  (Read 800 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Yesterday at 09:26:23
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2043


Topic starter
Total Post Ratings: +254

View Profile
« on: 06 June, 2011, 13:23:32 »
0

Is there any way to store text data in Axe and to recall it to display it ? (like bcall(_vputs) or bcall(_puts) in ASM ).
The aim is not only to display text (or I'll do Text(?,?,"?")
The aim is to "choose" the text to display in fonction of a number.
With text data, it would be possible.

1
2
3
  ;example of text data
   .db "lol",0
   .db "yes",0
Here, if a=1 it displays "lol" and if a=2 it displays "yes" (if we add the display code). See what I mean ?
« Last Edit: 02 September, 2011, 14:31:38 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
Aichi
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 08:49:29
Date Registered: 25 September, 2010, 15:13:24
Location: Germany
Posts: 291

Total Post Ratings: +72

View Profile WWW
« Reply #1 on: 06 June, 2011, 13:54:20 »
+1


1
2
3
4
5
6
7
"Text 1" -> Str1
"Txt2" -> Str2
"T 003" -> Str3
Data(Str1r,Str2r,Str3r) -> Gbd0
ClrHome
rand^3 -> A
Output(0,,{A*2+Gbd0}

Did you mean that?
Logged
aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Yesterday at 22:53:31
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3106


Total Post Ratings: +120

View Profile
« Reply #2 on: 06 June, 2011, 15:09:11 »
0

He's right, but I don't recommend the Data( command. You store text that way.
Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 02:55:47
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #3 on: 06 June, 2011, 15:40:49 »
0

He's right, but I don't recommend the Data( command. You store text that way.

Why not? In Aichi's code it's used to store the pointers to the strings in a list.
Logged




aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Yesterday at 22:53:31
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3106


Total Post Ratings: +120

View Profile
« Reply #4 on: 06 June, 2011, 15:43:53 »
0

Oops! Then its waaay better with Aichi's method. I thought it stored the data. Excuse me.
Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Aichi
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 08:49:29
Date Registered: 25 September, 2010, 15:13:24
Location: Germany
Posts: 291

Total Post Ratings: +72

View Profile WWW
« Reply #5 on: 06 June, 2011, 15:46:32 »
0

aeTIos, it stores the pointers to get all pointers in a list and work more efficient with it, it doesn't store the same strings of course. Tongue
Pointer list are extremly useful in some cases.
Logged
aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Yesterday at 22:53:31
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3106


Total Post Ratings: +120

View Profile
« Reply #6 on: 06 June, 2011, 15:49:09 »
0

Argh...

***Goes headbang himself Frustrated
« Last Edit: 06 June, 2011, 15:49:37 by aeTIos » Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
BrownyTCat
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 08 May, 2013, 19:20:38
Date Registered: 15 May, 2009, 22:39:36
Location: {(Y+Z)*W+(X+6)+GDB1}
Posts: 420


Total Post Ratings: +19

View Profile
« Reply #7 on: 06 June, 2011, 15:50:24 »
0

He's right, but I don't recommend the Data( command. You store text that way.
Is Data() highly volatile?
Logged

aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Yesterday at 22:53:31
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3106


Total Post Ratings: +120

View Profile
« Reply #8 on: 06 June, 2011, 15:51:23 »
0

Check next posts. I thought that Aichi copied everything into GDB1 which is not really efficient.
Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Yesterday at 09:26:23
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2043


Topic starter
Total Post Ratings: +254

View Profile
« Reply #9 on: 06 June, 2011, 16:39:06 »
0

Hey, thanks to all for your (very) fast answers.
But I'm bothering you all again with another question :
How do I do to store lots and lots of words ? Because with your method, I need a pointer for each word but if I have 200 words   Huh?
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
Aichi
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 08:49:29
Date Registered: 25 September, 2010, 15:13:24
Location: Germany
Posts: 291

Total Post Ratings: +72

View Profile WWW
« Reply #10 on: 06 June, 2011, 16:49:16 »
0

Yeah, I think you have to type in all 200 pointers by yourfelf, but notice that setting a pointer won't affect the size after compiling. Axe Parser replaces the pointer usages with the real data locations in the program plus 9D95h, so you don't have to spare on setting pointers.
« Last Edit: 06 June, 2011, 16:50:03 by Aichi » Logged
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Yesterday at 09:26:23
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2043


Topic starter
Total Post Ratings: +254

View Profile
« Reply #11 on: 06 June, 2011, 16:53:22 »
0

Okay but I wasn't wondering about the size but the number: does the TI have more than 200 names of pointers ? (offtopic: how do you do to make your avatar color changing  You just lost the game ?)
« Last Edit: 06 June, 2011, 16:54:44 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Yesterday at 00:55:01
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Total Post Ratings: +1019

View Profile
« Reply #12 on: 06 June, 2011, 16:54:15 »
+1

The Data command needs the r modifier after each entry if you're using pointers since each entry needs to be 2 bytes large.  But there is a more memory efficient way to store the text, which is to just have each entry right after each other like this:


1
2
3
4
5
:"Text1"[00]->Str1
:"Text2"[00]
:"More Text"[00]
:.etc

And then to get the Nth string, just write a routine that starts at Str1 and scans until it has read N-1 zeros


1
2
3
4
5
6
7
8
9
10
11
:Lbl NTH
:Str1->r2
:While r1
: While {r2}
:  r2++
: End
: r2++
: r1--
:End
:Return r2
« Last Edit: 06 June, 2011, 17:09:25 by Quigibo » Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Yesterday at 09:26:23
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2043


Topic starter
Total Post Ratings: +254

View Profile
« Reply #13 on: 06 June, 2011, 16:57:04 »
0

Once again, thank you.
So "Text1" is at Str1 and "Text2" is at Str1+2 ?
Another question: even "lolcoopuhstoretoAAAwtfloveomnimaga"[00] takes 2 bytes ?
« Last Edit: 06 June, 2011, 16:59:11 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
Aichi
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 08:49:29
Date Registered: 25 September, 2010, 15:13:24
Location: Germany
Posts: 291

Total Post Ratings: +72

View Profile WWW
« Reply #14 on: 06 June, 2011, 16:57:41 »
0

Okay but I wasn't wondering about the size but the number: does the TI have more than 200 names of pointers ? (offtopic: how do you do to make your avatar color changing  You just lost the game ?)

The TI OS doesn't support that much pointers, but Axe Parser does. You can use Gbd08A as a pointer for example.

The random color is generated through PHP. Smiley
Logged
Pages: [1] 2   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.238 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.