PowerBuilder Assertion Failure

Posted on Wednesday, October 26th, 2011 at 8:04 pm in

Here is a minor head scratcher in PB11.5.

IF Len(dw_1.object.column_name[1]) > 50 THEN
   // and so on

This gives you a nifty messagebox:

To fix this do something like:

IF Len(string(dw_1.object.column_name[1])) > 50 THEN...

or

string ls
ls = dw_1.object.column_name[1]
IF Len(ls) > 50 THEN...

Since there are two Len methods (one for blob and one for strings), Powerbuilder gets confused since accessing the datawindows data via dot notation returns an ‘any’.

Top