Using Powerbuilder 7.0
How to remove trailing and leading spaces, and prevent empty data, on an
item within a treview on user label edit?
Thanks..!
Just use the PB built-in commands: Trim ( ), LeftTrim ( ) or RightTrim
( ) as required.
Note: You can often set this type of trimming option in your database
driver - via the DBParm settings (if your DBMS/Driver supports it).
HTH
--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com
"Alex Castillo" <a...@m.com> wrote in message
news:4a5dd063$1...@forums-3-dub.sybase.com...
Any idea?
P.S.: The other post I placed, is in regards the same situation but within a
column within a datawindow... I've tried trimming 'data' on the datawindow's
ItemChanged, but it doesn't seems to work for me either...
"Chris Pollach" <cpol...@travel-net.com> wrote in message
news:4a5dd557$1...@forums-3-dub.sybase.com...
Select Trim (First_name),
Trim (Last_Name),
.... FROM ....
;
As far as the TV Item is concerned it should work. However PB 7 is so old
I can not say so sure that there is not a TV bug you are experiencing. I
would suggest that you post a simple example application for us to look at
but, I doubt anyone would still be using PB 7. The lowest version I have
installed currently is now PB 10.5.2.
"Alex Castillo" <a...@m.com> wrote in message
news:4a5dd71f$2...@forums-3-dub.sybase.com...
// String with spaces only ' ' or empty string '' is NULL
// Otherwise trim the value
string ls_new_value
string ThisIsNullString
setnull(ThisIsNullString)
if dwo.Name = "mycolumn" then
ls_new_value = trim(data)
if ls_new_value = "" then ls_new_value = ThisIsNullString
this.SetItem(row, string(dwo.Name), ls_new_value)
return (2)
end if
Regards,
Ivaylo
"Alex Castillo" <a...@m.com> wrote in message
news:4a5dd71f$2...@forums-3-dub.sybase.com...
TreeViewItem tvi
this.GetItem(handle, tvi)
tvi.Label = trim(newtext)
this.Post SetItem(handle, tvi)
return 1
The idea is to get a reference to the edited treeviewitem, modify its Label
property with the trimmed newtext and store the modification to the treeview
control rejecting (return 1) the user modification.
Ivaylo
"Alex Castillo" <a...@m.com> wrote in message
news:4a5dd71f$2...@forums-3-dub.sybase.com...
"Chris Pollach" <cpol...@travel-net.com> wrote in message
news:4a5dd557$1...@forums-3-dub.sybase.com...