Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mixed variable in function call
#1
when i call ppbang(debug,string) everything is ok,
but when i try to pass an integer tp ppbang i get an error.
because p1 is declared as string.
how can i make my variables in function calls more flexible,
so that either string or integer are valid ?

Code:
Copy      Help
function $script [$p1] [$p2]
str com

str scr = script
str arg1 = p1
out scr

if (scr = debug)    
,com.format("%s(''%s'')" debug p1)
,out com
if (scr = "Bar Keys main")    
,2
,lef    
,out com
,end
else if (!p1)
,com = script
else
,com.format("%s(''%s'',''%s'')" script p1 p2)
run "ppbang.exe" com
pi


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)