Jump to content
Sign in to follow this  

Help Loop

Recommended Posts


I try to learn Dim and Loop in Programming. I wrote this Loop but don't work in Autoit.I run this code at purebasic:


    Dim A.b (9)
    For i.b = 0 To 9
        A (i) = i
        Debug i


My code in Autoit:

Dim $A [10]
For $i = 0 to 9
   $A [$i] = $i

Local $FileOpen = @ScriptDir & "\text.txt"
Local $FileWrite = FileWrite ($FileOpen, $A [$i])

I want write $A numbers in a text file.

I need Guide, Can anyone give me an example how can use DIM $A [] with string values?


Share this post

Link to post
Share on other sites

Just in case if you're wondering why your first code didn't work. $i is only accessible within the For loop, yet you tried to use it outside. :whistle:


A minesweeper game created in autoit, source available.


An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...