int2str.e
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
|
Not Categorized, Please Help
|
|