iconv() function

The iconv() function converts a value from its external format to its internal equivalent, according to the processing code being applied.

Syntax

iconv(str.exp, conv.exp)

Parameter(s)

str.exp Specifies the external value to convert to its equivalent internal value.
conv.exp Specifies the processing code to use for the conversion.

Example(s)

This example converts check.amount to internal format, using the "mr2" conversion. Run time multiplies by 100 and truncates the decimal portion.

check.amount = 12.5
print iconv(check.amount,"mr2")
1250

This example converts check.date to internal format, using the d conversion.

check.date = "02/27/02"
print iconv(check.date,"d")
12477

This example performs an AQL group extract of two groups.

string = red*blue*green*yellow*orange
print iconv(string,’g0*2’)
red*blue

If ans contains y or n, the statements following the then clause are executed.

input ans,1
if iconv(ans,"p(’y’);(’n’)")#"" then...