|
-
Dec 27th, 2004, 09:02 AM
#1
Thread Starter
pathfinder
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:
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
-
Dec 27th, 2004, 09:03 AM
#2
Thread Starter
pathfinder
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
-
Dec 27th, 2004, 09:05 AM
#3
Thread Starter
pathfinder
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???
-
Dec 27th, 2004, 09:25 AM
#4
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!
-
Dec 27th, 2004, 09:33 AM
#5
Thread Starter
pathfinder
Re: How do I use the[Highlight=VB] tags ????
Yes I am.
Perhaps I'll turn it off and try again.
hmmm.
-
Dec 27th, 2004, 09:35 AM
#6
Thread Starter
pathfinder
Re: How do I use the[Highlight=VB] tags ????
VB Code:
Public Sub MULT_EQ(ByRef inEq() As EQ_FRACT, ByRef mEquals() As EQ_FRACT, ByRef ByWhat As EQ_FRACT, ByVal mI As Long)
Dim MyJ As Long
Dim MyGCD As Long
For MyJ = 0 To UBound(inEq, 2)
inEq(mI, MyJ).mInt(0) = inEq(mI, MyJ).mInt(0) * ByWhat.mInt(0)
inEq(mI, MyJ).mInt(1) = inEq(mI, MyJ).mInt(1) * ByWhat.mInt(1)
If inEq(mI, MyJ).mInt(0) = 0 Then
inEq(mI, MyJ).mInt(1) = 1
Else
If inEq(mI, MyJ).mInt(1) < 0 Then
inEq(mI, MyJ).mInt(1) = inEq(mI, MyJ).mInt(1) * (-1)
inEq(mI, MyJ).mInt(0) = inEq(mI, MyJ).mInt(0) * (-1)
End If
MyGCD = Mod3_GCD(Abs(inEq(mI, MyJ).mInt(0)), Abs(inEq(mI, MyJ).mInt(1)))
If MyGCD = 0 Then
MsgBox "GEEK!"
Else
inEq(mI, MyJ).mInt(0) = inEq(mI, MyJ).mInt(0) / MyGCD
inEq(mI, MyJ).mInt(1) = inEq(mI, MyJ).mInt(1) / MyGCD
End If
End If
Next MyJ
mEquals(mI).mInt(0) = mEquals(mI).mInt(0) * ByWhat.mInt(0)
mEquals(mI).mInt(1) = mEquals(mI).mInt(1) * ByWhat.mInt(1)
If mEquals(mI).mInt(0) = 0 Then
mEquals(mI).mInt(1) = 1
Else
If mEquals(mI).mInt(1) < 0 Then
mEquals(mI).mInt(1) = mEquals(mI).mInt(1) * (-1)
mEquals(mI).mInt(0) = mEquals(mI).mInt(0) * (-1)
End If
MyGCD = Mod3_GCD(Abs(mEquals(mI).mInt(0)), Abs(mEquals(mI).mInt(1)))
If MyGCD = 0 Then
MsgBox "GEEK!"
Else
mEquals(mI).mInt(0) = mEquals(mI).mInt(0) / MyGCD
mEquals(mI).mInt(1) = mEquals(mI).mInt(1) / MyGCD
End If
End If
End Sub
-
Dec 27th, 2004, 09:38 AM
#7
Thread Starter
pathfinder
Re: How do I use the[Highlight=VB] tags ????
Alrighty Then!
Guess WYSIWYG is not VBCode friendly.
-
Dec 27th, 2004, 02:55 PM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|