1. Krishna Mohan Gullap
  2. PowerBuilder
  3. Tuesday, 2 July 2024 13:51 PM UTC

Hello there to all PB Guru's

So, in my application, I have an NVO (say nvuo_dw) of type DataStore with the below variables:

2 strings and 1 string array

In my window code, I create an array of type nvuo_dw and dynamically populate it, depending on the number of DataWindows in my window (which I obtain using the Control[] built-in array in Window Code)

nvuo_dw    lnvuo_dw_list[]

I am trying to create the instance of the first member of this array using the following command

lnvuo_dw_list[1] = Create DataStore // Doesn't work

 

So, I tried creating a Dummy DataStore and assign it to the first element of the array

DataStore lds_temp

lds_temp = Create DataStore

lnvuo_dw_list[1] = lds_temp //This one fails during runtime throwing the error 'Cannot assign object of type datastore to variable of type nvuo_dw

                                         // (even though nvuo_dw is an NVO of type DataStore

I tried creating a dynamic DS and assigning it to this too, but nothing has worked so far

 

Then, I tried creating it using the SyntaxFromSQL method as well, that didn't work either

ls_new_syntax = SQLCA.SyntaxFromSQL(ldw_sample.GetSQLSelect() , 'Style(Type=Form)', ls_err)

lnvuo_dw_list [1].Create(ls_new_syntax, ls_err) //This one fails with the same runtime error

 

Basically, I am stuck :-) Any help is greatly appreciated!

Regards,

Krish

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 2 July 2024 14:53 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Krish ;

  That should be ...

nvuo_dw    lnvuo_dw_list[]
lnvuo_dw_list[1] = Create nvuo_dw    

HTH

Regards .. Chris

Comment
  1. David Peace (Powersoft)
  2. Tuesday, 2 July 2024 14:59 PM UTC
I was going to say the same, that should work fine. Just need to Create using the same datatype.
  1. Helpful 2
There are no comments made yet.
Krishna Mohan Gullap Accepted Answer Pending Moderation
  1. Tuesday, 2 July 2024 15:33 PM UTC
  2. PowerBuilder
  3. # 1

Thanks a lot, Chris and David! I feel so stupid thinking now how I was trying to do complex stuff instead of this simple straightforward approach. Damn! :-)

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 2 July 2024 17:16 PM UTC
No problem .. just more coffee & I bet that you would have figured that one out - lol!

  1. Helpful 1
  1. Krishna Mohan Gullap
  2. Tuesday, 2 July 2024 20:51 PM UTC
I have been following the answers that you guys give since I started working in PowerBuilder 6.5 way back in 2016. Sybase to SAP and now to APPEON. BIG FAN OF ALL YOUR WORK. Cheers !!!
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.