PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Handling the current control
  • Using MySelf in a procedure
  • WLanguage functions and current control
  • Summary
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
MySelf (Reserved word)
In french: MoiMême
MySelf is used to handle the current control. When the project is run, MySelf is replaced by the control (and not by the name of the control). Then, MySelf can be used like any control.
Benefit: MySelf is used to make a local code (control, item, ...) or a global code (global procedure, class, ...) independent of the current control.
Versions 16 and later
Universal Windows 10 App This feature is available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This feature is available for the Windows Phone applications.
Universal Windows 10 App This feature is available for the Windows Phone applications.
Versions 18 and later
Universal Windows 10 App This feature is available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This feature is available in Windows Store apps mode.
Universal Windows 10 App This feature is available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Example
// --Process whenever a combo box is modified
// Call the UpperMask procedure
UpperMask()
// --UpperMask procedure
// Capitalize the 1st letter for an editable combo box
PROCEDURE UpperMask()
Value = MySelf
IF Length(Value) > 1 THEN
CursorPosition = MySelf..Cursor
MySelf = Upper(Value[[1]]) + ...
Lower(Value[[2 TO Length(Value)]])
MySelf..Cursor = CursorPosition
END
Syntax
MySelf
Remarks

Handling the current control

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

      Modifying the value of the current control:
      MySelf = "Smith"
    • Using a property (..Caption for example):
      MySelf..Caption = "Name of customers"
      ControlCaption = MySelf..Caption
    • Passing a parameter:
      CallProcedure(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.
  • MySelf is used to make a procedure "generic": the name of the control is not spelled out. 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 in parameter, use:
  • an empty string,
  • Myself directly.

Summary

WINDEV In WINDEV or WINDEV Mobile:
Code where MySelf is used MySelf corresponds to
windowwindow
window controlcontrol
window procedure, with a direct call from a window codecontrol on which the event was triggered
window procedure, with a call via <Window>.<Procedure>window
window supercontrolsupercontrol
control of window supercontrolcontrol
procedure of window supercontrol with a direct call from a code of the supercontrolcontrol on which the event was triggered
procedure of window supercontrol with a call via <Supercontrol>.<Procedure>supercontrol
internal windowinternal window
control of internal windowcontrol
procedure of internal window with a direct call from a code of the internal windowcontrol on which the event was triggered
procedure of internal window with a call via <InternalWindow>.<Procedure>internal window
supercontrol of internal windowsupercontrol
control of supercontrol of internal windowcontrol
procedure of supercontrol of internal window with a direct call from a code of the supercontrolcontrol on which the event was triggered
procedure of supercontrol of internal window with a call via <Supercontrol>.<Procedure>supercontrol
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment