× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Darrell,

 I spend a lot of time arguing with RPG about syntax, but somehow the
computer always wins...

 We know your basic setup is OK because it works when you hardcode the
formula. In my programs, 'somestr' is 1024A - not varying - and I don't use
constants. But I'm not sure why that would make a difference. The best way
to tell what's going on is as Scott suggested - use the debugger to view the
field just before passing it to hssf_formula.

D somestr         S           1024
D sheetname       S             10
D cellname        S              5

D hssf_formula    PR                                     
D   peRow                             like(HSSFRow)      
D   peCol                        5I 0 value              
D   peFormula                 1024A   varying const      
D   peStyle                           like(HSSFCellStyle)

If this works:                                                         
hssf_formula( row:14:
    '(NAIC10!O9+NAIC12!O9+NAIC14!O9+NAIC16!O9)':Numeric);

Then this ought to work:
somestr = '(NAIC10!O9+NAIC12!O9+NAIC14!O9+NAIC16!O9)';
hssf_formula( row:14: %trim(somestr):Numeric);

As should this:
sheetname1 = 'NAIC10';
sheetname2 = 'NAIC12';
sheetname3 = 'NAIC14';
sheetname4 = 'NAIC16';
cellname = 'O9';
somestr = +
  '(' + %trim(sheetname1) + '!' + %trim(cellname) + '+' +
        %trim(sheetname2) + '!' + %trim(cellname) + '+' +
        %trim(sheetname3) + '!' + %trim(cellname) + '+' +
        %trim(sheetname4) + '!' + %trim(cellname) +
   ')';
hssf_formula( row:14: %trim(somestr):Numeric);

Good luck

JK

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of DLee@xxxxxxxx
Sent: Friday, July 21, 2006 9:06 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Poi linking to other spreadsheets

Jk;  and Scott;

Thanks for your replys.

I still am not getting it I guess.


Still am getting Operands are not compatible with the type of operator
error on both your examples.

I must have stuff defined wrong still

This is what I have.

    D NAIC10          C                   CONST('NAIC10')
    D someStr         s            120a   varying
D gwp02_c         s              5A   varying

gwp02_c    = hssf_cellname( rowcount: 15);

 somestr = +
  '(' + (NAIC10) + '!' + gwp02_c +')';


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.