0
votes

i have a datastore that when retrieve and has results, the rows should be displayed in another window

ds_1.Retrieve()

IF ds_1.RowCount() > 0 THEN

i_str_pass.po[1] = ds_1

OpenWithParm(w_error, i_str_pass)

END IF

i_str_pass is a structure and po is a powerobject

i want to display the results of ds_1 in w_error's datawindow without needing to retrieve it again

i tried calling in w_error

str_pass i_str_pass

i_str_pass = Message.PowerObjectparm

dw_1 = i_str_pass.po[1]

i debugged and saw that I passed it correctly but the data that was retrieved were not showing at all anything im doing wrong? thanks in adv.

2
is w_error NOT a response window? is ds_1 a local variable? if so, your reference is going out of scope before the code in w_error can access the now-destroyed datastore object. There are a couple of ways to handle this depending on you're functionality requirements. - Jim O'Neil
w_error can be a response window, i did it as a pop up window with a datawindow. - Sid
Wow this was a year ago... I searched google for the same problem on another project, I landed on my question, exactly 1 year ago same date. haha - Sid

2 Answers

3
votes

Use

i_str_pass.po[1]. DYNAMIC ShareData(dw_1)

instead of

dw_1 = i_str_pass.po[1]

Surprised the latter wasn't a runtime error, since you're assigning a DataStore to a DataWindow.

GetFullState/RowsCopy is all fine too, but incurs a memory penalty since you're making a copy of that data (which may or may not be something you're concerned about)

1
votes

You could take a look at GetFullState()/SetFullState() :

blobl lbl_data
if i_str_pass.po[1].GetFullState(lbl_data) = 1 then
    dw_1.SetFullState(lbl_data)
end if

You could also take a look at ShareData() to establish a "link" between 2 DataStores or DataWindows.