ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage syntax / Operators
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Operator on Address
In french: Opérateur sur Adresse
The & operator returns the address of a variable as an integer.
Example
i is int
z is string ASCIIZ on 50 
t is array of 10 reals
s is composed of 
	L_Age is int
	Le_Nom is string ASCIIZ on 50 
END
adr is int
adr = & i 
adr = & z 
adr = & z + 2			// Adresse du 3ème caractère de la chaîne 
adr = & t				// Adresse du début du tableau (donc du 1er élément) 
adr = & t[5]			// Adresse du 5ème élément 
adr = & s				// Adresse de la structure et donc de s.age
adr = & s.L_Age
adr = & s.Le_Nom
Syntax
<Result> = &<Variable Name>
<Result>: Integer
Address of the specified variable.
<Variable name>: Any type
Name of variable to use.
Remarks
  • The & operator is used to find out the address of any type of variable (simple and composite variables).
  • The & operator is mainly used to pass addresses to API or CallDLL32.
  • The & operator cannot be used to retrieve the address:
    • of a control,
    • an HFSQL section.
      The & operator displays an error then when compiling the project. Indeed, the addresses of these two elements may change at any time.
  • If a "String" is to be passed by address to function API or CallDLL32, don't use a String variable: the string address can change at any time.. we recommend that you use the ASCIIZ String type.
  • If the variable is a local variable, the value returned by the & operator must only be used in the process where the variable was declared. When the current process is ended, the address will be invalid and it must not be used anymore.
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