Sign in to follow this  
Followers 0
Minikori

Don't know why I get an error

2 posts in this topic

Hello, I'm declaring variables with a For...Next, but I get a syntax error whenever I execute the program. My code:

$Colors = StringSplit("0xFF0000|0x0000FF|0x00FF00|0xFFFF00|0x000000|0xFFFFFF|0xAA00AA|0xFF00AA", "|")

For $x = 1 To $Colors[0]
    Dim $ColorBut[$x]
    Dim $Color[$x] = $Colors[$x]
Next

I get a syntax error pointing to the first $ in $Colors[$x]. Anyone know why this is happening?


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites



Well not sure what's meant to be happening. This works.

Dim $Colors = StringSplit("0xFF0000|0x0000FF|0x00FF00|0xFFFF00|0x000000|0xFFFFFF|0xAA00AA|0xFF00AA", "|")
Dim $ColorBut[$Colors[0]+1]
Dim $color[$Colors[0]+1]

For $x = 1 To $Colors[0]
    $Color[$x] = $Colors[$x]
Next

Maybe post your full code?

Cheers,

Brett

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