PxPlus User Forum
Main Board => Discussions => Nomads => Topic started by: Jeffrey Ferreira on June 09, 2020, 08:26:29 AM
-
Hi List,
I continually have problems where customers copy and paste item_numbers and descriptions from the internet into multi_lines on our system. Is there any global way to clean this data or do I have to handle it on each multi-line. I end up with Tabs and CRLF's and it causes havoc in other places.
thanks
jeff
-
Have you tried CVS(data$,16) ?
-
i did and i will do that...but it seems like every time i fix one multi line they do it on another.....
that is probably the answer ...
-
I think we're suffering from the same problem. Users like to paste east european addresses, because they can't type these special characters on the keyboard. But this is just a visual solution.
What about a runtime parameter, which tells PxPlus to apply cvs(data$,16) itself upon pasting into a multiline? Could that be a way?
-
What type of input field are you using and what version PxPlus?
Is it a single line input field or a multi-line input field?
-
I normally use a single line input.
-
You might want to assign a data validation routine to the field and have it strip any non-printable characters.
-
Ok Mike, we will do this. Thanks.
-
Question for everyone ...
We could add a system option to strip out all non-printable characters from any data pasted into an input field.
Is this something people would like to have?
If so, should we default it on or off?
Non-printable would include things such as TAB and $FF$ along with any other characters in the range $00$->$1F$.
If the input accepted multiple lines we would allow CR & LF.
High-order ASCII characters (accents generally) would not be stripped.
-
Hi Mike:
I think it's a great idea. The have been more times than I care to count where someone has pasted data from an alternate source, which causes fields in files to be moved down causing all sorts of undesirable results. My vote would be to have the data stripped of these characters by default.
Regards
Dave Fullerton
-
How about this;
On single line inputs (not inputs that accept multiple lines) we strip all leading non-printables and consider any non-printable after the first printable character as end of input and truncate the clipboard at that point.
Here are some examples:
- If data is <tab>12345 the pasted data is 12345
- If data is <cr><lf>123<tab>456 the pasted data is 123
- If data is CAT<tab>Meow<lf> the pasted data is CAT
This would only be on single line inputs and the clip board would be changed to match the data pasted in case the user wanted to paste it elsewhere.
-
My prefered option would be:
Strip all non-printables from the start.
Strip all non-printables from the end.
If possible: strip most non-printables from the data, with the exception of tabs and linefeeds, replace those with spaces.
If not possible: just strip all non-printables.
Don't truncate after first non-printable.
I don't know how I feel about changing the clipboard.
And enable by default. I can't think of a situation where I want users to enter tabs or linefeeds in our data (on single line input).
-
Perhaps the options can be either "stacked" (like Multi_Line Auto Fill) or in a Drop_Box (like Scrollbars) for individual variations from the defaults.
-
I like koenv's suggestions.
No one knows what features the users see in the current behaviour. Though I like to turn that option on by default, we must be able to turn it off again.
-
Just to let you know we have implemented a new Paste Filter on the next release of PxPlus.
When the Filter is enabled it will strip any leading/trailing non-printing characters and replaces any internal sequence of non-printing characters with a single space. This results in data such as:
123 Main Street
Markham
Ontario
Being pasted as
123 Main Street Markham Ontario
The filter will be controlled by a new ‘PasteFilter property to indicate if the paste filter is enabled or not. It will be available on the MULTI_LINE and GRID controls.
We are also providing a new 'OPTION'("PasteFilter", value) mnemonic and SETDEV SET "PasteFilter" TO value directive to control the default setting for the filter. When the filter is enabled (default) then all GRID and single line entry Multi-Line controls will have the paste filter enabled when the control is created.
On the GRID the filter is NOT applied to the Multi_line cells types which are intended for multiple lines of text. Also MULTI_LINE controls which accept multiple lines of text will not default to being filtered.