ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage syntax / Reserved keywords
  • Handling the current control
  • Using MySelf in a procedure
  • WLanguage functions and current control
  • Summary
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
MySelf (Reserved word)
In french: MoiMême
MySelf is used to handle the current control. When the project is run, MySelf is replaced with the control (and not by the name of the control). Therefore, MySelf is used as a control.
Interest: The keyword Myself can be used to make a local code (field, item, etc.) or global code (global procedure, class, etc.) independent of the current field.
Example
// --A chaque modification d'un champ Combo
// Appel de la procédure MasqueMajus
MasqueMajus()
// --Procédure MasqueMajus
// Masque la 1ère lettre en majuscule pour un champ Combo avec saisie
PROCEDURE MasqueMajus()
Valeur = MySelf
IF Length(Valeur) > 1 THEN
	PositionCurseur = MySelf.Curseur
	MySelf = Upper(Valeur[[1]]) + ...
				Lower(Valeur[[2 TO Length(Valeur)]])
	MySelf.Curseur = PositionCurseur
END
Syntax
MySelf
Remarks

Handling the current control

  • MySelf is always replaced with the current control. For example:
    • Retrieving the value of the current control:
      ValeurChamp = MySelf

      Modifying the value of the current control:
      MySelf = "Dupond"
    • Using a property (Caption for example):
      MySelf.Libellé = "Nom des clients"
      LibelléChamp = MySelf.Libellé
    • Passing a parameter:
      AppelProcedure(MySelf)
  • A WLanguage error occurs if there is no current control.

Using MySelf in a procedure

  • MySelf can be used in a local procedure or in a global procedure only if the procedure is called in a process associated with a control. In this case, MySelf refers to the current control.
  • The MoiMême keyword is used to make a procedure "generic": the field name is not spelled out in full.. This procedure can be called by several controls.

WLanguage functions and current control

To specify the current control in the WLanguage functions that accept a control name as parameter, use:
  • an empty string,
  • MySelf.

Summary



WEBDEV - Server code In WEBDEV:
Code where MySelf is used MySelf corresponds to
pagepage
page controlcontrol
page procedure, with direct call from a page codecontrol on which the event was triggered
page procedure, with a call via <Page>.<Procedure>page
page supercontrolsupercontrol
control of page supercontrolcontrol
procedure of page supercontrol, with direct call from a supercontrol codecontrol on which the event was triggered
procedure of page supercontrol, with a call via <Supercontrol>.<Procedure>supercontrol
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help