Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Returning user-defined types with user-defined functions
#3
Aha....so the type of usertype variables in function return should be placed after the typename? hmmm
Thats a inconsistency i didnt know :lol:

So if i want to return a reference like original idea i would use this correct?
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 able to use like:
Code:
Copy      Help
FindJob(1).name

Sorry for not understanding, i should have posted this in programming instead of general (bug) forum...
Well thats all for now, 3M


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)