User Tools

Site Tools


left_return_left_justified_string_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== LEFT (return left justified string) ====== Previous pageReturn to chapter overviewNext page

LEFT(string [,length])

blk2blue.jpg

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 ' &amp; LEFT(CardNo,4))
  RETURN
END

See Also:

RIGHT

CENTER

CLIP

SUB

left_return_left_justified_string_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1