{
{ BAI$SCAN_TO_DELIMITING_CHAR
{
{ This code scans until a delimiting character is found.
{
{ It is designed to handle the case of a missing delimiter at the end
{ of the file.  Normally, this code leaves the variable <trailing_char_length>
{ with a value of 1, but in the case of a missing delimiter at the end
{ of the file, trailing_char_length will be left with a value of 0.

      scan_byte_address := record_info.current_byte_address;
      scan_size := max_scan_size;
      trailing_char_length := trailing_char_length_constant; { assume that a delimiter will be found

    /scanning_for_delimiter/
      REPEAT
        IF scan_byte_address + max_scan_size > file_instance^.
              global_file_information^.eoi_byte_address THEN
          IF scan_byte_address >= file_instance^.global_file_information^.
                eoi_byte_address THEN

            trailing_char_length := 0;
            EXIT /scanning_for_delimiter/
          IFEND;
          scan_size := file_instance^.global_file_information^.
            eoi_byte_address - scan_byte_address;
        IFEND;

        scan_string := #address (#ring (file_instance^.file_pva), #segment
              (file_instance^.file_pva), scan_byte_address);

        #scan (delimiting_char_set, scan_string^ (1, scan_size),
              scanned_piece_size, found_delimiter);

        scan_byte_address := scan_byte_address + scanned_piece_size;

{  Since scanned_piece_size is scan_size + 1, scan_byte_address is
{  one beyond the delimiter if the record length is exactly max_scan_size
{  or some multiple of it.  The test is for the negative condition since
{  the conditional code will seldom be executed.

        IF NOT found_delimiter THEN
          scan_byte_address := scan_byte_address - 1;
        IFEND;
      UNTIL found_delimiter;

{ end of BAI$SCAN_TO_DELIMITING_CHAR
{
