Author Topic: BASIC ReCode v2.00  (Read 54925 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #45 on: April 07, 2011, 03:46:34 pm »
Hehe, thanks :) I was actually a little iffy about using //, but it really does look nice :) Also, it only works after a newline and it pretty much just skips the whole line and moves to the next one when it reaches a //

Does anybody else have any coding conventions that I should add?

/*

*/ Maybe for multiline comments.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #46 on: April 07, 2011, 03:51:56 pm »
How would it work? Can you give an example?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #47 on: April 07, 2011, 03:53:04 pm »
How would it work? Can you give an example?

As in most PC languages:

Code: [Select]
/*
All these lines are comments
The goal of this program
is to clear the
screen/LCD
*/
dim(40
Fill(0
//The last line clears the screen
Stop

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #48 on: April 07, 2011, 03:57:10 pm »
Okay, then in that case maybe I can make it so that if you do /Then, the comment will end with an End statement (to save a byte?) Would that work?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #49 on: April 08, 2011, 11:29:47 am »
Okay, then in that case maybe I can make it so that if you do /Then, the comment will end with an End statement (to save a byte?) Would that work?

Yes, it would :D

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #50 on: April 09, 2011, 12:50:41 pm »
I just realised that I will need to change the Pause While command because it will cause problems if it is inside of another block (the parser reads the "While" and expects another End). So I am thinking of changing it back to Pause If like I once had it. Does anybody have any better suggestions?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #51 on: April 11, 2011, 05:16:10 am »
I highly recommend adding Goto and Labels if you can :)

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #52 on: April 11, 2011, 08:15:56 am »
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #53 on: April 11, 2011, 09:54:19 am »
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.

You mean, you'll only be using jr's?

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #54 on: April 11, 2011, 08:54:52 pm »
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.

You mean, you'll only be using jr's?
Sorry, I don't know what you mean :/ In TI-BASIC, labels can be letters or numbers and can either be 1 or 2 of them in any combination. I know in a lot of other programming languages, you can make longer labels than that. I am not sure if I want to add label support for that or not. If I keep it at a one or two byte limit, it will be faster :)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #55 on: April 12, 2011, 07:40:17 am »
Yes, I plan to add them, but I don't know how soon and I don't know if I want to add support for long labels or just one or two byte labels like the OS.

You mean, you'll only be using jr's?
Sorry, I don't know what you mean :/ In TI-BASIC, labels can be letters or numbers and can either be 1 or 2 of them in any combination. I know in a lot of other programming languages, you can make longer labels than that. I am not sure if I want to add label support for that or not. If I keep it at a one or two byte limit, it will be faster :)

I meant, you said Labels will have a limited range, so I guessed you would only use 18** for labels (in the hex code).

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #56 on: April 12, 2011, 10:12:06 am »
I don't remember saying that... :/ Also, BatLib doesn't work that way, so it wouldn't use a jr :P There is a pointer stored in RAM that tells where the next byte to parse is. Actually, I use the same pointer as the BASIC parser, which is why when it reaches "Stop" the BASIC program pics up where it left off. That is also why ReCode can execute after C000h

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #57 on: April 12, 2011, 10:55:40 am »
I don't remember saying that... :/ Also, BatLib doesn't work that way, so it wouldn't use a jr :P There is a pointer stored in RAM that tells where the next byte to parse is. Actually, I use the same pointer as the BASIC parser, which is why when it reaches "Stop" the BASIC program pics up where it left off. That is also why ReCode can execute after C000h

I misunderstood this:

Quote
nd I don't know if I want to add support for long labels or just one

Sorry.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC ReCode v2.00
« Reply #58 on: April 12, 2011, 04:31:16 pm »
Sorry about that :/

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BASIC ReCode v2.00
« Reply #59 on: April 13, 2011, 04:20:05 am »
Sorry about that :/

No problem, but numbered labels are good too :D