• Please review our updated Terms and Rules here

Problem with TI-Basic Program

its because you are trying to use v$ as a dim. you are trying to comare an entire list to a single part of the list.

That is what stands out to me.
 
Well, close there Bob.

V$ is a single string variable.
V$(1) is an array of string variables

As in, DIM V$(12) would be an array of 12 string variables

So V$ is one kind of thing and V$(I) is another.

If you are limited to single letter variables then you need some other name for V$(1), like Z$(1). I don't think you can name a single string the same as a array of strings.

i.e. " already defined "
 
The easiest fix is to find where the verb array V$(25) is initialized and change to VP$(25)

then change 310

310 IF V$=VP$(I) THEN VB=I
 
Last edited:
Of course, you then have to look thru the entire program for other V$( and change them all to VP$(
 
As that code is doing a table lookup for the correct verbs, it is pretty likely that line 310 and where the table is setup are the only 2 places it is used.

So, go down to line 1600 and start looking for the initialization code.
 
Put all the "DIM" statements close to where you define V,W, etc.

Just "edit 1600" and change the line number to 74, press enter, do the same for the next line. That way the variables and arrays will be defined earlier.

You can leave where they are initialized alone. You will next a dummy 1600 line if you leave the gosub 1600 line, like 1600 REM
 
Thanks.

I now get an invalid dimension error for part of the gosub line: DIM VP$(V) and DIM O$(W)

It seems to accept D$ and R$ as they both have numbers within the brackets, but not letters...

my cc-40 book says the one dimensional array takes the form:

dim array-name(integer-constant)

so I'm gonna somehow replace with v and w with numbers....aswell as for line 1610

1610 DIM C(W),L(G),F(W)
 
Last edited:
I thought of that, the fact that using a variable might not work but I tried it with my Tandy 200 and it worked so I thought maybe I was wrong.
 
Thanks, but it makes no difference, it's line 1600 again, the variable has been previously defined error still!! Ah well!
 
Is it possible one of your four defined DIM objects in line 1600 is one of the predefined/reserved objects in the CC40 ROM?

Try and separate each of them to a separate line to find out which one is the problem and try renaming just that one--of course, it is possible that all of them will give issues, so rem out the first one that causes problems after it errors just to see if it passes any of the others through OK.
 
I tried that but it says "already defined" for each one of the dims. I'm thinking it's due to the position of the gosub in the program. The thing is I've tried putting it at the beginning (lines 1600-1650) and now I get this same error the 1st time V$ is listed again in the program

240 V$="":W$="":VB=0:OB=0

What I could do with is someone who is good with TI-BASIC who could rewrite the program for me! I think it'll need several changes.....money is not a problem!!!
 
We're going to need a manual for this mysterious TI Enhanced BASIC.

I've started messing with your program in MBASIC on CP/M (because I have it handy).
First thing I notice is there's not enough data items to correctly fill R$.
 
The nice thing about Basic is that everyone can have their own dialect!

It is possible that your TI Extended Basic doesn't support arrays of strings at all. If the Extended Basic on CC-40 is anything like Extended Basic on the TI-99/4 series, you should replace LEFT$, MID$ and RIGHT$ by various SEG$ which has the same syntax as MID$.

Generally string handling is something that can be done in many ways. The MID$ style is Microsoft Basic compatible, while e.g. Sinclair Basic uses A$(1 TO ..) which also means DIM A$(10) on the ZX Spectrum means reserve room for one string that is 10 characters long, not ten strings of arbitrary length.

Aha, I downloaded the TI Extended Basic manual. Although it is for the TI-99 computer, for now I would presume the dialect is the same as on the CC-40. Correct me if I'm wrong.

If you dimension an array, the DIM statement must appear in the program at a lower numbered line than any other reference to the array.

Browse to page 40 of 130:
http://www.digitpress.com/library/manuals/ti994a/ti%20extended%20basic.pdf (9 MB large file)

It means you have some reshuffling to do, move the subroutine from line 1600 to the beginning of the program.
 
Last edited:
Back
Top