PDA

Click to See Complete Forum and Search --> : vBulletin Tool


Fox
Feb 11th, 2001, 04:08 PM
Here's the first release of my vBulletin Tool which formats for you the [code] blocks like this:

Original code:

private sub Test(iCount as long)
dim A as long

'Sample loop
for A = 0 to iCount
'Draw lines
pset (0, a), rgb(255, 0, 0)

if a > 20 then: exit sub
next
end sub


Code created by vBulletin tool:

Private Sub Test(iCount As long)
Dim A As Long

'Sample loop
For A = 0 to iCount
'Draw lines
PSet (0, a), RGB(255, 0, 0)

If a > 20 Then: Exit Sub
Next
End Sub



Make sure you don't miss this free open-source tool to make your posts look better!

Click here (http://forums.vb-world.net/showthread.php?s=&postid=234607) to download

Feb 12th, 2001, 02:54 AM
Great tool - thanks

Fox
Feb 12th, 2001, 11:04 AM
Note that this is still a beta - I'll do some improvements soon.. :)

Test code:


Declare Function BitBlt Lib "gdi32" Alias "BitBlt" ( _
ByVal hDestDC As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hSrcDC As Long, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dwRop As Long) As Long

Feb 12th, 2001, 11:52 AM
Private Sub cmdDownLoad_Click()
On Error GoTo errHandler

If ConnectedFlag = False Then
MsgBox "No connection yet"
Exit Sub
ElseIf lisServerFiles.ListCount = 0 Then
MsgBox "No server file listed yet"
Exit Sub
ElseIf Right(lisServerFiles.Text, 1) = "/" Then
MsgBox "Selected item is a directory only." & vbCrLf & vbCrLf & _
"To list files under that dir, double click on it."
Exit Sub
End If

lblStatus.Caption = "Retreiving file..."
SerFilespec = Right(txbURL.Text, Len(txbURL.Text) - homeLen) & _
"/" & lisServerFiles.Text
SerFilespec = Right(SerFilespec, Len(SerFilespec) - 1)

' Use same file name and store it in current dir of local. Parse
' above SerFilespec and take only the file name as LocFileSpec.
LocFilespec = SerFilespec
Do While InStr(LocFilespec, "/") <> 0
LocFilespec = Right(LocFilespec, Len(LocFilespec) - _
InStr(LocFilespec, "/"))
Loop

If IsFileThere(LocFilespec) Then
If MsgBox(LocFilespec & " already exist. Overwrite?", _
vbYesNo + vbQuestion) = vbNo Then
Exit Sub
End If
End If

lblStatus.Caption = "Requesting for file size..."

gFileSize = ""
FileSizeFlag = True
Inet1.Execute , "SIZE " & SerFilespec
Do While Inet1.StillExecuting
DoEvents
If ConnectedFlag = False Then
Exit Sub
End If
Loop

If gFileSize = "" Then
MsgBox "Selected file has 0 byte content."
Exit Sub
Else
If MsgBox("File size is " & gFileSize & " bytes." & vbCrLf & vbCrLf & _
"Proceed to download?", vbYesNo + vbQuestion) = vbNo Then
Exit Sub
End If
End If

DownloadFlag = True
Inet1.Execute , "Get " & SerFilespec & " " & LocFilespec
Do While Inet1.StillExecuting
DoEvents
If ConnectedFlag = False Then
Exit Sub
End If
Loop

lblStatus.Caption = "Connected"
File1.Refresh
Exit Sub

errHandler:
If icExecuting Then
If ConnectedFlag = False Then
Exit Sub
End If

If MsgBox("Executing job. Cancel it?", vbYesNo + vbQuestion) = vbYes Then
Inet1.Cancel
If Inet1.StillExecuting Then
lblStatus.Caption = "System failed to cancel job"
End If
Else
Resume
End If
End If
ErrMsgProc "cmdDownLoad_Click"
End Sub



just testing...seams to look good (cepy my code ;) )