aGorilla Posted April 11, 2008 Posted April 11, 2008 How do I convert the following to a constant? Global $FILESET[4] $FILESET[0]="connect.ini" $FILESET[1]="folder1.ico" $FILESET[2]="folder2.ico" $FILESET[3]="folder3.ico" While I'm here... is there a 'style guideline' for AutoIt code? Search AutoItScript.com via Google
aGorilla Posted April 11, 2008 Author Posted April 11, 2008 I'm not very good with arrays, but I belive you can use: Global Const $FileSet["connect.ini", "folder1.ico", "folder2.ico", "folder3.ico"] If this doesn't work sorry, but im not sure 100% of the syntax for that. Hope it helps! I was hoping it would be something like that, but that gives me the same error that all of my other attempts led to... Error: Array variable subscript badly formatted. Thanks much for trying though. Search AutoItScript.com via Google
NELyon Posted April 11, 2008 Posted April 11, 2008 Global Const $FileSet[4] = ["connect.ini", "folder1.ico", "folder2.ico", "folder3.ico"] Tried and tested.
Swift Posted April 11, 2008 Posted April 11, 2008 (edited) Aha, Sorry Kenton, I knew I was missing something! I deleted my post so it incase others see it, they don't get the wrong info! Edited April 11, 2008 by Swift
aGorilla Posted April 11, 2008 Author Posted April 11, 2008 (edited) After a few more tries, I figured it out. Global Const $FILESET[4]=["connect.ini","folder1.ico","folder2.ico","folder3.ico"] Make sure the dimension covers the number of values, or more. Oddly enough, it's not 0-based, even though array access is. Edit: and KentonBomb confirms it - should have reloaded before posting. Edited April 11, 2008 by aGorilla Search AutoItScript.com via Google
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now