Sign in to follow this  
Followers 0
behdadsoft

Help Loop

6 posts in this topic

Hello.

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
      Next

 

My code in Autoit:

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

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?

Thanks

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Thanks John, Now Work. :)

Edited by behdadsoft

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:


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

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

Thanks AlmarM for Your Hint. :)

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