Copying variable values to clipboard
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 64
- Joined: Thu Jan 16, 2020 10:28 pm
- Location: Max Meadows, VA USA
Copying variable values to clipboard
Hi Folks.
When debugging, is there some way to copy the value stored when you break or step through code? I can see the value in the watch tab (or whatever the official name is) but you cannot highlight and copy it. I can think of some ways to get around it such as putting a text box and populate but this seems a silly way to do this. TIA
When debugging, is there some way to copy the value stored when you break or step through code? I can see the value in the watch tab (or whatever the official name is) but you cannot highlight and copy it. I can think of some ways to get around it such as putting a text box and populate but this seems a silly way to do this. TIA
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Copying variable values to clipboard
Hi.
If I understand what you are asking, when execution has halted during debugging, if you double click on a variable in the variable pane, that variable and its contents will be presented in a small stack window. From there, you can select and copy either the contents of that variable, or, in fact the variable itself. The clipboard will hold what you select.
This works as well for array variables.
Craig
If I understand what you are asking, when execution has halted during debugging, if you double click on a variable in the variable pane, that variable and its contents will be presented in a small stack window. From there, you can select and copy either the contents of that variable, or, in fact the variable itself. The clipboard will hold what you select.
This works as well for array variables.
Craig
Re: Copying variable values to clipboard
As Craig says, or you can click on the box with the pen (2. edit), you can also search for specific variables using 1. the search box.
-
- Posts: 64
- Joined: Thu Jan 16, 2020 10:28 pm
- Location: Max Meadows, VA USA
Re: Copying variable values to clipboard
Thanks folks. Not sure why you have to enable an additional edit action, instead of just making it eligible to copy right off though.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Copying variable values to clipboard
Wee, I guess what you are asking is to be able to select the value of a variable right in the variable pane. Currently, if you have:
you will see that temp contains three lines, which is visible (AND EDITABLE) in the small window I mentioned. But in order to access those three lines directly from the variable pane might be a, er, pain. Could be done, but isn't.
For arrays:
The variable pane deconstructs the array variable (a very convenient tool), and you can see what is in that small window. But you might agree that it is now a bit more complicated to be able to simply copy a value from one of the elements of that array.
You can always build your own, using the "variableNames" function. A wordy example:
"qqq" contains the contents of var1
Craig
Code: Select all
on mouseUp
put "aaa" & return & "bbb" & return & "ccc" into temp
breakpoint
For arrays:
Code: Select all
on mouseUp
put "aaa" into temp["a"]
put "bbb" into temp["b"]
breakpoint
end mouseUp
You can always build your own, using the "variableNames" function. A wordy example:
Code: Select all
on mouseUp
put "XXX" & return & "ZZZ" into var1
put "YYY" & return & "JJJ" into var2
put the variableNames into tNames
put item 2 of line 2 of tNames into temp --this is where var1 lives
do "put " && temp && "into qqq"
breakpoint
end mouseUp
Craig