Lars Fosdal 1791 Posted December 10, 2018 Is there a way to use RTTI for records to allow walking public consts and types to extract names and values? Asking for a friend 😛 - kidding ... I'm try to produce documentation of certain structures at run time, and would like to do something like TDocBuilder.WalkRecordType<html>.  type html = record type TRow = TArray<string>; public const LineBreak = '<BR />'; nbsp = ' '; lt = '<'; gt = '>'; DivEnd = '</div>'; public type divStyleDefault = record public const info = 'info'; book = 'book'; chapter = 'chapter'; section = 'section'; detail = 'detail'; example = 'example'; jsoncode = 'jsoncode'; end; divStyleDebug = record public const info = 'debuginfo'; book = 'debugbook'; chapter = 'debugchapter'; section = 'debugsection'; detail = 'debugdetail'; example = 'debugexample'; jsoncode = 'debugjsoncode'; end; {$ifdef debug} divStyle = divStyleDebug; {$else} divStyle = divStyleDefault; {$endif} end;  Share this post Link to post
Stefan Glienke 2002 Posted December 10, 2018 (edited) No, consts are consts and no types (even if nested in types) hence no RTTI Â Whatever you are trying you are probably better using something like DelphiAST and include that into your build process to generate something from source. Edited December 10, 2018 by Stefan Glienke Share this post Link to post
Lars Fosdal 1791 Posted December 11, 2018 It's too complex for that, as the variations are many and loosely coupled. It means I will have to handcraft more info manually. Share this post Link to post