On Sat, 15 Oct 2011, artur bala wrote:

> I'm struggling to grasp in a string all the values of a dicrete variable. Any 
> hint?
>
> Things must look like this:
>
> string col_title = ""
> discrete groups
> matrix val = values(groups)
> loop i = 1..rows(val) --quiet
>    col_title += val(i)       # of course, it doesn't work
>    col_title += " "
> endloop

<hansl>
matrix vals = {0,5,10,15,20}' # just an example
string col_titles = ""
string valstr
loop i=1..rows(vals)
   sprintf valstr, "%g ", vals[i]
   col_titles += valstr
endloop
printf "Got '%s'\n", col_titles
</hansl>

Allin Cottrell

Reply via email to