Interested
Moderator: benryves
-
- New Member
- Posts: 5
- Joined: Mon 24 Aug, 2009 12:50 am
Interested
I want to try out a few things in BBC BASIC, but it's so similar to other variations of BASIC I don't feel like going through loads of documentation and beginner tutorials because of a few slight differences. Is there some BBC BASIC syntax checker somewhere so I can just go with trial and error?
Also, how can I store information and retrieve it after the calculator has been reset?
Also, how can I store information and retrieve it after the calculator has been reset?
-
- New Member
- Posts: 1
- Joined: Mon 24 Aug, 2009 1:19 am
Re: Interested
There is an extensive manual here. It has really helped me get to know BBC in the past few days that I've been learning it.
-
- New Member
- Posts: 5
- Joined: Mon 24 Aug, 2009 12:50 am
Re: Interested
The point is that I don't want to waste my time reading loads of documentation because of a few minor differences between BBC and QBasic. I don't have the attention span for this. If I need to do that, I'll do it, but I'm trying to facilitate the process.
Re: Interested
Ok, then why don't you just look at some example programs, or some BBC Basic programs in general? If you know QBasic, then it shouldn't be that hard to grasp when experimenting/viewing pre-made code, that should satisfy your needs.
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Re: Interested
That's not really a good thing for a programmer to admit to, is it?ColdPerson wrote:I don't have the attention span for this.
Off the top of my head, two main differences you may run into are indirection operators (instead of PEEK and POKE) and the way procedures and functions are declared. In fact, if you just skim the "Overview" section of the documentation, that may help.
BBC BASIC shouldn't be too "surprising" - it was designed to be easy for beginners yet powerful enough for advanced users.
If you want to use a more comfortable environment to learn BBC BASIC in, you can download a trial of the Windows version.
You would need to store it in the archive (go into the memory manager, put the cursor next to the variable to archive, and press Enter - a * will appear next to archived variables). The TI-OS does not make it possible to take control of this process, so you cannot archive variables within BBC BASIC (you can, however, read archived variables transparently).Also, how can I store information and retrieve it after the calculator has been reset?
-
- New Member
- Posts: 17
- Joined: Wed 10 Jun, 2009 9:58 pm
Re: Interested
What about the countless programs such as CelticII and Darkerlines tiny unarchiver that are floating around. I know it is possible, but maybe impossible with applications?benryves wrote:The TI-OS does not make it possible to take control of this process, so you cannot archive variables within BBC BASIC (you can, however, read archived variables transparently).
-
- New Member
- Posts: 5
- Joined: Mon 24 Aug, 2009 12:50 am
Re: Interested
Alright, I have a basic idea of how BBCB works.
I made some program to view the value returned by GET, then ask the user if he/she wants to do it again (to save time).
It works on the computer, but not on the calculator, it says there's a mistake on line 90, so I assume CASE is not on Z80 BBC BASIC. Am I forced to use IF/ELSE or is there an alternative?
Also, what I meant by saving data to access it later was more like some substitute for QB's OPEN. I'm trying to port some dumb program I made last year in QB to BBCB before getting into more complex stuff, I was too lazy and never learned how to use graphics in QB.
I made some program to view the value returned by GET, then ask the user if he/she wants to do it again (to save time).
Code: Select all
80 INPUT "Try again? " : key% = GET : PRINT
90 CASE key% OF
100 WHEN 121,89
110 GOTO 10
120 WHEN 110,78
130 CLS
140 END
150 OTHERWISE
160 PRINT "Wrong answer, enter Y or N."
170 PRINT
180 GOTO 80
190 ENDCASE
Also, what I meant by saving data to access it later was more like some substitute for QB's OPEN. I'm trying to port some dumb program I made last year in QB to BBCB before getting into more complex stuff, I was too lazy and never learned how to use graphics in QB.
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Re: Interested
Unarchiving is easy, yes; archiving, no. You have to go via the TI-OS to copy data to the archive, and as BBC BASIC leaves the calculator in a state that is not compatible with the TI-OS (custom interrupt handler, allocated memory, use of all registers including the shadow registers) this would cause a crash.builderboy wrote:What about the countless programs such as CelticII and Darkerlines tiny unarchiver that are floating around. I know it is possible, but maybe impossible with applications?benryves wrote:The TI-OS does not make it possible to take control of this process, so you cannot archive variables within BBC BASIC (you can, however, read archived variables transparently).
You assume correctly; there is no CASE in older versions of BBC BASIC (sorry). In this case, IF would appear to be the easiest solution. However, I must warn you that - again - in older versions of BBC BASIC, there are no multi-line IF statements.ColdPerson wrote:It works on the computer, but not on the calculator, it says there's a mistake on line 90, so I assume CASE is not on Z80 BBC BASIC. Am I forced to use IF/ELSE or is there an alternative
Code: Select all
10 playingGame=TRUE
20 REPEAT
30 REM Do something:
40 PRINT "<insert game here>"
50 REM Prompt to repeat:
60 tryAgainPrompting=TRUE
70 REPEAT:INPUT "Try again",key$
80 IF key$="n" OR key$="N" playingGame=FALSE ELSE IF key$="y" OR key$="Y" tryAgainPrompting=FALSE ELSE PRINT "Wrong answer, enter Y or N."
90 UNTIL NOT(tryAgainPrompting AND playingGame)
100 UNTIL NOT(playingGame)
110 REM End of program.
120 CLS
130 END
Code: Select all
10 REM Key input loop
20 REPEAT
30 ON GET-135 PROC_Left,PROC_Right,PROC_Down,PROC_Up ELSE : REM Dummy ELSE on the end to avoid errors.
40 UNTIL FALSE
50 REM Procedures to handle the up/down/left/right keys:
60 DEF PROC_Up PRINT "Up":ENDPROC
70 DEF PROC_Down PRINT "Down":ENDPROC
80 DEF PROC_Left PRINT "Left":ENDPROC
90 DEF PROC_Right PRINT "Right":ENDPROC
See OPENIN, OPENOUT and OPENUP for read/write/read+write file access respectively.Also, what I meant by saving data to access it later was more like some substitute for QB's OPEN. I'm trying to port some dumb program I made last year in QB to BBCB before getting into more complex stuff, I was too lazy and never learned how to use graphics in QB.
-
- New Member
- Posts: 5
- Joined: Mon 24 Aug, 2009 12:50 am
Re: Interested
Alright, looks super ugly now but it works, thanks for the clarification.
Was an old version of BBCB ported due to compatibility issues?
Also, printing GET displays the number near the center, why is that, and can it be 'fixed' to be printed on the left?
Was an old version of BBCB ported due to compatibility issues?
Also, printing GET displays the number near the center, why is that, and can it be 'fixed' to be printed on the left?
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Re: Interested
The Z80 and original 6502 versions were written in the 1980s, the Windows version has had a lot more work done on it in the intervening period. I've added some of the newer keywords via error handler hacks (eg EXIT, WHILE) but some of the other features would be difficult or impossible to implement in this manner.ColdPerson wrote:Alright, looks super ugly now but it works, thanks for the clarification.
Was an old version of BBCB ported due to compatibility issues?
Print Format Control. Alternatively, use STR$() which defaults to G9 format (no leading spaces).Also, printing GET displays the number near the center, why is that, and can it be 'fixed' to be printed on the left?
Don't forget that GET$ returns a string!
-
- New Member
- Posts: 17
- Joined: Wed 10 Jun, 2009 9:58 pm
Re: Interested
Ah, i see. good to knowbenryves wrote:Unarchiving is easy, yes; archiving, no. You have to go via the TI-OS to copy data to the archive, and as BBC BASIC leaves the calculator in a state that is not compatible with the TI-OS (custom interrupt handler, allocated memory, use of all registers including the shadow registers) this would cause a crash.
-
- New Member
- Posts: 5
- Joined: Mon 24 Aug, 2009 12:50 am
Re: Interested
a) Would there be a way to build an app containing a single standalone program and the necessary BBCB commands instead of having to run a program FROM the BBCB app?
b) How many characters (in the small font) fit on the TI-83+'s screen on both axis?
c) Is there an ASCII character map for the possible CHR$ values? How many values are there in total?
As for OPENIN/OPENOUT, where can the data be stored, in a static variable?
Thanks for the help.
b) How many characters (in the small font) fit on the TI-83+'s screen on both axis?
c) Is there an ASCII character map for the possible CHR$ values? How many values are there in total?
As for OPENIN/OPENOUT, where can the data be stored, in a static variable?
Thanks for the help.
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Re: Interested
Not currently, no.ColdPerson wrote:a) Would there be a way to build an app containing a single standalone program and the necessary BBCB commands instead of having to run a program FROM the BBCB app?
By default, 24x10.b) How many characters (in the small font) fit on the TI-83+'s screen on both axis?
The only difference with ASCII I can think of is that &60 is £ instead of `. Only the first 128 characters are defined, and even then only printable characters are defined.c) Is there an ASCII character map for the possible CHR$ values? How many values are there in total?
I'm not sure I follow what you mean. For files, the type of TI-OS variable (Prgm, AppVar or Pic) depends on the extension (eg .VAR for AppVars).As for OPENIN/OPENOUT, where can the data be stored, in a static variable?