Jump to content

Array error


vin1
 Share

Recommended Posts

I have this script that gives an error, how to fix it?

 

#include <File.au3>
$file = @DesktopDir & "\temp.txt"
$file_output = @DesktopDir & "\output.txt"

Local $array[1]
_FileReadToArray($file, $array)
$hOutput = FileOpen($file_output, 2)
$iMultiplier = 3
Global $aTemp, $Text
For $i = 1 To $array[0]
    $aTemp = StringSplit($array[$i], @TAB)
    If Not Mod($i, 50) Then $iMultiplier += 1
    $text = ""
    For $j = 1 To $aTemp[0]
        $text &= $aTemp[$j] * $iMultiplier & @TAB
    Next
    $text = StringTrimRight($text, 1)
    FileWriteLine($hOutput, $text)
Next

FileClose($hOutput)

 

ylcag.png

Link to comment
Share on other sites

  • Moderators

@vin1 in the future, do not hijack other people's threads, please.

As to your code, do an _ArrayDisplay on your array after the _FileReadToArray call. Is the value for $array[0] what you expect it to be?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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