Posts

FOR Loop

FOR Loop or FOR Statement In Microsoft Dynamics NAV Definition FOR loop is a repetitive statement or loop, is used when we need to execute the code a predetermined number of times.  FOR Loop in Microsoft Dynamics NAV, C/AL having mainly 2 types FOR .. TO Loop FOR .. DOWNTO Loop FOR .. TO Loop In the case of FOR .. TO Loop the value checking is incresed format and when the value reach the condition wrong then exit loop. Syntax of FOR .. TO Loop: -------------------------------------------------------------- FOR Control Variable :=   Start Value TO End Value DO Statement -------------------------------------------------------------- Here Control Variable must be a variable type of Boolean, Date, time or any numeric type. The Start value and End Value must be either expressions of same data type. For Example: =========================================== FOR i :=1 TO 5 DO     Result := Result + 5; =========================================== In this programming codes works in a manner that...

LOCAL FUNCTIONS AND VARIABLES

LOCAL FUNCTIONS AND VARIABLES Local Functions A local function is a function that can be called in the object in which it is defined. Any function that not be defined by local function called from other objects as well as the objects from which its defined. Local Variables A local variable is avariable whose scope is limited to single function. This means that in this function trigger code, a local variable can be used like any other variable. If the name of a local variable is reffered outside of the function in which it is defined, syntax error will result.