Sign in to follow this  
Followers 0
sc4ry

var error

5 posts in this topic

hey,

i don´t understand, whats going wrong.

i want to start different tools within my program. you can select them on first start of the program and after that it is saved to an ini-file.

on next boot, my program will be automaticly loaded and will start the tools which were selectet and saved in the ini.

but then the following error appear

---------------------------
AutoIt Error
---------------------------
Line 0  (File "F:\AutoScrIpTs\Henkel\S.T.A.R.T.E.R_V3.exe"):

For $i = 1 To $var[0][0]
For $i = 1 To $var^ ERROR

Error: Subscript used with non-Array variable.
---------------------------
OK   
---------------------------

But if i run my tool after the start of my pc, there will be NO error and all my tools are running form my script.

here is the error (but only when my scipt starts after the boot)

;starte programme
 
    If $RunOwnTools = "1" Then
            $var = IniReadSection ( $ini, "Run own tools after Start")
            For $i = 1 To $var[0][0]
                Run(@ComSpec & ' /c "' & $var[$i][1] & '"', "", @SW_HIDE)
            Next
        Else
    EndIf

and here is the whole script

[autoit]

; S.T.A.R.T.E.R V.3

;

;

Share this post


Link to post
Share on other sites



pretty sure the ini file isn't found thus $var isn;t an Array

Test for @error=0 to ensure the IniReadSection() worked ...


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

because there are some other functions before my scirpt run the tools, i know, that the ini must be found, else the other actions could not be progressed, right?

and the ini is there, you can test it yourself.

compile this script, start the program, go to tool-settings and add some tools, click 2 times ok.

after that run the script second time ... all your tools will start.

then restart your pc (script is only in autostart folder) ... the script will run with this error.

confrim error and after that run the script again ... all you tools will start again ... you see?

that what i can´t catch

Share this post


Link to post
Share on other sites

because there are some other functions before my scirpt run the tools, i know, that the ini must be found, else the other actions could not be progressed, right?

and the ini is there, you can test it yourself.

compile this script, start the program, go to tool-settings and add some tools, click 2 times ok.

after that run the script second time ... all your tools will start.

then restart your pc (script is only in autostart folder) ... the script will run with this error.

confrim error and after that run the script again ... all you tools will start again ... you see?

that what i can´t catch

Just put the FileExist() in your script with an msgbox() and test it yourself... I cannot think of any other reason ..


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

ok, it runs perfectly, if i add @scriptdir =)

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