Tech Off Thread

15 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Not Serious - Foolish, Try Catch

Back to Forum: Tech Off
  • User profile image
    SEP2007

    This is my new "Try - Catch"  Structure !


                    '*******************************************

                            Try
                                                                  '****************'
                                try code                     '    PICTURE HERE    '
                                try code                     '    OF CATCH-BLOCK '
                                try code                     '     e.g. Piping       '
                                                                  '      Picture.           '
                                                                  '                            '
                                                                  '****************
               


                                                              Catch ex As Exception
                                                              Msgbox ex.Message
                                                              End Try


                    '*******************************************


    Maybe should be in Coffee House.

  • User profile image
    littleguru

    What are you trying to tell us? I really don't understand!

  • User profile image
    SEP2007

    I kind of hoped I could write formatting "rules" into an editor, so that it would auto-matically format code in a way that was not just tabbing.

    I tried to find out if I could do this in the VB editor. But I couldn't work out how.




  • User profile image
    SEP2007

    I was trying to create a block of code that represented a try- catch statement, that was more visual than tab formatting of code.

    >
        >
           >
        >
           >
    >
    >


  • User profile image
    jsampsonPC

    What do you mean? Were you trying to create significance in the whitespace or something? If so, maybe you should start coding in python instead of C# or VB Smiley

  • User profile image
    W3bbo

    jsampsonPC wrote:
    What do you mean? Were you trying to create significance in the whitespace or something? If so, maybe you should start coding in python instead of C# or VB Smiley


    SEP2007 seems to have difficulties in visualising how program code works in his head and wants the IDE to show a visualisation of language constructs in the background of the text-editor. (Like "pipes" and arrows showing program flow)

    At least that's how I'm interpreting his incoherent posts.

  • User profile image
    SEP2007

    .
     

  • User profile image
    jsampsonPC

    C3PO?

    Dunno who that is, but I'm sorry if they jumped on you for not asking a highly-technical question Tongue Out I would, just as a friendly comment, ask that you not respond to people with things like "F8ck off" as your comment...that might get you in trouble with admins.

    Anyway, I'm interested in your idea about creating custom formatting in an editor. Unfortunately, I don't understand your visual-demonstration, so could you write up a couple of descriptions, or examples, of what you mean?

    Thanks!

  • User profile image
    SEP2007

    .

  • User profile image
    SEP2007

    .

  • User profile image
    SEP2007

    jsampsonPC wrote:
    C3PO?

    Dunno who that is, but I'm sorry if they jumped on you for not asking a highly-technical question Tongue Out I would, just as a friendly comment, ask that you not respond to people with things like "F8ck off" as your comment...that might get you in trouble with admins.

    Anyway, I'm interested in your idea about creating custom formatting in an editor. Unfortunately, I don't understand your visual-demonstration, so could you write up a couple of descriptions, or examples, of what you mean?

    Thanks!



    Thanks Man. Some Positive feed back instead of being slated.

    Ok,

    If in the VB editor I write.

    Try
    Me.Richtextbox.Loadfile("thefile")
    Catch ex as Exception
    Msgbox ex.message
    End Try

    Then if formatting is on, "pritty formatting" the editor in Visual Studio writes :

    Try
        Me.Richtextbox.Loadfile("thefile")
    Catch ex as Exception
        Msgbox ex.message
    End Try

    And puts in colours too, Ok?

    What I wanted to do, to make the program more visual on the page, was to specifiy formating rules in the editor for different code-words(for-next, try-catch, sub, function).

    So I could specify that:

    Try
    Me.Richtextbox.Loadfile("thefile")
    Catch ex as Exception
    Msgbox ex.message
    End Try

    was reformmated as

    '----------------------------------------------------------'
    Try
           Me.Richtextbox.Loadfile("thefile")

                                         Catch Ex as Exception
                                         '*****************'
               
                                           Msgbox ex.message

                                         '*****************'

    End Try
    '----------------------------------------------------------'


    Its a little over the top here but I'm just trying to get across a basic principle. That you could have more than just tabs as formatting.
    And you could specify your own formating rules. And perhaps have different formatting rule (auto-formatting) for say, Events, Subs, Functions, For, While, etc.

    Does that make sense ?









  • User profile image
    W3bbo

    SEP2007 wrote:
    Try
    Me.Richtextbox.Loadfile("thefile")
    Catch ex as Exception
    Msgbox ex.message
    End Try

    was reformmated as

    '----------------------------------------------------------'
    Try
           Me.Richtextbox.Loadfile("thefile")

                                         Catch Ex as Exception
                                         '*****************'
               
                                           Msgbox ex.message

                                         '*****************'

    End Try
    '----------------------------------------------------------'


    Its a little over the top here but I'm just trying to get across a basic principle. That you could have more than just tabs as formatting.
    And you could specify your own formating rules. And perhaps have different formatting rule (auto-formatting) for say, Events, Subs, Functions, For, While, etc.

    Does that make sense ?


    You can do all that with IDE Macros.

  • User profile image
    SEP2007

    W3bbo wrote:
    
    SEP2007 wrote:Try
    Me.Richtextbox.Loadfile("thefile")
    Catch ex as Exception
    Msgbox ex.message
    End Try

    was reformmated as

    '----------------------------------------------------------'
    Try
           Me.Richtextbox.Loadfile("thefile")

                                         Catch Ex as Exception
                                         '*****************'
               
                                           Msgbox ex.message

                                         '*****************'

    End Try
    '----------------------------------------------------------'


    Its a little over the top here but I'm just trying to get across a basic principle. That you could have more than just tabs as formatting.
    And you could specify your own formating rules. And perhaps have different formatting rule (auto-formatting) for say, Events, Subs, Functions, For, While, etc.

    Does that make sense ?


    You can do all that with IDE Macros.


    Ok thanks, can I do it in the VB editor ? Can I have the Macros working in the VB editor ?


    .
    .
    .
    .
    .


    Have been looking at it, I think i can.

  • User profile image
    W3bbo

    SEP2007 wrote:
    
    W3bbo wrote:
    SEP2007 wrote:Try
    Me.Richtextbox.Loadfile("thefile")
    Catch ex as Exception
    Msgbox ex.message
    End Try

    was reformmated as

    '----------------------------------------------------------'
    Try
           Me.Richtextbox.Loadfile("thefile")

                                         Catch Ex as Exception
                                         '*****************'
               
                                           Msgbox ex.message

                                         '*****************'

    End Try
    '----------------------------------------------------------'


    Its a little over the top here but I'm just trying to get across a basic principle. That you could have more than just tabs as formatting.
    And you could specify your own formating rules. And perhaps have different formatting rule (auto-formatting) for say, Events, Subs, Functions, For, While, etc.

    Does that make sense ?


    You can do all that with IDE Macros.


    Ok thanks, can I do it in the VB editor ? Can I have the Macros working in the VB editor

    Have been looking at it, I think i can.


    Yes, you can.



    Don't confuse C++/Preprocessor Macros with IDE Macros. One is a form of metaprogramming, the other is just automating IDE tasks (i.e. what you're trying to do)

  • User profile image
    SEP2007

    I don't have visual studio.

    I only have VB 2005 Express Edition.

    IDE Macros aren't on it ?


Conversation locked

This conversation has been locked by the site admins. No new comments can be made.