Text.MaxStrLen(Text) Method
Version: Available or changed with runtime version 1.0.
Gets the maximum defined length of a string variable.
Syntax
MaxLength := Text.MaxStrLen(String: Text)
Note
This method can be invoked without specifying the data type name.
Parameters
String
Type: Text
The string variable for which you want to find the maximum length.
Return Value
MaxLength
Type: Integer
The maximum length of the string variable.
Remarks
If you call this method on a Variant, it returns an error.
Example
var
City: Text[30];
MaxLength: Integer;
Length: Integer;
Text000: Label 'Vedbaek';
Text001: Label 'The MaxStrLen method returns %1,\\';
Text002: Label 'whereas the StrLen method returns %2';
begin
City := Text000;
MaxLength := MaxStrLen(City);
Length := StrLen(City);
Message(Text001 + Text002, MaxLength, Length);
end;
The message window displays the following:
The MaxStrLen method returns 30,
whereas the StrLen method returns 7.
See Also
Commentaires
https://aka.ms/ContentUserFeedback.
Prochainement : Tout au long de l'année 2024, nous supprimerons progressivement les GitHub Issues en tant que mécanisme de retour d'information pour le contenu et nous les remplacerons par un nouveau système de retour d'information. Pour plus d’informations, voir:Soumettre et afficher des commentaires pour