(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)
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.
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.
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.
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.
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.
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.
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.