PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
// Procédure de décalage de champs
PROCEDURE DécaleChamp(*)
 
POUR I = 1 _À_ MesParamètres..Occurrence
MesParamètres[I]..X +=10
FIN
Procedure used to delete characters from a string.
PROCEDURE SupprimeCaractere(LOCALE ChaîneComplète est une chaîne, *)
 
ChaîneNettoyée est une chaîne = ChaîneComplète
 
POUR IndiceParamètre = 2 _À_ MesParamètres..Occurrence - 1
ChaîneNettoyée = Remplace(ChaîneNettoyée, MesParamètres[IndiceParamètre], "")
FIN
 
RENVOYER ChaîneNettoyée
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..Count223
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.
Remark: 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