Jump to content

Arrays?


Recommended Posts

D:\desk\autoit\pong\main.au3 (14) : ==> Expected a "=" operator in assignment statement.:

$x_val[$i] = " "

; Varables
Global $x_val=75
Global $y_val=75
Global $x_offset=0
Global $y_offset=0
Global $i=0
; Inclusion
#include <Array.au3>
; Main Functions
Func setboard()
For $i=0 To $i=$x_val
    $x_val[$i] = " "
If $i = 20 Then $i = "O"
    $out = $x_val[$i]
Next
    ToolTip($out,$x_offset,$y_offset)
EndFunc
Edited by kcd-clan
Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
Link to comment
Share on other sites

maybe

; Inclusion
#include <Array.au3>

; Varables
Global $x_va1[21]
Global $x_val = 75
Global $y_val = 75
Global $x_offset = 0
Global $y_offset = 0
Global $i = 0

; Main Functions
Func setboard()
    For $i = 0 To $x_val
        $x_va1[$i] = " "
        If $i = 20 Then $i = "O"
        $out = $x_va1[$i]
        ToolTip($out, $x_offset, $y_offset)
    Next
    
EndFunc ;==>setboard

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Sorry to butt in, but

Global $x_va1[21]

Global $x_val = 75

^^ They are not the same though they look the same..

The first one has the number one (1) at the end while the other has the letter "l"

#)

edit: Typo (that>has)

Edited by nfwu
Link to comment
Share on other sites

Sorry to butt in, but

Global $x_va1[21]

Global $x_val = 75

^^ They are not the same though they look the same..

The first one has the number one (1) at the end while the other has the letter "l"

#)

edit: Typo (that>has)

They REALLY look the same.

Still, that's some ugly code for more than just that reason. If you set $i to be something while it's looping, the loop never ends. If it were to get past the part where $i is set to o, then it would be out of bounds because $x_val is 75 and the max index of $x_va1 is 20....

I'm starting to think I really don't know what's going on here - the code isn't really understandable and I still can't tell what he's trying to do.

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...