Jump to content
Sign in to follow this  
Xav

IniWrite/IniRead Help plz...

Recommended Posts

Xav

Hi dodes,

How can it "COPY" or "paste" :

$Write = IniWrite ( $SettingsFile, 'Friends', 'Sms', '"^v"' )

somethin like that send("^v")...

$Read = IniRead ( $SettingsFile, 'Friends', 'Sms', "ERROR" )

can "iniread" read only a part of sentence .

ex .: CanThatWorkPlease. "That will read only 'WORK'"

Thanks for any helps.

i did'nt write autoit's ben a while =O!

Edited by Xav

Share this post


Link to post
Share on other sites
Malkey

Hi dodes,

How can it "COPY" or "paste" :

$Write = IniWrite ( $SettingsFile, 'Friends', 'Sms', '"^v"' )

somethin like that send("^v")...

$Read = IniRead ( $SettingsFile, 'Friends', 'Sms', "ERROR" )

can "iniread" read only a part of sentence .

ex .: CanThatWorkPlease. "That will read only 'WORK'"

Thanks for any helps.

i did'nt write autoit's ben a while =O!

This link is one method of copying highlighted text, which can be used in conjunction with this script.

#714806

;

Local $sRead, $Copied = "CanThatWorkPlease"

ClipPut($Copied)

IniWrite(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', ClipGet())

$sRead = IniRead(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', "ERROR")

; Use any of the String...() functions to manipulate the contents of the variable, $sRead. 
If StringInStr($sRead, "work", 2) <> 0 Then $sRead = "WORK"

MsgBox(0, "Result", $sRead)
;

Share this post


Link to post
Share on other sites
Xav

Thanks guys.!

just a litle last thing ...

Right after it read "work" do it can just endfunc

;
Func sms()
Local $sRead, $Copied = "CanThatWorkPlease"

ClipPut($Copied)

IniWrite(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', ClipGet())

$sRead = IniRead(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', "ERROR")

; Use any of the String...() functions to manipulate the contents of the variable, $sRead. 
If StringInStr($sRead, "work", 2) <> 0 Then $sRead = "WORK"
--
Right there , if "WORK" is wrote , it will end funcs... Elseif Does'nt work?
--
MsgBox(0, "Result", $sRead)
endfunc
;

Share this post


Link to post
Share on other sites
Malkey

Thanks guys.!

just a litle last thing ...

Right after it read "work" do it can just endfunc

;
Func sms()
Local $sRead, $Copied = "CanThatWorkPlease"

ClipPut($Copied)

IniWrite(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', ClipGet())

$sRead = IniRead(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', "ERROR")

; Use any of the String...() functions to manipulate the contents of the variable, $sRead. 
If StringInStr($sRead, "work", 2) <> 0 Then $sRead = "WORK"
--
Right there , if "WORK" is wrote , it will end funcs... Elseif Does'nt work?
--
MsgBox(0, "Result", $sRead)
endfunc
;

May I suggest you play with, experiment with the examples in the help file under:-

If...ElseIf...Else...EndIf ; and,

Func...Return...EndFunc.

Try to work out what is happening in the examples and why.

The help file is a better friend than I am, Gunga Din - mon ami.

Share this post


Link to post
Share on other sites
Xav

Something like this , does not work

Func Work()
Local $sRead, $Copied = "CanThatWorkPlease"

ClipPut($Copied)

IniWrite(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', ClipGet())

$sRead = IniRead(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', "ERROR")

; Use any of the String...() functions to manipulate the contents of the variable, $sRead. 
If StringInStr($sRead, "work", 2) <> 0 Then
endfunc
ElseIf StringInStr($sRead, "work", 2) <> 0 Then
Thanks ()
endfunc

Func Thanks()
Send("{ENTER}")
endfunc
Edited by Xav

Share this post


Link to post
Share on other sites
Xav

Help some1 =)

Edited by Xav

Share this post


Link to post
Share on other sites
Malkey

Try this.

;
MsgBox(0, "Result", Work()) ; Calls Work() function and displays the function's return value in message box.

Func Work()
    Local $sRead, $Copied = "CanThatWorkPlease" ; "CanThatPlease" ;

    ClipPut($Copied) ; Puts contents of variable $Copied onto clipboard.

    IniWrite(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', ClipGet()); Gets contents of clipboard and writes to myfile.ini file.

    $sRead = IniRead(@ScriptDir & "\myfile.ini", 'Friends', 'Sms', "ERROR"); Reads Friends section of myfile.ini file & returns value of Sms.

    ; Use any of the String...() functions to manipulate the contents of the variable, $sRead.
    If StringInStr($sRead, "work", 2) <> 0 Then 
        Return "WORK" ; This statement or just "Return" will end this function if the sub-string "work" is in the string contained in the variable $sRead.

    ;ElseIf StringInStr($sRead, "WhatThe", 2) <> 0 Then ; If the condition of the above "If" is True, then this line is NOT execute.
        ;   Return "Missed it completely"

    ;Else
        ;   Return "Not Work" ; If the conditions of the above "If" and "ElseIf" are false, then this line is executed.
        
    EndIf ; This is required to complete the "If...ElseIf...Else...EndIf" statement.

    Return Thanks()
EndFunc   ;==>Work

Func Thanks()
    Return "{ENTER}"
EndFunc   ;==>Thanks
;

Share this post


Link to post
Share on other sites
Xav

Thanks !!!!

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  

×