|
Previous Top Next |
Prototype: | (String pS1, String pS2, Byte pFavourite=1),String |
pS1 | First string |
pS2 | Second string |
pFavourite | Favourite string |
Returns | Selected 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.