Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - Danyfirex

#91
Tendiras que poner algo como

Código (php) [Seleccionar]
local $result=0
while true
$result = _ImageSearch($hBitmapA, 1, $x, $y, 20, 0) ;
if $result>0 Then
MouseMove($x, $y)
MouseClick("left")
ExitLoop
endif
sleep(300)
WEnd



saludos
#92
Ya te dije tienes que leer mas.

el error es por el nombre de los controles que alguno no coincide. ademas falta terminarlo así no va a andar.
#93
Estas declarando un rutina dentro de otra :S

debería ser algo así.

Código (vb) [Seleccionar]




Private Sub Ordenar_Click()
Dim i As Long
Dim arreglo() As Long
ReDim arreglo(List1.ListCount - 1)
For i = 0 To List1.ListCount - 1
arreglo(i) = Int(List1.List(i))
Next
For i = 0 To UBound(arreglo)

Next
Call BubbleSort(arreglo(), True)
List1.Clear

For i = 0 To UBound(arreglo)
List1.AddItem arreglo(i)
Next



End Sub




'true ascendente, false descendente
Public Sub BubbleSort(ByRef iaArray() As Long, Optional ByVal tipo As Boolean = True)

Dim n As Integer, i As Integer, j As Integer

    n = UBound(iaArray)

    For i = (n - 1) To 0 Step -1

        For j = 0 To i

If tipo = True Then
            If iaArray(j) > iaArray(j + 1) Then
            Swap iaArray(j), iaArray(j + 1)

            End If
Else
If iaArray(j) < iaArray(j + 1) Then
            Swap iaArray(j), iaArray(j + 1)

            End If
            End If
           

        Next j

    Next i

End Sub





Private Sub Swap(ByRef xArg1, ByRef xArg2)

    Dim xTmp

    xTmp = xArg2

    xArg2 = xArg1

    xArg1 = xTmp

End Sub







PD: te recomiendo que leas mas sobre vb6( al menos lo básico ¬¬) lo estas haciendo al azar.

saludos
#94
Muestra tu código completo  :rolleyes:
#95
A ver.

Te la pongo facil.

usa este algoritmo

Código (vb) [Seleccionar]
'true ascendente, false descendente
Public Sub BubbleSort(ByRef iaArray() As Long, Optional ByVal tipo As Boolean = True)

Dim n As Integer, i As Integer, j As Integer

    n = UBound(iaArray)

    For i = (n - 1) To 0 Step -1

        For j = 0 To i

If tipo = True Then
            If iaArray(j) > iaArray(j + 1) Then
            Swap iaArray(j), iaArray(j + 1)

            End If
Else
If iaArray(j) < iaArray(j + 1) Then
            Swap iaArray(j), iaArray(j + 1)

            End If
            End If
           

        Next j

    Next i

End Sub



que tienes que hacer. lo siguiente.



coger todos los elementos del listbox en un array.


luego

limpiar el listbox

luego llamar la rutina

Call BubbleSort(arreglo(), True)

luego llenar el listbox otra vez.


saludos



#96
El insertionSort esta hecho en vb.net.

pero que has hecho que no te funciona?
#97
Supongo que deberías loguearte.

Este lo use hace tiempo y va bien.

Código (vb) [Seleccionar]
Public Function SendMail(sTo As String, sSubject As String, sFrom As String, _
    sBody As String, sSmtpServer As String, iSmtpPort As Integer, _
    sSmtpUser As String, sSmtpPword As String, _
    sFilePath As String, bSmtpSSL As Boolean) As String
     
    On Error GoTo SendMail_Error:
    Dim lobj_cdomsg      As CDO.Message
    Set lobj_cdomsg = New CDO.Message
    lobj_cdomsg.Configuration.Fields(cdoSMTPServer) = sSmtpServer
    lobj_cdomsg.Configuration.Fields(cdoSMTPServerPort) = iSmtpPort
    lobj_cdomsg.Configuration.Fields(cdoSMTPUseSSL) = bSmtpSSL
    lobj_cdomsg.Configuration.Fields(cdoSMTPAuthenticate) = cdoBasic
    lobj_cdomsg.Configuration.Fields(cdoSendUserName) = sSmtpUser
    lobj_cdomsg.Configuration.Fields(cdoSendPassword) = sSmtpPword
    lobj_cdomsg.Configuration.Fields(cdoSMTPConnectionTimeout) = 30
    lobj_cdomsg.Configuration.Fields(cdoSendUsingMethod) = cdoSendUsingPort
    lobj_cdomsg.Configuration.Fields.Update
    lobj_cdomsg.To = sTo
    lobj_cdomsg.From = sFrom
    lobj_cdomsg.Subject = sSubject
    lobj_cdomsg.TextBody = sBody
    If Trim$(sFilePath) <> vbNullString Then
        lobj_cdomsg.AddAttachment (sFilePath)
    End If
    lobj_cdomsg.Send
    Set lobj_cdomsg = Nothing
    SendMail = "ok"
    Exit Function
         
SendMail_Error:
    SendMail = Err.Description
End Function



saludos
#99
la documentación es larga pero el algoritmo te quedara en menos de 15 lineas.

culaquier duda pregunta.

saludos