can express allow to create code snippets?

M

mp

is there a way to save sections of code to insert similar to the snippets
functionality?
mztools had this for vb6, is there a way with c# or vb in express versions?
thanks
mark'
 
M

mp

Peter Duniho said:
Can you clarify what you're trying to do?

snip

If none of that information is useful, maybe you can write in a more exact
way what it is you're trying to do.

Pete

Thanks,
the current example was I usually log a line in each function/sub at start
and end to follow the program flow (so i can see where things went south)
ex: (in vbish syntax but same idea in c#)

Sub Somesub()
Dim ProcName as String = "SomeSub"
moDebugger.ProcStart (ProcName)
....code...
moDebugger.ProcEnd (ProcName)
End Sub

with mztools in vb6 I could insert that with a keystroke in any sub/func and
it would 'read' the sub name and fill in accordingly

similarly there were various other sections of code that appeared somewhat
repetitively in various routines i used to write, it was handy to be able to
insert any text with a keystroke combination when needed.
i think mztools called them code templates
thanks
mark
 
M

mp

Peter Duniho said:
mp said:
[...]
Sub Somesub()
Dim ProcName as String = "SomeSub"
moDebugger.ProcStart (ProcName)
....code...
moDebugger.ProcEnd (ProcName)
End Sub

with mztools in vb6 I could insert that with a keystroke in any sub/func
and it would 'read' the sub name and fill in accordingly

I haven't verified, but I know the snippets feature in VS supports
context-sensitive variables in the snippet. I'm pretty sure it supports
the scenario you describe directly.
similarly there were various other sections of code that appeared
somewhat repetitively in various routines i used to write, it was handy
to be able to insert any text with a keystroke combination when needed.

Have you tried the snippets feature itself? Why are you asking for
something ".similar to the snippets functionality"? Why not just create
and use a snippet?

Pete

I tried through snippets manager but only succeeded in adding a folder
I should have looked in help to see if it explains how to create a user
defined snippet
thanks
mark
 
M

mp

Peter Duniho said:
The snippets managed has an "Add." and "Remove" that manage the folders,
but there should also be an "Import." button to allow you to import
specific .snippet files.

Pete

I saw that but since I don't have a snippet to import yet...(still at the
point of trying to create one)
I did find this in the help files (should have looked there first I know...)
To create a .snippet file
1.. On the File menu, click New and then click File.

only problem is, in express C# the File menu doesn't have a New sub item,
only New Project
I don't know what File menu they're talking about, I had assumed the dotnet
ide, but maybe not?

ah! I think i found the solution....
a code snippets editor on the msdn site
http://msdn.microsoft.com/en-us/vbasic/bb973770.aspx

that should do the trick
thanks
again, apologies for not searching more first (though it's more fun to have
some social interaction with you all here on the ng...:) )
mark

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top