I’m posting this in “Getting Started” because it seems like a fairly basic question that I’m just missing the answer to.
Say I’ve found a forum post with a few methods in it that I’d like to paste into Xojo:
Function abc(x as integer, y as double) as string
' code
End Function
Private Function def (i as string, a as string, byref b as boolean) as integer
' code
End Function
How do I now paste this code into the Xojo IDE without having to retype all of the definitions then pasting the code into the body of the method?
what I usually do. is paste the whole thing into XOJO
delete the END FUNCTION line
copy the signature (between the () ) and paste it into the inspector
and type in the rest
and its not just coming from the forum… its from any source that you “cut” from where the code is like this
[quote=254238:@Dave S]
what I usually do. is paste the whole thing into XOJO
delete the END FUNCTION line
copy the signature (between the () ) and paste it into the inspector
and type in the rest[/quote]
Thanks. That’s pretty awkward to be honest. You can’t paste multiple methods simultaneously? Maybe into a text file and then import it into Xojo?
Thanks, I’ve tried this (on a Mac) and the method isn’t created in the window I had selected. Xojo seems to take the paste with no effect.
[quote=254243:@Karen Atkocius]Copy them individually and select the Window , Module or class where want it, and paste. The method will be added to to … at least on a Mac.
Karen[/quote]
Works fine on Windows too. Just copy the function declaration through the end and it drops right in. My experience is that you need to paste it into the code window.
Ah, okay, I got it to work by right-clicking on the Window in the Contents and choosing Paste. But it only pastes the first function on the clipboard. If there are many functions in a row, only the first is added.
It worked sometimes ago on OS X, then I needed to press the Option key while selecting the Paste MenuItem or drop onto what was the Navigation pane, and now it does not works at all like Dave said earlier.
Code selection in the Code Editor and activating the ContextualMenu Add As Method (or so) does not wk-orks too (as I expect it to do). I think the code is pasted in the declaration field (I do not recall).
Becasue nobody complain, I was thinking that I was suffering to some disease ;-
Although pasting copied text methods only works for one method at at a time, pasting a method into a navigator object and having the method created works for me in Xojo on a Mac.
It would be nice if it did some simple parsing (Looking for End Method or End Function) so you COULD paste multiple methods, but not a big deal for me.
Why in the world would that thread starter (whoever they may be) think that should be a “Pro” only topic? That type of thing is why I did not think a Pro only forum was a good idea.
BTW In general (at least in the forum for the rest of us) I don’t find the discussions to be as interesting or as in depth as they were on the NUG… I learned a lot on the NUG. BTW I felt the same way about the old REAL Forum.
Now I don’t know if that is because of the existence of the Pro forum or some other reason.
Karen, I am sorry for having pointed to a Pro forum discussion. Not sure why a hobbyist should criticize one of the tools professionals use to communicate, though. Especially when most of them go out of their way to share their knowledge and assist all in the general forum.
Let me echo the solution offered by Norman, to a question that was very similar :
Q : [quote]I have 100’s of classes that i need to get into Xojo, currently they are in a different language which i can get them from as its a text file.
is there a way to paste that text into Xojo and have it create the class object?[/quote]
I suggested modifying an XML project, but
A : [quote]XML really sucks for this
vcp is much simpler
[/quote]
#tag Class
Class Class1
property key01 As Integer
End Class
#tag EndClass