Path: utzoo!mnetor!uunet!husc6!bbn!mit-eddie!rutgers!mcnc!ece-csc!ncrcae!hubcap!hutch From: hutch@hubcap.UUCP (David Hutchens) Newsgroups: comp.lang.c Subject: Re: gotos Message-ID: <1464@hubcap.UUCP> Date: 21 Apr 88 14:50:46 GMT References: <2200@louie.udel.EDU> Organization: Clemson University, Clemson, SC Lines: 93 From article <2200@louie.udel.EDU>, by new@udel.EDU (Darren New): > > How about: (pseudocode) > for (i = 0; i < max_in_table && key != name[i]; ++i) > if (keypressed()) goto handle_key; > seek(helpfile, offset[i]); > if (keypressed()) goto handle_key; > linecount = 0; > do { > read_line_from_file(); > ++linecount; > if (keypressed()) goto handle_key; > if (read_line[0] == special_flag_char) goto handle_key; > insert_spaces_and_color_codes(); > if (keypressed()) goto handle_key; > display_text_line(); > if (keypressed()) goto handle_key; > } while (linecount < 24); > handle_key: > c = wait_for_key_then_read_it(); > switch (c) { > case 'A': ... > ... > } > > I contend that if the reading and formatting and displaying are sufficiently > slow, such behaviour can be desirable (i.e., on microcomputers). > I would like to see a goto-less version of this that is easier to understand. > - Darren New > Graduate Student > University of Delaware. > > for (i=0; i