Unable to get user defined function to work (set occupiedseatsAdj=$$occupiedseatsAdj(.initialArr,.loc,.row produces error <NOLINE>There has been an attempt to refer to a nonexistent routine line.)
Hey everyone as you may know I am a beginner and I am kindly asking for some assistance in a problem I have been solving. The problem is that I am calling a user defined function within a procedure called occupiedseatsAdj and the compiler comes up with this error.
<NOLINE> | There has been an attempt to refer to a nonexistent routine line. |
From what I understand I can call a user defined function from within a procedure (correct me if I am wrong) as shown below. Is this the correct way or should I create a .Mac file and include it somewhere within the above mentioned cls file ? I understand the fact that you can use do to call functions the trouble is that I can't return anything back from these procedures and ideally I would like to be able to do that.
Here is my code snippet and assistance is greatly appreciated.
Class Missing.Seats Extends %RegisteredObject
{
ClassMethod findnextSeat(initialArr As %ArrayOfDataTypes, ByRef count As %Integer)
{
set occupiedseatsAdj=$$occupiedseatsAdj(.initialArr,.loc,.row)
}
ClassMethod occupiedseatsAdj(initialArr As %ArrayOfDataTypes, J, K)
{
for adjj=J-1:1:J+1 {
for adjK=K,-1:1:K+1
{
if adjK=K, adjJ=J continue
if $EXTRACT($GET(initialArr(adjK)),adjJ)="#"
set total=total+1
}
}
}
}