06-11-2006, 07:27 AM
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":
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:
And here is a cut-out version of the user-defined types used:
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)
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":
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:
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:
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