1. David Vasconcelos
  2. PowerServer 2020 or older (Obsolete)
  3. Friday, 1 March 2019 15:48 PM UTC

I will admit I am getting very frustrated with Powerserver/PowerBuilder 2017. I am running PB2017 R3, WIN10.

Scenerio.

4 string variables

String ls_1, ls_2, ls_3, ls_all

ls_1, ls_2, ls_3 - all variables happen to have null values

when "adding/concatenating" them together you would think the result would be null or empty string.

but in WEB its the actual number ZERO.

 

ls_all = ls_1 + ls_2 + ls_3

 

Why would this be zero since they are all strings, we are seeing zeros showing up on columns that normally would have been empty.

Is this a bug or is it now the new "Normal".

 

Please clarify..

Thanks Dave V.

 

 

 

Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 5 March 2019 20:17 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

David is correct, whenever a null string is concatenated with any other string(s), the resulting string should be a NULL.

That's how it works in the PBv12.x and previous versions of PB.


Olan

 

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 5 March 2019 20:29 PM UTC
Things sometimes work differently in PowerServer Web than PowerBuilder because with PowerServer Web it is running in JavaScript or we just maybe haven't exactly matched PowerBuilder's behavior. This is why there is an unsupported features guide for PowerServer Web. Anyway, Appeon tech support is looking into this to determine if it is a bug or if it is an unsupported feature of PowerServer Web.
  1. Helpful
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Monday, 4 March 2019 00:39 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Hi David,

Thanks for reporting this problem! We reproduced it on our end and will do further research to figure it out. We will keep you posted about the progress.

Regards,
ZhaoKai

Comment
  1. David Vasconcelos
  2. Monday, 4 March 2019 10:19 AM UTC
Thanks.
  1. Helpful
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Sunday, 3 March 2019 20:44 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Hi David,

You missed to SetNull the variables. Declaration is not enough.

Try this code and you'll verify what the webpage reports.

String ls_1, ls_2, ls_3, ls_all
setnull(ls_2)
setnull(ls_3)
ls_1 = '1'
ls_all = ls_1 + ls_2 + ls_3
messagebox("", ls_all)

Best,

.m

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Saturday, 2 March 2019 10:19 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 4
Comment
  1. David Vasconcelos
  2. Saturday, 2 March 2019 10:35 AM UTC
Thanks for the response Marco, but based on the link you gave me the result set should have been null not zero which is what I would have expected. This is string concat so according to the link I should see "nullnullnull" BUT I am seeing zero. Its like its changing the variable type from string to numeric or ignoring it.
  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.