I'm trying to make an application which does something based on an argument provided in a .lnk flie.
My problem is that the application is slow to load, probably because it has to read the "actions.ini" every time it starts.
Is there a way to talk to an already running program using .lnk files?
Thanks
How big is your "actions.ini"?
See my beta demo ini editor...
it loads a small (10 lines or so" ini file with the most important things....
You could create a smal ini.file containing the file names of the lnk, and have the app "read" them during executions, has needed...
This would problebly cause some files to be read several times, but should not cause a too big lagg time...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
If you want to have an idea of how long it would take to load a BIG ini file, create a dumy ini file ( any textfile will do) and name it something.ini and load it with my app...
In my app the load time is NOT optimum, as I gave a small (50ms) time gap beetween each line read to create the "Load-write" effect..
Still it will be only a few seconds to load such a BIG ini file...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
I like to read the whole file into an array list and then search for the item that is needed, like so.....
Code:
If FileExist( "Config.ini" ) Then AlConfig.Clear ' Clear the current configuration FileOpen( ConfigFile , "Config.ini" , cRead,, cASCII ) ' Open config file and read into the current configuration Data = FileRead( ConfigFile ) DoUntil Data = EOF AlConfig.Add( Data ) Data = FileRead( ConfigFile ) Loop FileClose( ConfigFile )
Index = AlConfig.IndexOf( "CONFIG" ) ' Find start of the config settings AlConfig.Item( Index + 1 ) = "AutoSchedule=Enabled"' Update Autoschedule setting Else
CreateConfig ' If config file is missing create a new file before updating EndIf
I find that doing it this way is fast, it also releases the file for other uses and it is easy to find the item you require using IndexOf on the array list which in this example is called AlConfig.
Hope this helps.
Regards,
RandomCoder
__________________
"Defeat never comes to any man until he admits it."Josephus Daniels
I should've mentioned this in the topic start,
but at the moment I'm reading the actions into a table
using the loadCSV, could this cause the lag?
You can only be sure by trying other methods...
Ramdom's emthod seems simple enought to Append to your project..either as is or as a sub...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!