extractallmethods Method
Object: frmbehindsc
Expand/Collapse source code of procedure extractallmethods Source Code
LPARAMETERS tnFileHandle
LOCAL lcMethods, ;
      lnNextMethod, ;
      lcThisMethod, ;
      lnLine, ;
      lcOutputString

IF EMPTY(showmeth.methods)
  RETURN ""
ENDIF

lcMethods = LTRIM(showmeth.methods)

DO WHILE !EMPTY(lcMethods)
  lnNextMethod = ATC("PROCEDURE", lcMethods, 2)
  IF lnNextMethod = 0
    lnNextMethod = LEN(lcMethods)
  ENDIF
  lcThisMethod = LEFT(lcMethods, lnNextMethod - 1)

  *-- Cut the current method
  lcMethods = SUBSTR(lcMethods, lnNextMethod)

  *-- Print the method to the text file
  FOR lnLine = 1 TO MEMLINES(lcThisMethod)
    lcOutputString = ""
    IF BETWEEN(lnLine, 1, MEMLINES(lcThisMethod))
      lcOutputString = TAB
    ENDIF

    =FPUTS(tnFileHandle, lcOutputString + MLINE(lcThisMethod, lnLine))
  ENDFOR
ENDDO