www.icetips.com  Icetips Utilities Documentation 7/6/2014    

String Class:  MatchParenthesis

Previous  Top  Next  


Prototype: (String pS),Short

 

pSString to test

 

ReturnsNumber of mismatching parenthesis

 

This method counts opening parenthesis and closing parenthesis and returns the difference.  If the parenthesis are matched, the return value should be zero.  If there are more opening parenthesis than closing parenthesis, the return value will be a positive number.  If there are more closing parenthesis than opening parenthesis, the return value will be negative.

 

Example:

ITS ITStringClass

S   String(1024)

Code

S = '1*(123/(12/4))+(23*54)'

Message('MatchParenthesis = ' & ITS.MatchParenthesis(S))  ! Should return 0

S = '1*(123/(12/4))+(23*54'

Message('MatchParenthesis = ' & ITS.MatchParenthesis(S))  ! Should return 1

S = '1*123/(12/4))+(23*54'

Message('MatchParenthesis = ' & ITS.MatchParenthesis(S))  ! Should return -1

 

 

See also:

AddIntoParenthesis



Direct link to this page: http://www.icetips.com/manuals/utilities/matchparenthesis_stringclass.htm