Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Returning user-defined types with user-defined functions
#1
I somehow cant seem to return a user-defined type with my functions...
Maybe i've been coding too long but :?
My real goal is to return a reference to my element.

Anyway if i try the following i get "unsuported return type":
Code:
Copy      Help
function'tJobArrayElement int'iJobNr
int iLoop

for iLoop 0 JobSystem.JobArray.len
,if(iJobNr = JobSystem.JobArray[iLoop].nr)
,,break
;;;end-for
ret JobSystem.JobArray[iLoop]

And when i use either "*" or "&" or combinations of these 2 with the ', i get a syntax error when i try to compile it (CTRL+SHIFT+R)
This is what i would like to work:
Code:
Copy      Help
function&tJobArrayElement int'iJobNr
int iLoop

for iLoop 0 JobSystem.JobArray.len
,if(iJobNr = JobSystem.JobArray[iLoop].nr)
,,break
;;;end-for
ret &JobSystem.JobArray[iLoop]

And here is a cut-out version of the user-defined types used:
Code:
Copy      Help
type tJobArrayElement
,int'nr
,str'name

type tJobSystem
,ARRAY(tJobArrayElement)JobArray

tJobSystem+ JobSystem

So now the question is:
Am i doing something wrong because too much codeing in a session?
Or did i find another bug? (Because documentation says its posible)
Well thats all for now, 3M


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)