Results 1 to 8 of 8

Thread: How do I use the[vbcode] tags ????

  1. #1

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    How do I use the[Highlight=VB] tags ????

    Hmmmm.

    Lets see, I type in [vbcode], hit "Enter", paste my code from my project, hit "Enter", then type [/vbcode], hit "Enter", click waving smilie, hit the submit button, and...

    VB Code:
    1. Private Sub Command1_Click()
    2.     'This is a simple illustration of returning values from a function.
    3.     'Lets say you wanted a function to return the sum of 5 numbers.
    4.     'Lets say you had those 5 numbers in an array:
    5.     Dim AN_ARRAY(4) As Long
    6.     'And lets say you wanted the sum placed in the following variable:
    7.     Dim THE_SUM As Long
    8.     'lets say that array had the values 1,2,3,4,9"
    9.     AN_ARRAY(0) = 1
    10.     AN_ARRAY(1) = 2
    11.     AN_ARRAY(2) = 3
    12.     AN_ARRAY(3) = 4
    13.     AN_ARRAY(4) = 9
    14.     'so, this will now access the function:
    15.    
    16.     THE_SUM = MY_FUNCTION(AN_ARRAY)
    17.     MsgBox THE_SUM
    18. End Sub
    19. Private Function MY_FUNCTION(ByRef inArr() As Long) As Long
    20.     'This function will return a 1 dimensional value
    21.     'representing the sum of all the numbers in inArr()
    22.     Dim MyI As Long
    23.     MY_FUNCTION = 0
    24.     For MyI = 0 To UBound(inArr)
    25.         MY_FUNCTION = MY_FUNCTION + inArr(MyI)
    26.     Next MyI
    27. End Function

  2. #2

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: How do I use the[Highlight=VB] tags ????

    Ok. How about:

    Same thing, except I Preview it, THEN submit???



    visual basic code:

    Private Sub Command1_Click()
    'This is a simple illustration of returning values from a function.
    'Lets say you wanted a function to return the sum of 5 numbers.
    'Lets say you had those 5 numbers in an array:
    Dim AN_ARRAY(4) As Long
    'And lets say you wanted the sum placed in the following variable:
    Dim THE_SUM As Long
    'lets say that array had the values 1,2,3,4,9"
    AN_ARRAY(0) = 1
    AN_ARRAY(1) = 2
    AN_ARRAY(2) = 3
    AN_ARRAY(3) = 4
    AN_ARRAY(4) = 9
    'so, this will now access the function:

    THE_SUM = MY_FUNCTION(AN_ARRAY)
    MsgBox THE_SUM
    End Sub
    Private Function MY_FUNCTION(ByRef inArr() As Long) As Long
    'This function will return a 1 dimensional value
    'representing the sum of all the numbers in inArr()
    Dim MyI As Long
    MY_FUNCTION = 0
    For MyI = 0 To UBound(inArr)
    MY_FUNCTION = MY_FUNCTION + inArr(MyI)
    Next MyI
    End Function



  3. #3

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: How do I use the[Highlight=VB] tags ????

    Previewing displays the long, extended, single line as seen in Post#1.
    However, scrolling down to the reply box, it appears perfect, highlights
    where they're supposed to be, proper indents, and yet???
    All the indents disappear when submitted???


  4. #4
    ex-Administrator brad jones's Avatar
    Join Date
    Nov 2002
    Location
    Indianapolis
    Posts
    6,614

    Re: How do I use the[Highlight=VB] tags ????

    Are you using the WYSIWYG editor? The standard editor doesn't seem to have any problems.

    Brad!
    Have you given out your reputation points today? Select the Rate This Post link to give points for good posts!
    -------------------------------------------------------------
    Brad! Jones
    Lots of Software, LLC
    (I wrote: C Programming in One Hour a Day) (Dad Jokes Book) (Follow me on Twitter)

    --------------------------------------------------------------

  5. #5

  6. #6

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: How do I use the[Highlight=VB] tags ????

    VB Code:
    1. Public Sub MULT_EQ(ByRef inEq() As EQ_FRACT, ByRef mEquals() As EQ_FRACT, ByRef ByWhat As EQ_FRACT, ByVal mI As Long)
    2. Dim MyJ As Long
    3. Dim MyGCD As Long
    4.  
    5. For MyJ = 0 To UBound(inEq, 2)
    6.     inEq(mI, MyJ).mInt(0) = inEq(mI, MyJ).mInt(0) * ByWhat.mInt(0)
    7.     inEq(mI, MyJ).mInt(1) = inEq(mI, MyJ).mInt(1) * ByWhat.mInt(1)
    8.     If inEq(mI, MyJ).mInt(0) = 0 Then
    9.         inEq(mI, MyJ).mInt(1) = 1
    10.     Else
    11.         If inEq(mI, MyJ).mInt(1) < 0 Then
    12.             inEq(mI, MyJ).mInt(1) = inEq(mI, MyJ).mInt(1) * (-1)
    13.             inEq(mI, MyJ).mInt(0) = inEq(mI, MyJ).mInt(0) * (-1)
    14.         End If
    15.         MyGCD = Mod3_GCD(Abs(inEq(mI, MyJ).mInt(0)), Abs(inEq(mI, MyJ).mInt(1)))
    16.         If MyGCD = 0 Then
    17.             MsgBox "GEEK!"
    18.         Else
    19.             inEq(mI, MyJ).mInt(0) = inEq(mI, MyJ).mInt(0) / MyGCD
    20.             inEq(mI, MyJ).mInt(1) = inEq(mI, MyJ).mInt(1) / MyGCD
    21.         End If
    22.     End If
    23. Next MyJ
    24.     mEquals(mI).mInt(0) = mEquals(mI).mInt(0) * ByWhat.mInt(0)
    25.     mEquals(mI).mInt(1) = mEquals(mI).mInt(1) * ByWhat.mInt(1)
    26.     If mEquals(mI).mInt(0) = 0 Then
    27.         mEquals(mI).mInt(1) = 1
    28.     Else
    29.         If mEquals(mI).mInt(1) < 0 Then
    30.             mEquals(mI).mInt(1) = mEquals(mI).mInt(1) * (-1)
    31.             mEquals(mI).mInt(0) = mEquals(mI).mInt(0) * (-1)
    32.         End If
    33.         MyGCD = Mod3_GCD(Abs(mEquals(mI).mInt(0)), Abs(mEquals(mI).mInt(1)))
    34.         If MyGCD = 0 Then
    35.             MsgBox "GEEK!"
    36.         Else
    37.             mEquals(mI).mInt(0) = mEquals(mI).mInt(0) / MyGCD
    38.             mEquals(mI).mInt(1) = mEquals(mI).mInt(1) / MyGCD
    39.         End If
    40.     End If
    41.    
    42. End Sub

  7. #7

  8. #8
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: How do I use the[Highlight=VB] tags ????

    I've had the same problems, using the full editor and copy and pasting code doesnt work it just displays it in a long line, if you use the 'middle' editor it seems ok....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width