[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Array and define uses
>hello
>I have problem in putting the #define value inside the array
> put $temp_dedcd $temp_provider into Provider(#i-1) Dedcd Name
>the statement above will put 'dedcd1' and 'NameProvider1' inside the array
>not the value of 'AET' and 'AETNA'.
>Any one know how to solve this problem?
>
>It's works if i used below statement
> put {dedcd1} {NameProvider1} into Provider(#i-1) Dedcd Name
>however it has disadvantage, if additional provider need to be added
>I will need to add into two places one in the define
>and another one in the code.
>
>=================== THE CODE =======================
>
>#define NumberOfProvider 16
>#define dedcd1 'AET'
>#define NameProvider1 'AETNA'
>#define dedcd2 'EQU'
>#define NameProvider2 'EQUATABLE'
>.......
>
>
>let #i=1
> while #i <= {NumberOfProvider}
> let $i = to_char (#i)
> string 'dedcd' $i by '' into $temp_dedcd
> string 'NameProvider' $i by '' into $temp_provider
> put $temp_dedcd $temp_provider into Provider(#i-1) Dedcd Name
> add 1 to #i
> end-while
>
>=================== END OF THE CODE =======================
>
>Thank you in advance
>I will appeciate any suggestion
>bye
>
>Sehat Rosny
>PeopleCode and SQR Developer
>
>