> On Mar 15, 2020, at 8:53 PM, Howard Page-Clark via fpc-pascal > <fpc-pascal@lists.freepascal.org> wrote: > > > With recent FPCs you can however do this: > > program test; > var > data: array[0..2] of Integer; > tmp: array of Integer = Nil; > begin > tmp := [1,2,3]; > Move(tmp[0], data[0], SizeOf(data)); > end.
yeah I figured you can do something similar with generics: generic procedure Move<T>(source: array of T; var dest); var bytes: SizeInt; begin bytes := length(source) * sizeof(T); Move(source, dest, bytes); end; begin specialize Move<GLfloat>([0.0, 0.5, 0.0, -0.5, -0.5, 0.0, 0.5, -0.5, 0.0], data.verts); end. but why doesn't open arrays already do this? an open array is just a constant array so the compiler should know the arrays are compatible for assignments. Regards, Ryan Joseph _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal