Trainsch version .99b by Ed Padin (epadin@wagweb.com)

I commute by railroad and am subject to my train schedule. I used to
keep my train schedule in a simple text file and found it a pain in the
ass to have to scan for the departure time. I figured it would be nice
to have a program that scans the file for me and tells me when the next
train is leaving. I could then make my way to the train station and
see, in real-time, how much time I have left. 

In version .99 of this program it just printed a single train schedule.
This version (.99b) presents a menu of different possible shcedules. The menu
data is stored in data file. You can specify a menu file to use on the
command line or use the default name of menu.dat. In this way, you can
have multiple menus of mutltiple train schedules.


format of a menu data  file
record 1 - menu title
record 2 - Menu Headers
record 3 - 14 Train schedule entries
 - the schedule record's entries should match up column positions with the
   header record
 - records above 14 are ignored so you can only have 12 entries.

Look at the sample menu.dat file for more information.

The included sample.dat file contains an example of how an individual
schedule data file should look. Use it to create your own schedule
files but remember to delete the extraneous text to allow it to load
faster.


Here's a sample of how  the trainsch schedule screen appears when a
schedule has been selected: 

Weekdays  Time Now: 05:44:54 AM  10-22-1998   Thursday                        
SA      NWK     NYP     NYP     NWK     SA       SA    NY                   
05:19|  05:50   06:10   --:--|  --:--   --:--    **    **                      
06:05|  06:35   06:54   06:03|  06:18   06:49    21    19                      
06:15|  06:56   07:15   --:--|  --:--   --:--    31    **                      
06:26|  06:51   07:12HB  Goes to Hoboken ----    42    **                      
06:42|  07:12   07:33   --:--|  --:--   --:--    58    **                      
06:33|  07:15   07:36   --:--|  --:--   --:--    49    **                      
06:57|  07:22   07:52HB  Goes to Hoboken ----    73    **                      
07:19|  08:04   08:25   07:06|  07:21   07:58    95    82                      
07:38|  08:10   08:28   07:50|  08:06   08:41   114   126                      
08:13|  08:41   08:59   08:29|NW08:51   09:17   149   165                      
08:06|  08:48   09:07   08:49|  09:04   09:36   142   185                      
08:49|  09:28   09:48   --:--|  --:--   --:--   185    **                      
08:59|  09:37   09:57   --:--|  --:--   --:--   195    **                      
09:37|  10:13   10:33   09:43|  09:58   10:32   233   239                      
Press [ENTER] to exit or [R] to redraw                                         
                                                                                
When the schedule is selected it  will read the data file and print the
records  closest to the current time. I leave in the morning from a
station named South Amboy. I have labeled that station above as "SA".
There is a station called "Newark" in-between and then "New York Penn
Station". The screen shows which trains are leaving from SA and NYP at
the current time. Notice that the current time above is 5:44AM and that
the next train leaving SA is at 6:04 in 21 minutes. The actual screen
uses reverse and blinking text to highlight the next train(s). 

The last two columns are the "minutes until" values.
If you press "R" it will reprint the screen according to the current
time. Any other key exits. If the program is left running it will
update the screen 6 times after a small timeout. It will exit after the
6th time to allow the palmtop to sleep. 

               
In the example below, the time is 6:00pm and I need to get on the next
train home. I see that there's a train leaving in 2 minutes... hmm,
that one's out but I can make the next one leaving in 23 minutes.                         
                                                                                
                                                                                

Weekdays  Time Now: 6:00 PM  10-22-1998   Thursday  
SA      NWK     NYP     NYP     NWK     SA       SA    NY
05:17|  05:57   05:57   05:12|  05:26   06:05    **    **
--:--|  --:--   --:--   05:27|  05:42   06:07    **    **
--:--|  --:--   --:--   05:30|  05:45   06:26    **    **
--:--|  --:--   --:--   05:55|  06:11   06:54    **    **
06:21|  06:54   07:14   06:02|  06:18   06:45    21     2
06:47|  07:18   07:37   06:23|  06:39   07:20    47    23
--:--|  --:--   --:--   06:26|  06:41   07:09    **    26
--:--|  --:--   --:--   06:52|  07:07   07:43    **    52
07:37|  08:11   08:31   07:09|  07:24   07:50    97    69
--:--|  --:--   --:--   07:25|  07:40   08:15    **    85
--:--|  --:--   --:--   07:50|  08:05   08:41    **   110
08:38|  09:12   09:31   08:05|  08:20   08:47   158   125
08:56|  09:30   09:49   08:31|  08:46   09:22   176   151
--:--|  --:--   --:--   09:04|  09:19   09:49    **   184
Press [ENTER] to exit or [R] to redraw                                          
                                                                                

You will have to edit your own data files. I have included 
example files with some explanations.

I have included the source code in trainsch.asi. It's written in a
BASIC-alike language called ASIC 5.0. You can get it on www.simtel.net.
It's a nice language for making very small executables. This program
will run with as little as 50k free dos memory so you can definitely
run it from system manager.


I program as a hobby and am not, in my estimation,  very good at it.
I write things for myself that I think will be useful. I humbly submit
this program with the hope that others will find it useful. I make no implied
waranty on this program. If your palmtop goes up in a puff of blue
smoke it's YOUR problem. Look at the source code if you're concerned
about its operation. 


You may not find this program useful so "del *.*" will be useful. At least it
was a small download :-). If you do find it useful, let me know. I'm
interested in improving  this program and I'd like to
see the fruits of my labor have purpose. Basic is an easy language to learn 
so, if you want to improve it, knock yerself out. 



Ed Padin.
epadin@wagweb.com

BTW: Here's some good ASIC 5.0 (and other Basics) links

http://www.basicguru.com/abc/


this is a Simtel search:
http://www.simtel.net/simcgi-bin/dosfind.cgi?asic

Note that there are two libraries here that let you expand the number of
commands available: asi5lib and ibrary.


