/* * chart.c, Version 1.1 * * This program builds a chart suitable for scanner frequency * entries. The frequencies are spaced 5 KHz with an area for * a short note about each frequency. It lists 200 channels on * a page. Start with a frequency such as 144, 154, etc. The * chart is output to the screen, printer, or file: * * chart 144 149 - Screen * chart 144 149 twometer - File * chart 144 149 prn - Printer * * Based on a program by Tony B. Anderson, Copyright (c) 1987 * All Rights Reserved * * Turbo-C Version written by Steve Sampson 75136,626 * * Fixed frequencies so they are right justified instead of left. * You can use this chart for shortwave now. */ #include #include static char top[] = " ________ "; static char bot[] = "|________|"; static double s1, s2; main(argc, argv) int argc; char *argv[]; { register int i; if (argc < 3 || argc > 4) { fprintf(stderr, "Usage: chart 'start freq' 'stop freq' [filename]\n"); exit(1); } s1 = atof(argv[1]); s2 = atof(argv[2]); if (s2 < s1) { fprintf(stderr, "chart: Start frequency should be less than Stop\n"); exit(1); } if (argc == 4) { if (freopen(argv[3], "w", stdout) == NULL) { fprintf(stderr, "chart: Unable to open output file\n"); exit(1); } } do { printf("\t\tS C A N N E R F R E Q U E N C Y C H A R T\n"); printf("\t\t---------------------------------------------\n\n"); printf("%s %s %s %s\n", top, top, top, top); for (i = 0; i < 50; i++, s1 += .005000) printf("%7.3f %s %7.3f %s %7.3f %s %7.3f %s\n", s1, bot, s1 + .250000, bot, s1 + .500000, bot, s1 + .750000, bot ); putchar('\014'); /* form feed */ } while (((s1 += .750000) + .005000) < s2); exit(0); } /* EOF */