Sign in to follow this  
Followers 0
Zephir

IniRead in Functions

3 posts in this topic

Hey,

im not sure if it is a bug or not. But if u make a Script that reads an ini file to variables it works fine:

Example:

$var = IniRead("blah", "blub", " bli", 0)

However, as soon as you wrap the order in a function it wont work saying that the variable $var is used wihtouh being declared

Example:

Func _loadExternalData()

$var = IniRead("blah", "blub", " bli", 0)

EndFunc

I does work if u declare the variable $var first (Dim $var for example). I just dont understand why it doesnt work as soon as u plac the iniread segment into a function.

Sorry if it is not a bug or has been reported before.

Greetz, Zephir

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

When you are not sure its a Bug then please post it in the support forum first. (I will move it)

When you use a variable in a Func without a Global scope decleration , the variable will have a local scope, which means it will only "exist" inside the Func..EndFunc.

:)

Edited by JdeB

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

Share this post


Link to post
Share on other sites

When you are not sure its a Bug then please post it in the support forum first. (I will move it)

When you use a variable in a Func without a Global scope decleration , the variable will have a local scope, which means it will only "exist" inside the Func..EndFunc.

:)

sorry for posting in wrong place

and thanks for explanation

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