Doppio Posted October 27, 2006 Share Posted October 27, 2006 I have a shortcut called ATS that when opened with notepad shows the following:[Profile]ID=WSVersion=6[Telnet3270]HostName=10.2.41.41LUName=R00N405Security=NAutoReconnect=Y[Communication]Link=telnet3270[3270]QueryReplyMode=AutoHostCodePage=037-U[Keyboard]CuaKeyboard=1Language=United-StatesDefaultKeyboard=$$BLANK$$If I go to the shortcut properties it says that it opens with ( PCSWS.EXE ) ,which is a mainframe application that reads these settings and configures a mainframe session when openned.My question to anyone out there, how can I write a script that would do the same as the ATS shortcut?Thank you. Link to comment Share on other sites More sharing options...
spyrorocks Posted October 27, 2006 Share Posted October 27, 2006 well, if you want to read/write settings and stuff to ini files, look at the following functions in your autoit help file: IniWrite ( "filename", "section", "key", "value" ) IniRead ( "filename", "section", "key", "default" ) IniDelete ( "filename", "section" [, "key"] ) Hope that helps [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
Doppio Posted October 27, 2006 Author Share Posted October 27, 2006 well, if you want to read/write settings and stuff to ini files, look at the following functions in your autoit help file: IniWrite ( "filename", "section", "key", "value" ) IniRead ( "filename", "section", "key", "default" ) IniDelete ( "filename", "section" [, "key"] ) Hope that helps I want ( PCSWS.EXE ) my mainframe application to read the settings from an AutoIt script, and I just can't figure out how to do it. I'm aware of IniRead and IniWrite, I'm not looking to read and write to an ini file I want my script to be able to have this settings in it, like this: #include <GuiConstants.au3> [Profile] ID=WS Version=6 [Telnet3270] HostName=10.2.41.41 LUName=R00N405 Security=N AutoReconnect=Y [Communication] Link=telnet3270 [3270] QueryReplyMode=Auto HostCodePage=037-U [Keyboard] CuaKeyboard=1 Language=United-States DefaultKeyboard=$$BLANK$$ run (C:\Program Files\IBM\Personal Communications\pcsws.exe) This is the best way I can explain it, I'm sorry If cI can't be more precise. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 27, 2006 Moderators Share Posted October 27, 2006 I want ( PCSWS.EXE ) my mainframe application to read the settings from an AutoIt script, and I just can't figure out how to do it. I'm aware of IniRead and IniWrite, I'm not looking to read and write to an ini file I want my script to be able to have this settings in it, like this: #include <GuiConstants.au3> [Profile] ID=WS Version=6 [Telnet3270] HostName=10.2.41.41 LUName=R00N405 Security=N AutoReconnect=Y [Communication] Link=telnet3270 [3270] QueryReplyMode=Auto HostCodePage=037-U [Keyboard] CuaKeyboard=1 Language=United-States DefaultKeyboard=$$BLANK$$ run (C:\Program Files\IBM\Personal Communications\pcsws.exe) This is the best way I can explain it, I'm sorry If cI can't be more precise.Sounds like you just want to make them an array: Dim $Profile[2][2] $Profile[1][0] = 'ID' $Profile[1][1] = 'WS' ;Etc... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Doppio Posted October 27, 2006 Author Share Posted October 27, 2006 Sounds like you just want to make them an array: Dim $Profile[2][2] $Profile[1][0] = 'ID' $Profile[1][1] = 'WS' ;Etc... tha's what I want I will try it and let you know. Link to comment Share on other sites More sharing options...
Doppio Posted October 27, 2006 Author Share Posted October 27, 2006 I'm having problems understanding how to do it, can you please do the five first lines? thank you Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 27, 2006 Moderators Share Posted October 27, 2006 (edited) I'm having problems understanding how to do it, can you please do the five first lines? thank youDim $Profile[3][2] $Profile[1][0] = 'ID';[0] will be the "key" $Profile[1][1] = 'WS';[1] will be the value $Profile[2][0] = 'Version' $Profile[2][1] = 6 Dim $Telnet3270[5][2] $Telnet3270[1][0] = 'HostName' $Telnet3270[1][1] = 'W10.2.41.41' $Telnet3270[2][0] = 'LUName' $Telnet3270[2][1] = 'R00N405' $Telnet3270[3][0] = 'Security' $Telnet3270[3][1] = 'N' $Telnet3270[4][0] = 'AutoReconnect' $Telnet3270[4][1] = 'Y' ;The above is the long way to do Dim $Profile = IniReadSection('FileLocation.ini', 'Profile') Dim $Telnet3270 = IniReadSection('FileLocation.ini', 'Telnet3270') Edit: Not only is IniReadSection() shorter, but more efficient, as I made 2 errors originally in displaying it Edited October 27, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Doppio Posted October 27, 2006 Author Share Posted October 27, 2006 I will try and let you know. Thank you again. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now