Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1162

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
Converting between .NET and ColdFusion data types
Accessing .NET classes requires a Java proxy on the ColdFusion system and .NET code on the target system, so data
must be converted among ColdFusion, Java, and .NET (to be exact, Microsoft Intermediate Language, or MSIL) data
types. ColdFusion converts data types automatically. Usually, you do not have to take any special steps to ensure
correct conversion. Some conversion limitations exist, and in some cases you must explicitly specify a data type when
you call a method in a .NET proxy object.
The following paragraphs describe data conversion issues and how to handle them. For a detailed specification of how
ColdFusion converts among ColdFusion data, Java data types, and .NET data types, see cfobject: .NET object in the
CFML Reference.
Data type conversion rules and techniques
ColdFusion converts data automatically among ColdFusion, Java, and CLR data types. The following table indicates
how ColdFusion converts among .NET Common Language Runtime (CLR) primitive and standard data types, the
Java data types used in the proxies to represent CLR data types, and ColdFusion data types in your CFML application.
.NET type
Java type
sbyte
byte
byte
short
short
short
ushort
int
int
int
uint
long
char
char
long
long
ulong
float
float
float
double
double
bool
boolean
enum
array
array
string
String
System.Collections.ArrayLis
java.util.ArrayList
t
System.Collections.Hashtab
java.util.Hashtable
le
ColdFusion type
Integer
Integer
Integer
Integer
Integer
Number
Integer or string
Number
Number
Number
Number
The returned number retains greater precision than is normally displayed in ColdFusion.
Use the PrecisionEvaluate function to access and display the full precision of a returned
double value. You can also pass a value with full double precision to a .NET method.
Boolean
Not converted, but enumerator elements can be accessed directly by using the format
Enumerator_variable.enumerator, as in MyColor.Red
Array
String
Array
Note: ColdFusion converts from .NET type to ColdFusion type only, it does not convert
ColdFusion Arrays to .NET ArrayLists.
Structure
Note: ColdFusion converts from .NET type to ColdFusion type only, it does not convert
ColdFusion Structures to .NET Hashtables
Last updated 1/20/2012
1157

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents