: : Hie there fellows. Thanks for replying my previous messages. But I have another problem now. Hope to get help now to.
: :
: : The problem is, I downloaded some example VB programs form the net and while looking at the codes of one program I have found a new sign in the code. I have tried to find out the meaning of the sign in the MSDN but could not findout any meaning.
: :
: : The sign is " : " (colon). I have checked that the : sign was not a part of comment but a part of code.
: :
: : Could anybody please tell me what does it mean and what is its function.
:
: Most of the time it indicates a "label", which is just a point that GoTo can jump to. Yes, GoTo is a Bad Thing (tm) when misused, but VB doesn't provide for structured error handling or Return statements like .NET does, so sometimes the only way to accomplish things cleanly is through judicial use of GoTo.
:
:
: Public Sub Foo()
:
: On Error GoTo FooError
:
: 'do stuff
:
: If SomeExitCondition = True Then GoTo FooExit
:
: 'do other stuff
:
: FooExit:
: Exit Sub
:
: FooError:
: MsgBox "FOO!"
:
: End Sub
:
:
: In some cases it's also a line-separator, meaning you can combine two statements on one line in certain circumstances:
:
:
: Public Sub Foo()
:
: Dim bar As String: bar = "foo"
:
: End Sub
:
:
:
:
infidel
:
:
: $ select * from users where clue > 0
: no rows returned
:
:
:
Thanks for your reply. Now I remember the use of :(colon) sign in labels. But yet my problem is not fixed. Because I have checked the codes again and the statements which are using the : sign don't seem to be part of labels. For clearity I am sending some segments of the code below------
If CurMonNo% = 0 Then Universe.TotMonsters = Universe.TotMonsters + 1: CurMonNo% = Universe.TotMonsters
____________________________________________________________________________________
For X% = 0 To 100
Map(X%, 0, 1).icon = 4: Map(X%, 0, 1).Blocked = True
Map(X%, 1, 1).icon = 4: Map(X%, 1, 1).Blocked = True
Map(X%, 99, 1).icon = 4: Map(X%, 99, 1).Blocked = True
Map(X%, 100, 1).icon = 4: Map(X%, 100, 1).Blocked = True
Next X%
____________________________________________________________________________________
For Y% = 0 To 100
Map(0, Y%, 1).icon = 4: Map(0, Y%, 1).Blocked = True
Map(1, Y%, 1).icon = 4: Map(1, Y%, 1).Blocked = True
Map(99, Y%, 1).icon = 4: Map(99, Y%, 1).Blocked = True
Map(100, Y%, 1).icon = 4: Map(100, Y%, 1).Blocked = True
Next Y%
____________________________________________________________________________________
For X% = 2 To 98
If Rnd > 0.5 Then Map(X%, 2, 1).icon = 4: Map(X%, 2, 1).Blocked = True
If Rnd > 0.5 Then Map(X%, 3, 1).icon = 4: Map(X%, 3, 1).Blocked = True
If Rnd > 0.5 Then Map(X%, 97, 1).icon = 4: Map(X%, 97, 1).Blocked = True
If Rnd > 0.5 Then Map(X%, 98, 1).icon = 4: Map(X%, 98, 1).Blocked = True
Next X%
For Y% = 2 To 98
If Rnd > 0.5 Then Map(2, Y%, 1).icon = 4: Map(2, Y%, 1).Blocked = True
If Rnd > 0.5 Then Map(3, Y%, 1).icon = 4: Map(3, Y%, 1).Blocked = True
If Rnd > 0.5 Then Map(97, Y%, 1).icon = 4: Map(97, Y%, 1).Blocked = True
If Rnd > 0.5 Then Map(98, Y%, 1).icon = 4: Map(98, Y%, 1).Blocked = True
Next Y%
____________________________________________________________________________________
For X1% = 1 To 100
X% = Int(Rnd * 90) + 5
Y% = Int(Rnd * 90) + 5
Map(X%, Y%, 1).icon = 5: Map(X%, Y%, 1).Blocked = True
Next X1%
____________________________________________________________________________________
The use of : sign in the above statements are certainly not part of label. So any farther information will be highly appreciated. Please do reply.
_____________________________________________________________________________
Knowledge Is Power. Be Sure To Use This Power For Others WelFare. (;->