Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Maximum number of char/fields dump

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Maximum number of char/fields dump

    I need to create a dump with file structure and field info (like the below) can alpha5 do this?

    MasterFile= file.ZIP
    File= file.txt
    6888 RECORDS IN THIS FILE

    LINE1 has 33 chars max. Threshold in 0 recs.
    LINE2 has 1 chars max. Threshold in 0 recs.
    LINE3 has 31 chars max. Threshold in 0 recs.
    LINE4 has 0 chars max. Threshold in 0 recs.
    LINE5 has 0 chars max. Threshold in 0 recs.
    LINE6 has 31 chars max. Threshold in 0 recs.
    LINE7 has 27 chars max. Threshold in 0 recs.
    LINE8 has 33 chars max. Threshold in 0 recs.

    3 FIELDS OCCUPIED BY 6710 RECORDS.
    4 FIELDS OCCUPIED BY 60 RECORDS.
    5 FIELDS OCCUPIED BY 117 RECORDS.
    6 FIELDS OCCUPIED BY 1 RECORDS.

    Maximum number of lines required is 6
    located at record 620
    Maximum number of characters required is 33

    Dump of first record(s) for file O145261.txt

    #2
    Re: Maximum number of char/fields dump

    A dump of what?

    MasterFile= file.ZIP---------------------------Where would this info reside
    File= file.txt----------------------------------Where would this info reside
    6888 RECORDS IN THIS FILE-------------------Is this a total record count?

    LINE1 has 33 chars max. Threshold in 0 recs.---Does this mean field 1 has a maximum width of 33 and no records exist where the field is filled?
    LINE2 has 1 chars max. Threshold in 0 recs.----Does this mean field 2 has a maximum width of 1 and no records exist where the field is filled?
    LINE3 has 31 chars max. Threshold in 0 recs.---Etc.
    LINE4 has 0 chars max. Threshold in 0 recs.----Etc.
    LINE5 has 0 chars max. Threshold in 0 recs.----Etc.
    LINE6 has 31 chars max. Threshold in 0 recs.---Etc.
    LINE7 has 27 chars max. Threshold in 0 recs.---Etc.
    LINE8 has 33 chars max. Threshold in 0 recs.---Etc.

    3 FIELDS OCCUPIED BY 6710 RECORDS.--------Does this mean that 6710 records have only 3 fields populated?
    4 FIELDS OCCUPIED BY 60 RECORDS.----------Etc.
    5 FIELDS OCCUPIED BY 117 RECORDS----------Etc..
    6 FIELDS OCCUPIED BY 1 RECORDS.-----------Etc.

    Maximum number of lines required is 6 ---------Maximum number of (fields?) required for what?
    located at record 620-------------------------Is this the record number of the one (6 FIELDS OCCUPIED BY 1 RECORDS) indicated above?
    Maximum number of characters required is 33---Is this the defined width of the widest field?

    Dump of first record(s) for file O145261.txt-----No clue here
    Last edited by Stan Mathews; 11-27-2007, 05:21 PM.
    There can be only one.

    Comment


      #3
      Re: Maximum number of char/fields dump

      MasterFile= file.ZIP---------------------------Where would this info reside - c:\temp\file.zip
      File= file.txt----------------------------------Where would this info reside - c:\temp\file.txt
      6888 RECORDS IN THIS FILE-------------------Is this a total record count? - Correct

      LINE1 has 33 chars max. Threshold in 0 recs.---Does this mean field 1 has a maximum width of 33 and no records exist where the field is filled? - Need to show the max # of chars *the field width is 60
      LINE2 has 1 chars max. Threshold in 0 recs.----Does this mean field 2 has a maximum width of 1 and no records exist where the field is filled? - need to show the max # of chars *the field width is 60
      LINE3 has 31 chars max. Threshold in 0 recs.---Etc. - Correct
      LINE4 has 0 chars max. Threshold in 0 recs.----Etc.
      LINE5 has 0 chars max. Threshold in 0 recs.----Etc.
      LINE6 has 31 chars max. Threshold in 0 recs.---Etc.
      LINE7 has 27 chars max. Threshold in 0 recs.---Etc.
      LINE8 has 33 chars max. Threshold in 0 recs.---Etc.

      3 FIELDS OCCUPIED BY 6710 RECORDS.--------Does this mean that 6710 records have only 3 fields populated? - Correct
      4 FIELDS OCCUPIED BY 60 RECORDS.----------Etc. - Correct
      5 FIELDS OCCUPIED BY 117 RECORDS----------Etc..
      6 FIELDS OCCUPIED BY 1 RECORDS.-----------Etc.

      Maximum number of lines required is 6 ---------Maximum number of (fields?) required for what? -Address label
      located at record 620-------------------------Is this the record number of the one (6 FIELDS OCCUPIED BY 1 RECORDS) indicated above? - Correct
      Maximum number of characters required is 33---Is this the defined width of the widest field? - Correct

      Dump of first record(s) for file O145261.txt-----No clue here

      First two records on file also record with max lines and record with max chars

      Thanks!

      Comment


        #4
        Re: Maximum number of char/fields dump

        I didn't get finsihed but try this to get you started.

        Code:
        tbl = table.open("[COLOR="Red"]master[/COLOR]",FILE_RW_EXCLUSIVE)
        fil = file.create("c:\temp\file.txt",FILE_RW_EXCLUSIVE)
        ix = tbl.index_primary_put()
        recs = ix.records_get()
        fil.write_line("MasterFile= file.zip")
        fil.write_line("File = file.txt")
        fil.write_line(Alltrim(str(recs))+" RECORDS IN THIS FILE")
        fld1 = 0
        fld2 = 0
        fld3 = 0
        fld4 = 0
        fld5 = 0
        fld6 = 0
        fld7 = 0
        fld8 = 0
        max1 = 0
        max2 = 0
        max3 = 0
        max4 = 0
        max5 = 0
        max6 = 0
        max7 = 0
        max8 = 0
        defw1 = tbl.field_get(1).width_get()
        defw2 = tbl.field_get(2).width_get()
        defw3 = tbl.field_get(3).width_get()
        defw4 = tbl.field_get(4).width_get()
        defw5 = tbl.field_get(5).width_get()
        defw6 = tbl.field_get(6).width_get()
        defw7 = tbl.field_get(7).width_get()
        defw8 = tbl.field_get(8).width_get()
        tbl.fetch_first()
        WHILE .not. tbl.fetch_eof()
        	IF len(alltrim(tbl.Field1)) > fld1
        		fld1 = len(alltrim(tbl.Field1))
        		if len(alltrim(tbl.Field1)) = defw1
        			max1 = max1+1
        		end if
        	END IF
        	IF len(alltrim(tbl.Field2)) > fld2
        		fld2 = len(alltrim(tbl.Field2))
        		if len(alltrim(tbl.Field2)) = defw2
        			max2 = max2+1
        		end if
        	END IF
        	IF len(alltrim(tbl.Field3)) > fld3
        		fld3 = len(alltrim(tbl.Field3))
        		if len(alltrim(tbl.Field3)) = defw3
        			max3 = max3+1
        		end if
        	END IF
        	IF len(alltrim(tbl.Field4)) > fld4
        		fld4 = len(alltrim(tbl.Field4))
        		if len(alltrim(tbl.Field4)) = defw4
        			max4 = max4+1
        		end if
        	END IF
        	IF len(alltrim(tbl.Field5)) > fld5
        		fld5 = len(alltrim(tbl.Field5))
        		if len(alltrim(tbl.Field5)) = defw5
        			max5 = max5+1
        		end if
        	END IF
        	IF len(alltrim(tbl.Field6)) > fld6
        		fld6 = len(alltrim(tbl.Field6))
        		if len(alltrim(tbl.Field6)) = defw6
        			max6 = max6+1
        		end if
        	END IF
        	IF len(alltrim(tbl.Field7)) > fld7
        		fld7 = len(alltrim(tbl.Field7))
        		if len(alltrim(tbl.Field7)) = defw7
        			max7 = max7+1
        		end if
        	END IF
        	IF len(alltrim(tbl.Field8)) > fld8
        		fld8 = len(alltrim(tbl.Field8))
        		if len(alltrim(tbl.Field8)) = defw8
        			max8 = max8+1
        		end if
        	END IF
        	tbl.fetch_next()
        END WHILE
        fil.write_line("LINE1 has "+alltrim(str(fld1))+" chars max. Threshold in "+alltrim(str(max1 ))+" recs." )
        fil.write_line("LINE2 has "+alltrim(str(fld2))+" chars max. Threshold in "+alltrim(str(max2 ))+" recs." )
        fil.write_line("LINE3 has "+alltrim(str(fld3))+" chars max. Threshold in "+alltrim(str(max3 ))+" recs." )
        fil.write_line("LINE4 has "+alltrim(str(fld4))+" chars max. Threshold in "+alltrim(str(max4 ))+" recs." )
        fil.write_line("LINE5 has "+alltrim(str(fld5))+" chars max. Threshold in "+alltrim(str(max5 ))+" recs." )
        fil.write_line("LINE6 has "+alltrim(str(fld6))+" chars max. Threshold in "+alltrim(str(max6 ))+" recs." )
        fil.write_line("LINE7 has "+alltrim(str(fld7))+" chars max. Threshold in "+alltrim(str(max7 ))+" recs." )
        fil.write_line("LINE8 has "+alltrim(str(fld7))+" chars max. Threshold in "+alltrim(str(max8 ))+" recs." )
        
        fil.flush()
        fil.close()
        tbl.close()
        Substitute your table name for master. It doesn't do the part from

        3 FIELDS OCCUPIED BY 6710 RECORDS. to the end but shouldn't be that hard to finish.
        There can be only one.

        Comment


          #5
          Re: Maximum number of char/fields dump

          I think this does it all, at least with the sample data I constructed.

          Code:
          'Date Created: 27-Nov-2007 04:07:45 PM
          'Last Updated: 27-Nov-2007 04:26:37 PM
          'Created By  : SMathews
          'Updated By  : SMathews
          tbl = table.open("master",FILE_RW_EXCLUSIVE)
          fil = file.create("c:\temp\file.txt",FILE_RW_EXCLUSIVE)
          ix = tbl.index_primary_put()
          recs = ix.records_get()
          fil.write_line("MasterFile= file.zip")
          fil.write_line("File = file.txt")
          fil.write_line(Alltrim(str(recs))+" RECORDS IN THIS FILE")
          FOR i = 1 TO 8
          	evaluate_template("fld"+alltrim(str(i))+"= 0")
          NEXT i
          FOR j = 1 TO 8
          	evaluate_template("max"+alltrim(str(j))+"= 0")
          NEXT j
          FOR k = 1 TO 8
          	evaluate_template("defw"+alltrim(str(k))+"= "+alltrim(str(tbl.field_get(k).width_get())))
          NEXT k
          FOR l = 1 TO 8
          	evaluate_template("the"+alltrim(str(l))+"rec = 0")
          NEXT l
          FOR m = 1 TO 8
          	evaluate_template("arec"+alltrim(str(m))+"= .F.")
          NEXT m
          onefields = 0
          twofields = 0
          threefields = 0
          fourfields = 0
          fivefields = 0
          sixfields = 0
          sevenfields = 0
          eightfields = 0
          tbl.fetch_first()
          'debug(1)
          WHILE .not. tbl.fetch_eof()
          	IF len(alltrim(tbl.Field1)) > fld1
          		fld1 = len(alltrim(tbl.Field1))
          		IF len(alltrim(tbl.Field1)) = defw1
          			max1 = max1+1
          		END IF
          		
          	END IF
          	IF len(alltrim(tbl.Field2)) > fld2
          		fld2 = len(alltrim(tbl.Field2))
          		IF len(alltrim(tbl.Field2)) = defw2
          			max2 = max2+1
          		END IF
          	END IF
          	IF len(alltrim(tbl.Field3)) > fld3
          		fld3 = len(alltrim(tbl.Field3))
          		IF len(alltrim(tbl.Field3)) = defw3
          			max3 = max3+1
          		END IF
          	END IF
          	IF len(alltrim(tbl.Field4)) > fld4
          		fld4 = len(alltrim(tbl.Field4))
          		IF len(alltrim(tbl.Field4)) = defw4
          			max4 = max4+1
          		END IF
          	END IF
          	IF len(alltrim(tbl.Field5)) > fld5
          		fld5 = len(alltrim(tbl.Field5))
          		IF len(alltrim(tbl.Field5)) = defw5
          			max5 = max5+1
          		END IF
          	END IF
          	IF len(alltrim(tbl.Field6)) > fld6
          		fld6 = len(alltrim(tbl.Field6))
          		IF len(alltrim(tbl.Field6)) = defw6
          			max6 = max6+1
          		END IF
          	END IF
          	IF len(alltrim(tbl.Field7)) > fld7
          		fld7 = len(alltrim(tbl.Field7))
          		IF len(alltrim(tbl.Field7)) = defw7
          			max7 = max7+1
          		END IF
          	END IF
          	IF len(alltrim(tbl.Field8)) > fld8
          		fld8 = len(alltrim(tbl.Field8))
          		IF len(alltrim(tbl.Field8)) = defw8
          			max8 = max8+1
          		END IF
          	END IF
          	emptyfields = if(isblank("tbl.field1"),1,0)+if(isblank("tbl.field2"),1,0)+if(isblank("tbl.field3"),1,0)+if(isblank("tbl.field4"),1,0)+if(isblank("tbl.field5"),1,0)+if(isblank("tbl.field6"),1,0)+if(isblank("tbl.field7"),1,0)+if(isblank("tbl.field8"),1,0)
          	SELECT
          		CASE emptyfields = 0
          			eightfields = eightfields+1
          			arec8 = .T.
          		CASE emptyfields = 1
          			sevenfields = sevenfields+1
          			arec7 = .T.
          		CASE emptyfields = 2
          			sixfields = sixfields+1
          			arec6 = .T.
          		CASE emptyfields = 3
          			fivefields = fivefields+1
          			arec5 = .T.
          		CASE emptyfields = 4
          			fourfields = fourfields+1
          			arec4 = .T.
          		CASE emptyfields = 5
          			threefields = threefields+1
          			arec3 = .T.
          		CASE emptyfields = 6
          			twofields = twotfields+1
          			arec2 = .T.
          		CASE emptyfields = 7
          			onefields = onefields+1
          			arec1 = .T.
          			
          	END SELECT
          	SELECT
          		CASE arec8 = .T.
          			the8rec = tbl.recno()
          		CASE arec7 = .T.
          			the7rec = tbl.recno()
          		CASE arec6 = .T.
          			the6rec = tbl.recno()
          		CASE arec5 = .T.
          			the5rec = tbl.recno()
          		CASE arec4 = .T.
          			the4rec = tbl.recno()
          		CASE arec3 = .T.
          			the3rec = tbl.recno()
          		CASE arec2 = .T.
          			the2rec = tbl.recno()
          		CASE arec1 = .T.
          			the1rec = tbl.recno()
          	END SELECT
          	FOR m = 1 TO 8
          		evaluate_template("arec"+alltrim(str(m))+"= .F.")
          	NEXT m
          	tbl.fetch_next()
          END WHILE
          SELECT
          	CASE the8rec > 0
          		bigrec = the8rec
          	CASE the7rec > 0
          		bigrec = the7rec
          	CASE the6rec > 0
          		bigrec = the6rec
          	CASE the5rec > 0
          		bigrec = the5rec
          	CASE the4rec > 0
          		bigrec = ther4ec
          	CASE the3rec > 0
          		bigrec = the3rec
          	CASE the2rec > 0
          		bigrec = the2rec
          	CASE the1rec > 0
          		bigrec = the1rec
          END SELECT
          fil.write_line("LINE1 has "+alltrim(str(fld1))+" chars max. Threshold in "+alltrim(str(max1 ))+" recs." )
          fil.write_line("LINE2 has "+alltrim(str(fld2))+" chars max. Threshold in "+alltrim(str(max2 ))+" recs." )
          fil.write_line("LINE3 has "+alltrim(str(fld3))+" chars max. Threshold in "+alltrim(str(max3 ))+" recs." )
          fil.write_line("LINE4 has "+alltrim(str(fld4))+" chars max. Threshold in "+alltrim(str(max4 ))+" recs." )
          fil.write_line("LINE5 has "+alltrim(str(fld5))+" chars max. Threshold in "+alltrim(str(max5 ))+" recs." )
          fil.write_line("LINE6 has "+alltrim(str(fld6))+" chars max. Threshold in "+alltrim(str(max6 ))+" recs." )
          fil.write_line("LINE7 has "+alltrim(str(fld7))+" chars max. Threshold in "+alltrim(str(max7 ))+" recs." )
          fil.write_line("LINE8 has "+alltrim(str(fld7))+" chars max. Threshold in "+alltrim(str(max8 ))+" recs." )
          fil.write_line("")
          
          IF onefields> 0 .and. onefields < recs
          	fil.write_line("1 FIELDS OCCUPIED BY "+alltrim(str(onefields))+" RECORDS.")
          	maxlines = 1
          END IF
          IF twofields> 0 .and. twofields < recs
          	fil.write_line("2 FIELDS OCCUPIED BY "+alltrim(str(twofields))+" RECORDS.")
          	maxlines = 2
          END IF
          IF threefields> 0 .and. onefields < recs
          	fil.write_line("3 FIELDS OCCUPIED BY "+alltrim(str(threefields))+" RECORDS.")
          	maxlines = 3
          END IF
          IF fourfields> 0 .and. onefields < recs
          	fil.write_line("4 FIELDS OCCUPIED BY "+alltrim(str(fourfields))+" RECORDS.")
          	maxlines = 4
          END IF
          IF fivefields> 0 .and. onefields < recs
          	fil.write_line("5 FIELDS OCCUPIED BY "+alltrim(str(fivefields))+" RECORDS.")
          	maxlines = 5
          END IF
          IF sixfields> 0 .and. onefields < recs
          	fil.write_line("6 FIELDS OCCUPIED BY "+alltrim(str(sixfields))+" RECORDS.")
          	maxlines = 6
          END IF
          IF sevenfields> 0 .and. onefields < recs
          	fil.write_line("7 FIELDS OCCUPIED BY "+alltrim(str(sevenfields))+" RECORDS.")
          	maxlines = 7
          END IF
          IF eightfields> 0 .and. onefields < recs
          	fil.write_line("8 FIELDS OCCUPIED BY "+alltrim(str(eightfields))+" RECORDS.")
          	maxlines = 8
          END IF
          
          fil.write_line("")
          fil.write_line("Maximum number of lines required is "+alltrim(str(maxlines)))
          fil.write_line("located at record "+alltrim(str(bigrec)))
          fil.write_line("Maximum number of characters required is "+alltrim(str(max(fld1,max(fld2,max(fld3,max(fld4,max(fld5,max(fld6,max(fld7,fld8))))))))))
          fil.flush()
          fil.close()
          tbl.close()
          There can be only one.

          Comment


            #6
            Re: Maximum number of char/fields dump

            Hi Stan -
            The below is the result from using the code as provided. I just need to work on the "Dump of first record(s)" part. See sample below.

            I know I did not explain everything from the begging but here are the tasks that I�m looking to accomplished:

            - Look for all dbase table associated with job number listed on the alpha5 form
            - Create a dump file with �Maximum number of char/fields� info.
            - Export dbase table(s) into comma delimited and zip them under the job number. You help is much appreciated.

            Sample from the code as provided...
            MasterFile= 138451.zip
            File = 138451.txt
            4034 RECORDS IN THIS FILE
            LINE1 has 36 chars max. Threshold in 0 recs.
            LINE2 has 1 chars max. Threshold in 0 recs.
            LINE3 has 35 chars max. Threshold in 0 recs.
            LINE4 has 36 chars max. Threshold in 0 recs.
            LINE5 has 0 chars max. Threshold in 0 recs.
            LINE6 has 0 chars max. Threshold in 0 recs.
            LINE7 has 0 chars max. Threshold in 0 recs.
            LINE8 has 0 chars max. Threshold in 0 recs.

            3 FIELDS OCCUPIED BY 3948 RECORDS.
            5 FIELDS OCCUPIED BY 86 RECORDS.

            Maximum number of lines required is 5
            located at record 4034
            Maximum number of characters required is 36

            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            This is what the dump of first record(s) should look like...

            Dump of first record(s) for file o145261N.txt

            LINE1
            LINE2
            LINE3 JOHN COBB
            LINE4
            LINE5
            LINE6 8 YALE STREET
            LINE7
            LINE8 BUDD LAKE NJ 07828-2118
            LINE9 07828-2118 DO NOT PRINT
            LINE10 08 DO NOT PRINT

            LINE1
            LINE2
            LINE3 LAURA MURDOCH
            LINE4
            LINE5
            LINE6 207 CHURCH STREET
            LINE7
            LINE8 HACKETTSTOWN NJ 07840-2207
            LINE9 07840-2207 DO NOT PRINT
            LINE10 07 DO NOT PRINT
            Record 10
            LINE1 T24*******MIXED AADC 07099
            LINE2 #
            LINE3 DONNIE CAMPBELL
            LINE4
            LINE5
            LINE6 80 LLARK RD
            LINE7
            LINE8 WANTAGE NJ 07461
            LINE9 07461 DO NOT PRINT
            LINE10 DO NOT PRINT

            I have verified the above format contains all data for this job and
            all lines that need to be printed are marked as such.

            Computer Mgr X______________________Date:_____________


            I have checked Every Line AND confirmed that the
            Printed Ink-Jet Sample Matches the Computer Print-out

            Production Mgr X______________________Date:_____________

            Comment


              #7
              Re: Maximum number of char/fields dump

              See if this gets you a little further.

              Code:
              'Date Created: 27-Nov-2007 04:07:45 PM
              'Last Updated: 28-Nov-2007 09:51:51 AM
              'Created By  : SMathews
              'Updated By  : SMathews
              topen = ui_get_file("What table","Table(*.dbf)",a5.Get_Path(),"X")
              if topen = ""
              	end
              end if
              tbl = table.open(topen,FILE_RW_EXCLUSIVE)
              tbl_name = file.filename_parse(topen,"N")
              fil = file.create(a5.Get_Path()+chr(92)+tbl_name+".txt",FILE_RW_EXCLUSIVE)
              ix = tbl.index_primary_put()
              recs = ix.records_get()
              fil.write_line("MasterFile= "+tbl_name+".zip")
              fil.write_line("File = "+tbl_name+".txt")
              fil.write_line(Alltrim(str(recs))+" RECORDS IN THIS FILE")
              FOR i = 1 TO 10
              	evaluate_template("fld"+alltrim(str(i))+"= 0")
              NEXT i
              FOR j = 1 TO 10
              	evaluate_template("max"+alltrim(str(j))+"= 0")
              NEXT j
              
              FOR k = 1 TO 10
              	evaluate_template("defw"+alltrim(str(k))+"= "+alltrim(str(tbl.field_get(k).width_get())))
              NEXT k
              FOR l = 1 TO 10
              	evaluate_template("the"+alltrim(str(l))+"rec = 0")
              NEXT l
              FOR m = 1 TO 10
              	evaluate_template("arec"+alltrim(str(m))+"= .F.")
              NEXT m
              onefields = 0
              twofields = 0
              threefields = 0
              fourfields = 0
              fivefields = 0
              sixfields = 0
              sevenfields = 0
              eightfields = 0
              ninefields = 0
              tenfields = 0
              tbl.fetch_first()
              'debug(1)
              WHILE .not. tbl.fetch_eof()
              	IF len(alltrim(tbl.Field1)) > fld1
              		fld1 = len(alltrim(tbl.Field1))
              		IF len(alltrim(tbl.Field1)) = defw1
              			max1 = max1+1
              		END IF
              		
              	END IF
              	IF len(alltrim(tbl.Field2)) > fld2
              		fld2 = len(alltrim(tbl.Field2))
              		IF len(alltrim(tbl.Field2)) = defw2
              			max2 = max2+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field3)) > fld3
              		fld3 = len(alltrim(tbl.Field3))
              		IF len(alltrim(tbl.Field3)) = defw3
              			max3 = max3+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field4)) > fld4
              		fld4 = len(alltrim(tbl.Field4))
              		IF len(alltrim(tbl.Field4)) = defw4
              			max4 = max4+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field5)) > fld5
              		fld5 = len(alltrim(tbl.Field5))
              		IF len(alltrim(tbl.Field5)) = defw5
              			max5 = max5+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field6)) > fld6
              		fld6 = len(alltrim(tbl.Field6))
              		IF len(alltrim(tbl.Field6)) = defw6
              			max6 = max6+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field7)) > fld7
              		fld7 = len(alltrim(tbl.Field7))
              		IF len(alltrim(tbl.Field7)) = defw7
              			max7 = max7+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field8)) > fld8
              		fld8 = len(alltrim(tbl.Field8))
              		IF len(alltrim(tbl.Field8)) = defw8
              			max8 = max8+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field9)) > fld9
              		fld8 = len(alltrim(tbl.Field9))
              		IF len(alltrim(tbl.Field9)) = defw9
              			max9 = max9+1
              		END IF
              	END IF
              	IF len(alltrim(tbl.Field10)) > fld10
              		fld8 = len(alltrim(tbl.Field10))
              		IF len(alltrim(tbl.Field10)) = defw10
              			max10 = max10+1
              		END IF
              	END IF
              	emptyfields = if(isblank("tbl.field1"),1,0)+if(isblank("tbl.field2"),1,0)+if(isblank("tbl.field3"),1,0)+if(isblank("tbl.field4"),1,0)+if(isblank("tbl.field5"),1,0)+if(isblank("tbl.field6"),1,0)+if(isblank("tbl.field7"),1,0)+if(isblank("tbl.field8"),1,0)+if(isblank("tbl.field9"),1,0)+if(isblank("tbl.field10"),1,0)
              	SELECT
              		CASE emptyfields = 0
              			tenfields = tenfields+1
              			arec10 = .T.
              		CASE emptyfields = 1
              			ninefields = ninefields+1
              			arec9 = .T.
              		CASE emptyfields = 2
              			eightfields = eightfields+1
              			arec8 = .T.
              		CASE emptyfields = 3
              			sevenfields = sevenfields+1
              			arec7 = .T.
              		CASE emptyfields = 4
              			sixfields = sixfields+1
              			arec6 = .T.
              		CASE emptyfields = 5
              			fivefields = fivefields+1
              			arec5 = .T.
              		CASE emptyfields = 6
              			fourfields = fourfields+1
              			arec4 = .T.
              		CASE emptyfields = 7
              			threefields = threefields+1
              			arec3 = .T.
              		CASE emptyfields = 8
              			twofields = twotfields+1
              			arec2 = .T.
              		CASE emptyfields = 9
              			onefields = onefields+1
              			arec1 = .T.
              			
              	END SELECT
              	SELECT
              		CASE arec10 = .T.
              			the10rec = tbl.recno()
              		CASE arec9 = .T.
              			the9rec = tbl.recno()
              		CASE arec8 = .T.
              			the8rec = tbl.recno()
              		CASE arec7 = .T.
              			the7rec = tbl.recno()
              		CASE arec6 = .T.
              			the6rec = tbl.recno()
              		CASE arec5 = .T.
              			the5rec = tbl.recno()
              		CASE arec4 = .T.
              			the4ec = tbl.recno()
              		CASE arec3 = .T.
              			the3rec = tbl.recno()
              		CASE arec2 = .T.
              			the2rec = tbl.recno()
              		CASE arec1 = .T.
              			the1rec = tbl.recno()
              	END SELECT
              	FOR m = 1 TO 10
              		evaluate_template("arec"+alltrim(str(m))+"= .F.")
              	NEXT m
              	tbl.fetch_next()
              END WHILE
              SELECT
              	CASE the10rec > 0
              		bigrec = the10rec
              	CASE the9rec > 0
              		bigrec = the9rec
              	CASE the8rec > 0
              		bigrec = the8rec
              	CASE the7rec > 0
              		bigrec = the7rec
              	CASE the6rec > 0
              		bigrec = the6rec
              	CASE the5rec > 0
              		bigrec = the5rec
              	CASE the4rec > 0
              		bigrec =ther4ec
              	CASE the3rec > 0
              		bigrec = the3rec
              	CASE the2rec > 0
              		bigrec = the2rec
              	CASE the1rec > 0
              		bigrec = the1rec
              END SELECT
              fil.write_line("LINE1 has "+alltrim(str(fld1))+" chars max. Threshold in "+alltrim(str(max1 ))+" recs." )
              fil.write_line("LINE2 has "+alltrim(str(fld2))+" chars max. Threshold in "+alltrim(str(max2 ))+" recs." )
              fil.write_line("LINE3 has "+alltrim(str(fld3))+" chars max. Threshold in "+alltrim(str(max3 ))+" recs." )
              fil.write_line("LINE4 has "+alltrim(str(fld4))+" chars max. Threshold in "+alltrim(str(max4 ))+" recs." )
              fil.write_line("LINE5 has "+alltrim(str(fld5))+" chars max. Threshold in "+alltrim(str(max5 ))+" recs." )
              fil.write_line("LINE6 has "+alltrim(str(fld6))+" chars max. Threshold in "+alltrim(str(max6 ))+" recs." )
              fil.write_line("LINE7 has "+alltrim(str(fld7))+" chars max. Threshold in "+alltrim(str(max7 ))+" recs." )
              fil.write_line("LINE8 has "+alltrim(str(fld8))+" chars max. Threshold in "+alltrim(str(max8 ))+" recs." )
              fil.write_line("LINE9 has "+alltrim(str(fld9))+" chars max. Threshold in "+alltrim(str(max9 ))+" recs." )
              fil.write_line("LINE10 has "+alltrim(str(fld10))+" chars max. Threshold in "+alltrim(str(max10 ))+" recs." )
              fil.write_line("")
              
              IF onefields> 0 .and. onefields < recs
              	fil.write_line("1 FIELDS OCCUPIED BY "+alltrim(str(onefields))+" RECORDS.")
              	maxlines = 1
              END IF
              IF twofields> 0 .and. twofields < recs
              	fil.write_line("2 FIELDS OCCUPIED BY "+alltrim(str(twofields))+" RECORDS.")
              	maxlines = 2
              END IF
              IF threefields> 0 .and. onefields < recs
              	fil.write_line("3 FIELDS OCCUPIED BY "+alltrim(str(threefields))+" RECORDS.")
              	maxlines = 3
              END IF
              IF fourfields> 0 .and. onefields < recs
              	fil.write_line("4 FIELDS OCCUPIED BY "+alltrim(str(fourfields))+" RECORDS.")
              	maxlines = 4
              END IF
              IF fivefields> 0 .and. onefields < recs
              	fil.write_line("5 FIELDS OCCUPIED BY "+alltrim(str(fivefields))+" RECORDS.")
              	maxlines = 5
              END IF
              IF sixfields> 0 .and. onefields < recs
              	fil.write_line("6 FIELDS OCCUPIED BY "+alltrim(str(sixfields))+" RECORDS.")
              	maxlines = 6
              END IF
              IF sevenfields> 0 .and. onefields < recs
              	fil.write_line("7 FIELDS OCCUPIED BY "+alltrim(str(sevenfields))+" RECORDS.")
              	maxlines = 7
              END IF
              IF eightfields> 0 .and. onefields < recs
              	fil.write_line("8 FIELDS OCCUPIED BY "+alltrim(str(eightfields))+" RECORDS.")
              	maxlines = 8
              END IF
              IF ninefields> 0 .and. onefields < recs
              	fil.write_line("9 FIELDS OCCUPIED BY "+alltrim(str(ninefields))+" RECORDS.")
              	maxlines = 9
              END IF
              IF tenfields> 0 .and. onefields < recs
              	fil.write_line("10 FIELDS OCCUPIED BY "+alltrim(str(tenfields))+" RECORDS.")
              	maxlines = 10
              END IF
              fil.write_line("")
              fil.write_line("Maximum number of lines required is "+alltrim(str(maxlines)))
              fil.write_line("located at record "+alltrim(str(bigrec)))
              fil.write_line("Maximum number of characters required is "+alltrim(str(max(fld1,max(fld2,max(fld3,max(fld4,max(fld5,max(fld6,max(fld7,max(fld8,max(fld9,fld10))))))))))))
              fil.write_line("")
              fil.write_line("Dump of first record(s)for file "+tbl_name+".txt")
              fil.write_line("")
              tbl.fetch_first()
              for n = 1 to 3
              	fil.write_line("Line1 "+tbl.field1)
              	fil.write_line("Line2 "+tbl.field2)
              	fil.write_line("Line3 "+tbl.field3)
              	fil.write_line("Line4 "+tbl.field4)
              	fil.write_line("Line5 "+tbl.field5)
              	fil.write_line("Line6 "+tbl.field6)
              	fil.write_line("Line7 "+tbl.field7)
              	fil.write_line("Line8 "+tbl.field8)
              	fil.write_line("Line9 "+tbl.field9)
              	fil.write_line("Line10 "+tbl.field10)
              	fil.write_line("")
              next n
              fil.write_line("")
              fil.write_line("I have verified ....")
              fil.write_line("all lines...")
              fil.write_line("")
              'etc.
              fil.flush()
              fil.close()
              tbl.close()
              There can be only one.

              Comment


                #8
                Re: Maximum number of char/fields dump

                I wonder if there is a way to get the file(s) without using user interaction (ui) and in the event that there are more than one file for the job, can the code run for each file?
                example: my job#: 12345 files are 12345a.dbf, 12345b.dbf
                Thanks!

                Comment


                  #9
                  Re: Maximum number of char/fields dump

                  You can get the path and filenames like.

                  Code:
                  dtermin = "12345"
                  filelist = filefind.get("P:\executive\hdb\test\\"+dtermin+"?.dbf",FILE_FIND_NORMAL,"PN")
                  ? filelist
                  = P:\executive\hdb\test\12345a.dbf
                  P:\executive\hdb\test\12345b.dbf
                  P:\executive\hdb\test\12345c.dbf
                  P:\executive\hdb\test\12345m.dbf
                  P:\executive\hdb\test\12345z.dbf
                  And count the files with

                  Code:
                  ? w_count(filelist,crlf())
                  = 5
                  So all you need to do is alter the script to loop through this list.
                  There can be only one.

                  Comment


                    #10
                    Re: Maximum number of char/fields dump

                    Can you tell me how to make the script loop through the list? Thanks -

                    Comment


                      #11
                      Re: Maximum number of char/fields dump

                      You want jam on that?

                      Change the path in the filefind.get() to match where your files will be found.

                      Code:
                      dtermin = ui_get_text("File","What file number?","12345","00000")
                      filelist = filefind.get("P:\executive\hdb\test\\"+dtermin+"?.dbf",FILE_FIND_NORMAL,"PN")
                      IF filelist = ""
                      	end
                      END IF
                      filecount  = w_count(filelist,crlf())
                      FOR i = 1 TO filecount
                      	topen = word(filelist,i,crlf())
                      	tbl = table.open(topen,FILE_RW_EXCLUSIVE)
                      	tbl_name = file.filename_parse(topen,"N")
                      	fil = file.create(a5.Get_Path()+chr(92)+tbl_name+".txt",FILE_RW_EXCLUSIVE)
                      	ix = tbl.index_primary_put()
                      	recs = ix.records_get()
                      	fil.write_line("MasterFile= "+tbl_name+".zip")
                      	fil.write_line("File = "+tbl_name+".txt")
                      	fil.write_line(Alltrim(str(recs))+" RECORDS IN THIS FILE")
                      	FOR i = 1 TO 10
                      		evaluate_template("fld"+alltrim(str(i))+"= 0")
                      	NEXT i
                      	FOR j = 1 TO 10
                      		evaluate_template("max"+alltrim(str(j))+"= 0")
                      	NEXT j
                      	
                      	FOR k = 1 TO 10
                      		evaluate_template("defw"+alltrim(str(k))+"= "+alltrim(str(tbl.field_get(k).width_get())))
                      	NEXT k
                      	FOR l = 1 TO 10
                      		evaluate_template("the"+alltrim(str(l))+"rec = 0")
                      	NEXT l
                      	FOR m = 1 TO 10
                      		evaluate_template("arec"+alltrim(str(m))+"= .F.")
                      	NEXT m
                      	onefields = 0
                      	twofields = 0
                      	threefields = 0
                      	fourfields = 0
                      	fivefields = 0
                      	sixfields = 0
                      	sevenfields = 0
                      	eightfields = 0
                      	ninefields = 0
                      	tenfields = 0
                      	tbl.fetch_first()
                      	'debug(1)
                      	WHILE .not. tbl.fetch_eof()
                      		IF len(alltrim(tbl.Field1)) > fld1
                      			fld1 = len(alltrim(tbl.Field1))
                      			IF len(alltrim(tbl.Field1)) = defw1
                      				max1 = max1+1
                      			END IF
                      			
                      		END IF
                      		IF len(alltrim(tbl.Field2)) > fld2
                      			fld2 = len(alltrim(tbl.Field2))
                      			IF len(alltrim(tbl.Field2)) = defw2
                      				max2 = max2+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field3)) > fld3
                      			fld3 = len(alltrim(tbl.Field3))
                      			IF len(alltrim(tbl.Field3)) = defw3
                      				max3 = max3+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field4)) > fld4
                      			fld4 = len(alltrim(tbl.Field4))
                      			IF len(alltrim(tbl.Field4)) = defw4
                      				max4 = max4+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field5)) > fld5
                      			fld5 = len(alltrim(tbl.Field5))
                      			IF len(alltrim(tbl.Field5)) = defw5
                      				max5 = max5+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field6)) > fld6
                      			fld6 = len(alltrim(tbl.Field6))
                      			IF len(alltrim(tbl.Field6)) = defw6
                      				max6 = max6+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field7)) > fld7
                      			fld7 = len(alltrim(tbl.Field7))
                      			IF len(alltrim(tbl.Field7)) = defw7
                      				max7 = max7+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field8)) > fld8
                      			fld8 = len(alltrim(tbl.Field8))
                      			IF len(alltrim(tbl.Field8)) = defw8
                      				max8 = max8+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field9)) > fld9
                      			fld8 = len(alltrim(tbl.Field9))
                      			IF len(alltrim(tbl.Field9)) = defw9
                      				max9 = max9+1
                      			END IF
                      		END IF
                      		IF len(alltrim(tbl.Field10)) > fld10
                      			fld8 = len(alltrim(tbl.Field10))
                      			IF len(alltrim(tbl.Field10)) = defw10
                      				max10 = max10+1
                      			END IF
                      		END IF
                      		emptyfields = if(isblank("tbl.field1"),1,0)+if(isblank("tbl.field2"),1,0)+if(isblank("tbl.field3"),1,0)+if(isblank("tbl.field4"),1,0)+if(isblank("tbl.field5"),1,0)+if(isblank("tbl.field6"),1,0)+if(isblank("tbl.field7"),1,0)+if(isblank("tbl.field8"),1,0)+if(isblank("tbl.field9"),1,0)+if(isblank("tbl.field10"),1,0)
                      		SELECT
                      			CASE emptyfields = 0
                      				tenfields = tenfields+1
                      				arec10 = .T.
                      			CASE emptyfields = 1
                      				ninefields = ninefields+1
                      				arec9 = .T.
                      			CASE emptyfields = 2
                      				eightfields = eightfields+1
                      				arec8 = .T.
                      			CASE emptyfields = 3
                      				sevenfields = sevenfields+1
                      				arec7 = .T.
                      			CASE emptyfields = 4
                      				sixfields = sixfields+1
                      				arec6 = .T.
                      			CASE emptyfields = 5
                      				fivefields = fivefields+1
                      				arec5 = .T.
                      			CASE emptyfields = 6
                      				fourfields = fourfields+1
                      				arec4 = .T.
                      			CASE emptyfields = 7
                      				threefields = threefields+1
                      				arec3 = .T.
                      			CASE emptyfields = 8
                      				twofields = twotfields+1
                      				arec2 = .T.
                      			CASE emptyfields = 9
                      				onefields = onefields+1
                      				arec1 = .T.
                      				
                      		END SELECT
                      		SELECT
                      			CASE arec10 = .T.
                      				the10rec = tbl.recno()
                      			CASE arec9 = .T.
                      				the9rec = tbl.recno()
                      			CASE arec8 = .T.
                      				the8rec = tbl.recno()
                      			CASE arec7 = .T.
                      				the7rec = tbl.recno()
                      			CASE arec6 = .T.
                      				the6rec = tbl.recno()
                      			CASE arec5 = .T.
                      				the5rec = tbl.recno()
                      			CASE arec4 = .T.
                      				the4ec = tbl.recno()
                      			CASE arec3 = .T.
                      				the3rec = tbl.recno()
                      			CASE arec2 = .T.
                      				the2rec = tbl.recno()
                      			CASE arec1 = .T.
                      				the1rec = tbl.recno()
                      		END SELECT
                      		FOR m = 1 TO 10
                      			evaluate_template("arec"+alltrim(str(m))+"= .F.")
                      		NEXT m
                      		tbl.fetch_next()
                      	END WHILE
                      	SELECT
                      		CASE the10rec > 0
                      			bigrec = the10rec
                      		CASE the9rec > 0
                      			bigrec = the9rec
                      		CASE the8rec > 0
                      			bigrec = the8rec
                      		CASE the7rec > 0
                      			bigrec = the7rec
                      		CASE the6rec > 0
                      			bigrec = the6rec
                      		CASE the5rec > 0
                      			bigrec = the5rec
                      		CASE the4rec > 0
                      			bigrec =ther4ec
                      		CASE the3rec > 0
                      			bigrec = the3rec
                      		CASE the2rec > 0
                      			bigrec = the2rec
                      		CASE the1rec > 0
                      			bigrec = the1rec
                      	END SELECT
                      	fil.write_line("LINE1 has "+alltrim(str(fld1))+" chars max. Threshold in "+alltrim(str(max1 ))+" recs." )
                      	fil.write_line("LINE2 has "+alltrim(str(fld2))+" chars max. Threshold in "+alltrim(str(max2 ))+" recs." )
                      	fil.write_line("LINE3 has "+alltrim(str(fld3))+" chars max. Threshold in "+alltrim(str(max3 ))+" recs." )
                      	fil.write_line("LINE4 has "+alltrim(str(fld4))+" chars max. Threshold in "+alltrim(str(max4 ))+" recs." )
                      	fil.write_line("LINE5 has "+alltrim(str(fld5))+" chars max. Threshold in "+alltrim(str(max5 ))+" recs." )
                      	fil.write_line("LINE6 has "+alltrim(str(fld6))+" chars max. Threshold in "+alltrim(str(max6 ))+" recs." )
                      	fil.write_line("LINE7 has "+alltrim(str(fld7))+" chars max. Threshold in "+alltrim(str(max7 ))+" recs." )
                      	fil.write_line("LINE8 has "+alltrim(str(fld8))+" chars max. Threshold in "+alltrim(str(max8 ))+" recs." )
                      	fil.write_line("LINE9 has "+alltrim(str(fld9))+" chars max. Threshold in "+alltrim(str(max9 ))+" recs." )
                      	fil.write_line("LINE10 has "+alltrim(str(fld10))+" chars max. Threshold in "+alltrim(str(max10 ))+" recs." )
                      	fil.write_line("")
                      	
                      	IF onefields> 0 .and. onefields < recs
                      		fil.write_line("1 FIELDS OCCUPIED BY "+alltrim(str(onefields))+" RECORDS.")
                      		maxlines = 1
                      	END IF
                      	IF twofields> 0 .and. twofields < recs
                      		fil.write_line("2 FIELDS OCCUPIED BY "+alltrim(str(twofields))+" RECORDS.")
                      		maxlines = 2
                      	END IF
                      	IF threefields> 0 .and. onefields < recs
                      		fil.write_line("3 FIELDS OCCUPIED BY "+alltrim(str(threefields))+" RECORDS.")
                      		maxlines = 3
                      	END IF
                      	IF fourfields> 0 .and. onefields < recs
                      		fil.write_line("4 FIELDS OCCUPIED BY "+alltrim(str(fourfields))+" RECORDS.")
                      		maxlines = 4
                      	END IF
                      	IF fivefields> 0 .and. onefields < recs
                      		fil.write_line("5 FIELDS OCCUPIED BY "+alltrim(str(fivefields))+" RECORDS.")
                      		maxlines = 5
                      	END IF
                      	IF sixfields> 0 .and. onefields < recs
                      		fil.write_line("6 FIELDS OCCUPIED BY "+alltrim(str(sixfields))+" RECORDS.")
                      		maxlines = 6
                      	END IF
                      	IF sevenfields> 0 .and. onefields < recs
                      		fil.write_line("7 FIELDS OCCUPIED BY "+alltrim(str(sevenfields))+" RECORDS.")
                      		maxlines = 7
                      	END IF
                      	IF eightfields> 0 .and. onefields < recs
                      		fil.write_line("8 FIELDS OCCUPIED BY "+alltrim(str(eightfields))+" RECORDS.")
                      		maxlines = 8
                      	END IF
                      	IF ninefields> 0 .and. onefields < recs
                      		fil.write_line("9 FIELDS OCCUPIED BY "+alltrim(str(ninefields))+" RECORDS.")
                      		maxlines = 9
                      	END IF
                      	IF tenfields> 0 .and. onefields < recs
                      		fil.write_line("10 FIELDS OCCUPIED BY "+alltrim(str(tenfields))+" RECORDS.")
                      		maxlines = 10
                      	END IF
                      	fil.write_line("")
                      	fil.write_line("Maximum number of lines required is "+alltrim(str(maxlines)))
                      	fil.write_line("located at record "+alltrim(str(bigrec)))
                      	fil.write_line("Maximum number of characters required is "+alltrim(str(max(fld1,max(fld2,max(fld3,max(fld4,max(fld5,max(fld6,max(fld7,max(fld8,max(fld9,fld10))))))))))))
                      	fil.write_line("")
                      	fil.write_line("Dump of first record(s)for file "+tbl_name+".txt")
                      	fil.write_line("")
                      	tbl.fetch_first()
                      	FOR n = 1 TO 3
                      		fil.write_line("Line1 "+tbl.field1)
                      		fil.write_line("Line2 "+tbl.field2)
                      		fil.write_line("Line3 "+tbl.field3)
                      		fil.write_line("Line4 "+tbl.field4)
                      		fil.write_line("Line5 "+tbl.field5)
                      		fil.write_line("Line6 "+tbl.field6)
                      		fil.write_line("Line7 "+tbl.field7)
                      		fil.write_line("Line8 "+tbl.field8)
                      		fil.write_line("Line9 "+tbl.field9)
                      		fil.write_line("Line10 "+tbl.field10)
                      		fil.write_line("")
                      	NEXT n
                      	fil.write_line("")
                      	fil.write_line("I have verified ....")
                      	fil.write_line("all lines...")
                      	fil.write_line("")
                      	'etc.
                      	fil.flush()
                      	fil.close()
                      	tbl.close()
                      NEXT i
                      There can be only one.

                      Comment


                        #12
                        Re: Maximum number of char/fields dump

                        You are the best. Thanks a lot.

                        Comment

                        Working...
                        X