Jump to content

Expected a "=" operator in assignment statement?


Recommended Posts

Whats the problem with that? It keeps returning :

C:\Documents and Settings\--\Desktop\--.au3 (9) : ==> Expected a "=" operator in assignment statement.:

$Link[$String] = $StringB[$String]

$Link^ ERROR

#include <inet.au3>
#include <String.au3>

$source = _INetGetSource("http://yahoo.com")
$count = _StringGetChrCount($source, "<a href=")
MsgBox(64, "Informations", "There are " & $count & " links in the page!")
$StringB = _StringBetween($source, 'href="', '"')
For $String = 1 to $count
    $Link[$String] = $StringB[$String]
    ConsoleWrite($Link[$string] & @crlf)
Next

Func _StringGetChrCount($cStr, $cChr, $iCase = 0)
   If $iCase <> 0 Then $iCase = 1
   StringReplace($cStr, $cChr, $cChr, 0, $iCase)
   Return @Extended
EndFunc
Link to comment
Share on other sites

Whats the problem with that? It keeps returning :

#include <inet.au3>
#include <String.au3>

$source = _INetGetSource("http://yahoo.com")
$count = _StringGetChrCount($source, "<a href=")
MsgBox(64, "Informations", "There are " & $count & " links in the page!")
$StringB = _StringBetween($source, 'href="', '"')
For $String = 1 to $count
    $Link[$String] = $StringB[$String]
    ConsoleWrite($Link[$string] & @crlf)
Next

Func _StringGetChrCount($cStr, $cChr, $iCase = 0)
   If $iCase <> 0 Then $iCase = 1
   StringReplace($cStr, $cChr, $cChr, 0, $iCase)
   Return @Extended
EndFuncoÝ÷ Ûú®¢×+0¢¹,jëh×6#include <inet.au3>
#include <String.au3>

$source = _INetGetSource("http://yahoo.com")
$count = _StringGetChrCount($source, "<a href=")
local $Link[$count+1]
MsgBox(64, "Informations", "There are " & $count & " links in the page!")
$StringB = _StringBetween($source, 'href="', '"')
For $String = 1 to $count
    $Link[$String] = $StringB[$String]
    ConsoleWrite($Link[$string] & @crlf)
Next

Func _StringGetChrCount($cStr, $cChr, $iCase = 0)
   If $iCase <> 0 Then $iCase = 1
   StringReplace($cStr, $cChr, $cChr, 0, $iCase)
   Return @Extended
EndFunc
Link to comment
Share on other sites

#include <String.au3>

_StringBetween ( $sString, $sStart, $sEnd [, $vCase [, $iSRE ]] )

Return Value

Success: A 0 based $array[0] contains the first found string.

so your index value goes from 0 to count -1 !!

For $String = 0 to $count - 1

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...