Donate Now Goal amount for this month: 100 USD, Received: 0 USD (0%)
Donate to support this site and ThinBASIC project development

Results 1 to 1 of 1

Thread: Template for tool which processes line based text from clipboard

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    6,399
    Rep Power
    649

    Template for tool which processes line based text from clipboard

    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.

    [code=thinbasic]
    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
    [/code]

    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 7 64bit - Intel Core 2 Duo T6600 @ 2.2GHz - 4 GB RAM - NVIDIA GeForce G210M 512MB
    Windows 8 64bit - Intel Core i5-3350P @ 3.1GHz - 8 GB RAM - NVIDIA GeForce GT640 3GB

Similar Threads

  1. Petr's cool 2 line copy processes to clipboard
    By kryton9 in forum Sources, Templates, Code Snippets, Tips and Tricks, Do you know ...
    Replies: 3
    Last Post: 30-03-2008, 17:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •