Coding Standards/conventions Question:

Explain Naming Convention Functions?

Tweet Share WhatsApp

Answer:

Description
Functions abstract a sequence of SQABasic code statemens in either a script-file (.REC) or a library-file (.SBL) and cover them with a reasonable name that is explanatory to others.

Syntax
[SOURCE]+"_"+[PerformedAction]+[Parameterlist]+" As " + [ReturnValue]

[SOURCE] is an abbr. of the library name it is implemented at. [PerformedAction] consists of two words, an action(verb) and an object the action is performed against. [Parameterlist] is a sequence of placeholders the function is feeded with. [ReturnValue] is the value returned by the function

Examples
· UTIL_CountItemInString(sHaystrack$, sNeedle$) As Integer
· SERVICE_Start(sServiceName$) As Integer
· SERVICE_StopAllServices() As Integer

The function name must always correspond to what the function is actually doing. That is the script developer knows what the function is doing without the need to dig any deeper into its implementation. If the function name is called "NaviagteTo("a-web-link") it is expected that the function does only navigate to that specific web-link and not doing additional actions that is deletion and/or creation of any records in the DBMS.

Download Coding Standards PDF Read All 26 Coding Standards Questions
Previous QuestionNext Question
Explain Naming Convention Constants?Explain Naming Convention Scripts?