Results 1 to 3 of 3

Thread: Class - Stack trace

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Class - Stack trace

    Hey all. I've seen multiple threads on this, and I decided to implement it in a program I was using. Because of the interest I figured I'd post it here. Let me know if you have any questions or comments, improvelements, etc.

    After you dim the variable as the class you need to call the initialize method of the class. That's about the only restriction.
    Attached Files Attached Files
    Last edited by drag0n_45; May 29th, 2008 at 11:41 AM.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Class - Stack trace

    How about some sample code to show how to use it?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Re: Class - Stack trace

    Ah..well of course. LOL Forgot that bit. It's my first code bank post.

    Make a form with a textbox and a label. Paste this code into the code window.


    vb Code:
    1. Dim stack As New cp_Stack_cls
    2.  
    3. Private Sub Form_Load()
    4.  
    5. stack.Push "Form_Load"
    6.  
    7. PopStack
    8. End Sub
    9.  
    10. Private Sub Label1_Change()
    11. stack.Push "Label1_Change"
    12.  
    13. On Error GoTo errhandler
    14. If InStr(1, Text1.Text, "a") > 0 Then
    15.     Err.Raise 83
    16. End If
    17.  
    18. PopStack
    19.  
    20. Exit Sub
    21. errhandler:
    22. MsgBox "Error " & Err.Number & vbCrLf & stack.Trace
    23. End Sub
    24.  
    25. Private Sub Text1_Change()
    26. stack.Push "Text1_Change"
    27.  
    28. Label1.Caption = Text1.Text
    29.  
    30. PopStack
    31. End Sub
    32.  
    33. Private Sub PopStack()
    34. Debug.Print "Popped: " & stack.Pop
    35. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width