Sign in to follow this  
Followers 0
Shorty

New Line

8 posts in this topic

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. :)

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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! :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Shorty

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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]

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  
Followers 0