我试图制作手榴弹投掷剧本但是当我测试它时,它总是同时产生2枚手榴弹。
powerobject lpo_arg //do not create it, as it is autoinstanciated
lpo_arg = message.PowerObjectParm //make immediate copy of the message
nv_va_args lva_args
if isvalid(lpo_arg) and not isnull(lpo_arg) then
lva_args = lpo_arg
end if
//example: enumerate all the parameters
string ls_msg = "", ls_class
int i
any la_val
for i = 1 to lva_args.size()
ls_msg = ls_msg + lva_args.get_name(i) + ': '
la_val = lva_args.get_item(i)
ls_class = classname(la_val)
if ls_class = "string" or ls_class = "long" then
ls_msg = ls_msg + string(la_val, "[general]")
else
ls_msg = ls_msg + '[' + ls_class + ']'
end if
ls_msg = ls_msg + "~r~n"
next
messagebox("list of parameters", ls_msg)
//example: just get a named parameter
string ls_name = "arg_2"
la_val = lva_args.get_item(ls_name)
ls_msg = ls_name + " is " + string(la_val, "[general]")
messagebox("named parameter", ls_msg)