Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
StringTools[GenerateIdentifier] - create an identifier sequence generator
Calling Sequence
GenerateIdentifier( opts )
Parameters
opts
-
(optional) options
Description
The GenerateIdentifier command returns a procedure that, when invoked repeatedly, returns strings for use as identifiers.
Identifiers are, by default, formed by using the string as a base, and appending integer suffices until the length of the resulting string exceeds a specified maximum length.
The default maximum length is .
The maximum length can be changed by specifying the maxlen = LEN option, which takes a positive integer value LEN.
The default base string can be changed by specifying the base = STRING option.
In this case, the value of STRING will be used instead of .
The value of the base string must not exceed the maximum identifier length.
An alternative system of generating names can be invoked by using the option.
In this form, the returned generator forms strings by using maximal prefices of the given string, replacing suffices up to the maximum identifier length with digit sequences on subsequent calls.
The maximal prefix of the STRING used is shortened as long as at least one character from the string remains.
When no more unique strings not exceeding the maximum length can be generated, the returned generator raises the exception "no more identifiers".
Examples
Error, (in StringTools:-GenerateIdentifier) base for identifiers is too long
Error, (in gen) no more identifiers
See Also
string, StringTools
Download Help Document