Difference between revisions of "ETOS()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to evaluate an expression and return the result as a string
 
Function to evaluate an expression and return the result as a string
 
  
 
==Syntax==
 
==Syntax==
 
ETOS(<expr> [, <expN>])
 
ETOS(<expr> [, <expN>])
 
  
 
==See Also==
 
==See Also==
[[CAST()]], [[DTOC()]], [[DTOS()]], [[LTOS()]], [[MTOS()]], [[RTOS()]], [[SET STRICT]], [[STR()]], [[TOSTRING()]]
+
[[CAST()]], [[DTOC()]], [[DTOS()]], [[LTOS()]], [[MTOS()]], [[RTOS()]], [[SET STRCONVERT]], [[STR()]], [[TOSTRING()]]
 
+
  
 
==Description==
 
==Description==
Line 17: Line 14:
  
 
The optional <expN> is used to specify the length of the string returned.  If the length is shorter than that required by <expr>, strings, dates and datetimes are truncated to the right and numerics truncated to the left.
 
The optional <expN> is used to specify the length of the string returned.  If the length is shorter than that required by <expr>, strings, dates and datetimes are truncated to the right and numerics truncated to the left.
 
  
 
==Example==
 
==Example==
Line 40: Line 36:
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Expressions and Type Conversion]]
+
[[Category:Formatting Functions]]
[[Category:Expressions and Type Conversion Functions]]
+
[[Category:Lianja VFP Extensions]]
 +
[[Category:VFP Function Extensions]]

Latest revision as of 10:41, 1 February 2016

Purpose

Function to evaluate an expression and return the result as a string

Syntax

ETOS(<expr> [, <expN>])

See Also

CAST(), DTOC(), DTOS(), LTOS(), MTOS(), RTOS(), SET STRCONVERT, STR(), TOSTRING()

Description

The ETOS() function evaluates the expression in <expr> and returns the result as a string. The <expr> can be any valid string, date, datetime, logical or numeric expression.

Where <expr> is a date or datetime expression, the string returned will conform to the current SET DATE, SET SEPARATOR, SET SECONDS and SET CENTURY settings, in the same format as DTOC() or TTOC().

The optional <expN> is used to specify the length of the string returned. If the length is shorter than that required by <expr>, strings, dates and datetimes are truncated to the right and numerics truncated to the left.

Example

? etos({03/29/2003})
03/29/2003
? etos({03/29/2003},5)
03/29
 
? etos(10 * 10)
       100
? etos(0.45,3)
.45
 
? etos("Hello" + " " + "World")
Hello World
? etos("Hello" + " " + "World",5)
Hello
 
? etos(.F.)
F