Jump to content
Sign in to follow this  
fbk

Parameters from file?

Recommended Posts

fbk

Hi. I have a problem: I want to get a code from a txt, ini or other file, but the program use as string. I did test some variable, but doesn't work...

Thanx for help and sorry for my english.

CODE

If $CmdLine[0]=0 Then

If FileExists(@ScriptDir & "\" & "options.ini")=0 Then

ConsoleWrite( ip() & @CRLF & submask() )

filewrite($info, ip() & @CRLF & submask() )

Else

$opt=StringToBinary(IniRead(@ScriptDir & "\" & " options.ini","options","format","na"))

ConsoleWrite($opt)

filewrite($info, $opt)

EndIf

Else

If $CmdLine[1]="ip" Then

ConsoleWrite( ip())

filewrite($info, ip())

ElseIf $CmdLine[1]="submask" Then

ConsoleWrite( submask())

filewrite($info, submask())

Else

ConsoleWrite("Érvénytelen paraméter!")

filewrite($info, "Érvénytelen paraméter!")

EndIf

EndIf

Edited by fbk

Share this post


Link to post
Share on other sites
PsaltyDS

You didn't say what you wanted the "code" to be. If StringToBinary() isn't getting it, what did you want the string converted to?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
fbk

You didn't say what you wanted the "code" to be. If StringToBinary() isn't getting it, what did you want the string converted to?

:)

CODE
[options]

format="IP: "ip()

It's the ini file... Edited by fbk

Share this post


Link to post
Share on other sites
PsaltyDS

CODE
[options]

format="IP: "ip()

It's the ini file...
You mean you want to put the literal AutoIt function call in the ini file? I guess you could try Call($opt)... seems like an awfully crunchy way to do things, though...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
fbk

You mean you want to put the literal AutoIt function call in the ini file? I guess you could try Call($opt)... seems like an awfully crunchy way to do things, though...

:)

It doesn't work. The return value: 0

Share this post


Link to post
Share on other sites
PsaltyDS

It doesn't work. The return value: 0

I give up... my crystal ball isn't working here...

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×