KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility Method to Retokenize Methods
PRODUCT: 4D | VERSION: 16 | PLATFORM: Mac & Win
Published On: October 31, 2018

Sometimes issues can occur where methods need to be retokenized due to corruption issues with the database. Below is a utility method that can retokenize all methods in a database. To use it all methods must be closed or else an error will occur.

//Util_RetokenizeMethods
//--------------------------------------------------

ARRAY TEXT($methodPaths_at;0)
C_TEXT($code_t)
C_LONGINT($count_l)

METHOD GET PATHS(Path all objects;$methodPaths_at)

For ($count_l;1;Size of array($methodPaths_at))
  If ($methodPaths_at{$count_l}#Current method path)
    METHOD GET CODE($methodPaths_at{$count_l};$code_t)
    METHOD SET CODE($methodPaths_at{$count_l};$code_t)
  End if
End for

To use the method close all of the opened methods in a method editor and run the utility method from the Execute tool from either the menu bar > Run > Method... or the Execute Icon in the tool bar.