Weird PROP:From behavior, last '|#Value' truncated - CW 11

I have a drop list associated with a STRING(15) variable.
in the window IDE I have
‘Printer|Visa|Master Card|Amex|Discover|Checking|Savings|Email|No Print’
and that works fine.
My client wanted the last value to show ‘Self Print’ but store ‘No Print’ Easy right?
‘Printer|Visa|Master Card|Amex|Discover|Checking|Savings|Email|Self Print|#No Print
The drop list shows correctly, but the value stored is
‘No Pri’
I have tried adding extra values at the end, but it still cuts off at same place, i have rearranged the items but the last choices are cut off
any ideas?
i have also tried assigning in the code using PROP:FROM but no change.

Is it any different without the #? (e.g., a # is special in a FROM string)

So I took the # out which then of course make ‘Self Print’ and ‘No Print’ 2 individual choices, but the dropdown items list is truncated - ‘Self Print’ stores, but i get ‘No Prin’ and not ‘No Print’

oic. Was missing out on your usage requirement, sorry about that.

This seems to work OK. Maybe something is replacing your PROP:From, but it is truncating it? or your USE() variable is too small?


 PROGRAM

  MAP
  END
  
MyField STRING(20)  
  
Window WINDOW('Caption'),AT(,,395,224),GRAY,FONT('Microsoft Sans Serif',8)
        LIST,AT(25,91),USE(MyField),DROP(10),FROM('Printer|Visa|Master Card|Amex|Discover|Checking|Savings|Email|Self Print|#No Print')
    END
  CODE
  
  OPEN(Window)
  ACCEPT
    CASE ACCEPTED()
    OF ?MyField
      MESSAGE(MyField)
    END
  END
  

i have all that - my use variable is string(15), i have drop 10 - everything looks like it should work. just a head scratcher

Have you changed your dictionary?

If so, have you compiled all DLLs to match?

yes, i have checked all the obvious. i will keep at it :upside_down_face:

So you took out 1 character the “#” and now the value you get is 1 character longer i.e. the “n” ?

That makes me think some code is changing Prop:From but using a variable that is 2 bytes too short to hold the full value. Or maybe there is some other bug in code changing that From string.

Show the full code of that LIST control not just the FROM string. Is it a COMBO?

Also the Event Accepted code. Also any code that changes that ?ListFeq

If in Designer you open a Window Preview does your From #No Print work? The Preview is a true running Clarion program for your Window, but without any of your code, so would better prove if the RTL had a flaw.

I’m wondering if the size available for the last element is determined by the size of the first one?

In your case ‘Printer’ = String 7 ; ‘#No Pri’ = String 7
Just a thought bubble

Kevin, I tested Jeff’s solution with both Clarion 10.0.11897 and 11.1.13845 and it worked fine.
There must be something else going on in your program.
What version of C11 are you using?

The thing I keep going back to is 1 or more DLLs that dont have a matching record buffer. Or a 3rd party class/template that massages the FROM()

This app/window have been in production for a couple of years. This was a change they wanted today. All I was trying to do was add a different option to the drop-down. I will try to do a simple app tomorrow and post with results if I can reproduce it.

Kevin

C-415.819.1415
Communication is the key to a successful relationship.

In Designer can you open a Window Preview? Does your From #No Print work in that?

IMO Window Previewer is a wonderful thing in C8+ and a must have.

I have a Previewer thing on GitHub you simply drop in LibSrc to enhance it. There is also a thread here to fix Previewer not working.

You’re seeing your USE() truncated, which you are Not going see in the Previewer…

In Event Accepted show the From string and I think you’ll see it truncated by 2 bytes:

Message('From="' & ?{PROP:From} & '"' )

If so there’s some bad code changing the From


In my Preview tool you can see all the PROP’s of a Control and see the Prop:Value truncated. Probably also see the From truncated.

Works in C6. Note the extra hash symbol Self Print|#|#No Print'

Loc:TestString       STRING(20)
LIST,AT(159,15,116,10),USE(Loc:TestString),DROP(10),FROM('Printer|Visa|Master Card|Amex|Discover|Checking|Savings|Email|Self Print|#|#No Print')