Sign in to follow this  
Followers 0
ParoXsitiC

IniRead won't compute "true" true or false values.

3 posts in this topic

#1 ·  Posted (edited)

Global $UsersFile = @TempDir & "\Info" & Round(Random(0, 100), 0) & ".ini"

$Test = IniRead($UsersFile, "Options", "BeFalse", False)
Check($Test)

IniWrite($UsersFile, "Options", "BeFalse", False)
$Test = IniRead($UsersFile, "Options", "BeFalse", False)
Check($Test)

$Test = IniRead($UsersFile, "Options", "BeTrue", True)
Check($Test)

IniWrite($UsersFile, "Options", "BeTrue", True)
$Test = IniRead($UsersFile, "Options", "BeTrue", True)
Check($Test)



Func Check($Test)
    If $Test Then
        ConsoleWrite("It is true!!!!!" & @CRLF)
    Else
        ConsoleWrite("It is false!!!!!" & @CRLF)
    EndIf
EndFunc   ;==>Check

It should display

It is false!!!!!

It is false!!!!!

It is true!!!!!

It is true!!!!!

But displays:

It is true!!!!!

It is true!!!!!

It is true!!!!!

It is true!!!!!

Is this behavior normal? is it expected? how do I change it? Edited by ParoXsitiC

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Delite keyes before testing

Func Check($Test)
    If $Test = "True" Then
        ConsoleWrite("It is true!!!!!" & @CRLF)
    Else
        ConsoleWrite("It is false!!!!!" & @CRLF)
    EndIf
EndFunc   ;==>Check
Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

IniRead always returns a string, not a boolean value.

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