[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Array and define uses



Hello Sehat!!

In the code use

string {dedcd} $i by ' ' into $temp_dedcd
string {Name Provider} $i by ' ' into $temp_provider

You were stringing the word dedcd with $i  into $temp_dedcd instead of
stringing the value of dedcd ({dedcd}) with $i.
You were doing the same thing with NameProvider also.

Hope this helps. Good Luck!!

Charu




SRosny@SMTPGW.ARMS.OHIO-STATE.EDU on 09/08/98 02:22:10 PM

Please respond to SQR-USERS@USA.NET

To:   SQR-USERS@list.iex.net
cc:    (bcc: C. Srinivas/dsisys/US)
Subject:  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
>
>