Thanks Peter. That was it.
----- Original Message -----
Sent: Thursday, November 18, 2004 11:57 AM
Subject: Re: [Maptitude] GISDK Help

Tom:

>I have the following line:
>WriteLine(keyfile, "<?xml version="+'"'+r2s(1.0)+'"'+"
>encoding="+'"'+"UTF-"+i2s(8)+'"'+"?>")
>
>The output of the above line is:
><?xml version="1" encoding="UTF-8"?>
>
>I need the "1" to be "1.0". Anyone able to help?

If the line really has constants as arguments to R2S() and I2S() then the
whole thing can be one string:

WriteLine(keyfile, '<?xml version="1.0" encoding="UTF-8"?>')

If you will be using variables then, as Dave Twehues indicated, you can use
Format() to format the resulting strings. For integers, for example, if you
had a numeric ZIP Code and wanted five digits with leading zeros, you could
do something like this:

Format(zip,'00000')

R2S() creates the simplest string version of the real number that you pass
it. Since 1.0 is a whole number, R2S(1.0) returns "1" as the string. To get
one decimal point, use something like this:

Format(version,'*.0')

The on-line help topic "String Functions" summarizes those functions.

Peter

----------------------------------------------------------------
Peter Van Demark
Director of GIS Products and Training        Phone: 617-527-4700
Caliper Corporation                            Fax: 617-527-5113
1172 Beacon Street                     E-mail: [EMAIL PROTECTED]
Newton MA 02461-9926            Web site: http://www.caliper.com




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to