Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mixed variable in function call
#2
We could just declare p1 and p2 as str' (then numeric to string conversion is automatic). But numbers probably must be without ". Also, variable number of arguments.

Code:
Copy      Help
;/
function $script [VARIANT'p1] [VARIANT'p2] [VARIANT'p3] [VARIANT'p4] ;;up to p30

str s.from(script "(") ss
int i
VARIANT* a=&p1

for i 0 getopt(nargs)-1
,ss=a[i]
,sel a[i].vt
,,case [VT_BSTR,VT_DATE] s.formata("''%s''," ss)
,,case else s.formata("%s," ss)
s.rtrim(','); s+")"

;out s

run "ppbang.exe" s


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)