TextToBuffer & BufferToText (Copy & Paste)

Home Forums Multi-Edit User Created Macros TextToBuffer & BufferToText (Copy & Paste)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2894
    shrike
    Participant

    Hi,
    NB Tried to post this Prev But Lost it Somewhere – Ignore if it Turns Up Elsewhere!

    Using ME2008 under Win 7 Pro.

    Essentially I’m, Trying to Do a copy & Paste Using TextToBuffer() & BufferTo Text But
    Alas Come Paste Time I get a BLANK/Zilch/Nothing!

    In File_1 I copy the required text Ok!
    IE: Block the required Text then Copy It [code:309p9c16]RV = TextToBuffer(iBufHndl, 0xffff, TRUE);[/code:309p9c16]
    Because I have to do some CleanUp Work on File_2 (.Dat file) and Save it as a .txt file, I cant Paste
    the Copied text to File_2 Straight after the Copy, I create a Global Str and tried to assign the Value
    of "iBuffHdnl" to the Global String But [code:309p9c16]Str_Var = Global_Str(‘Search_Str’ );[/code:309p9c16], Which is where I come
    unStuck. The "iBuffHdnl" pointer, is the address of the copied text!!
    I need to get the Text to a Gobal Var so I Can Use it Later on after I finish what I Have to do and then Paste it
    into File_2.

    Would appreciate any help on this!!!

    #9377
    shrike
    Participant

    Hi again – Have sort of answered my Own Question!

    The Solution is in "Block.s", BlockToStr() or BlockToGlobal() which would allow
    me to do what I want to Do!!

    Would still be interested in a Solution to Using TextToBuffer() & BufferToText()
    if anyone has any Ideas

    Thanks
    Shrike

    #9380
    Clay Martin
    Keymaster

    Hi,
    I think to use those "buffer" functions you need to create one first, since buffers are tied to windows, thus you create a window (invisible) first then copy your text to and from that window’s buffer. In the CMac help check the window function list, and do a search on buffer. I am not sure but I think you create a window (hidden), make it current, then use Buffer_ID to get its id. Then you can use these functions like you wanted to. Cool thing about using an hidden window is you don’t have to store a possibly large amount of text in a global variable, just the window’s id.

    Hope this helps,
    Clay

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.