PDA

View Full Version : Template for tool which processes line based text from clipboard



Petr Schreiber
31-07-2010, 17:16
From time to time,

I use this template as a base for work which modifies text in my clipboard, maybe somebody will find it useful.

Just unzip the attachement to your thinAir/Template directory.



Dim sInput As String = ClipBoard_GetText
Dim sOutput As String

Dim lines() As String
Dim nLines As Long = Parse(sInput, lines, $CRLF)

' -- Auxiliary variable for enhanced line handling
Dim oneLine As String
Dim lineToken() As String
Dim lineTokenCount As Long

' -- Auxiliary variable to log any problems
Dim problemLog As String

Dim i As Long

For i = 1 To nLines
oneLine = lines(i)
'lineTokenCount = parse(oneLine, lineToken, " ")


Next

If Len(problemLog) Then
MsgBox (0, problemLog, %MB_OK Or %MB_ICONINFORMATION, "Problems found")
Else
sOutput = Join$(lines, $CRLF)
ClipBoard_SetText(sOutput)
End If


Petr