-
Apr 5th, 2021, 07:54 AM
#1
Thread Starter
Frenzied Member
How to make the length of module name and class name exceed 39?
We know that the length of module name and class name in VB6 is not allowed to exceed 39, but this will cause a lot of trouble. Because of the readability of modern programs, the length of many module names and class names exceeds 39.
I wonder if there is a way to make the length of module names and class names exceed 39? Thanks.
-
Apr 5th, 2021, 08:01 AM
#2
Addicted Member
Re: How to make the length of module name and class name exceed 39?
Originally Posted by SearchingDataOnly
We know that the length of module name and class name in VB6 is not allowed to exceed 39, but this will cause a lot of trouble. Because of the readability of modern programs, the length of many module names and class names exceeds 39.
I wonder if there is a way to make the length of module names and class names exceed 39? Thanks.
I didn't know that!
39 seems like an odd number (no pun intended) for a limit.
-
Apr 5th, 2021, 08:07 AM
#3
Re: How to make the length of module name and class name exceed 39?
The docs say 40 characters. But since a line of code should not exceed 80 I can't imagine how longer names make any sense.
"Modern" programs have readable code? Er, not really.
-
Apr 5th, 2021, 08:08 AM
#4
Re: How to make the length of module name and class name exceed 39?
https://docs.microsoft.com/ru-ru/win...m/-progid--key
The format of a ProgID is <Program>.<Component>.<Version>, separated by periods and with no spaces, as in Word.Document.6. The ProgID must comply with the following requirements:
- Have no more than 39 characters.
- Contain no punctuation (including underscores) except one or more periods.
- Not start with a digit.
- Be different from the class name of any OLE 1 application, including the OLE 1 version of the same application, if there is one.
-
Apr 5th, 2021, 08:27 AM
#5
Re: How to make the length of module name and class name exceed 39?
Project Limitations
A single project can contain up to 32,000 "identifiers" (any nonreserved keyword), which include, but are not limited to, forms, controls, modules, variables, constants, procedures, functions, and objects. Note that the actual number of identifiers is limited to available memory.
Variable names in Visual Basic can be no longer than 255 characters, and the names of forms, controls, modules, and classes cannot be longer than 40 characters. Visual Basic imposes no limit on the actual number of distinct objects in a project.
So 39/40 seems to be in question. Doesn't hurt to assume 39 though.
-
Apr 5th, 2021, 08:32 AM
#6
Re: How to make the length of module name and class name exceed 39?
Code:
Private Sub Form_Load()
With New C234567890123456789012345678901234567890
.X = 10
End With
End Sub
Runs just fine. But a public class in a DLL might not I suppose.
-
Apr 5th, 2021, 10:27 AM
#7
Re: How to make the length of module name and class name exceed 39?
already had this problem in my ocx control ...
Edit: Really appears 39 for me too
-
Apr 5th, 2021, 10:46 AM
#8
Thread Starter
Frenzied Member
Re: How to make the length of module name and class name exceed 39?
Originally Posted by dilettante
Code:
Private Sub Form_Load()
With New C234567890123456789012345678901234567890
.X = 10
End With
End Sub
Runs just fine. But a public class in a DLL might not I suppose.
When you click the VB6 menu item "Make Project1.exe", an error message will appear.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|