Shorty Posted February 24, 2009 Posted February 24, 2009 I am writing a program that grabs the song title from VLC media player when I'm playing streams so I can write down the name of songs I like. I need the FileWrite Function to write a new line to the file after it writes the title to my file so it isn't one giant string but I cant seem to figure out how to do that. Any help would be great.
bo8ster Posted February 24, 2009 Posted February 24, 2009 have a look at @CR and @CRLF in the help file. Usage like - ConsoleWrite("The button is " & $oButton & @CRLF) Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
Moderators Melba23 Posted February 24, 2009 Moderators Posted February 24, 2009 Shorty,Look at FileWriteLine - it adds the @CRLF for you.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
Shorty Posted February 24, 2009 Author Posted February 24, 2009 have a look at @CR and @CRLF in the help file.Usage like - ConsoleWrite("The button is " & $oButton & @CRLF)Oops, Stupid mistake, I had that earlier just used incorrectly rofl. Thanks Alot!
Shorty Posted February 24, 2009 Author Posted February 24, 2009 (edited) Now I have another question. How can I make it so that it wont write repeats to the file? (Such As The Same Song Twice) Edited February 24, 2009 by Shorty
bo8ster Posted February 24, 2009 Posted February 24, 2009 I think you'll have to check that manually. You can use an array of strings check each element before you insert it. There is no distinct function here that I know of Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
Shorty Posted February 24, 2009 Author Posted February 24, 2009 I know there isn't a function to do it, Let me reword. What would be a basic layout to check if the title is already listed or not?
bo8ster Posted February 24, 2009 Posted February 24, 2009 Here is a very quick example - not the best i'm sure but its a good start. It may not compile but i'm sure you can fix that. The idea is to search the array for the item to see if its there before you try to enter a new item. Once you are done you can use a loop to write out the array to a file. Global $aArray[1] aArray[1] = "First Title" ; you need to do this to make sure an array is declared. Global $inputText ; you can fill this if (_ArraySearch($aArray, $inputText) == -1) ; see if its there or not - i'm sure there is a better way to do this _ArrayInsert($aArray, $inputText) EndIf Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
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