1. Konstantin Goldobin
  2. PowerBuilder
  3. Friday, 29 December 2023 15:19 PM UTC

Hello,

I don't think I've ever tried this, so I'm not sure if I'm doing something wrong or this is a known issue. I'm trying to modify a list of values of a datawindow column that has the DropDownListBox edit style but does not have an initial list of values. I'm using a string with a proper format, just like it says in Help, but the Modify() call returns "Line 1  Column 18: incorrect syntax." Column 18 contains a slash that separates the first and second pairs. I'd appreciate any advice!

PB 2019 R3 b 2728

Best regards,
Konstantin

Accepted Answer
Konstantin Goldobin Accepted Answer Pending Moderation
  1. Monday, 1 January 2024 12:32 PM UTC
  2. PowerBuilder
  3. # Permalink

Thanks everyone! It's turned out to be a typo in the column name. Sorry for the confusion and happy new year!

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Saturday, 30 December 2023 17:10 PM UTC
  2. PowerBuilder
  3. # 1

When faced with a similar situation, here's how I typically address the issue:

1. I create an external-source DataWindow with only the example column(s) I need, and set the column properties in the Edit tab. In your case, I'd define a single column and I would set the Edit Style for that column to Drop-down List Box and define the same set of display and data values that I'm wanting to set dynamically via code. Save the DataWindow.

2. I Edit Source for the newly-created DataWindow and locate the syntax that I'm interested in. In this particular instance, the code table that contains the display & data values used in the DDLB edit style is included in the description of the column definition (not the column DWObject) near the top of the source syntax. Look for: values=".....".

3. In the Values property string, make special note of the use of a tab character between each display and data value, and the forward slash (/) that delimits each display/data value pair - including the end of the last pair. Of course, in a Modify string, you would use ~t instead of a 0x09 character. Syntactically, everything has to be just right for the Modify to work.

Best regards, John

Comment
  1. Konstantin Goldobin
  2. Monday, 1 January 2024 12:30 PM UTC
Thanks for the exhaustive reply! I often do the same!
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 29 December 2023 15:58 PM UTC
  2. PowerBuilder
  3. # 2

So what do you have at column 18?

Put a debug stop at you modify command and do a quick watch of you Modify() statement with parts of the string, until you figure out which is the part causing the problem.

Comment
  1. Miguel Leeuwe
  2. Saturday, 30 December 2023 07:07 AM UTC
To clarify: when you edit the source code of your dw, "column" 18 is somewhere at xpos 18 of the edited code. The use of the name "column" is a bit confusing.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 29 December 2023 15:42 PM UTC
  2. PowerBuilder
  3. # 3

Hi, Konstantin -

Tip: You make it difficult for anyone to offer suggestions/corrections when you neglect to include your code.

Best regards, John

Comment
  1. Konstantin Goldobin
  2. Monday, 1 January 2024 12:28 PM UTC
Thanks for your reply! I thought everyone knows what a Modify() call looks like, so it didn't seem necessary.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 29 December 2023 15:28 PM UTC
  2. PowerBuilder
  3. # 4

Hi Konstantin;

  Did you use the DW Syntax Utility to build the Modify() command syntax?

Regards ... Chris 

Comment
  1. Konstantin Goldobin
  2. Monday, 1 January 2024 12:19 PM UTC
Of course! But it shows the same as the online Help.
  1. Helpful
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.