PxPlus User Forum

Twitter Twitter Twitter

Author Topic: copy and pasting from the internet  (Read 2997 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
copy and pasting from the internet
« 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

Marty

  • Member
  • **
  • Posts: 5
    • View Profile
Re: copy and pasting from the internet
« Reply #1 on: June 09, 2020, 09:54:43 AM »
Have you tried CVS(data$,16) ?

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: copy and pasting from the internet
« Reply #2 on: June 09, 2020, 09:58:09 AM »
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 ...

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: copy and pasting from the internet
« Reply #3 on: June 09, 2020, 10:52:28 AM »
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?

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: copy and pasting from the internet
« Reply #4 on: June 09, 2020, 02:33:03 PM »
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?
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: copy and pasting from the internet
« Reply #5 on: June 09, 2020, 02:35:40 PM »
I normally use a single line input.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: copy and pasting from the internet
« Reply #6 on: June 09, 2020, 02:50:26 PM »
You might want to assign a data validation routine to the field and have it strip any non-printable characters.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: copy and pasting from the internet
« Reply #7 on: June 09, 2020, 02:51:19 PM »
Ok Mike, we will do this. Thanks.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: copy and pasting from the internet
« Reply #8 on: June 10, 2020, 09:27:04 AM »
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.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Dave Fullerton

  • Silver Member
  • ***
  • Posts: 35
    • View Profile
Re: copy and pasting from the internet
« Reply #9 on: June 10, 2020, 09:54:37 AM »
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

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: copy and pasting from the internet
« Reply #10 on: June 10, 2020, 11:03:00 AM »
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.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

koenv

  • Member
  • **
  • Posts: 12
    • View Profile
Re: copy and pasting from the internet
« Reply #11 on: June 11, 2020, 06:07:25 AM »
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).

James Zukowski

  • Diamond Member
  • *****
  • Posts: 296
    • View Profile
Re: copy and pasting from the internet
« Reply #12 on: June 11, 2020, 10:12:02 AM »
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.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: copy and pasting from the internet
« Reply #13 on: June 12, 2020, 02:19:59 AM »
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.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: copy and pasting from the internet
« Reply #14 on: June 12, 2020, 10:36:51 AM »
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.

« Last Edit: June 12, 2020, 02:20:12 PM by Mike King »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com