如何使用TPoint
设置TRttiProperty.setValue()
属性的值?还是类型为record
的其他任何属性?
答案 0 :(得分:1)
我会这样:
default rel
extern printf
extern scanf
extern rand
section .rdata ;; constants
prompt: db "What is your guess? (Answer is: %d) ", 0
congrats: db "You guessed it!", 10, 0
section .data ;; mutable variables
guess: dq 0
target: dq 0 ; assumed constant, but technically not
section .text
global main
main:
stack_reserve: equ 40
sub rsp, stack_reserve
;; let's assign our random target
;; rand(num_target) % 100 + 1
lea rcx, [prompt]
call printf
add rsp, stack_reserve
ret
答案 1 :(得分:1)
使用通用类方法TValue.From<>
Vertex: TPoint;
Val: TValue;
...
Vertex := Point(1, 22);
Val := TValue.From<TPoint>(Vertex);
Prop.SetValue(Self, Val);