|
-
Apr 25th, 2005, 07:18 AM
#1
Thread Starter
Lively Member
Declaration
Is it possible to declare with an index?
Dim tile(index) as long
-
Apr 25th, 2005, 07:25 AM
#2
Fanatic Member
Re: Declaration
you can declare with a constant - if you want to declare with a variable you need to:
dim X() as long
redim X(index)
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
-
Apr 25th, 2005, 07:38 AM
#3
Thread Starter
Lively Member
Re: Declaration
And how do I declare it with a constant?
-
Apr 25th, 2005, 07:40 AM
#4
Re: Declaration
 Originally Posted by haruki
And how do I declare it with a constant?
VB Code:
'form level
Private Const MYINDEX = Whatever
'event level
Const MYINDEX = Whatever
Last edited by Hack; Apr 25th, 2005 at 07:44 AM.
-
Apr 25th, 2005, 07:49 AM
#5
Fanatic Member
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
-
Apr 25th, 2005, 07:52 AM
#6
Thread Starter
Lively Member
Re: Declaration
Hm.. So if I want to use this for example how do I need to declare?
VB Code:
For i = 1 to 10
Tile(i) = LoadGraphicDC(App.Path & "\tile" & i & ".bmp")
Next i
Last edited by haruki; Apr 25th, 2005 at 07:55 AM.
-
Apr 25th, 2005, 08:44 AM
#7
Fanatic Member
Last edited by THEROB; Apr 25th, 2005 at 09:45 AM.
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
-
Apr 25th, 2005, 09:41 AM
#8
Thread Starter
Lively Member
Re: Declaration
UH?
I dont understand, give me the whole idea. How do I need to declare from scratch to get that to work.
-
Apr 25th, 2005, 09:45 AM
#9
Fanatic Member
Re: Declaration
VB Code:
Dim Tile(10) As Long
Dim i As Long
For i = 1 To 10
Tile(i) = LoadGraphicDC(App.Path & "\tile" & i & ".bmp")
Next i
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
-
Apr 25th, 2005, 09:48 AM
#10
Thread Starter
Lively Member
Re: Declaration
and if i want to do
VB Code:
Tile(1) = "1adf234"
Tile(3) = "43adfadf"
Why add 10? like you did "dim Tile(10)"?
-
Apr 25th, 2005, 10:04 AM
#11
Fanatic Member
Re: Declaration
I did Dim Tile(10) because you gave your example of having i = from 1 to 10.
The statement Dim Tile(10) as long, creates an array with elements from 0 to 10. If you only need 3 items use Dim Tile(3) as long.
You only need to declare the array to be the size you need.
Clear??
R
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
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
|