[Coco] Pointer to sting array

Phill Harvey-Smith afra at ramoth.org.uk
Wed Apr 5 11:47:18 EDT 2017


Hi all,

Does anyone know how to get in assembler a pointer to a string array, I 
want to write an array sorting routine as it's too slow in basic, that 
takes an array and sorts it I should be able to do this by swapping the 
order of the 5 byte string descriptors for the array, but I need to work 
out either how to get the array name so I can search the array variables 
area for it's data, or a pointer to the array descriptor.

I'm envisioning something like :

10 DIM A$(10)
20 A$(1)="BBB"
30 A$(2)="CCC"
40 A$(3)="AAA"
50 SORTARR(A$)
60 FOR A=1 TO 3
70 PRINT A$(A)
80 NEXT A

Would print :

AAA
BBB
CCC

Cheers.

Phill.


More information about the Coco mailing list