Jump to content

Expected a "=" operator in assignment statement when it exists

Recommended Posts

Whenever I try to run the following function
Func _P2P_Stop_Node()
    For $x = 0 to $max_connections step 1
        $Socket_Handle_array[$x] = -1
        $Node_Identifier_array[$x] = -1
        $Node_IP_array[$x] = -1
        $Node_Peer_Reachable_list[$x] = -1
    $max_connections = 0
    $Listening_Socket = ""
    $node_IP = ""
    $node_Port = ""
    $node_Identifier = -1
    $node_ext_IP = ""
    $Bootstrap_mode = ""
    $Bootstrap_max = 0
    $connectfunc = ""
    $recievefunc = ""
    $disconnectfunc = ""
    $newconnectionfunc = ""
    $messagefunc = ""
    $auxfunc = ""
    if $console_out = True then ConsoleWrite( @CRLF & "P2P_: Engine shutdown successful.")
I get this error:
Y:SIMNetworkingp2p.au3 (199) : ==> Expected a "=" operator in assignment statement.:
$Socket_Handle_array[$x] = -1
$Socket_Handle_array^ ERROR
There is clearly an = operator in the function, but for some reason the script is not detecting it?
(I'm using the latest beta)
Or am I missing something?
Edited by nullschritt
Link to comment
Share on other sites

Just guessing, but it looks like it is actually complaining about $Socket_Handle_array. Are you sure this is an array?

They're all arrays, and it complains about all of them. I was able to get it to function as desired by removing the array denoter, and just assigning the value of the whole variable to -1, then re-creating them as arrays when needed again. Though I should be able to set all the array values to -1, I don't know why it won't work that way.

Link to comment
Share on other sites

There is not nearly enough there for us to help you.  You need to post "workable" code.

As is, we are unable to run this function, and you have variables that seem to be magically defined outside of it....LOTS of variables...

I'd suggest passing in params, and including the line counts on the paste, so we can see context...give us code that works.

Number 4:


Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Does this give you the same error message?

Global $Socket_Handle_array[2], $max_connections = 1
For $x = 0 To $max_connections Step 1
    $Socket_Handle_array[$x] = -1

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

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

  • Recently Browsing   0 members

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