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

Re: [sqr-users] FW: compare array-field with a string



Did you Try and Display the Value just before the If condition?
Try 
show '|' $bewdata_descr '|' 
and see if there are space or may be the Value is Null ? 

HTH 
Datta. 
--- "Martin, Annerose" <annerose.martin@hp.com> wrote:
>  
>    
> 
> Hello, 
>  
> I've following (urgent) problem:
>  
> I have created an array, loaded with the values (put)(within a
> while-loop) and then accessed
> the array with get (within a while-loop) for comparing the field
> description with a fixed
> string (variable: 'Hugo').
> Although I see the correct value of this array-field with DISPLAY,
> but  the IF-comparison
> is not true.
> What is the problem ?
> In a next step, I delimited the description-field with   let ... =
> substr($bewdata_descr,1,4)
> and compared with 'Hugo' , but I had again no success !!
>  
> Many thanks for your help !!!
>  
>  
>  
>  CREATE-ARRAY name=bewdata   size={max_entries_bewdata}    
>           field=description:char
>           field=report-type:char
>           field=excl-code:char
>           field=firmnr:char
>           field=pay-element:char:2
>           field=element-code:char:3
>  
>  
>      .... 
>  
>       put $description $report_type $exclusion_code $firmnr
> $pay_element1 $pay_element2
>              $element_code1 $element_code2 $element_code3 into
> bewdata(#j)
>              description report-type excl-code firmnr pay-element(0)
> pay-element(1)
>              element-code(0) element-code(1) element-code(2)
>  
>  
>   ....
>  
>  get $bewdata_descr $bewdata_report-type $bewdata_excl
> $bewdata_firmnr 
>           from bewdata(#i) description report-type excl-code firmnr 
>  
>  if $bewdata_descr = 'Hugo'    !is always wrong
>  
>  
> many thanks  
>  
>     Annerose
>   
>  
> 
> 
> Annerose Martin 
> Hewlett-Packard Boeblingen (Germany)
> EMEA Payroll and Time Tracking IT Team
> 
> Office:                phone.: +49 (0)7031  14-7059
> 
> Home Office:      phone:   +49 (0) 711  79 467 51   (8a.m. - 12 a.m.)
> 
>                          Fax:      +49 (0) 711  78 232 67 
> 
> mailto:annerose.martin@hp.com <mailto:annerose_martin@hp.com>  
> 
> 
> 
>  
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users