Author Topic: Basic in Axe  (Read 7308 times)

0 Members and 1 Guest are viewing this topic.

Offline BlackCode

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +0/-0
    • View Profile
Re: Basic in Axe
« Reply #15 on: September 22, 2013, 05:27:46 pm »
(Also, sometimes it is good to look on the forums before making a new topic, or try Googling a bit (second link when typing "run basic progs in axe"))

In my defense (not that I'm justifying it or anything), neither forum searches nor googling turned up the results I wanted.  In fact, most of what I got was requests on translating Basic code into Axe.  Shmibs, I'm basically trying to create a string, based on user input, that can later be recalled by the user.  Since Axe support for this is...lacking...I figured Basic would be much simpler to implement.
« Last Edit: September 22, 2013, 05:28:52 pm by BlackCode »
-I post from my iPod, so please forgive any funky formatting.

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: Re: Basic in Axe
« Reply #16 on: September 22, 2013, 06:41:56 pm »
Actually Google worked for me before, but I noticed that it had been getting worse at finding relevant results lately. Sometimes I use Bing instead.

It is nowhere as horrible as DuckDuckGo and to a lesser extent the revived forum search (which can be decent if you know how to get around its quirks)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Basic in Axe
« Reply #17 on: September 22, 2013, 06:47:24 pm »
an os string to be recalled outside the program? that's a simple problem that's been solved several times now. it's much simpler to handle it in Axe than it would be to launch a basic program and pass things back and forth. check out this external variables tutorial that Finale wrote a while ago for a quick overview. if you have any more questions, feel free to ask =).

and dj, the site search is working again and gave lots of relevant info for me when i used it just now =)
« Last Edit: September 22, 2013, 06:48:08 pm by shmibs »

Offline BlackCode

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +0/-0
    • View Profile
Re: Basic in Axe
« Reply #18 on: September 22, 2013, 07:30:29 pm »
I wasn't clear.  By recall, I mean 2nd+STO, as in, RCL.  I want to be able to do RCL Str(whatever I use) and have it paste it.  Its a helping program like HexSprite.  Hope that clears it up a bit.
-I post from my iPod, so please forgive any funky formatting.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Basic in Axe
« Reply #19 on: September 22, 2013, 07:44:04 pm »
yes, that's what i thought you meant. you can create an OS string variable and store text into it fairly easy from within Axe using the method i linked to. if you do it right, it will be just like any other os string which you can recall that way.

Offline BlackCode

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +0/-0
    • View Profile
Re: Basic in Axe
« Reply #20 on: September 22, 2013, 08:23:25 pm »
Something isn't clicking for me.  Could you provide a quick example of a program that would store some text into a string?  My current attempts don't seem to actually be doing anything, despite compiling and running fine.
-I post from my iPod, so please forgive any funky formatting.

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: Basic in Axe
« Reply #21 on: September 22, 2013, 08:32:55 pm »

and dj, the site search is working again and gave lots of relevant info for me when i used it just now =)
Yeah, hence why I said it works well when you know how to get around its quirks (basically, searching from board index rather than from a sub-forum)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Basic in Axe
« Reply #22 on: September 22, 2013, 08:38:47 pm »
IMPORTANT PREFACE: Strings used by the OS are all strings of tokens, not characters. This means that my first example below would not work if I used "Hello", because although the 'H' character and token codes are the same (all letters, numbers, and some symbols have this characteristic), lowercase letters are two-byte tokens and not equal to their one-byte character codes.


Now that that's out of the way, here's a quick example of how you could store the string "HELLO" to Ans:

Code: [Select]
Copy("HELLO",GetCalc([04720000],5),5)


And here's a slightly less simple example I made for fun that would convert an 8x8 sprite pointed to by S into a hex string in Str0:

Code: [Select]
If GetCalc("Str0",16)
 →O
 S
 For(8)
  Select(,{{}►Hex+2}ʳ→{O}ʳ+1→O)+1
 End
End
« Last Edit: September 22, 2013, 08:46:49 pm by Runer112 »

Offline BlackCode

  • LV2 Member (Next: 40)
  • **
  • Posts: 28
  • Rating: +0/-0
    • View Profile
Re: Basic in Axe
« Reply #23 on: September 22, 2013, 09:21:05 pm »
How would I make it work if I were to use lowercase then?  And how would this work for recalling, will it not just be displayed as numbers (or whatever), or are tokens interpreted differently?

Edit:  Also, I was under the impression that strings in Axe were static and determined at compile time.  Unless hacked strings (which the tutorial doesn't have) get around this(?) I don't see how this would help...
« Last Edit: September 23, 2013, 06:58:50 pm by BlackCode »
-I post from my iPod, so please forgive any funky formatting.