for min(MyRecord) to max(MyRecord) do
ang get all ellements (Field1,2,3)
This solution is only for one specific type. I specifically wrote the procedure in the example earlier than the type it handles.
Function TMyRecord.GetElement(index:Integer):variant; Begin Case Index of 1:result := Self.Field1; 2:result := self.Field2; 3:Result := self.Field3; end; end;
This solution is only for one specific type. I specifically wrote the procedure in the example earlier than the type it handles.
Function TMyRecord.GetElement(index:Integer):variant; Begin Case Index of 1:result := Self.Field1; 2:result := self.Field2; 3:Result := self.Field3; end; end;
The compiler inserts type data into the code only when it sees the TypeInfo function, which is what the help hints at <<<< Good To knowTypeInfo (https://www.freepascal.org/docs-html/rtl/system/typeinfo.html).
I hope the compiler does not store type info for every record type in the system in my EXE file!
I hope the compiler does not store type info for every record type in the system in my EXE file!
Yes, it does. Also for classes, method and procedure pointers and basically any type. But only those that are used in your program.
Yes, it does. Also for classes, method and procedure pointers and basically any type. But only those that are used in your program.Only those type infos or only those types (that are used in your program)?
I hope the compiler does not store type info for every record type in the system in my EXE file!
Yes, it does. Also for classes, method and procedure pointers and basically any type. But only those that are used in your program.
Does it honor {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} ?
Yes, it does. Also for classes, method and procedure pointers and basically any type. But only those that are used in your program.Only those type infos or only those types (that are used in your program)?
Types themselves do not exist in the final binary (it's only assembly code after all). Their type information does however (if the corresponding type is used).
Types themselves do not exist in the final binary (it's only assembly code after all). Their type information does however (if the corresponding type is used).
Is there a way to hide the used typenames in the binaries?
Even something simple would help like xor or reverse string, with custom write/readName function.