Computer Science Canada

integer to string with an array as a value

Author:  x-ecutioner [ Wed Nov 19, 2008 1:44 pm ]
Post subject:  integer to string with an array as a value

hi,

im trying to convert an array from an integer to a string but it has a problem when i indicate which key in the array because it utilizes brackets. any ideas?
code:

%this is placed inside of a for statement
intstr (RLetters.whichletter(r))

thanks for any help possible.

Author:  [Gandalf] [ Wed Nov 19, 2008 3:42 pm ]
Post subject:  RE:integer to string with an array as a value

Do you mean you are trying to convert an array of integers to an array of strings?

Also, post some code that can be placed in better context, it's hard to tell what the problem is from your description.

Author:  Insectoid [ Wed Nov 19, 2008 4:49 pm ]
Post subject:  RE:integer to string with an array as a value

don't you need to assign that conversion to a variable?

code:

for r: 1..x
    var  foo : int := intstr (RLetters.whichLetter(r))
end for

Author:  andrew. [ Wed Nov 19, 2008 6:24 pm ]
Post subject:  RE:integer to string with an array as a value

You want convert an array of integers to an array of strings? If so, it would be something like this:
code:
for i : 1..upper (integer_array)
    string_array (i) := intstr (integer_array (i))
end for


I believe that's how you would do it. I am not in Windows so I can't check.


: