Sign in to follow this  
Followers 0
mithandir1

Need help with _clipboard_setdata

3 posts in this topic

#1 ·  Posted (edited)

I have a program that gives me offsets and file sizes of files compressed in a .pak file. I have written a scripts that converts the beginning offset from hexadecimal to decimal and adds the file size to give me the both offsets in decimal. I am now attempting to make the script automatically copy the outputs to the clipboard so that I can simply paste them to a text file. I need the output copied to the clipboard in this format: beginning,ending Here is what I have tried I am rather stumped since I have never tried anything with the clipboard before.

#include <ClipBoard.au3>

HotKeySet("{esc}", "Terminate")
call("main")
func main()
while 1

If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer
local $hex_valure = InputBox("Offset Calculator","Enter Starting Hex Value",""," ","100","50","1","1")
Select
    Case @Error = 0

    Case @Error = 1 

    Case @Error = 3 

EndSelect
If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer
local $bytes = InputBox("Offset Calculator","Enter File Size",""," ","100","50","1","1")
Select
    Case @Error = 0 

    Case @Error = 1 

    Case @Error = 3 

EndSelect

local $dec = Dec($hex_valure)
local $fileend = ($dec + $bytes)
if $dec = 0 Then
    MsgBox(0,"ERROR","INVALID OFFSET!")
    exitloop
    endif
_ClipBoard_SetData ($dec,$fileend);I want this copied to the clipboard in text format with a comma separating the 2 values



wend
call ("main")
endfunc

Func Terminate()
         Exit 0
EndFunc
Edited by mithandir1

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try getting it all set up with StringFormat or other string commands, then at the end using _ClipBoard_SetData.

Edit: Looked at code more: Try replacing your line with:

_ClipBoard_SetData ($dec & "," & $fileend);
Edited by Prab

Share this post


Link to post
Share on other sites

Try getting it all set up with StringFormat or other string commands, then at the end using _ClipBoard_SetData.

Edit: Looked at code more: Try replacing your line with:

_ClipBoard_SetData ($dec & "," & $fileend);
Works perfectly Thank you very much!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0