Sign in to follow this  
Followers 0
Innovative

Expected a "=" operator in assignment statement?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



what version of AutoIt are you running?

My 3.2.10 runs this fine with a warning about $Link array not being declared.

You might declare it at the begining:

Dim $Link[1000]


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

$a[0]

You'll get the same error from a script with just this line alone. The problem here (as Malkey noticed) is that you're trying to use an undeclared variable ($Link). Honestly, that's an odd error message to be throwing, though >_>


[ WinINet.au3 | Array.au3 (Optimized) | _UnixTimeParse() ]

Share this post


Link to post
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

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  
Followers 0