1. RAFAEL RODRIGUEZ
  2. PowerBuilder
  3. Thursday, 4 July 2024 14:24 PM UTC

I want to change background's column in a datawindow, i'm using Modify command with an if, but it not change  

This is the command:

v_res = dw_dat2.Modify( "#" + trim( string( i ) ) + ".background.color='255 ~t if( integer(syn) = 1 , 255 , if( integer(syn) = 2 , 65535 , 16777215 ) ) ' " )

there is no error message, can you help me, thanks

 

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 4 July 2024 19:39 PM UTC
  2. PowerBuilder
  3. # 1

Hi,

make sure the background.mode is set to "opaque". Please see https://docs.appeon.com/pb2022/datawindow_reference/XREF_12284_Background_property.html

There's an example at the end of that page.

I also seem to remember that the order in which you set the mode and the background.color might be important.

regards

 

Note: I would also get rid of the blank space before ~t and after it.

What I do most of the time is assign the Modify string to a string variable and then do a

modify(ls_syntax).

 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 4 July 2024 15:53 PM UTC
  2. PowerBuilder
  3. # 2

Hi Rafael;

  When I get this type of challenge, I like to use the DW Painter & try to add an Expression somewhere that tries to mimic what the Modify() is trying to do. This allows me to have the DW Expression Builder in the painter to help me with the syntax, validate it, then if there is an error inform me why.

  Once the basic expression works in the DW Painter, I copy it over to the Modify() command after the "~t".  HTH 

Regards ... Chris 

Comment
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.