PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Parameters of a procedure with a variable number of parameters
When the procedure is using a variable number of parameters, you must be able to handle the different parameters passed to the function in the code of the procedure. These operations are performed by the MyParameters keyword.
Procedure used to shift the controls: The controls passed in parameters are shifted by 10 pixels.
// Procedure used to shift controls
PROCEDURE ShiftControl(*)

FOR I = 1 _TO_ MyParameters..Occurrence
MyParameters[I]..X +=10
END
Procedure used to delete characters from a string.
PROCEDURE DeleteCharacter(LOCAL FullString is string, *)

CleanedString is string = FullString

FOR ParameterSubscript = 2 _TO_ MyParameters..Occurrence - 1
CleanedString = Replace(CleanedString, MyParameters[ParameterSubscript], "")
END

RESULT CleanedString
The parameters are always indexed from 1 regardless the number of mandatory parameters or the number of optional parameters.
Example:
PROCEDURE Proc(p1, po2= "Z", *)
CallProc("A")Proc("A", "B")Proc("A","B", "C")
MyParameters..NbReceived123
MyParameters..Occurrence223
MyParameters[1]"A""A""A"
MyParameters[1]..DefaultFalseFalseFalse
MyParameters[2]"Z""B""B"
MyParameters[2]..DefaultTrueFalseFalse
MyParameters[3]WLanguage errorWLanguage error"C"
MyParameters[3]..DefaultWLanguage errorWLanguage errorFalse

A variable number of parameters can be used with:
  • the procedures,
  • the methods of classes,
  • the declaration code of global variables of windows, pages or reports.
Note: The type of a parameter is returned by GetDefinition.
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment