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

String Class:  UseEither

Previous  Top  Next  


Prototype: (String pS1, String pS2, Byte pFavourite=1),String

 

pS1First string
pS2Second string
pFavouriteFavourite string

 

ReturnsSelected string

 

This method chooses between two strings based on which should be a favourite.  If pS1 is not empty and it is the favourite, it is returned, otherwise pS2 is returned if it is not empty.  If pS1 is empty and pS2 is the favourite, it will return pS2.  Otherwise the function returns an empty string.  This method was developed for a special situation and only really makes sense to use with variables rather than literal strings. 

 

Example:

ITS  ITStringClass

S    String(100)

Code

S = ITS.UseEither(CON:AddressMain,CON:AddressShip,2)

 

This would assign the CON:Addr1Addl to the S variable, since it favours the second parameter.  If the second parameter is empty, it would use the first one.  In this case it determines if a shipping address should be used if it's specified.

 

 



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