Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing crlf from clipboard or variable

Status
Not open for further replies.

Sparky1157

Programmer
Aug 19, 2016
30
US
I've copied the contents of the clipboard into a variable, and then send that information to the screen in Reflection. However, if there's any crlf characters the screen information displays incorrectly. Since there is no REPLACE command, I've written my own function with the intent of removing these characters if present in the string. But so far all of my attempts have failed. I'm at home now, so I can't copy and paste my function right now, but basically I'm stepping through the variable using FOR I = 1 TO LEN(STRING) (or something like that) and check each character for "<Ctrl+M>" or "<Ctrl+J>" and then don't copy them to a new variable.

This hasn't amounted to anything favorable. I'm looking for some assistance in how I might be able to accomplish this. On Monday I can copy the code here if that would be helpful....
 
Hi,
Code:
Dim s As String
For i = 1 to Len(String)
   Select Case Mid(String, i, 1)
      Case Chr(10), Chr(13)
      Case else
         s = s & Mid(String, i, 1)
   End Select
Next

String = s

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Hey, Skip! Just to follow up: I'm up and running successfully! Thanks so much for your expertise!
 
Up and running successfully Is good!

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top