Jump to content

IniRead in Functions


Zephir
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

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