unknown sign of VB

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.
_____________________________________________________________________________
Knowledge Is Power. Be Sure To Use This Power For Others WelFare. (;->

Comments

  • : 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.

    [code]
    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
    [/code]

    In some cases it's also a line-separator, meaning you can combine two statements on one line in certain circumstances:

    [code]
    Public Sub Foo()

    Dim bar As String: bar = "foo"

    End Sub
    [/code]


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • : : 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.
    :
    : [code]
    : 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
    : [/code]
    :
    : In some cases it's also a line-separator, meaning you can combine two statements on one line in certain circumstances:
    :
    : [code]
    : Public Sub Foo()
    :
    : Dim bar As String: bar = "foo"
    :
    : End Sub
    : [/code]
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :
    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. (;->

  • : 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%
    :
    : 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. (;->
    :
    :

    here is an excerpt from the VB help files.

    [green]
    Remarks

    You can use the single-line form (first syntax) for short, simple tests. However, the block form (second syntax) provides more structure and flexibility than the single-line form and is usually easier to read, maintain, and debug.

    Note With the single-line form, it is possible to have multiple statements executed as the result of an If...Then decision. All statements must be on the same line and separated by colons, as in the following statement:

    If A > 10 Then A = A + 1 : B = B + A : C = C + B
    [/green]
  • : : 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%
    : :
    : : 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. (;->
    : :
    : :
    :
    : here is an excerpt from the VB help files.
    :
    : [green]
    : Remarks
    :
    : You can use the single-line form (first syntax) for short, simple tests. However, the block form (second syntax) provides more structure and flexibility than the single-line form and is usually easier to read, maintain, and debug.
    :
    : Note With the single-line form, it is possible to have multiple statements executed as the result of an If...Then decision. All statements must be on the same line and separated by colons, as in the following statement:
    :
    : If A > 10 Then A = A + 1 : B = B + A : C = C + B
    : [/green]
    :
    Thanks a lot for the help. I was also guessing something like this. But I became confused while I had put :(colon) sign in the index search of MSDN and got nothing related to VB there.

    By the by I got my answer and lots of lots of thanks to everybody for helping me.
    _____________________________________________________________________________
    Knowledge Is Power. Be Sure To Use This Power For Others WelFare. (;->

  • You asked:

    [green]: : : Could anybody please tell me what does it mean and what is its function.[/green]

    I said:

    [blue]: : Most of the time it indicates a "label" ... [/blue]

    I [italic]also[/italic] said:

    [blue]: : [red]In some cases it's also a line-separator[/red], meaning you can combine two statements on one line in certain circumstances ...[/blue]

    Then you said:

    [green]: 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 ...[/green]

    Please try to pay attention :-)


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • : You asked:
    :
    : [green]: : : Could anybody please tell me what does it mean and what is its function.[/green]
    :
    : I said:
    :
    : [blue]: : Most of the time it indicates a "label" ... [/blue]
    :
    : I [italic]also[/italic] said:
    :
    : [blue]: : [red]In some cases it's also a line-separator[/red], meaning you can combine two statements on one line in certain circumstances ...[/blue]
    :
    : Then you said:
    :
    : [green]: 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 ...[/green]
    :
    : Please try to pay attention :-)
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :
    ranainnet,

    In future, if you will have problem with code, please, post that portion of code. It will be easier for people from PH to understand what your problem is and explain to you how to fix it.
  • [b][red]This message was edited by ranainnet at 2005-10-6 11:0:35[/red][/b][hr]
    : : You asked:
    : :
    : : [green]: : : Could anybody please tell me what does it mean and what is its function.[/green]
    : :
    : : I said:
    : :
    : : [blue]: : Most of the time it indicates a "label" ... [/blue]
    : :
    : : I [italic]also[/italic] said:
    : :
    : : [blue]: : [red]In some cases it's also a line-separator[/red], meaning you can combine two statements on one line in certain circumstances ...[/blue]
    : :
    : : Then you said:
    : :
    : : [green]: 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 ...[/green]
    : :
    : : Please try to pay attention :-)
    : :
    : :
    : : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    : :
    : : [code]
    : : $ select * from users where clue > 0
    : : no rows returned
    : : [/code]
    : :
    : :
    : ranainnet,
    :
    : In future, if you will have problem with code, please, post that portion of code. It will be easier for people from PH to understand what your problem is and explain to you how to fix it.
    :
    Thanks for ur suggestions. And yes u r right "infidel", I should give more concentration while reading replys. Please don't mind and forgive me for my carelessness. I really do appreciate all of yours' effort. Hope you fellows could forgive me. Please don't mind. I guess that I was a bit excited while remembered about the use of : as a part of label and thats the reason behind overlooking the next part. Thanks again for the advice.
    _____________________________________________________________________________
    Knowledge Is Power. Be Sure To Use This Power For Others WelFare. (;->



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories