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!

Share this post


Link to post
Share on other sites
JLogan3o13

Explain what you're trying to do with that line. Help us help you.


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

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
JLogan3o13

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.


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

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

    • 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
    • AnonymousX
      By AnonymousX
      Hello,
      I'm trying to make a program that can look at a folder directory, find all the CSV files, and then add the data from CSV's to an array. 
      The problem I seem to be running into is on the 2nd iteration (2nd file) when the script will not create an array. Could someone please help? Thanks in advance
       
      #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Global $MasterArray RefineData() Func RefineData() Local $i, $filenum, $file, $csvArray, $sFilePath = @ScriptDir $fileList = _FileListToArrayRec($sFilePath, "*.csv", 1) ;Create and array of all .csv files within folder ;=====Loop through the .csv files within the folder====== For $filenum = 1 To UBound($fileList) - 1 Step 1 $file = $fileList[$filenum] $sFilePath = $sFilePath & "\" & $file ;=====Create array based on csv file===== _FileReadToArray($sFilePath, $csvArray, $FRTA_NOCOUNT, ",") _ArrayDisplay($csvArray,"File: " & $filenum) If $filenum = 1 Then $MasterArray = $csvArray _ArrayDisplay($MasterArray, "Master") Else $MasterArray = _ArrayColInsert($MasterArray, UBound($MasterArray)) ;want column added at end For $i = 0 To UBound($MasterArray)-1 Step 1 $MasterArray[$i][UBound($MasterArray) - 1] = $csvArray[$i][4] Next _ArrayDisplay($MasterArray, "Master") EndIf Next EndFunc ;==>RefineData  
    • ur
      By ur
      In the autoit file, if we add multiple libraries (both internal and custom created one)
       
      When we compile the code and run the exe, some time we are getting runtime errors.
      But the line number of error is not showing the exact line number, might be it is including the line number count of libraries also.
      Can you please suggest how to get the exact error line number.
      So, it will be useful for debugging.
    • Rskm
      By Rskm
      i have seen many pointing out issues related to this, i tried reading through them - still unable to solve mine.. i have a script which reads certain lines based on a search item, this is an iterative process - the ldflst_file gets updated for each iteration and the script finds the line number which has the search item. this works perfectly for few iterations, but stops in some cases abruptly with the error = 
      Subscript used on non-accessible variable $aRead^ ERROR I have verified that the search item is present in the file. what could be the reason for this code to stop in certain cases. thanks for help
      my code below (partial).. full code is in attachment
       
      local $aRead=FileReadToArray($ldflst_file)
      global $ldflst_var1=" JOINT  LOAD       FORCE(X)        FORCE(Y)        FORCE(Z)       MOMENT(X)       MOMENT(Y)       MOMENT(Z)"
       
      for $i= 0 to $ldflst_totlines    ; ldflst_totlines is total number of  lines in the file 'ldflst_file'

          if $aRead[$i]=$ldflst_var1 Then
              $ldflst_LFound=$i
              ExitLoop
              else
              EndIf
      Next
       
       
      nomo_new1.au3
×