AM / PM time for the blind
[1/4] from: john::thousand-hills::net at: 31-Aug-2001 17:19
Andrew, Joel:
I can't seem to make this AM/PM thing work.
If you could see the files, might that help?
There is something fundamental i am missing.
John
[2/4] from: al:bri:xtra at: 1-Sep-2001 11:37
John wrote:
> I can't seem to make this AM/PM thing work.
>
> If you could see the files, might that help?
>
> There is something fundamental i am missing.
It could be something as simple as a typo. Probably best to start again from
a empty file, and work one small step at a time, while making sure each step
works as expected. For example, each step could be:
* reading the text file into a block;
* picking the right line out of the block;
* loading the block to form rebol values;
* getting the 'map function to work correctly;
* enhancing map function to add AM/PM and HTML markup; and
* writing HTML back to disk.
I hope that helps!
Andrew Martin
ICQ: 26227169 http://zen.scripterz.org
[3/4] from: john:thousand-hills at: 31-Aug-2001 22:04
Andrew:
You were correct, putting it in a clean file worked. This has been very
instructive.
The next question is, the code fails when it hits an empty cell in the
schedule, fails in that it moves the remaining cells to the left putting
the table out of the correct headers..
The logical thought would be to replace the empty cell with TAB TAB which
what Oracle supplies by default. This also causes the table to shift left
to fill that hole.
The codes we have used in the past are " --" or " * " and the tables in
Excel didn't care.
I tried 0:0 and it worked, except the output was " 0:0 AM "...
Is there a way to make that nice-time return either " 0:0 " or better yet,
make the code accept a " * " or " -- " ? Or simply an empty cell for an
empty cell ?
/John
//John
At 11:37 AM 9/1/2001 +1200, you wrote:
[4/4] from: john:thousand-hills at: 31-Aug-2001 23:34
Andrew:
I got it..!
nicetime: func [time [time!] /local am] [
time/3: 0
am: pick [" AM" " PM"] time < 12:00
if time >= 13:00 [time: time - 12:00]
if time = 0:00 [time: "*"]
if time/1 <= 0 [time/1: 0]
either time = "*" [rejoin [time time]][rejoin [time am]]
]
This returns a <TD>cell</TD> with " * * " for a time value of " 0:00 "
John
At 10:04 PM 8/31/2001 -0500, you wrote: