Jump to content


Photo
- - - - -

recursive calls


1 reply to this topic

#1 Paul Taylor

Paul Taylor

    Member

  • Members
  • PipPip
  • 20 posts
  • Gender:Male

Posted 22 November 2016 - 06:41 PM

I put together a function that does recursive calls to find the exit points from file scslink , does anyone know the limitation on how many times the function can be called or is it limited to memory. I am using v6.2 green screen dev.

 

 



#2 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 395 posts
  • Gender:Male
  • Location:Florida,USA

Posted 23 November 2016 - 06:11 PM

It is limited by memory. I am not a C coder but I understand that it is the stack space that is consumed. You may get a error relating to Workspace Exceeded. An alternate method to iterative calls is to encapsulate into a While loop. e.g.

 

#FoundValue = False

While #FoundValue = False

   GLOBAL_LSCALL(MyFunction,MyInterface)

Endwhile

 

The MyFunction interface will have a 'B'oth parameter(s) of the value(s) you are searching for. Because the parameter(s) are 'B'oth then it will pass back out the next set of parameters to search for upon an unsuccessful search. It will also pass back 'O'ut the #FoundValue which will be set to True if the search was successful. You may also wish to consider introducing an iteration count to limit the number of times it loops.

 

Hope that helps.


Things should be made as simple as possible, but not simpler



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users