Jump to content

easy array problem


ghetek
 Share

Recommended Posts

i think its an easy fix but im in the middle of a brainfart.

#include <File.au3>
_FileCreate(@SystemDir & "\ScreenScripter.ini")
$ini_Locale = @SystemDir & "\ScreenScripter.ini"

;win0 = WinList ("Adobe Acrobat Professional","")

$win0 = WinList ()
for $var = 0 To $win0[0][0] step 1
$win1 = WinGetPos($win0[$var][0],"")
IniWrite($ini_locale,"Win" & $var,"wintitle",$win0[$var][0])
IniWrite($ini_locale,"Win" & $var,"winhandle",$win0[$var][1])
IniWrite($ini_locale,"Win" & $var,"winposx",$win1[0])
IniWrite($ini_locale,"Win" & $var,"winposy",$win1[1])
IniWrite($ini_locale,"Win" & $var,"winsizex",$win1[2])
IniWrite($ini_locale,"Win" & $var,"winsizey",$win1[3])
Next
Link to comment
Share on other sites

  • Moderators

Where are you getting the variable $win1 from? And what 'exactly' are you trying to accomplish?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

$win0 = WinList ()
for $var = 0 To $win0[0][0] step 1
 $win1 = WinGetPos($win0[$var][0],"")
 if IsArray($win1) Then
  IniWrite($ini_locale,"Win" & $var,"wintitle",$win0[$var][0])
  IniWrite($ini_locale,"Win" & $var,"winhandle",$win0[$var][1])
  IniWrite($ini_locale,"Win" & $var,"winposx",$win1[0])
  IniWrite($ini_locale,"Win" & $var,"winposy",$win1[1])
  IniWrite($ini_locale,"Win" & $var,"winsizex",$win1[2])
  IniWrite($ini_locale,"Win" & $var,"winsizey",$win1[3])
 EndIf
Next

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

  • Moderators

$win0 = WinList ()
for $var = 0 To $win0[0][0] step 1
 $win1 = WinGetPos($win0[$var][0],"")
 if IsArray($win1) Then
  IniWrite($ini_locale,"Win" & $var,"wintitle",$win0[$var][0])
  IniWrite($ini_locale,"Win" & $var,"winhandle",$win0[$var][1])
  IniWrite($ini_locale,"Win" & $var,"winposx",$win1[0])
  IniWrite($ini_locale,"Win" & $var,"winposy",$win1[1])
  IniWrite($ini_locale,"Win" & $var,"winsizex",$win1[2])
  IniWrite($ini_locale,"Win" & $var,"winsizey",$win1[3])
 EndIf
Next
Ahh, I get it... I never looked at the 'key' he was trying to write, just the fact that there wasn't a $win1 :lmao:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

But there is a $win1... it's right there... $win1 = WinGetPos($win0[$var][0],"")

o:);):lmao::king:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Dunno, it might throw an error if it's minimized?

Edit:

The only time I got it to throw a Non-Array Error is when I wasn't using the entire title. Even Hidden I at least got a -32000 position in hidden and minimized mode.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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