KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility method to check if a given text is the name of a project method
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: June 12, 2019

Here is a simple method that checks if the given text is a project method.

  // ----------------------------------------------------
  // Method: IsProjectMethod
  // Description
  //   Check if the given text is the name of
  //   a Project method.
  //
  // Parameters
  //   $1 - Text
  // ----------------------------------------------------


C_BOOLEAN($0)
C_TEXT($1;$path_t)
C_DATE($mod_d)
C_TIME($mod_h)

If (Count parameters>=1)
  $path_t:=$1
  If (Length($path_t)>0)
    ON ERR CALL("ignoreError")  // ignoreError is an empty project method
    METHOD GET MODIFICATION DATE($path_t;$mod_d;$mod_h)
    ON ERR CALL("")
    $0:=($mod_d#!00-00-00!)
  End if
End if