Page 1 of 1

Addressing elements of a string

Posted: Mon Jul 28, 2014 5:44 pm
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

Re: Addressing elements of a string

Posted: Mon Jul 28, 2014 6:39 pm
by basicchip
Working for me, but I am using a slightly newer compiler.

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

Re: Addressing elements of a string

Posted: Mon Jul 28, 2014 8:46 pm
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!