Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How Can We Comment Multiple Lines Of Code Simultaneously In VB6


How can we comment multiple lines of code simultaneously in VB6 like we do it in VB.Net?

slowpoison786@gmail.com
"Work like you don't need the money, Love like you've never been hurt."




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Comment Out Multiple Lines Of Code?
Hi,

I have almost 100 lines of code which I want to comment out, but using the single line commenting character ( ' ) for this is a little painful. Is there any way to comment these many lines of code in a better way? (Say at start and at the end). Because, in future I may use these lines of code, so again uncommenting it will be even more painful. I can do this in C, C++ and Java using /* and */. But how do I do it in VB? Can anyone help me on this? Thank you very much.

--Srikanth



Edited by - sri1025 on 9/8/2005 8:54:28 AM

Comment Multiple Lines
Is it possible to comment multiple lines without putting ' in front of them all?

Java lets you do this:

/* All
of
this
is commented */

Does VB have an equivalent?

How To Comment Multiple Lines In Visual Studio.NET?
Hi. I need to comment out several lines at once. For example, I have this piece of code:

blah1
blah2()
blah3(nevermind)
blah4(hey)
blah5.open

Can I achieve the following with one click?

'blah1
'blah2()
'blah3(nevermind)
'blah4(hey)
'blah5.open

- How Would I Comment / Uncomment Multiple Lines Like In Visual Basic???
- How would i comment / uncomment multiple lines like in visual basic???

Commenting A Block Of VBA Code Without Having To Comment Individual Lines
Hi everybody

Is there a way of commenting out a block of lines of VBA code without having to comment out each line individually as we can do in languages like C, Jave and the programming language SAS etc etc. like so (I think) :-

/*

Block of code here

*/


Best regards


Deepak Agarwal

Can You Setup Multiple Child Forms To Run Code Simultaneously Using VB 6.0?
I have a program I'm working on where you click on a button from the main form and, each time you click this button, it opens a child form that displays network data.

Basically, I would like the child forms to automatically perform a function every 5 seconds or so and constantly update the data in each of the child forms. I'm just wondering if this can be done. I'm not sure how I get this child form code to operate in the background or where this code needs to be inserted - in the main form or in the child forms? Just a general outline of how I can do something like this would be very appreciated. Thank you.

Two Lines Simultaneously
Hi
Im using a picture box two draw some line graphs. I will like to know if is is possible to draw simultaneously two or three lines. Right now im getting the values for a single line from an array using this code(which is part of a bigger loop):

Code:
picPlot.AutoRedraw = True
picPlot.CurrentX = 0 'Initialize position(X)
picPlot.CurrentY = 0 'Initialize position (y)
For i = 160 To 900 'Remove useless pixels
AbsArray(i - 159) = -Log((aData(i, 1) / aData(i, 2))) / S 'Generate de ABS Array
If (i And 1) = 0 Then 'Will Plot Even Points Only
picPlot.Line -(i, AbsArray(i - 159))
End If
Next i

Can i plot each column of the aData array as a separate line at the same time (with different color)?

Thanks

Answering Two Telephone Lines Simultaneously
Hi there,

How can i answer two telephone lines simultaneously in Visual Basic.
I want them to act independant from eachother, e.g. they run in their own thread (?)

Please help me out, thanx!

Greetings
Law

Writing Code To Multiple Lines
hi, this is a VERY N00B question, and I'm SURE its answered everywhere, but I can't seem to find the right wording to make the search find it...

how do i write my code so that it can be written on multiple lines, for ease of use in the future...

so, instead of coding

MsgBox "blah di blah...... (times 5000 characters)",

it will be something like
MsgBox "blah di blah.... (times 50 characters)",
(next fifty characters)
next fifty...


I'm not talking about the actual display of text, just my coding syntax...

I thought it was something like
CODE &_
CODE ...

but i'm drawing a blank

Multiple Lines Of Code(info) To 1 Text Box
Hi everyone,

Sorry about the basic(dummy) question.

I am making a program that takes information from many text boxes and compiles it to one multiline text box. The code is long and requires more than a page space of code at (1024 x 768). How do I extend my code to a new line?

example:

txtdummy.text = "very funny " & txt1.text & " you are so cool" & txt2.text & " This should be a new line" & vbnewline & " but it's not!!"


I want to change this to:

txtdummy.text = "very funny " & txt1.text &
" you are so cool" & txt2.text &
" This should be a new line" & vbnewline " but it is now!!"

Just so it is easier to read the code.

Any help is greatly appreciated.
Thanks

BackWing

How Can I Delete Multiple Lines In A RTFbox With Code?
I would like to use code to be able to delete multiple continguous lines of text from an RTFbox. For example, I might choose lines 3-7, and delete them, erasing all null spaces so that line 8 immediately follows line 2 in the RTFbox.

I would prefer to use the API call SendMessage to do so, as I am using it to Replace and Insert lines in the box, but haven't been able to get it to completely delete lines (always leaves blank spaces).
I am using VB6.

Many Thanks!

Comment Lines
Hello guys, I am new to here.... how read the comment lines from the .exe file ( Complied by vb)...

Comment Out Several Lines?
I'm unaware of the existence of some feature to comment out several lines at once. Is there such a thing?

How To Comment Bunch Of Lines ?
Putting a quote everyline is more work. Is there
some way I can comment bunch of lines in VB.

In C we use /* many lines */

Strange Comment Lines (MemberInfo)
Hello!

I have this piece of code here which contains some strange comment lines:


Code:
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MemberInfo=10,0,0,vbButtonFace
Public Property Get BackColor() As OLE_COLOR

BackColor = UserControl.BackColor

End Property

Could you please tell me what...


Code:
'MemberInfo=10,0,0,vbButtonFace

...means and why it is commented?

Thank you in advance,
Sebastian Mares

Hi .. Shortcut 4 Comment The Lines Or Block In Vb
hi all
Is there any shortcut to comment a line or comment out the selected block without using mouse .. just like we use .. ctrl+A to select whole modules line .. and Ctrl+S to save the project ...

Please help me on this matter ...

ur friend ..
pawan jain

Run Multiple Timers Simultaneously
Hi,

I need to be able to run 8 timers all at the same time, but be able to control when they are all turned on and off....

Also, I would like to be able to hold down 8 keys (numbers 1 to 8) to activate certain things.

I have a USB Controller that can be controlled via VB, it has 8 outputs and I have written a program that numbers 1 to 8 will activate each output respectively. I would like to be able to hold down the 8 keys to have all 8 outputs switched on but I can only manage to get 4 keys to work when all are pressed.

The timers are also related to the controller, I have written a program that will read a txt file for each channel and turn on or off the output when the text file says so.



Edited by - heartofoz on 12/24/2005 4:04:23 AM

Playing Multiple Swf Files Simultaneously
How can I play swf files one after another or simultaneously by only using one shockwave flash control, a loop, and an array?

Multiple Active Forms Simultaneously
i am trying to write a game but for it to run minted i need one form to require to mouse clicks and the other at the same time to respond to the keyboard and i cant keep clicking the other form to make it active, it would get a bit annoying during game play

Playing Multiple WAVs Simultaneously
Is it possible to play multiple WAV files from VB simultaneously? If so, how? (Sample source code would be greatly appreciated.)

Thanks in advance!

Multiple Internet Users Simultaneously?
I've seen a few gadgets that will allow two computers to access the internet on the same line, and I was wondering if maybe a program can be written that works just as well. We have three computers that have access, but we can't all be on at the same time, and I was hoping that maybe someone knew of a way that all three of us could use the internet at the same time on the same line and account.

Thanks in advance,
bob

Multiple Internet Users Simultaneously?
I've seen a few gadgets that will allow two computers to access the internet on the same line, and I was wondering if maybe a program can be written that works just as well. We have three computers that have access, but we can't all be on at the same time, and I was hoping that maybe someone knew of a way that all three of us could use the internet at the same time on the same line and account.

Thanks in advance,
bob

Multiple Inet1. Connections Simultaneously?
i have never succesfully gotten any type of array to work,

here is what i have going on with inet

Private Sub Command1_Click()
Dim strHtml As String
strHtml$ = Inet1.OpenURL("http://profiles.yahoo.com/" & txtName)
If InStr(1, UCase(strHtml$), UCase("Sorry, but the profile you are looking for is not currently available")) Then
Label1.Caption = "invalid user"
Else
If InStr(1, UCase(strHtml$), UCase("The requested URL /")) Then
Label1.Caption = "your ip is temporarily blocked"
blocked.Action = 7
Timer1.Enabled = False
Else
Label1.Caption = "found one !!!!"
List2.AddItem txtName
Label16.Caption = List2.ListCount
End If
End If
End Sub

what this does is basically search for yahoo ids to see if they exsist,,

*http://profiles.yahoo.com/" & txtName


txtName is fed with possible names from a wordlist in a list box. that runs on a timer ,

the program waits until recieved results on each attempted name b4 it lets the timer push the listbox to the next name,, which makes it a bit too slow

how can i use what i have so far and add multiple attempts at one time?

==============================================
below is how the prog feeds the names from list1 to txtName



Private Sub List1_Click()
Dim X
X = List1.ListIndex

txtName = List1.List(X)

End Sub


Private Sub Timer1_Timer()
List1.ListIndex = m_CurInd
m_CurInd = m_CurInd + 1
If (m_CurInd = List1.ListCount) Then
Timer1.Enabled = False
Label1.Caption = "complete ..."
m_CurInd = 0
End If
End Sub



while inet is attemptig one name , can i make another inet (or inet array) jump to the next name in the list without waiting for the first one to complete?

i hope this isnt too much to ask, but i have searched everywhere and cannot find anything so far that i can apply to what im trying to do here.

any help is always appreciated , and sorry for such a long post

Sending Info Simultaneously Over Multiple USB Ports
I am trying to modify a program to communicate with multiple ValueCAN devices at the same time over USB ports. I am having difficulty doing this, however, and don't know if it is even possible. I can connect with both individually, but not at the same time. Here is the relevent section of code that I am trying to modify:


Code:
'------------------------------------------------------------------------------------
' INITIALIZATION: Initialize()
'------------------------------------------------------------------------------------
' - Finds the VCAN on any USB port, connects to it and configures baud to 250Kbps
' - Ex. "ValueCAN.Initialize()"
'------------------------------------------------------------------------------------
Public Function Initialize(Optional canMode As Byte = MODE_NORMAL)
'Find all devices on USB com ports 0-255
icsneoResult = icsneoFindAllCOMDevices(0, 1, 0, 1, icsneoDeviceTypes(0), icsneoComPorts(0), icsneoSerialNumbers(0), icsneoNumDevices)

'Go through all USB devices found
icsneoResult = 0
icsneoPresent = False
For i = 0 To icsneoNumDevices - 1
'If the device is a VCAN open communications to it
If icsneoDeviceTypes(i) = VCAN_DEVICE Then
icsneoResult = icsneoOpenPort(icsneoComPorts(i), 0, 0, 0, 0, icsneoDriver)
icsneoPresent = True
frmMain.Check1(i).Enabled = True
End If
Next i

'If the VCAN was found, configure it for J1939
If CBool(icsneoResult) = True Then
'Read in current VCAN configuration from the device
icsneoResult = icsneoGetConfiguration(icsneoDriver, icsneoConfigBytes(0), 1024)

'Set the VCAN baud config bytes to 250Kbps for J1939
icsneoConfigBytes(CNF_1) = RATE_250K_1
icsneoConfigBytes(CNF_2) = RATE_250K_2
icsneoConfigBytes(CNF_3) = RATE_250K_3

'Set the VCAN mode config bytes to selected mode (normal,listen,loop)
icsneoConfigBytes(CAN_MODE) = canMode

'Send out the new VCAN configuration with baud of 250Kbps to the device
icsneoResult = icsneoSendConfiguration(icsneoDriver, icsneoConfigBytes(0), 1024)
'Otherwise if the VCAN was not found, notify the user and exit
Else
'Display a message box notifying the user a VCAN device was not found, halt execution
MsgBox "Could not find a USB ValueCAN device!" & vbCrLf & _
"Please connect a ValueCAN to your USB port and restart this program.", vbOKOnly + vbCritical
End
End If


End Function
Is it possible to connect with them simultaneously, or will they have to take turns? If they have to take turns, I would appreciate some advice on how to code this. Thanks!

Multiple Instances Of A Form Running Simultaneously
I have a server program that creates a New instance of a form every time someone connects. The form is meant to handle everything for that user. The problem is, if I have loops on this form, and the same sub tries to execute on another instance, the first form pauses until the second form completes instead of them running in parallel. Is there any way to do this?

I was originally trying to multithread the application, but I ran into issues with the createObject call (you may have seen some of my previous posts in the general forum). So, if you have any solutions that make it multithreaded, that would be ideal...

Thansk in advance.

Disable/Enable Multiple Textboxes Simultaneously
I have a program that displays information from a database. When it displays this information, I want it to be read-only. If a user presses a button called Modify, I want the information to become read/writable so I can change some of that information and rewrite it to the database.

For example, on a form, I am displaying the following:

Name: John Doe
Phone: (555) 555-5555
E-mail: john@doe.com

The name, phone, and e-mail are in text boxes, which I have initially set as locked. This information comes from a database. Now, when a user clicks on a button called Modify, I want the text boxes to become unlocked so I can, for example, change the e-mail address, hit OK, and update this info, then lock the text fields back up.

Is there a way to "bulk" lock/unlock these text fields, or do I have to do each one separately? Any help is appreciated. Thanks.

Modifying Multiple Controls Of The Same Type Simultaneously
Ok Here goes.

    What I want to be able to do is change a specific property for all of the controls of a certain type (say checkbox) within a container (frame or form) leaving those controls of that type that are outside the container unmodified. Basically I want to duplicate the behavior of the option buttons with other controls. I hope my question is clear it was rather difficult to explain. If anyone has any ideas I would appreciate it!

~sarabelle

DataBlaze 1.0 - Work On Multiple Data Sources Simultaneously!
DataBlaze is a great little tool that lets you view, insert, update, and delete records from any datasource you can connect to using a DSN. It's such a simple and handy tool, you'll wonder how you ever got along without it. DataBlaze allows you to actually perform operations on multiple data sources in adjacent windows simultaneously.

For example, have you ever found yourself in a situation where you're creating a new application based on an existing legacy application? And when that legacy application uses several different database platforms, and your new application uses yet another one, wouldn't it be nice to be able to see all the data from all the different platforms all at once without having to switch back and forth between, Oracle, Access, Sybase, SQL Server, and who knows what else? Well, now you can just run DataBlaze, and have it all laid out for you within one, easy-to-use application. And since DataBlaze is an MDI application, you can tile them all, or arrange them in whatever layout suits you best.

DataBlaze is useful to any IT professional; from developers to testers to DBA's. You can download a free evaluation copy of DataBlaze from our web site at http://www.q-d.com.

Running Code On Two Forms Simultaneously
Hello,

I want to trigger some code to run on another form, whilst the code continues to run on the first form (the triggered code monitors an event that occurs after the first code finishes)

Can anybody help me?

Running ScriptControl Code Simultaneously With Vb
Hi

How can i run some vbscript thats in a script control simultaneously with my VB app?

Because when the script control runs into large loops, my app freezes until the script control has finished.

Thanks

Please Comment On This Code
Set cnnconnection = New ADODB.Connection
cnnconnection.Open ADO_CONNECTSTRING
cnnconnection.CursorLocation = adUseClient
Set cmdCommand = New ADODB.Command
cmdCommand.CommandText = "proc_MacroUpd"
cmdCommand.CommandType = adCmdStoredProc

later he
set cmdCommand = nothing
set cnnconnection = nothing


I have a student, he wrote this code in his project and appears more than 26 times. Can someone explain what is bad about this code. First I know he can create a proc then he will can it once. I also do not like he made new connection so many times. But I can not find right words for that.

Easy Way To Comment- Out Code?
Hi everybody!

Probably many of you have at one time or another been in my shoes...you have a situation whereby you have this HUGE chunk of code that you need to 'comment-out' temporarily. As far as I know, with VB, you need to comment line-by-line. Any quicker solutions for this? Something similar to C++ or java code where whole blocks can be commented out at a go.

Thank you.

What Is The Shortcut To Comment Code
What Is the key combination to comment out code in visual basic? I don't see it on the menu dropdowns, of course been staring at the screen too long.


Thanks

Comment Chunks Of Code?
is it possible to comment chunks of code in VB, or do i have to keep putting a ' infront of every line?

Well - AddIN To Comment Out Code
Does an Addin exist that allows for selection of code to highlight, which will comment out all selected code? Then can toggle to uncomment out the same code?

Comment Out Paragraphs Of Code
How do I comment out paragraphs of code?? this should be an easy question. thanks

Code Comment Challenge
Please, we need your help to comment this VB sort program. We are a BTEC national group in England. This is our final assignment and we need it finished ASAP. The challenge is, can anyone comment it for us?

_______________________________________

Option Explicit

Const SPEED As Integer = 15000
Const BARS = 16
Const BARSM1 = BARS - 1
Const MAXFUNC = 4
Const UNIT = 255, SPCING = 300, MARGIN = 100
Const SLOC = UNIT * BARSM1 + MARGIN
Const TITLEBAR = 295, BOARDERS = 120
Const GREEN = &H80FF80, BLUE = &HFF8080
Const ORANGE = &H80C0FF, RED As Long = &HFF
Const IHI = 32767, MIHI = -32768

Private Type atemp
Top As Integer
Height As Integer
End Type

Dim atmp As atemp
Dim colorkey As Integer
Dim Spd As Integer, ascend As Integer
Dim sorting As Boolean, partition As Boolean
Dim stepping As Boolean, stepit As Boolean
Dim sorts(MAXFUNC) As String


Private Sub Command1_Click(Index As Integer)
Static idx As Integer, i As Integer

If sorting Then
Select Case Index
Case 0, 1: stepping = False: stepit = True
Case 4
If stepping Then
stepit = True
Else
Stepp Index
End If
Exit Sub
End Select

sorting = False
stepit = True
idx = Index + 1
Exit Sub
End If

Form1.BackColor = vbButtonShadow
Label1.BackColor = vbButtonShadow

cm1: sorting = True
Select Case Index
Case 0: Reset
Case 1: Stopp
Case 2: Recurr Index
Case 3: UpDn Index
Case 4: Stepp Index: GoTo cm2
Case 5: insert_sort 0, BARSM1
Case 6: merge_sort 0, BARSM1
Case 7: quick_sort 0, BARSM1
Case 8: shell_sort 0, BARSM1
Case 9: bubble_sort 0, BARSM1
End Select

If idx Then
Index = idx - 1: idx = 0
For i = 0 To BARSM1
Shape1(i).FillColor = BLUE
Next
labelCaption BLUE
GoTo cm1
ElseIf Index Then
If sorting Then
Form1.BackColor = ORANGE
Label1.BackColor = ORANGE
End If
End If
cm2: sorting = False
End Sub

Private Sub addButton(s As String, Optional tip As String = "")
Static num As Integer, n1 As Integer, n2 As Integer
Static toploc As Integer

n1 = 1 - (num Mod 2)
n2 = (num + 1) 2 - 3
toploc = SLOC + UNIT + MARGIN

If num Then Load Command1(num)

If num < 5 Then
Command1(num).Top = toploc + (UNIT + MARGIN 2) * num
Command1(num).Left = MARGIN
Command1(num).Height = UNIT
Command1(num).Width = UNIT * 1.5
Command1(num).ToolTipText = tip
Else
Command1(num).Top = toploc + (UNIT * 2 + MARGIN) * n1
Command1(num).Left = MARGIN * 2 + UNIT * 1.5 + _
(UNIT * 3 + MARGIN) * n2
Command1(num).Height = UNIT * 2
Command1(num).Width = UNIT * 3
Command1(num).ToolTipText = tip
End If
Command1(num).FontBold = True
Command1(num).Caption = s
Command1(num).Visible = True

num = num + 1
End Sub


Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If stepping Then
KeyCode = vbKeyEscape
stepit = True
End If
End Sub

Private Sub Form_Load()
Dim i As Integer, toploc As Integer

Spd = SPEED: ascend = 1

sorts(0) = "Insert"
sorts(1) = "Merge"
sorts(2) = "Quick"
sorts(3) = "Shell"
sorts(4) = "Bubble"

Form1.Height = UNIT * (BARS + 5) + MARGIN * 5 _
+ BOARDERS + TITLEBAR
Form1.Width = SPCING * BARS + MARGIN * 2 + BOARDERS
Form1.BackColor = vbButtonShadow
Form1.KeyPreview = True

toploc = UNIT * (BARS + 4) + MARGIN * 4
HScroll1.Top = toploc
HScroll1.Left = MARGIN * 2 + UNIT * 1.5
HScroll1.Height = UNIT
HScroll1.Width = UNIT * 6 + MARGIN
HScroll1.Value = IHI - SPEED
HScroll1.SmallChange = 1000
HScroll1.LargeChange = 5000

Label1.Top = toploc
Label1.Left = MARGIN * 4 + UNIT * 8
Label1.Height = UNIT
Label1.Width = UNIT * 4.5
Label1.BackColor = vbButtonShadow
Label1.Alignment = 1
Label1.FontBold = True

Shape1(0).Shape = 0
Shape1(0).Height = UNIT
Shape1(0).Width = UNIT
Shape1(0).Top = SLOC
Shape1(0).Left = MARGIN
Shape1(0).FillStyle = 0

addButton "R", "Stop & Reset"
addButton "S", "Stop"
addButton "N", "Click to Partition (recursive sorts)"
addButton ">", "Click for Descending"
addButton "1", "Click for Stepping"

'Places buttons on the form
For i = 0 To MAXFUNC
addButton sorts(i)
Next

For i = 1 To BARSM1
Load Shape1(i)
Shape1(i).Left = MARGIN + SPCING * i
Shape1(i).Visible = True
Next

Load Shape1(i)
Shape1(i).Top = toploc
Shape1(i).Left = MARGIN * 5 + UNIT * 13
Shape1(i).Height = UNIT
Shape1(i).Width = UNIT * 4
Shape1(i).Visible = True
colorkey = i

Call Reset
End Sub

Private Sub Form_Unload(Cancel As Integer)
sorting = False
stepping = False
stepit = True
End Sub

Private Sub HScroll1_Change()
If Not stepping Then Spd = IHI - HScroll1.Value
End Sub

Private Sub pause()
Dim i As Long

For i = 1 To Spd
If stepping Or Not sorting Then Exit For
DoEvents
Next
End Sub

Private Sub Stopp()
sorting = False
stepping = False
stepit = True
HScroll1.Enabled = True
Command1(2).Enabled = True
Command1(3).Enabled = True
Command1(4).Caption = "1"
Command1(4).ToolTipText = "Click for Stepping"
Form1.Caption = "Sort Viewer"
End Sub

Private Sub Stepp(i As Integer)
Command1(i).Caption = "+"
Command1(i).ToolTipText = "Click to Step"
Command1(2).Enabled = False
Command1(3).Enabled = False
HScroll1.Enabled = False
stepping = True
End Sub

Private Sub Recurr(i As Integer)
sorting = False
If Command1(i).Caption = "N" Then
Command1(i).Caption = "P"
Command1(i).ToolTipText = "Click for Normal (nonrecursive)"
partition = True
Else
Command1(i).Caption = "N"
Command1(i).ToolTipText = "Click to Partition (recursive sorts)"
partition = False
End If
End Sub


Private Sub Reset()
Dim nbrs As New Collection
Dim i As Integer, j As Integer, k As Integer

Stopp

For i = 0 To BARSM1
nbrs.Add i
Next

Do While nbrs.Count
Randomize
i = Int(Rnd * nbrs.Count + 1)
k = nbrs(i)
nbrs.Remove i

Shape1(j).Top = SLOC - UNIT * k
Shape1(j).Height = UNIT * (k + 1)
Shape1(j).FillColor = BLUE
j = j + 1
Loop
labelCaption BLUE
End Sub


Private Sub UpDn(i As Integer)
sorting = False
If Command1(i).Caption = ">" Then
Command1(i).Caption = "<"
Command1(i).ToolTipText = "Click for Ascending"
ascend = -1
Else
Command1(i).Caption = ">"
Command1(i).ToolTipText = "Click for Descending"
ascend = 1
End If
End Sub

Private Sub labelCaption(ByVal clr As Long)
Static s As String

Select Case clr
Case RED: s = "Swap!"
Case GREEN: s = "Comparing"
Case ORANGE: s = "Min Mid Max"
Case Else: clr = BLUE: s = "No Op"
End Select

Shape1(colorkey).FillColor = clr
Label1.Caption = s
End Sub

Private Function compar(ByVal n1%, ByVal n2%) As Boolean
showcolor n1, n2, GREEN, GREEN
compar = False

If sorting Then
If stepping Then wait
If Shape1(n1).Height > Shape1(n2).Height Then
compar = True
Else
showcolor n1, n2, BLUE, BLUE
End If
End If
End Function

Private Sub showcolor(num1%, num2%, olor1&, olor2&)
labelCaption olor1
Shape1(num1).FillColor = olor1
Shape1(num2).FillColor = olor2
pause
End Sub

Private Sub swapint(n1 As Integer, n2 As Integer)
Static i As Integer
i = n1: n1 = n2: n2 = i
End Sub


Private Sub wait()
stepit = False
Do Until stepit
DoEvents
Loop
End Sub

Private Sub swap(n1 As Integer, n2 As Integer)
Dim t1 As Integer, t2 As Integer

showcolor n1, n2, RED, RED

If stepping Then wait

t1 = Shape1(n1).Height
t2 = Shape1(n1).Top
Shape1(n1).Height = Shape1(n2).Height
Shape1(n1).Top = Shape1(n2).Top

Shape1(n2).Height = t1
Shape1(n2).Top = t2
pause

showcolor n1, n2, BLUE, BLUE
End Sub


Private Sub siftUp(ByVal first%, ByVal mid%, last%)
Dim j As Integer, k As Integer
Dim j1 As Integer, k1 As Integer

j = mid
k = (j - first) * 2 + first
Do While k * ascend <= last * ascend
If (k * ascend < last * ascend) Then
k1 = k - ascend
If compar(k, k1) Then
If sorting = False Then Exit Do
showcolor k, k1, BLUE, BLUE
k = k + ascend
Else
showcolor k, k1, BLUE, BLUE
End If
If sorting = False Then Exit Do
End If

k1 = k - ascend: j1 = j - ascend

If compar(k1, j1) Then
If sorting = False Then Exit Do
swap k1, j1
If sorting = False Then Exit Do
Else
Exit Do
End If
j = k
k = (j - first) * 2 + first
Loop
End Sub


Code continutes on next post....

Replicating Vb&#039;s Comment Code!?!?!
Im trying to replicate the way Visual Basic does its commenting when you click on the comment button in the editing toolbar it will comment all the lines you have selected or the line you have selected..But I cant figure out how to get it to put the ' character as the first character in all the lines..Does anyone know how to do this?

Comment A Code Block In VB6
can I comment a code block in VB6 without having to comment each line separately?..

like c++:

/*
...
code block
...
*/

plz help

What's The Conventional Way To Comment Code.
I was just wondering how most people use comments.

I ask because When I print out code, it's hard to read becase I like to comment next to the lines of code and it ends up being broken and above and below the code.


Suggestions?

Code Comment Block
How can I read the comments block of the source code????

How Can I Comment A Block Of Vb Code?
It seems I can only comment the code line by line by using " ' ". Does anybody know how can I comment a block of vb code?
thanks

I Must Comment A Certian Code That Is Weird
In my project, the code includes
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long
I must add a comment in the project explaining what it is and what exactly it does. Anybody haev a explination for that?!?!? I wish i knew

Quick Question Concerning Comment Code
Hi, I've seen a lot of source code posted (and downloaded a lot) that has many comments that are full lines of code. I originally thought they were just there 'cause the person was too lazy to delete them, they were just old code, and never needed again. But a program I got today said *Warning, do not modify or delete and of the following comments*, and I jsut wondered, is it possible that comments can be a part of the code, and it would cause errors to delete them to compact code?

Can You Comment Out An Entire Block Of Code In VB6?
Just wondering if you can comment out an entire block of code in VB6, or do you have to comment out each line seperately?

SOLVED: Comment Large Blocks Of Code?
how do I comment large blocks of code?

Multiple Lines
I'm createing a very simple forum but am having trouble displaying any message that has been saved that users multiple lines. Below is an example of how it's saved and displayed in the databse but when I retreive and display it on my web page it's just one long string.

"How saved in database"
This
Message
Users
Multiple
Lines.

"How displayed on webpage"
This Message Users Multiple Lines.

I have the message field in my SQL db set to "mediumtext". Is this the correct type of field to use and if so why would it be displayed as one long string instead of how it's saved in the db?

Thanks.

Multiple Lines Of Text
i want to do something like this

Private Sub Command1_Click()
select case lbl1.caption
case = "whatever i have here"
lbl2.caption = "i need to show multiple lines
of text so it looks just like
this when it prints to the lbl2"
end select

End Sub

the problem i am having is that when i put the text in multiple lines like that all the lines except the top one turn red and i get a sytex error. is there a way to do this. the reason i want to do it this way is that i will be doing a lot of copy and paste for my label text and i am using as few labels as i can so im using "select case" to change them.

Getting Data From Multiple Lines
Hi, I have a .txt file with numbers in like the following:
10110
01111
11111
00000
11001

How do I get that data out of the text file? I tried:

Code:
Private Sub cmdRead_Click()
Dim mapdata As Single

Open App.Path & "map.txt" For Input As #1

Input #1, nextline

Text1.Text = Text1.Text & nextline
End Sub

This just puts the first line into the textbox. How do I get all the lines?

Copyright 2005-08 www.BigResource.com, All rights reserved