Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
define argument types in subs
#51
TBBQ, your code will work, but you need to DECLARE SUB mysub( foo() AS ANY, i%)
Reply
#52
Code:
TYPE mytype
   ab  as integer
   cd   as string * 10
END TYPE

SUB mysub(foo() as mytype, n%)
   for i% =  1 to n%
      print foo(i%).ab
      print foo(i%).cd
   next
END SUB

DIM myarr(1 to 20) as mytype

FOR m% = 1 to 20
   myarr(m%).ab = m% + 5
   myarr(m%).cd = CHR$(m% + 5)
NEXT

mysub myarr(), 20

Oracle this exact code will works =). I tried it out just now =P.
Reply
#53
I didn't say it wouldn't. I just said that you or the compiler would add the line I wrote above Wink
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)