left_return_left_justified_string_.htm
| Navigation: Language Reference > 13 - Built-in Functions >====== LEFT (return left justified string) ====== | ![]() ![]() |
LEFT(string [,length])
| LEFT | Left justifies a string. |
| string | A string constant, variable, or expression. |
| length | A numeric constant, variable, or expression for the length of the return string. If omitted, length defaults to the length of the string. |
The LEFT procedure returns a left justified string. Leading spaces are removed from the string. Spaces are padded on the right to return a string of the “length” specied. To remove trailing spaces use CLIP(LEFT())
Return Data Type: STRING
Examples:
LEFT(' ABC') returns 'ABC '
!******************
CompanyName = LEFT(CompanyName) !Left justify the company name
!******************
IF FILEDIALOG('Pick file',FileName) THEN
IF LEFT(FileName,2)='\\' THEN
STOP('\\UNC paths are not supported!')
ELSIF UPPER(LEFT(FileName,11))='C:\WINDOWS\' THEN
STOP('Do not select Windows folder!')
END
END
!******************
MESSAGE('Sub Total $' & CLIP(LEFT(FORMAT(Inv:PmtTotal,@n-15.2))) & ' plus...')
!******************
IF LEFT(CardNo,1) = '4' THEN
CardType = 'VISA'
ELSIF LEFT(CardNo,2) >= '50' AND LEFT(CardNo,2) <= '55'
CardType = 'MC'
ELSIF LEFT(CardNo,4) = '6011'
CardType = 'DISC'
ELSIF LEFT(CardNo,2) = '34' OR LEFT(CardNo,2) = '37'
CardType = 'AMEX'
ELSE
Message('Unknown card type ' & LEFT(CardNo,4))
RETURN
END
See Also:
left_return_left_justified_string_.htm.txt · Last modified: 2025/05/26 08:00 by carlbarnes




