Resolved Creating Snippet

jcardana

Old to VB6, New to VB.NET
Joined
Oct 26, 2015
Messages
72
Location
Rio Rancho, NM
Programming Experience
Beginner
EDIT: I was missing the <![CDATA[ ]]> field

Below is what I have in the "ErrHeadFoot.snippet" file. Upon Import I'm told it's not valid. This is based on Create a code snippet in Visual Studio - Visual Studio (Windows)

As always, thank for your time and efforts,
Joe

ErrHeadFoot.Snippet:
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>ErrHeaderFooter</Title>
        </Header>
        <Snippet>
            <Code Language="VB">
                If EnableErrHandling Then On Error GoTo ERRORHANDLER
                Dim ErrorAppRoutine, ErrorAppTask, ErrorFNFFN, ErrorProcedure, ErrResp As String
                ErrorAppRoutine = "frmMain_Blank"
                SubLevel += 1 : Routine(SubLevel) = StrDup(SubLevel, "|") & ErrorAppRoutine : If DebugLog Then WriteToLog.WriteLine(Format(Now, "yyyyMMdd.HHmmss") & "- " & Routine(SubLevel) & " - ENTER")
                '───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
                'START CODE HERE
                EXITRTN:
                '═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════
                If DebugLog Then WriteToLog.WriteLine(Format(Now, "yyyyMMdd.HHmmss") & "- " & Routine(SubLevel) & " - EXIT") : SubLevel -= 1 : GoTo ENDRTN Else SubLevel -= 1 : GoTo ENDRTN
                ERRORHANDLER:
                ErrResp = MainErrorHandler(Err.Number, Err.Description, Routine(SubLevel), ErrorAppTask, ErrorFNFFN)
                If ErrResp = "RETRY" Then Resume
                If ErrResp = "IGNORE" Then Resume Next
                ENDRTN:
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
 
Last edited:
I guess unstructured is a relative term. My method provides logging and Task Labeling, so I know where in the procedure something goes bad and what it was doing. As I get better at anticipating the future I'll switch.
 
Back
Top