[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Function returns a FLOAT



Try an unstring:

!Read datafile into a variable(1)
open $filename as 1 for-reading record=300:vary status=#stats1a.
.
.
read 1 into $checkrow:300:vary status=#chkread
      if #chkread <> 0
         print 'Read failed:' (+1,1)
         stop quiet
      end-if

      if #end-file = 1
         let $go = '0'
         break
      end-if

      !Parse out values
        unstring $checkrow by '^' into
      $field1
      $field2
                .
                .
                .
                etc...

Matt Matthiessen

Programmer Analyst
Alterra HealthCare
Voice:  414-918-5677
Email: mmatthiessen@assisted.com <mailto:lkainz@assisted.com>


        -----Original Message-----
        From:   Sablatura, Amy [SMTP:Amy.Sablatura@IMPERIALSUGAR.COM]
        Sent:   Monday, May 01, 2000 2:29 PM
        To:     SQR-USERS@list.iex.net
        Subject:        Function returns a FLOAT

        I have a file I am trying to read that is 1 long line.  The length
of this line will vary all the time.  It is actually a 210 file.  I wanted
to read the file and write a new file with a new row for each identifier.
The end of each new identifier row has a carrot - '^'.  I tried using the
FIND or INSTR function but both of these functions died after I got to the
1000th position because they return a FLOAT.  Is there any other function I
can try or do you have any suggestions?  My file I am trying to read is
usually over 20000 characters in length.  I tried the declare-variable but
it didn't do anything for me.  Below is my code.  Any help is greatly
appreciated.





          While #count <> 0

              let #end_pos   = instr($CHR-Data,'^',#start_pos)
        !      FIND '^' IN $CHR-Data #start_pos #end_pos
              let #start_pos = #end_pos + 1

              write 2 from $Line_Data

              If #end_pos = 0
                  let #count = 0
              end-if


          end-while




        Amy Sablatura
        281/490-9546
        asablatura@imperialsugar.com