tags:

views:

429

answers:

1

Hi,

I have two windows let say w_base1 and w_base2. Now in w_base1 I have below statement written which is working fine.

ls_Value = This.GetItemString(ll_CurrRow, "af_value")

Now the same above statement I want to use in w_base2 but it is giving below error:

Powerbuilder Application Execution Error (R0002) Application Terminated. Error: Null Object reference at line 230 in abcd event of object w_base2.

When it terminate the application it comes directly to above statement i.e.

ls_Value = This.GetItemString(ll_CurrRow, "af_value")

I believe the problem is with af_value which I am not unable to see what actually it is fetching, but as per the above error it is encoutering to Null. Could anyone please help me out on this as soon as possible.

+3  A: 

Your error says line 230 in abcd event of object w_base2, this sounds like a window, but your code says This.GetItemString(). GetItemString is a DataWindow method and can't be used on a window. Check that your code is actually operating on a DataWindow control.

If the type of af_value is not a string, then you will get an execution error (although I think it should be a different error?)

Basically this error means you're referencing an object which does not exist or is out of scope. Check if you have a DataWindow object assigned to the DataWindow control too.

Things you can rule out:

  1. If the contents of af_value is null, then you will get a null in ls_Value, but you will not get this error.
  2. If the row or column do not exist, you will get "Invalid row/column specified".
Colin Pickard