User | Kudos |
---|---|
6 | |
5 | |
3 | |
2 | |
2 |
I really liked the concept of Code Snippets when they were unveiled and experimented with them in the week that I have had LV2009. As others have noted, there is a fundamental flaw when property nodes or references are involved. I am surely oversimplifying, but it appears that they are borrowing the code used to generate Sub-VIs from a selection and putting a picture with it. People who have studied this more than I have say there is a very good reason for doing things this way for sub-VIs and I believe them.
Code snippets are a different story. In Visual Studio, snippets are a lot like macros, I consider them code fragments. They save me the trouble of opening a file, copying some code, and pasting it into my current document. I may have to change a few variable names, but it is a real timesaver. If I want to use a procedure I have already written, I don't copy and paste, I just add the file to my project. Likewise in LV, if I want to include a subVI, I'll just include it. However, if I want a fragment of the block diagram I'll copy and paste. I have never had a problem doing this. The code snippet should be a way of sharing fragments, and it appears to me the code is mostly in place. If you copy a portion of your BD and paste in the same or a different VI, you get the LV code (unchanged), paste it in a graphics program you get the image. Both of the pieces are already in place, we just need a way of changing the contents of the clipboard to a PNG file with the additional metadata. Dragging a snippet to the BD should be equivalent to adding the LV code metadata to the clipboard and pasting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.