English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. General (http://eab.abime.net/forumdisplay.php?f=37)
-   -   Hollywood Designer, Save Page on Exit. help (http://eab.abime.net/showthread.php?t=106358)

amigang 24 March 2021 15:26

Hollywood Designer, Save Page on Exit. help
 
So anyone on here use Hollywood and Hollywood Designer?

on my next update for Amilion, I would love it to be able to save which page its on, on exit, I guess I would put code on the exit button, and then code on start up, so it check which page to start on, trouble is I kind of not sure what the code would be. I thinking of creating a external txt file that would save a number 1 to 6 on exit depending on the page your on and hollywood on boot would check the number and go to that page.

Anyone know how I would go about doing this? Cheers :spin

So far I have a Setting.txt file with just "1" in the file so to test Hollywood is reading it, I have

OpenFile(1, "setting.txt")
pageset = ReadLine(1)
CloseFile(1)
SetLayerStyle("pagetxt",{text=pageset})

On text entry "pagetxt" it display the number 1

On exit I have this when exit page 1
OpenFile (1, "setting.txt", #MODE_WRITE)
WriteLine(1, "1")
Closefile(1)

Code for page 2
OpenFile (1, "setting.txt", #MODE_WRITE)
WriteLine(1, "2")
Closefile(1)

This works and changes the setting.txt number to 2 and on next load up of the app it displays the number 2
Now I just need to figure out how to get Hollywood to jump to Page 2 if pageset = 2

amigang 25 March 2021 00:03

https://forums.hollywood-mal.com/vie...hp?f=14&t=3274
hope you can follow this image
https://amigang.com/software/1.jpg
new page 1 identify is page001

rectangle 250 is basically the button that would save the page the user on into the Table "page001"

On removing this code, the app works, so it got to be something here?, checking the syntex it says error on line 3,
Switch SettingsTable.PageTxt
Case "page001"
%>"page001"
Case "page002"
%>"page002"
EndSwitch


Running the app it says Syntex error in Object "B??o" no idea what Object that is as this is a very simple test app I made to see if I could get this to work.

Tried %>PAGEID "page001" but not sure if that how the code should work.

uploaded my very basic Designer app with this code
https://amigang.com/software/wite2.lha
Thanks for you help, or if anyone else can shed light on what Im doing wrong. cheers :guru

amigang 25 March 2021 12:58

You know persistency pay off, after trying a number of different codes, this one works!!!! Plus renaming the Page Name page001
Code: Select all
Switch SettingsTable.PageTxt Case "page001" %>page001 Case "page002" %>page002 EndSwitch
https://forums.hollywood-mal.com/ima..._e_biggrin.gif, this is one of the very few time the manual let me down, as I could not even find the code to change page in the doc plus no example of how to use the code.


All times are GMT +2. The time now is 20:22.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.

Page generated in 0.04230 seconds with 11 queries