lstr_rates = Message.PowerObjectParm
At runtime, this statement causes an application error. I don't use
structures very often, so maybe I'm doing something wrong here. Any
suggestions?
TIA - Dave
--
Roy
str_exch_rates
decimal exch_rate_q1
decimal exch_rate_q2
decimal exch_rate_q3
decimal exch_rate_q4
Here's the code executed when the window closes:
str_exch_rates lstr_rates
lstr_rates.exch_rate_q1 = dw_criteria.GetItemDecimal(1, "exch_rate_q1")
lstr_rates.exch_rate_q2 = dw_criteria.GetItemDecimal(1, "exch_rate_q2")
lstr_rates.exch_rate_q3 = dw_criteria.GetItemDecimal(1, "exch_rate_q3")
lstr_rates.exch_rate_q4 = dw_criteria.GetItemDecimal(1, "exch_rate_q4")
CloseWithReturn(Parent, lstr_rates)
The function contains an identical local structure. Here's the code in the
function:str_exch_rates lstr_rates
str_exch_rates lstr_rates
Open(w_report_criteria)
lstr_rates = Message.PowerObjectParm
I checked to see if PowerObjectParm is null, but it's not. I can't figure
out what I'm doing wrong.
Dave
"Roy Kiesler [TeamSybase]" <SPAM_FREE_...@teamsybase.com> wrote in
message news:40e30c2b$1@forums-1-dub...
Is this code running in the window's close event by chance?
"Roy Kiesler [TeamSybase]" <SPAM_FREE_...@teamsybase.com> wrote in
message news:40e31761$1@forums-1-dub...
"Dave Ringot" <da...@bwc.com> wrote in message
news:40e32178$1@forums-1-dub...
Ken
"Dave Ringot" <da...@bwc.com> wrote in message
news:40e32178$1@forums-1-dub...
Jerry: I tried creating an instance variable but when I do, I get the
following warning:
Warning C0190: Instance variables of local structure type (str_exch_rates)
will be implicitly private in the next release.
It then seems to ignore the instance variable because as soon as I leave the
instance variable list and come back, the instance variable I tried to
create is gone. Did you mean that the structure itself, str_exch_rates,
needs to be created as an instance variable? I'm not really clear on how I
would go about doing this. Am I not understanding you correctly?
Dave
"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message
news:40e324b6$1@forums-2-dub...
Ken
"Dave Ringot" <da...@bwc.com> wrote in message
news:40e32a41$1@forums-1-dub...
If using a global structure is the only way, I have another question. Is
there any advantage to creating a global structure that contains 4 decimal
vars, instead of just creating 4 global decimal vars?
Dave
"Ken Balakrishnan" <kNOe...@cps92.com> wrote in message
news:40e32d14$1@forums-1-dub...
Hopefully that makes more sense -- I'm having a hard time putting this into
words.
Ken
"Dave Ringot" <da...@bwc.com> wrote in message
news:40e330b4$1@forums-1-dub...
You have to get rid of the local type definition in your window (in the
Window painter, go to View->Structure) and make sure that the variables
refer to the definition that you see (or will see) in the PBL itself.
When you said that I need to get rid of the local type definition in my
window, do you mean that I need to delete the structure altogether? If so,
where do I declare the structure that I will be returning in my call to
CloseWithReturn()? Sorry for all the questions about this, but I don't use
structures very often.
Just so we're clear on this, here's what I currently have setup: In my
window painter, and my function painter, I have the structure view
displayed. I have identical structures declared called 'str_exch_rates'.
Each one contains 4 variables, all of type decimal. In both the window and
function objects, I declare a local variable 'lstr_rates' of type
'str_exch_rates'. Just before I call CloseWithReturn, I assign values to
the variables in the local structure lstr_rates. Does this help you?
Dave
"Ken Balakrishnan" <kNOe...@cps92.com> wrote in message
news:40e3329f$1@forums-1-dub...
I think that your problem is:
<snip> "I have identical structures declared called 'str_exch_rates'"
</snip>
I think the point is that both the window and the function have to see the
SAME declaration of 'str_exch_rates'. In your situation, the window and the
function are each seeing a different, but identical, declaration.
One way to do this would be to use a "global" structure (which you are
trying to avoid - we never use them).
Rather than creating a "global" structure, create a PB object which is a
structure. Do this via File -> New -> PB Object tab -> Structure, which
opens the Structure Painter and you can save the structure as a PB object,
eg 's_exch_rates'. Then remove both your declarations of 'str_exch_rates'
and have your window and your function refer to 's_exch_rates' instead.
That way, they are both referring to the same declaration of the structure
involved.
I think that this is what Ken has been getting at.
There might be other ways to do this, but this is the technique that we have
used, without problem.
Cheers
--
Andrew Giulinn
Senior Analyst/Programmer
Integrated Aviation Software Pty Ltd
"Dave Ringot" <da...@bwc.com> wrote in message
news:40e34873$1@forums-2-dub...
> I think I'm still a little confused. I don't quite understand what you
> meant when you said the following:
>
> You have to get rid of the local type definition in your window (in the
> Window painter, go to View->Structure) and make sure that the variables
> refer to the definition that you see (or will see) in the PBL itself.
>
> When you said that I need to get rid of the local type definition in my
> window, do you mean that I need to delete the structure altogether? If
so,
> where do I declare the structure that I will be returning in my call to
> CloseWithReturn()? Sorry for all the questions about this, but I don't
use
> structures very often.
>
> Just so we're clear on this, here's what I currently have setup: In my
> window painter, and my function painter, I have the structure view
> displayed. I have identical structures declared called 'str_exch_rates'.
> Each one contains 4 variables, all of type decimal. In both the window
and
> function objects, I declare a local variable 'lstr_rates' of type
> 'str_exch_rates'. Just before I call CloseWithReturn, I assign values to
> the variables in the local structure lstr_rates. Does this help you?
>
> Dave
snip...
"Andrew Giulinn" <NO.osc...@dsa.com.au> wrote in message
news:40e35d95@forums-1-dub...
Thanks for all the help everyone,
Dave
"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message
news:40e42436@forums-2-dub...