Jump to content
Sign in to follow this  
TheWebz

Help error

Recommended Posts

TheWebz

;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?


Share this post


Link to post
Share on other sites
TheWebz

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.

Share this post


Link to post
Share on other sites
BrewManNH

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

Share this post


Link to post
Share on other sites
JLogan3o13

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

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
TheWebz

Really? can you explain whats wrong to me pls?


Share this post


Link to post
Share on other sites
TheWebz

look i did this code long time ago, and now i com back to it but i thought that i had left the code without errors and i don t know whats wrong!


Share this post


Link to post
Share on other sites
BrewManNH

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

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • vati1011
      By vati1011
      Hey, guys.
      Currently, I'm using Opencv UDF and i'm  encountering issues with DLLOPEN(). it is failing and returning -1
      But, I cannot figure out why it is failing.
      I need help from people.
      I'm running windows 10 32bit.
      This's my code.
      #RequireAdmin $fileopen = DllOpen("opencv_core2413.dll") MsgBox(0,"Result",$fileopen) Example.au3opencv_core2413.dll
    • xiantez
      By xiantez
      This script used to work on an older version of AutoIT. Currently I am running AutoIT v3.3.14.5 and it's failing.
      Func PublicIP() ;Post public facing IP address Local $url = 'https://www.google.com/search?client=opera&q=what+is+my+ip&sourceid=opera&ie=UTF-8&oe=UTF-8' Local $getIPaddress = BinaryToString(InetRead($url)) Local $sStart = 'clamp:2">' Local $sEnd = '</div>' Local $ipaddress = _StringBetween($getIPaddress, $sStart, $sEnd For $i In $ipaddress MsgBox(0, 'External IP', "Your public IP address is " & $i) Next EndFunc ;==>PublicIP The console output shows:
      "C:\Users\user\Documents\AutoIT\Scripts\WSI Tools.au3" (197) : ==> Variable must be of type "Object".: For $i In $ipaddress For $i In $ipaddress^ ERROR ->14:12:16 AutoIt3.exe ended.rc:1 +>14:12:16 AutoIt3Wrapper Finished. >Exit code: 1 Time: 9.811
    • Xandy
      By Xandy
      I'm listing the error message strings, and roughly matching the error code
      Is this how to do error reporting?  Is there a more simple way I don't know about?
      I realise I might not need to trap @error inside $error.  I like it this way b/c I have no fear of overwriting @error now; I don't even use it.
      Func Send_Connect($address, $port)     $socket = TCPConnect($address, $port)     $error = @error     If $error <> 0 Then         Local $aError[4] = ["-2 not connected.", _                             "1 IPAddr is incorrect.", _                             "2 port is incorrect."]         $aError[3] = "10060 Connection timed out."         If $error < 0 Then $error = 0         If $error > 2 Then $error = 3         MsgBox(0, "TCP Connect Error", $aError[$error], 0)         $socket = 0     EndIf     Return $socket EndFunc
    • Spartan117
      By Spartan117
      Hi everyone,
      I am wondering if is there any autoit function that make the program ignore errors and move on and resume correct lines?
      Thank you
    • nacerbaaziz
      By nacerbaaziz
      Hi dear
      I have a question please
      Can we customize error messages in autoit script?
      I mean internal error messages
      for example
      AutoIt Error
      Line 4  (File "D:\my projects\NVDA Manager\New AutoIt v3
      Script.au3"):
      $script[1] = 1
      $script^ ERROR
      Error: Subscript used on non-accessible variable.
      For example, I want to customize this message
      Is this possible?
      am waiting for your answers
×