int2str.e

new topic     » topic index » view thread      » older message » newer message

I needed to convert an integer to a string for using it in a file
name for instance. I overlooked it someplace imagine but I couldn't find any
built in function to do so. I wrote the following which handles the
problem...but tell me, is there a built in way? Thanks, Art Adamson

--convert an int to a string
global function intToStr(integer tempInt)
sequence seqOut
seqOut = {}
while   floor(tempInt) do
        seqOut = prepend(seqOut,  48 + remainder(tempInt,10))
        tempInt = floor(tempInt / 10)
end while
return seqOut
end function    --intToStr

--puts(1,"The sequence returned is:  ")
--? intToStr(1234)
--puts(1,intToStr(1234))
Arthur P. Adamson, The Cincinnati Engine Man, euclid at isoc.net

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu