Newbie questions about Pliant
section blocks - goto commands
A debate on how to keep multiple web pages in a single file while keeping the *.page file readable. |
Message posted by maybe Bryan on 2002/06/08 18:05:18 |
Is there a way to create section blocks in a *.page file? I would to know because the indentation requirements can result in a line starting halfway across the page. Eg. center table columns 2 cell [blah] cell center button "blah" title "results" center table..... ....
And so on. Instead, after the button, there should be a goto command which refers to an area further down the page. A section should conventionally contain only "new" pages.
I read through some of the code. The "part" function is inappropriate because it does not let you move to other section blocks. I saw some goto commands but they didn't work (I think I found them in *.c files anyway).
Is there a goto command available? I know and understand why goto commands should be generally avoided but I think, in the case of pliant *.page documentation/readability (and programming... it's a hassle to setup all those spaces), that they should be made available. |
Message posted by maybe Hubert Tonneau on 2002/06/09 09:16:04 |
One could implement a 'goto' meta, but it would not solve your problem because in your sample .page, there are truely two functions: the overall page, and the action under the button, so it would be hard to implement a 'goto' instruction that let you jump from one to the other.
On the other hand, you could write it that way:
method page my_button arg_rw HtmlPage page title "results" center table.....
center table columns 2 cell [blah] cell center button "blah" my_button
If the 'my_button' method needs to use some of the variables of the overall page, then you need to pass these arguments explicitely to the method.
|
Message posted by maybe Bryan on 2002/06/09 19:00:09 |
That's my point; if you defer the button action to another *.page or a method then you need to pass arguments. So to avoid creating extra files and/or extra code to support the passing of "messages" we keep everything in a single *.page file.
But this results in the task of indenting. I think the indentation requirements are great, but there should be "shortcuts" to help us out. I'd like to see something like the following:
title "my title" center table columns 1 cell header [this is a long header] cell center button goto button_action
section button_action title "the results" center [in the *.page file, this would have started half-way across the page] |
Message posted by maybe Hubert Tonneau on 2002/06/09 19:52:15 |
Might be interesting, but that's not high in my priorities list, so don't expect much from me in this area.
|
Message posted by maybe Bryan on 2002/06/10 00:16:57 |
That's ok; I just wanted to know if that feature already existed, and if not to suggest that it should be added at some point. |