Jump to content

Help error


TheWebz
 Share

Recommended Posts

;BIBLIOTECAS A INCLUIR--------------
#include <GUIConstants.au3>
#Include <Array.au3>
#Include <Inet.au3>
#include <String.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include
;FIM DE BIBLIOTECAS A INCLUIR-------

;VISUAL-----------------------------------------------------------
$form = GUICreate( "test", 500, 500 )
$Button1 = GUICtrlCreateButton("Search Music", 112, 424, 281, 49)
$Input1 = GUICtrlCreateInput("Input1", 128, 128, 249, 21)
$Button2 = GUICtrlCreateButton("Download", 200, 160, 99, 41)
GUICtrlSetState( $Button2,$GUI_DISABLE )
GUICtrlSetState( $Input1,$GUI_DISABLE )
GUISetState( @SW_SHOW )
;FIM VISUAL-------------------------------------------------------


;FUNCAO CASO GUI SEJA FECHADA------------
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
;FIM FUNCAO CASO GUI SEJA FECHADA--------


;CASO BOTAO 1---------------------------------------------------------------------------------------------------------------------------------
Case $Button1
Global $sSearchingFor = InputBox( "Musica", "Escreva aqui em baixo o nome da música." )
; Specify the reguest:
Global $sURL = "http://mp3skull.com/mp3/" & StringReplace( $sSearchingFor, " ", "_" ) & ".html"
;$sURL = "http://mp3skull.com/mp3/barclay_james_harvest.html"

ProgressOn( "Searching..", "Working..", "Searching for " & $sSearchingFor & " ..." )
ProgressSet( 30 )
sleep(1000)
Global $sRes = _INetGetSource($sURL)

ProgressSet( 100, "Done!" )
Sleep(3000)
ProgressOff()
$aRes = _StringBetween($sRes,'"font-size:15px;">','rel="nofollow" target="_blank"') ;if title and Downloadlink is needed this line
Dim $aRes1[UBound($aRes)][2]
For $i = 0 to UBound($aRes) -1
    Next
$sTitle = _StringBetween($aRes[$i],'[b]','[/b]')
If IsArray($sTitle) Then $aRes1[$i][0]=$sTitle[0]
$sDL_URL = _StringBetween($aRes[$i],'<a data-cke-saved-href="','" href="','" ')="" if ="" isarray($sdl_url)="" then="" $ares1[$i][1]="$sDL_URL[0]<br">Next
_ArrayDisplay($aRes1, "", Default, Default, "¨")
GUICtrlSetState( $Button2,$GUI_ENABLE )
GUICtrlSetState( $Input1,$GUI_ENABLE )
;FIM DO CASO BOTAO 1--------------------------------------------------------------------------------------------------------------------------

Case $Button2
$RInput1 = GUICtrlRead( $Input1 )

$link = StringLeft($RInput1,StringInStr($RInput1,"¨"))
MsgBox( 64, "TESTE", "" & $link )

EndSwitch
WEnd

This code gives me an error and i can't fix it!! I can't understand whats wrong! Could you help me please?

Link to comment
Share on other sites

it says this: 

ERROR: syntax error
$sDL_URL = _StringBetween($aRes[$i],'<a data-cke-saved-href="','" href="','" ')="" if
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:Users---------DesktopMP3Download by kiko.au3(53,112) : ERROR: missing separator character after keyword.
Link to comment
Share on other sites

What is that line supposed to be doing? The way you have it written is completely wrong.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

This line is the problem, your If>Then is formatted badly, and you have a Next in there with no For. Take a look at the examples in the Help file for formatting this correctly.

$sDL_URL = _StringBetween($aRes[$i],'<a data-cke-saved-href="','" href="','" ')="" if ="" isarray($sdl_url)="" then="" $ares1[$i][1]="$sDL_URL[0]<br">Next

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

If even YOU don't know what this line is supposed to be doing, and I'm going to assume you wrote it initially, how in the world are WE supposed to know what your intent was?

There's so many problems on that one line that without knowing what it's final outcome should be, you're pretty much asking us to guess for you.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

I will offer that everything to this point looks viable:

$sDL_URL = _StringBetween($aRes[$i],'<a data-cke-saved-href="','" href="',

Everything after that point is a hot mess.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...