Beruflich Dokumente
Kultur Dokumente
//Function Declarations
void Copy_StarArray(char *source_prm,const char *targt_prm, int copy_opt);
int Pick_ValidStarArray(const char *frst_StarArrPrm,int No_StarArrys,char *Vald_
rowIdStr, int copy_opt);
//Function Definitions
void Copy_StarArray(char *source_prm,const char *targt_prm, int copy_opt)
{
unsigned long prmLen,in_Len;
int Loop_count,status;
char src_prmStr[35];
char trgt_prmStr[35];
char tmp_prmStr[35];
char *out_Buff=0;
sprintf(trgt_prmStr,"%s_1",targt_prm);
out_Buff=(char *)lr_eval_string(src_prmStr);
status=stricmp(out_Buff,tmp_prmStr);
for(Loop_count=1;status!=0;Loop_count++)
{
//Save the source star array param element into target star ar
ray param
lr_save_var(out_Buff,strlen(out_Buff),0,trgt_prmStr);
if(Loop_count!=1)
lr_eval_string_ext_free(&out_Buff);
sprintf(nxt_StarArrPrm,"{%s_rowid}",frst_StarArrPrm);
rowid_pos=(char *)strstr(lr_eval_string(nxt_StarArrPrm),Vald_row
IdStr);
for(Loop_count=1;rowid_pos==0&&Loop_count<No_StarArrys;Loop_coun
t++)
{
sprintf(nxt_StarArrPrm,"{%s+%d_rowid}",frst_StarArrPrm,Loop_count);
rowid_pos=(char *)strstr(lr_eval_string(nxt_StarArrPrm),
Vald_rowIdStr);
switch(StarArr_Ord)
{
case -1: lr_message("Star Array: %s not found at any of
the anticipated ordinals",frst_StarArrPrm);
return -1;
break;
case 0: break; //No need to copy, Star array found at d
esired ordinal
default: sprintf(nxt_StarArrPrm,"%s+%d",frst_StarArrPrm,
StarArr_Ord);
Copy_StarArray(nxt_StarArrPrm,frst_Star
ArrPrm,copy_opt);// Function Call to copy star array
break;
}
return 0;
}// End of Pick_ValidStarArray function