StrLength

Navigation:  Appendices > Macro Language > Built-in Functions > All Functions (Alphabetical) >

StrLength

Previous pageReturn to chapter overviewNext page

int = StrLength(sAnyString)

 

This macro function returns the length (number of characters) in the string sAnyString. Note that spaces (including those at the front and back of the string) are counted as invividual characters.

 

This function is useful when you need to perform some action based on the length of a string whose length you cannot predict ahead of time.

 

  // what is the a-holidays string for Token date

   sHolidaysCurDate = EvalToken(n_TokenDate,'[Fa]')

  // how many characters in the holiday

   nHolidayCharCnt = StrLength(sHolidaysCurDate)

  // Does the holiday have more than 35 characters

       bResult = nHolidayCharCnt > 35

  // regardless of bResult replace the token by its root

   sResult = '[' + s_TokenRoot + ']'

 

Reducing the font size or horizontal scale of the characters would be on of the possible resulting action that would be defined for the cases when bRESULT was true (ie. the holidays string had more than 35 characters).


Topic 110049 updated on 01-Nov-2016.
Topic URL: http://www.qppstudio.net/webhelp/index.html?strlength.htm