Synapse Posted November 20, 2004 Share Posted November 20, 2004 (edited) Answer has been found.. nevermind... ok.. kinda simple.. but i can't figure this out...on form_load i have my program read from an ini file then if "list" = "[NOT FOUND]" I need it to not add it to my listbox... heres the code that i have so far... i want to make it simpler and not put If then statements all the way down...list = INITool1.GetFromINI("Track1", "Location", App.Path & "\settings.ini")playlist.AddItem listlist = INITool1.GetFromINI("Track2", "Location", App.Path & "\settings.ini")playlist.AddItem listlist = INITool1.GetFromINI("Track3", "Location", App.Path & "\settings.ini")playlist.AddItem listso lets say... if for Track2 the user didn't put anything in it.. so it returns the string "[NOT FOUND]" but Track3 has something. If i use something like a Do Until event, it will stop on Track2.. insted of reading track 3 and so on..any ideas?ThanksMy Solution...For i = 1 To 20list = INITool1.GetFromINI("Track" & i, "Location", App.Path & "\settings.ini")If list = "[NOT FOUND]" Then'do nothing and don't add to the listElseplaylist.AddItem listEnd IfNext iEnd Sub Edited November 20, 2004 by Bi0haZarD Link to comment Share on other sites More sharing options...
maxXPsoft Posted November 22, 2004 Share Posted November 22, 2004 Wouldn't just parsing the dir and read in all files be simpler than an ini? That way no configuration just run it. Link to comment Share on other sites More sharing options...
Synapse Posted November 22, 2004 Author Share Posted November 22, 2004 If i just parse the folder for all .mp3's then it will come back into my listbox as "c:\my music\rock\metallica\Metallica - Master of puppets.mp3" and with an ini i can let the user pick the name of the song.. so insted of seeing the complete path they can set it to say "Metallica - Master of Puppets" it just makes it look a bit cleaner..this is for my Unattended Audio Player btw.. so thats why i only have it support 20 MP3's since that should be plenty, and whoever makes the CD can set the names of the tracks and it'll look better Link to comment Share on other sites More sharing options...
maxXPsoft Posted November 22, 2004 Share Posted November 22, 2004 (edited) Ok I wasn't telling you how to do it just suggesting ideas. But thats possible also to strip file path returning only name. Or even load the dir to a File1 filter out .exeStill waiting to try your next versionEDIT: One other idea maybe, After file is played delete it from dir?Then If I used it at different place it would start next Edited November 22, 2004 by maxXPsoft Link to comment Share on other sites More sharing options...
maxXPsoft Posted November 22, 2004 Share Posted November 22, 2004 The reason I was suggesting remove the ini is 'INITool1.GetFromINI'I think thats a separate exe isn't it? Link to comment Share on other sites More sharing options...
Synapse Posted November 22, 2004 Author Share Posted November 22, 2004 I know Suggestions are always welcome. and yea, i could always strip out the path to get more of a play all files in the folder.I don't see what the point of having it delete the file upon finishing the song would be. this unattended player is to go into the $OEM$ folder so it gets copied to the hard drive and played.. then at the end of the installation if you have your install.cmd (or whatever file) to delete the c:\install folder it deletes the songs and player off the hard drive. if the files were to stay on the CD, it would proably slow down the installation of your applications since it would constantly have to read from the CD. and it wouldn't be able to delete the songs from the CD. Link to comment Share on other sites More sharing options...
Synapse Posted November 22, 2004 Author Share Posted November 22, 2004 The reason I was suggesting remove the ini is 'INITool1.GetFromINI'I think thats a separate exe isn't it?no its a OCX Control file, i haven't tested to see if i have to bundle it.. i hope i don't since it would mean putting it in the system32 folder by putting it in "$OEM$\$$\System32" Link to comment Share on other sites More sharing options...
maxXPsoft Posted November 22, 2004 Share Posted November 22, 2004 ahhh,Yep very possible to use it will need to be included. I have seen a tool called initool.exe and was wondering, I have all my ini modding done by a .bas file included within my app. I searched for years for the right ini thing and came across this after trying nearly all.Do you have a link to that ocx I can check it out?Yeah this probably wouldn't play at User.cmd is reason I was thinking of delete file after play, then at runoncex start again new, I been experimenting play mp3's at different points with my app, still a work in progress... Link to comment Share on other sites More sharing options...
Synapse Posted November 22, 2004 Author Share Posted November 22, 2004 its very simple, although the people that made it aren't around anymore this guy has a very easy to follow instructions.http://www.martin2k.co.uk/vb6/tips/x6.phpyou got a link to that bas file.. i really don't want to have to include an OCX. i want to make this as stand alone as possible. Link to comment Share on other sites More sharing options...
maxXPsoft Posted November 23, 2004 Share Posted November 23, 2004 Sorry was uploading my new version UnattendXP then had to search.I've done some modifying to this myself adding a couple features if you want it then MSG me and leave email and I'll send.WriteToIniDim MyX As String, MyY As String MyX = Me.Top WriteToIni AddBackslash(App.Path) & "UnattendXP.ini", "ABOUT", "MainX", MyXGetFromIni MyX = GetFromIni(AddBackslash(App.Path) & "UnattendXP.ini", "ABOUT", "MainX")Get and save as IniMod.basGet the last post by Inverso, this has proved to be the easiest least confusing ini routine I have ever had. and I have tried them all Link to comment Share on other sites More sharing options...
maxXPsoft Posted November 23, 2004 Share Posted November 23, 2004 The AddBackslash routine which is great Just add it in the Public Functions seection of the inimod.basPublic Function AddBackslash(strPath As String) As String'Receives the App.Path and returns a path containing backslash'USAGE: SomePath = AddBackslash(App.Path) & "YourFile.xxx" If Right$(strPath, 1) <> "\" Then AddBackslash = strPath & "\" Else AddBackslash = strPath End IfEnd Function Link to comment Share on other sites More sharing options...
Tarun Posted November 23, 2004 Share Posted November 23, 2004 For i = 1 To 20list = INITool1.GetFromINI("Track" & i, "Location", App.Path & "\settings.ini")If list = "[NOT FOUND]" Then'do nothing and don't add to the listElseplaylist.AddItem listEnd IfNext iEnd SubJust a minor tweak, but you might want to try...For i = 1 To 20 list = INITool1.GetFromINI("Track" & i, "Location", App.Path & "\settings.ini") If list <> "[NOT FOUND]" Then playlist.AddItem list End If Next iEnd Sub Link to comment Share on other sites More sharing options...
Synapse Posted November 23, 2004 Author Share Posted November 23, 2004 @maxXPsoftits ok, I was making dinner. lolooh! i like this A LOT! thanks. Link to comment Share on other sites More sharing options...
Synapse Posted November 23, 2004 Author Share Posted November 23, 2004 Just a minor tweak, but you might want to try...heh, revised that this mornin, was tired as hell when i coded it and didn't get around to changing it. thanks for pointing it out Link to comment Share on other sites More sharing options...
Tarun Posted November 23, 2004 Share Posted November 23, 2004 What methods do you use to compile? I personally use Compile to P-Code, as it removes a lot of needless data from your application, literally cutting the size in half and doubling the speed. 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