Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on user-defined function
#7
I come up with this but then there are almost 2 identical "sel" statements:

Function Function12
Code:
Copy      Help
function `v `v2;;` is for VARIANT;
;Can pass string or array or int etc, don't need multiple parameters.

;outx v.vt
ARRAY(int)& a
str s
sel v.vt
,case VT_I4|VT_ARRAY
,,a=v.parray
,,;do somethine with a
,
,case VT_BSTR
,,s=v
,,;do something with s
,
,case else end ERR_BADARG

sel v2.vt
,case VT_I4|VT_ARRAY
,,a=v2.parray
,,;do somethine with a
,
,case VT_BSTR
,,s=v2
,,;do something with s
,
,case else end ERR_BADARG
Is there anyway to combine the 2 select statements into one?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)