Addressing elements of a string

Questions about the BASICtools and MakeItC
Post Reply
awhitten
Posts: 4
Joined: Sun Mar 24, 2013 2:24 pm

Addressing elements of a string

Post by awhitten »

The help files suggest that individual characters in a string can be addressed as elements of an array. With older frimware I could do this, but with the latest frimware, the program just stops without giving any error messages. For example:

DIM i as integer
DIM a(20) as string
Main:
a="Now is the time..."
print a
FOR i=0 to 10
Print i,a(i)
Next i

This used to work for me before upgrading to Kernel 7.65 (ARMite). Now all I get is the program ending. (I think this issue is at the root of my problems with the I2C routines, which I can address after getting this resolved.)
Analyzing //ad/homedir$/Staff/A/AWHITTEN/My Documents/2014-2015/phys358/programs/str.bas
Programming Flash 2103...
ARMbasic[9.33a] on the PC Copyright 2014, Coridium Corp.
*+*+
... ( 0.18K code + 0.02K const)/16K 0.03/5K data programmed

Executing...


Welcome to ARMbasic Kernel[7.65] with Floating Point Copyright 2013, Coridium Corp.
for the ARMmite
If I comment out the Print i,a(i) statement the program runs fine:
Analyzing //ad/homedir$/Staff/A/AWHITTEN/My Documents/2014-2015/phys358/programs/str.bas
Programming Flash 2103...
ARMbasic[9.33a] on the PC Copyright 2014, Coridium Corp.
*+*+
... ( 0.12K code + 0.02K const)/16K 0.03/5K data programmed

Executing...

Now is the time...


... Finished in 0 ms
Any ideas?

Adam T. Whitten



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Addressing elements of a string

Post by basicchip »

Working for me, but I am using a slightly newer compiler.

Try this one--
ARMbasic.exe
(130.36 KiB) Downloaded 1459 times

awhitten
Posts: 4
Joined: Sun Mar 24, 2013 2:24 pm

Re: Addressing elements of a string

Post by awhitten »

I copied ARMbasic.exe into the coridium subfolder and had the same problem, so I downloaded the tatest BASICtools setup program from the web and everything works fine now. I2C now works like a charm!

Post Reply