KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Renaming Database Method Parameters
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: August 7, 2023

Various database methods have predetermined parameters. For example, the On Web Authentication method has six (6) inputs and one (1) output. The parameters use the classic style of naming the parameters with the inputs being $1, $2, $3, $4, $5, and $6 and the output being $0.


These parameters are not very intuitive being numbers. With the new named parameters syntax, these parameters can be renamed to a more intuitive name. Named parameters can be declared using the #DECLARE keyword at the start of a method's code, this also applies to the database methods. With the On Web Authentication method, the parameters can be renamed to something like the following example:

#DECLARE($url_t : Text; $httpContent_t : Text; \
$clientIP_t : Text; $serverIP_t : Text; \
$user_t : Text; $password_t : Text)\
->$authenticate_b : Boolean



When declaring the parameters for a database method, make sure to check the documentation to confirm the types of the parameters and apply the correct type.