View Full Version : Need Help/Suggestions
abnrange
12-09-2008, 06:58 PM
Hello,
I have an app that has 97 pages and growing. Each page asks the user different questions - Some question require a PC restart. Is there a way that as the users goes throught the pages answering the questions, that I can some how either have a reg file or ini file remember were they last left off and restart from their. So, if the user is on page 61 and it requires a restart of the PC - When the PC restarts it will automatically launch the app on page 61.
Any suggestion? Thanks
abnrange
12-10-2008, 07:39 AM
Any help/suggestions would be great. Thanks
Ulrich
12-10-2008, 09:13 AM
You already wrote it: use a INI file to save the current page and former selections, read the file on program (re)start, and jump to the latest page in use... So what did I miss, what is your question? It can't be because a missing example on how to use INI files. :)
Ulrich
abnrange
12-10-2008, 10:27 AM
I guess the question would be - Would I have to have an ini for each page or could it me done global?
On restart how would I call the ini to start the app and load correct page?
Centauri Soldier
12-10-2008, 02:05 PM
--On Preload of your first (Load Code)
sLastPage = INIFile.GetValue("myfile.ini", "User Info", "Last Page");
if sLastPage ~= "" then
Page.Jump(sLastPage);
end
--On Show (Save Code)
sLastPage = Application.GetCurrentPage();
INIFile.SetValue("myfile.ini", "User Info", "Last Page", sLastPage);
--you might find that the code works better On Startup play with placing it in different spots but be sure the load code is ALWAYS before the save code
abnrange
12-10-2008, 02:32 PM
Thanks - I will try that.
abnrange
12-10-2008, 05:12 PM
I get a C Stack overflow when it reads the ini. Don't know why. I placed the code in different locations -same error. Any thoughts
Thanks
abnrange
12-10-2008, 05:28 PM
Sorry my mistake. I had a typo - The example works great thanks.
Centauri Soldier
12-10-2008, 05:36 PM
no prob...glad to help :)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.