|
-
Oct 13th, 2000, 01:41 PM
#1
Hi all
i want to have some string constant
i put these in a module
public const name(1) ="hi"
public const name(2) = "hi2"
it says i can not have array , so, what can i do?
-
Oct 13th, 2000, 01:51 PM
#2
Frenzied Member
Use different names for each constant
You can use different names for each constant like this:
Code:
Public Const HELLO As String = "Hello"
Public Const HELLO_2 As String = "Hello Again"
-
Oct 13th, 2000, 01:52 PM
#3
But i need to be array..... so, any help please
-
Oct 13th, 2000, 03:21 PM
#4
transcendental analytic
No way, some options though:
1. Enumeration
Code:
Enum myenum
const1 = 1
const2 = 2
End Enum
2. A normal array acts like a constant of arrays, just remember to initialize it
Code:
Public Arrayname(2) as variabletype
.
.
Arrayname(0)="HELLO"
Arrayname(1)="HELLO_2"
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 13th, 2000, 04:43 PM
#5
Since it will work like constant , thinking where is the best place to initialize them... in MDI form load?
-
Oct 13th, 2000, 04:53 PM
#6
Guru
Best place would be the Load event of the form (or MDI form) that loads first, or Sub Main of a module if the project loads from there.
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
|