Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Easy Copy and Paste
#1
I would simply like to copy text into a string for instance using a password bar running separate macros
Copy1
'HSE Cc
str a.getclip
Then Copy another text to string
Copy2
'HSE Cc
str b.getclip
Copy3
'HSE Cc
str c.getclip


I then want to paste them at a different time

paste1
str a.setclip
outp a

paste2
str b.setclip
outp b

paste3
str c.setclip
outp c


But this does not work. It only gives me the last thing I copied. I have tried a great many variations none of which work.
#2
Code:
Copy      Help
;create 2 global variables
str+ g_sA g_sB
;copy1
'HSE
g_sA.getsel
;copy2
'HSE
g_sB.getsel

Code:
Copy      Help
str+ g_sA g_sB
;paste 1
outp g_sA
;paste 2
outp g_sB
#3
Thank you very much. Big Grin This works great. Big Grin
Do I need to put in all the "global string" variables in to each copy and paste since I want to do about 20 of these copy and paste functions that will do different things before I copy and or paste?
I gather that str with the + makes it a global variable.
Does these global variables last between functions. I want to take things from an email and add them to a database, i.e. access 2010.
Again Thank You
#4
Read QM Help, "Variable storage and scope" topic.

Global variables last between functions. But don't use where not necessary. For example, when calling a function, you can pass variables as arguments. Or use thread variables.


Forum Jump:


Users browsing this thread: 2 Guest(s)