Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Question about date? function

From: bkalef:sympatico:ca at: 13-Oct-2001 4:48

Carl, Thanks. I see how this works. I guess the date? function isn't really processing the date and is just reporting back validity for the datatype query. You are correct about the date I am retrieving - it is coming in as a string from an ASK statement to start with and I could use try as indicated in your code below. This is my first 'real' and 'original' project with Rebol and my first real programming project outside of course-material and manipulating other Rebolers code for my own purposes. I'm trying to create a 'Scheduling' program/database for a 'rotating-shift oriented' workplace. I'm starting out text based and will add a /View GUI later. I've had enough of a challenge just getting the logic working properly without worrying about the GUI problems that will arise. I ran into this particular problem while trying to error-check data entry for a small function. My code is quickly getting large as I'm struggling to find adequate methods of code reuse. An example would be how to pass a parameter to a function that is later used in a data element path ie. record/:var-item-no. I would use a foreach statement to loop through each 'word in a series and each word would actually reference data elements from the data series. This would prompt the user for the specific element and then do the error checking, here's some sample code where code-reuse would be helpful..... until [sched-block/cell: ask "Enter Cell Prime: " find employees sched-block/cell] until [sched-block/p8am: ask "Enter Prostar 8am Prime: " find employees sched-block/p8am] until [sched-block/p9am: ask "Enter Prostar 9am Prime: " find employees sched-block/p9am] The 'until is doing the continuous error checking based on the result of the 'find statements success Brock