nht3004 Posted May 3, 2009 Share Posted May 3, 2009 This code doesnt work! IniWrite("Hello.txt", "Hello", "Checked", "True"); $ini=IniRead("Hello.txt","Hello","Checked"); MsgBox(0,"",$ini); I found no error then! for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
Developers Jos Posted May 3, 2009 Developers Share Posted May 3, 2009 Install the full SciTE4AutoIt3 package and hit F5 from SciTE. This will run au3check for you and tell you what is wrong with the syntax. Jos 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 More sharing options...
Moderators Melba23 Posted May 3, 2009 Moderators Share Posted May 3, 2009 nht3004,If you look at the error given in SciTE when you run your code, you see: "ERROR: IniRead() [built-in] called with wrong number of args".Then in the Help file you see: "IniRead ( "filename", "section", "key", "default" )".M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JackDinn Posted May 3, 2009 Share Posted May 3, 2009 no default value :- IniWrite("Hello.txt", "Hello", "Checked", "True"); $ini=IniRead("Hello.txt","Hello","Checked","Failed read" ); MsgBox(0,"",$ini); Thx all,Jack Dinn. JD's Auto Internet Speed Tester JD's Clip Catch (With Screen Shot Helper) Projects :- AutoIt - My projects My software never has bugs. It just develops random features. :-D Link to comment Share on other sites More sharing options...
FinalVersion Posted May 3, 2009 Share Posted May 3, 2009 IniWrite("Hello.txt", "Hello", "Checked", "True"); $ini=IniRead("Hello.txt","Hello", "Checked", "Read Fail") MsgBox(0,"",$ini); [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
nht3004 Posted May 3, 2009 Author Share Posted May 3, 2009 (edited) OK, I've put in Default value, but these codes don't work, either: Func doImport($fSource) If(StringRegExp($fSource, "[\\\w]+.snht", 0)==1) Then $ir=IniRead("temp.snht", "Hello", "There", "False"); alert($ir); Else alert("Invalid path!"); GUICtrlSetData($browseFileLink, ""); EndIf EndFunc doImport("D:\info.snht");oÝ÷ ØÌ¢!bꮢÛ^'Ú®¢×(uïuée£ÝÓêÞ I dont know why! Please help me, I really stuck! Edited May 3, 2009 by nht3004 for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 3, 2009 Moderators Share Posted May 3, 2009 nht3004,Ini File:[hello]There=This;Your code:IniRead("temp.snht", "Hello", "There", "False")M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
nht3004 Posted May 3, 2009 Author Share Posted May 3, 2009 (edited) nht3004, Ini File: [hello] There=This; Your code: IniRead("temp.snht", "Hello", "There", "False") M23Oh, it's my mistake when I type, actually the word is Hello, but it does not work! Here are my full scripts: Ini file: [Hello] This=There This code does not work: Func doImport($fSource) If(StringRegExp($fSource, "[\\\w]+.snht", 0)==1) Then $ir=IniRead("temp.snht", "Hello", "There", "False"); alert($ir); Else alert("Invalid Path!"); GUICtrlSetData($browseFileLink, ""); EndIf EndFuncoÝ÷ ض¬Â䱫¢+ÙÕ¹½%µÁ½ÉÐ ÀÌØíM½Õɤ($ÀÌØí¥Èõ%¹¥I ÅÕ½ÐíѵÀ¹Í¹¡ÐÅÕ½Ðì°ÅÕ½Ðí!±±¼ÅÕ½Ðì°ÅÕ½ÐíQ¡ÉÅÕ½Ðì°ÅÕ½Ðí±ÍÅÕ½Ðì¤ì(%±ÉÐ ÀÌØí¥È¤ì)¹Õ¹ It's weird! Edited May 3, 2009 by nht3004 for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
nht3004 Posted May 3, 2009 Author Share Posted May 3, 2009 Finally, it works and I know what was wrong with me, I experience that when you use IniRead(Path), Path must be full like C:\My.ini, when you use IniWrite(Path), path must be a file name that is the same directory with your program! for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 3, 2009 Moderators Share Posted May 3, 2009 nht3004,Personally, I always declare the ini file path at the beginning of the script and then use the variable in the IniWrite and IniRead statements:Global $sIniFile = "full_file_path" IniWrite($sIniFile,..... IniWrite($sIniFile,.....Solves the problem very neatly!M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
nht3004 Posted May 3, 2009 Author Share Posted May 3, 2009 nht3004, Personally, I always declare the ini file path at the beginning of the script and then use the variable in the IniWrite and IniRead statements:Global $sIniFile = "full_file_path" IniWrite($sIniFile,..... IniWrite($sIniFile,..... Solves the problem very neatly! M23Thanks for you exp, but why can't I use IniWrite with full path? It doesn't work, neither does IniRead without full path for(loop=0; loop<infinity; loop++) { alert('I love you'); } Link to comment Share on other sites More sharing options...
ProgAndy Posted May 3, 2009 Share Posted May 3, 2009 It does work with full path ... Possibly you miss some slashes or use a wrong path *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
CodyBarrett Posted May 3, 2009 Share Posted May 3, 2009 ... why can't you use @scriptdir ? it works for me EVERY time.. or some other directory marco [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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