I have some code that works fine in the IDE but gives errors when I try to compile. I can't see what is wrong - or really understand what the error means, can anyone help?
The error I get is:
error CS0022: Wrong number of indices in [], expected '1'
The code is:
sub globals
Public Type(GName,X,Y)CompSource
sub writefile
FileOpen(f,fname,cRandom)
bin.New1(f,False)
bin.WriteSingle(ArrayLen(CompSource()))
For i = 0 To ArrayLen(CompSource())-1
bin.WriteString(CompSource(i).GName) '<-- error here
bin.WriteSingle(CompSource(i).X)
bin.WriteSingle(CompSource(i).Y)
Next
The error I get is:
error CS0022: Wrong number of indices in [], expected '1'
The code is:
sub globals
Public Type(GName,X,Y)CompSource
sub writefile
FileOpen(f,fname,cRandom)
bin.New1(f,False)
bin.WriteSingle(ArrayLen(CompSource()))
For i = 0 To ArrayLen(CompSource())-1
bin.WriteString(CompSource(i).GName) '<-- error here
bin.WriteSingle(CompSource(i).X)
bin.WriteSingle(CompSource(i).Y)
Next