Author Topic: A little help  (Read 25282 times)

0 Members and 1 Guest are viewing this topic.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: A little help
« Reply #60 on: April 08, 2010, 07:07:54 pm »
Ok. Now, I have the array being saved, now lets say I want to save the hex sprite data, chosen pokemon name and attacks into the appvar too. I know that I would then have to change the 27 and would have to code more movements into the appvar. But, my question is, can I add the following to an appvar:

"SQUIRTLE  "    *note the two spaces. Will they be preserved?

SirCmpwn

  • Guest
Re: A little help
« Reply #61 on: April 08, 2010, 07:09:08 pm »
The two spaces will not be preserved.  8 character max.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: A little help
« Reply #62 on: April 08, 2010, 07:13:53 pm »
The two spaces will not be preserved.  8 character max.

No. I don't mean as its name. I mean inside it. The same way I'm putting an array inside it. I want to store the names for future use.

SirCmpwn

  • Guest
Re: A little help
« Reply #63 on: April 08, 2010, 07:14:56 pm »
Oh, in that case, I believe they will.
Sorry for the confusion.

Offline lafferjm

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: A little help
« Reply #64 on: April 17, 2010, 05:17:41 pm »
Alright I was wondering.  Suppose I had the following in my code:
Code: [Select]
[12345678->GDB1

How would I access each number seperatly?  I have tried:
Code: [Select]
{GDB1}->A

For the first element, and
Code: [Select]
{1+GDB1}->AFor the second element but it doesn't work.

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: A little help
« Reply #65 on: April 17, 2010, 05:41:06 pm »
This isn't correct:

Code: [Select]
[12345678->GDB1

THIS is correct:

Code: [Select]
[0102030405060708->GDB1
« Last Edit: April 17, 2010, 05:41:53 pm by Silver Shadow »
Former Coder of Tomorrow


Offline lafferjm

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: A little help
« Reply #66 on: April 17, 2010, 07:35:07 pm »
That fixed most of the problem but I still can't get the rest right.  I am trying to create a routine to get text input from the user and each value corresponds to a letter in the alphabet.  Right now the code I have looks like this:
Code: [Select]
.D
DiagnosticOff
[0102030405060708->GDB1
For(A,0,7
{A+GDB1}->B
If B
Disp "A"
End
If B=2
Disp "B"
End
If B=3
Disp "C"
End
If B=4
Disp "D"
End
If B=5
Disp "E"
End
If B=6
Disp "F"
End
If B=7
Disp "G"
End
If B=8
Disp "H"
End
End
The output is correct for the most part, but it looks like the following:
Code: [Select]
AABACADAEAFAGAH

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: A little help
« Reply #67 on: April 17, 2010, 08:21:54 pm »
You forgot the =1 for A.  If you omit it, then it is always true except for zero.  That's why it keeps showing all those As.

By the way I would do this:
Code: [Select]
.D
DiagnosticOff
[0102030405060708->GDB1
"ABCDEFGH"[]->GDB2
For(A,0,7
{A+GDB1}-1->B
Disp {B+GDB2}>Frac
End
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline lafferjm

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: A little help
« Reply #68 on: April 17, 2010, 08:26:08 pm »
Alright thanks.  I thought that just B itself would compare it to 1, not zero.  And thanks for that frac optimization as well.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A little help
« Reply #69 on: April 27, 2010, 12:35:11 am »
I would need some help with the Text command:

how would you display the content of a variable with it? Is it possible at all? I tried >Dec but it gave BAD SYMBOL error. Just doing Text(49,35,S causes garbage to show up
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: A little help
« Reply #70 on: April 27, 2010, 12:50:31 am »
That's coming next version for sure.  There isn't a built in OS-call to display an integer in an arbitrary position (that I know of) so I have to do a little work around by converting it to a float and then displaying it.  Its slower, but its somewhat small.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A little help
« Reply #71 on: April 27, 2010, 12:52:19 am »
ooh ok I see. What would be a workaround for this? I can't seem to figure out how to display only one character from a string (is it even possible at all with Text() anyway?). Should I just use a set of sprites instead?

Btw this is for title screen, where you can set game speed
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: A little help
« Reply #72 on: April 27, 2010, 01:01:11 am »
Yeah, when I add >Dec support for Text() I will also add the >Frac.

Temporarily, you can use the Output() feature to do this but it has to be aligned.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A little help
« Reply #73 on: April 27, 2010, 02:08:21 am »
yeah my issue was that I didn't want it aligned, but it shouldn't be an issue now since I decided to just show a sprite animation instead :P
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)