Copy and Pasting in the Navigator

I can copy a method out of the navigator to clipboard and end up with something like this when pasted into a text editor:


Function MyFunction(msg as String) As String
return msg
End Function


However, if I had this in a text editor it does not seem possible to paste this back into the navigator to create a method. To clarify that, if I wrote another method constructed as above in a text editor but called MyFunctionB and copied it to the clipboard, I don’t believe this can be pasted back to the navigator as a new method.

Can anyone confirm?

Have you tried to paste with the Option (Alp on Linux / Windows) ?

It worked like this with the previous IDE.

You can create a new method and paste into the method name field in the inspector which will interpret your code.

Not if what you have in the Clipboard starts with Sub and end with End Sub…

The problem lies with what you have in the Clipboard thus the question.

Of course, one can have a header in all its Methods Functions with a line that details the Syntax and:
Name(Parm As ListBox).

Yes, pasting Name(Parm As ListBox) in the Method name does the trick.

I understand the question as “I copy the Method in the Navigation pane: how do I paste it (in another Module, Window, Project, whatever…”

Believe me people it can get much worse than this error (which is also very serious)!

Imagine using copy, cut, past and depending on the choosen command, when you cut or past code INSIDE the text editor in the navigator methods or objects are duplicated (in the best case scenario) or completely deleted. Then you choose “save” - “run”… bingo your project is ruined! First I thought it was my mistake, however after carefully investigating I found out that it was Xojo’s buggy behaviour.

Can someone of Xojo inc explain to me how it is possible that this bug got in a release version? Are those Xojo engineers testing their application or do they just release in the hope it will work? To me it seems the latter.

In my opinion it is best that we all reverting back to RealStudio 2012 and in the meantime Xojo inc fixes all those major bugs.

This seems serious; did you make a bug report ?

@Chris: I don’t understand the bug you found. Can you explain with more detail? Oh, and when the programmer makes an error it’s not Xojo’s fault.

@Emile Schwarz

I did not made a bug report because those bug reports are viewed based on popularity. When I come accross a bug I try to find a workaround. For a long time, I thought it was my mistake and it did took me very long to realise it was Xojo doing this.

@Beatrix Willius
There where many methods in my project. I was always working within the code editor. When I cut one line out of a method by selecting it with the mouse, then use the shortcut “CTRL-X” (the line is now on the clipboard and no longer visible in the method), then I place the text cursor higher within the text editor (same method) and use the shortcut 'CTRL-V" a method or object in the navigator got duplicated. If I for example used “CTRL-X” it was no longer the selected text inside the method which was cutted out, but an object in the navigator. The focus was always inside the method. Somewhere along the process, the focus shifted from within the method to the navigator.

You are correct, when a programmer makes a mistake it is not always Xojo at fault. But in this case it is a human error at Xojo inc. When something goes wrong I always look for the cause by myself. Mostly but not always, it is indeed my own mistake. But in this case, it is a developer at Xojo which made a mistake. I only wonder why nodoby saw this bug at Xojo inc. Maybe because of my frustration the language I used was not correct.

Still, I am using RealBasic from version 5 and I am a true Xojo fan. I can see when all those bugs are fixed, Xojo has very high potential. Despite all frustration, I believe within a few releases from now, we will receive the fruits of our work.

Thank you Emile and Beatrix for your reply. It made me feel good again.

This sounds interesting. Will try later. Haven’t seen this before.

Copy and paste seems to be very very complicated. Copy a method in one class then go to another class. Select the “Methods” header and click paste. You will hear the lovely “ding”. Already in fixed - I think - for the next version.

I enarly never hear the lovely ‘ding’: my computer sound system is nearly always off :wink:

That might be a good idea, because Xojo dings incessantly.

[quote=37088:@Emile Schwarz]Not if what you have in the Clipboard starts with Sub and end with End Sub…

Strange. It’s working for me on windows. I copied Mikes Function completely & it worked also

Sub myMethod() msgBox "Hello" End Sub

this typed into notepad then pasted into the method name field in Inspector.

I see there’s a fb case feedback://showreport?report_id=24685 regarding this on OSX.

I have spent more time in the navigator and code editor and on Win7 the functionality is horribly inconsistent and is pretty much non-functional. I often have to hit CntrlC twice or CntrlV twice to get it to work. “Sometimes” right click copy/paste works, but other times nothing. There seems to be no consistency in the operation of copy and paste, even doing simply text copying and pasting in the code editor is dodgy.

I just don’t get it, how does something this glaring get released? It is not difficult to duplicate, all you have to do is use the navigator for a while.

Wayne: that is on OS X. Worked fine (with Option key down) with Real Studio.

I only use the contextual menu for copying and pasting as I’ve had too many inconsistencies using the keyboard. Some resulting in quite a bit of time figuring out what happened to break my code.

I’ve upgraded my wife to a Windows 8 laptop, so now I have her old mac mini to try Xojo on.

Those Microsoft stores have added something new to their trade in policy I see… I’ll ask my wife but don’t think she’ll go for it…