Page 1 of 1

.Character .Ascii structures etc

Posted: Fri Nov 12, 2021 9:29 am
by Rinzwind
Any reason why these are NOT declared as:

Code: Select all

EnableExplicit

Structure pcharacter
  c.c[0]  
EndStructure

Define s.s = "Test"

Define *pb.pcharacter
*pb = @s
Debug Chr(*pb\c)
Debug Chr(*pb\c[3])
So we can index into the structure?

Please change; it seems to be backwards compatible, right?

Re: .Character .Ascii structures etc

Posted: Fri Nov 12, 2021 10:13 am
by STARGĂ…TE
Rinzwind wrote: Fri Nov 12, 2021 9:29 am Please change; it seems to be backwards compatible, right?
No, because SizeOf(pcharacter) would then give always 0.
SizeOf(Character) is 1 or 2.

I have defined a general structure like:

Code: Select all

Structure GeneralArray
	StructureUnion
		a.a[0]  
		b.b[0]  
		c.c[0]  
		d.d[0]  
		f.f[0]  
		i.i[0]  
		l.l[0]  
		q.q[0]  
		u.u[0]  
		w.w[0]  
	EndStructureUnion
EndStructure