Skip to content

ConvertToClient

ConvertToClient

See Also: ConvertFromClient, Web Application Helper Functions

Purpose

In web applications, this function converts a DataFlex format value into a generic format appropriate for transport to the client (e.g., as XML or JSON data).

Return Type

String

Syntax

Move ( ConvertToClient(eDataType, sValue) ) to ReturnedValue

Parameters

  • eDataType: Must be passed to inform this function how to interpret the passed value sValue. This should be one of the Web Framework data type constants: typeASCII, typeNumber, typeDate, typeDateTime.

  • sValue: The value to be converted.

  • ReturnedValue: The converted value (as a String).

What it Does

This function converts a DataFlex format value into a generic format suitable for transport to the client (e.g., as XML or JSON data).

For example, a date value should be converted from "03/24/2013" into the XML transport format for dates. For instance, a European date "2013-03-24" is converted into "24/03/2013", while a USA date "2013-03-24" remains the same.

This function is intended to be used when sending numeric or date values to the client during an AJAX call in a Web Framework application.

This function is already used internally by the framework to convert psValue Web Properties.