Results 1 to 15 of 15

Thread: Stupid Mistakes I've made

  1. #1

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Stupid Mistakes I've made

    (OK, I tested this and the uploaded image isn't linked to the larger version. Is there a way to get the full size image? I am using Advanced mode to post this.)

    In my app I have a security manager which uses a User/Group model.

    Lowest level is No Access. This one allows an administrator to lock someone out without deleting their account which would also delete everything they ever did such as create new customer accounts, invoices etc.

    The settings are all grayed. Not even the owner can give No Access any permissions.

    Same goes for the Owner account. It's all grayed. If the Owner gets locked out of anything then nobody can restore it.

    The stupid mistake I made was to make it so that if "Unlimited Access" is checked then it can't be unchecked because it becomes grayed.

    So I didn't realize I did that until I gave Administrator 1 Unlimited Access just to test if everything was working and I couldn't take the access away.

    That's because I was using the state of the checkbox instead of something else.

    Second mistake. Making a Public Property that doesn't need to be public instead of a Private Constant.

    In order to log errors and procedure calls I give every Module a Name Property unless it has one by default such as forms do.

    I made it a public property instead of a private const.

    So I got over 1 millions calls to the NAME property internally within the class - all of which were logged.

    This is the result of clicking only three buttons on the left - Application Manager, Customer Manager and Communications.

    (The number to the left is the number of times the procedure was called)

    1050052 cListViewHandler_Name(Public Property Get)
    901417 cColumn_Name(Public Property Get)
    Attached Images Attached Images  
    Last edited by cafeenman; Apr 3rd, 2024 at 04:57 PM.

  2. #2

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    And this is why NAME gets called so much:

    Code:
    Private Function SelectLogsFolder() As Long
    Dim m_CallStacker As New cCallStacker
    Dim sFolder As String
    Dim sCurrentFolder As String
    
    
    ' Returns Error Code.
    On Error GoTo errHandler
    
    
    m_CallStacker.Add NAME & ".SelectLogsFolder(Private Function)"
    
    sCurrentFolder = ApplicationSettings.Setting.Field(idx_ApplicationSetting_LogLocation)
    
    
    Top:
    
    sFolder = BrowseForFolder(sCurrentFolder, 0, App.Title & " Logs Folder Location")
    
    If Len(sFolder) Then txtLogs.Text = sFolder
    
    Exit Function
    
    
    errHandler:
    Dim nErrorNumber As Long
    Dim nErrorHandlerResult As Long
    Dim sError As String
    Dim Parameters(1) As String
    
    SelectLogsFolder = Err
    
    sError = Error
    nErrorNumber = Err
    
    Parameters(0) = "sFolder = " & sFolder
    Parameters(1) = "sCurrentFolder = " & sCurrentFolder
    
    nErrorHandlerResult = ErrorHandler(sError, nErrorNumber, ParameterString(Parameters), NAME & ".SelectLogsFolder(Private Function)")
    
    If nErrorHandlerResult = vbRetry Then Resume Top
    
    End Function
    
    
    Public Property Get NAME() As String
    Dim m_CallStacker As New cCallStacker
    
    m_CallStacker.Add "cASCII_Settings_Name(Public Property Get)"
    
    NAME = "cASCII_Settings"
    
    End Property
    Last edited by cafeenman; Apr 3rd, 2024 at 04:09 PM.

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,624

    Re: Stupid Mistakes I've made

    And your question is?
    Sam I am (as well as Confused at times).

  4. #4

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    It wasn't a question. Did I post in the wrong place? This place has changed a lot since I was last here. Not trying to disrupt anything.

    Where should I have posted it?

    Thanks.

  5. #5

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    Also, I still have a question about posting images that don't enlarge.

  6. #6
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,624

    Re: Stupid Mistakes I've made

    See my posts on your other thread about images.

    If you don't have a question, then what do you want to DO with that Thread? Post it in, say, the CodeBank for others to glean some certain knowledge/information. Or possibly the CHAT section.

    I'll make the Administrators take a look at your thread and maybe they can suggest (and accomplish) where to relocate it.

    Sammi

    PS-welcome back
    Sam I am (as well as Confused at times).

  7. #7

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    Thanks.

    All I was doing was posting how I was doing something the worst, slowest way possible because when I started this app I thought I was really getting a handle on programming classes and decided to be clever and call all the properties internally instead of referring to the internal variable.

    That meant every call was going to the callstack and then either getting logged if debugging is on or kicked out if debugging is off.

    That's totally unnecessary when I just need the value.

    I did A LOT of that in this program which is now 130K lines of code and I'm starting the long slog of going back through it all and fixing all the stuff I did like that.

    I mean it's everywhere.

    It works and in action there's no speed problem until I turn debugging on. Even if I eliminate all that, debugging will be slow because every call stack gets written to a file (10K CallStacks per file and then a new file is started).

    If I click every single button on the left and don't do anything else but load those forms I get over 5 Gb of text files generated.

    I can significantly lessen that by not calling properties internally when I don't have to. Sometimes I do have to in order to initialize something in the property when it gets called but mostly I just need the value of the property variable without needing to call the property itself.

    That's all.

  8. #8

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    OK, here's a link to that screenshot in 2K resolution (down-sampled from 4K).

    I'd like to post a lot more screenshots but before I do can someone tell me where I should be doing this? It's not a code-bank thing. It's just me wanting to show off my work.

    Thanks

    http://www.airfieldmodels.com/other/...on_manager.jpg

    test:

    Last edited by cafeenman; Apr 3rd, 2024 at 04:45 PM.

  9. #9
    Lively Member
    Join Date
    Aug 2020
    Posts
    89

    Re: Stupid Mistakes I've made


  10. #10

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    That's this forum. So why isn't posting about my app here ok?

  11. #11
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Re: Stupid Mistakes I've made

    It's a gray area. There are certainly threads in this forum that are not questions, though not all that many of them. Heck, I started one not very long ago, and one of the big ones is Uncle Ber talking up what people are working on, as the link shows. On the other hand, this actually would be a fairly entertaining thread for chit-chat if people were talking about their biggest goofs. However, from your more recent posts, that doesn't appear to be your intention. It's kind of an absolution post, though I'm not clear whether that was what you wanted it to be. If it moved to chit-chat, that's what it would become, because most of us probably have examples we'd be willing to share. You don't care about post count, either, cause you've got a good many of them.

    I think I'll let you decide which direction this thread should go. If you want it to become a thread on goofs, I'll move it to Chit-Chat, and add one or two. If you want it to stay on the application you wrote, then I think it would be best to leave it here, for now.
    My usual boring signature: Nothing

  12. #12

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    I'm fine if you move it. I just came in guns blazing without looking around first (speaking of goofs).

    I just can't believe how much work I gave myself to fix things that are already working and done but wrong.

  13. #13

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    Also too, I've spent many thousands of hours working on my app. I really want to show it off by itself and not have it get lost by hijacking someone else's thread. So I did that (started my own thread).

    I mean considering the amount of time and work I've invested in it and that nobody will ever see it... I want someone to see it so I chose you.

  14. #14

    Thread Starter
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819

    Re: Stupid Mistakes I've made

    Go ahead and move it please.

  15. #15
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Re: Stupid Mistakes I've made

    Quote Originally Posted by cafeenman View Post
    Also too, I've spent many thousands of hours working on my app. I really want to show it off by itself and not have it get lost by hijacking someone else's thread. So I did that (started my own thread).

    I mean considering the amount of time and work I've invested in it and that nobody will ever see it... I want someone to see it so I chose you.
    Oh, I get that. I have an application built up over years to do something that would be useful to a very specialized group of people. Not sure that anybody will ever even see it, though, because of the politics around the subject.
    My usual boring signature: Nothing

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