ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Memory area functions
  • Sorting the memory area
  • Existence of memory area
  • Equivalence
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Warning
From version 20, this feature is kept for backward compatibility. We recommend that you use Associative arrays.
Positions on the first element of a memory area and returns the value of this first element.
Example
// Positionne sur le premier élément de la zone mémoire "MaZoneMémoire" 
// et renvoie la valeur de cet élément
ResPremier = MemFirst("MaZoneMémoire")
sChaîne is string = "A"
sChaîne = Complete(sChaîne, 10000, "B")
Trace(Length(sChaîne))

MemCreate("ZM")
MemAdd("ZM", "1", sChaîne)
sChaîne = MemFirst("ZM")
Trace(Length(sChaîne))
Syntax
<Result> = MemFirst(<Memory area>)
<Result>: Any type
  • If the memory area is not empty: return value of the first element, defined by functions MemAdd or MemModify.
  • If the memory area is empty: an empty string ("").
<Memory area>: Character string
Name of the memory area, defined by MemCreate.
Remarks

Sorting the memory area

The sorts performed by MemSort are taken into account during the call to MemFirst.
If no sort was requested, MemFirst returns the value of the first element added by MemAdd.

Existence of memory area

The existence of the memory area is not checked.
If the specified memory area does not exist, a WLanguage error occurs when MemFirst is used.
To check the existence of a memory area, use MemExist.

Equivalence

The two following syntaxes are equivalent:
Res = MemFirst(<Memory area>)

Res = MemRetrieve(<Memory area>, 1)
Business / UI classification: Neutral code
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help