Jump to content

Help Loop


Recommended Posts

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

Link to comment
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.

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