How to scrol a text file that bigger then 65000k 
Author Message
 How to scrol a text file that bigger then 65000k

How to scrol a text file that bigger is then 65000k

Open "file.txt" For Input As #1
Text1.Text = Input(LOF(1), 1)
Close #1

This works very good but the file that i'm have is bigger then 65000k

can you help me



Wed, 08 Nov 2000 03:00:00 GMT  
 How to scrol a text file that bigger then 65000k

Download the EMS library.  I know that it is on the Enhanced Qbasic
Programming page.



Wed, 08 Nov 2000 03:00:00 GMT  
 How to scrol a text file that bigger then 65000k

Quote:

>How to scrol a text file that bigger is then 65000k

>Open "file.txt" For Input As #1
>Text1.Text = Input(LOF(1), 1)
>Close #1

>This works very good but the file that i'm have is bigger then 65000k

>can you help me

Here's one for powerbasic you can get started with....

  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _)
 | |_)  / _ \ \____\/  \|  _)   | |
 |____//_/ \_\(____/\__/|_|     |_|

     www.basicguru.com/schullian

$if 0
    ??????????????????????????                        PowerBASIC v3.50
 ??          DASoft          ??????????????????????????????????????????
 3  ????????????????????????????    Copyright 1998    3 DATE: 1998-01-31 ??
 3  3 FILE NAME   FILEVIEW.UNT o          by          ?? o o
 3  3 LIBRARY     DAS-NBT1.PBL o  Don Schullian, Jr.                     o o
 3  ??                                         o o
 3 A license is hereby granted to the holder to use this source code in  o o
 3 any program, commercial or otherwise,  without receiving the express  o o
 3 permission of the copyright holder and without paying any royalties,  o o
 3 as long as this code is not distributed in any compilable format.     o o
 3  IE: source code files, PowerBASIC Unit files, and printed listings   o o
 ??? o
   ??
$endif

'.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?
' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
$if 1
  $CODE SEG "DAS_NBT1"
  $EVENT               OFF
  $ERROR     ALL       OFF
  $OPTIMIZE  SIZE
  $OPTION    GOSUB     OFF
  $OPTION    CNTLBREAK OFF
  $OPTION    SIGNED    OFF
  $DEBUG     MAP       OFF
  $DEBUG     PATH      OFF
  $DEBUG     UNIT      OFF
  $COMPILE   UNIT
$endif

  %HOME_key   = &h4700 : %UP_key     = &h4800 : %PGUP_key   = &h4900
  %LEFT_key   = &h4B00 :                      : %RIGHT_key  = &h4D00
  %END_key    = &h4F00 : %DOWN_key   = &h5000 : %PGDN_key   = &h5100
  %CTRL_LEFT  = &h7300 :                        %CTRL_RIGHT = &h7400
  %ESC_key    = &h001B : %TAB_key    = &h0009 : %SHIFT_TAB  = &h0F00

  DECLARE FUNCTION fGetKey% ()
  DECLARE      SUB  TprintN (BYVAL Row?,BYVAL Col?,BYVAL V$,BYVAL Attr?)
'.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?
' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
' PURPOSE: preview an ASCii (SEQUENTIAL) file to a box on the screen
'  PARAMS: Row?, Col?   the top/left corner of the box
'          Rows?, Cols? the depth/width of the box
'          FileName$    the d:\path\filename.ext of the file to be
'                       viewed
'    NOTE: it is assumed that the file already exists
'          it is assumed that the screen area has been cleared and
'            colored as no color attribute is used to print
'          only the 1st 16,383 "lines" of data will be read
'.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?
' ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
SUB DisplayFile ( BYVAL Row    AS INTEGER, _
                  BYVAL Col    AS INTEGER, _
                  BYVAL Rows   AS INTEGER, _
                  BYVAL Cols   AS INTEGER, _
                  SEG FileName AS STRING ) LOCAL PUBLIC

  DIM ColOff   AS LOCAL INTEGER
  DIM D        AS LOCAL FLEX
  DIM FileNo   AS LOCAL INTEGER
  DIM L        AS LOCAL INTEGER
  DIM Ln       AS LOCAL STRING
  DIM LastLine AS LOCAL INTEGER
  DIM LastOff  AS LOCAL INTEGER
  DIM LastRow  AS LOCAL INTEGER
  DIM LastTop  AS LOCAL INTEGER
  DIM OldCol   AS LOCAL INTEGER
  DIM OldTop   AS LOCAL INTEGER
  DIM P(MAX,1) AS LOCAL LONG
  DIM TopLine  AS LOCAL INTEGER
  DIM X        AS LOCAL INTEGER

  ON LOCAL ERROR GOTO FVerror

  IF LEN(DIR$(FileName$)) = 0 THEN EXIT SUB

  FileNo% = FREEFILE
  OPEN "I", FileNo%, FileName$
  IF LOF(FileNo%) = 0 THEN GOTO FVexit

  FOR LastLine% = 0 TO 16383
    LINE INPUT #FileNo%, Ln$
    IF EOF(FileNo%) THEN EXIT FOR
  NEXT

  DIM P&(LastLine%)
  SEEK #FileNo%, 0

  FOR X% = 1 TO LastLine%
    LINE INPUT #FileNo%, Ln$
    L%       = LEN( Ln$ )
    LastOff% = MAX%( LastOff%, L% )
    P&(X%)   = P&(X%-1) + L% + 2
  NEXT

  LastTop% = MAX%( 0, LastLine% - Rows% + 1 )
  LastOff% = MAX%( 1, LastOff% - Cols% + 1 )
  DECR Rows%
  LastRow% = Row% + MIN%( LastLine%, Rows% )
  ColOff%  =   1
  OldTop%  =  -1
  TopLine% =   0
  MAP D$$ * Cols%

  DO
    TopLine% = MIN%( LastTop%, MAX%( 0, TopLine% ) )
    ColOff%  = MIN%( LastOff%, MAX%( 1, ColOff% ) )
    IF ( OldTop% <> TopLine% )   OR _
       ( OldCol% <> ColOff%  ) THEN
      OldTop% = TopLine%
      OldCol% = ColOff%
      SEEK #FileNo%, P&(TopLine%)
      FOR X% = Row% TO LastRow%
        LINE INPUT #FileNo%, Ln$
        D$$ = MID$( Ln$, ColOff% )
        TprintN X%, Col%, D$$, 0
      NEXT
    END IF
    SELECT CASE fGetKey%
      CASE %HOME_key   :      TopLine% = 0
      CASE %UP_key     : DECR TopLine%
      CASE %PGUP_key   : DECR TopLine%, Rows%
      CASE %END_key    :      TopLine% = LastTop%
      CASE %DOWN_key   : INCR TopLine%
      CASE %PGDN_key   : INCR TopLine%, Rows%
      CASE %LEFT_key   : DECR ColOff%
      CASE %CTRL_LEFT  :      ColOff% = 1
      CASE %SHIFT_TAB  : DECR ColOff%, 5
      CASE %TAB_key    : INCR ColOff%, 5
      CASE %CTRL_RIGHT :      ColOff% = LastOff%
      CASE %RIGHT_key  : INCR ColOff%, 1
      CASE %ESC_key    : EXIT LOOP
    END SELECT
  LOOP

  FVexit:
    IF FILEATTR( FileNo%, 0 ) THEN CLOSE #FileNo%
    EXIT SUB

  FVerror:
    RESUME FVexit

END SUB



Thu, 09 Nov 2000 03:00:00 GMT  
 How to scrol a text file that bigger then 65000k


Quote:
>How to scrol a text file that bigger is then 65000k

>Open "file.txt" For Input As #1
>Text1.Text = Input(LOF(1), 1)
>Close #1

You must index every line of the text in an index  array, it takes some time
but
after that you get fast scrolls

dim seekarray&(32767)      'you need to open qbasic with /ah option
                                        'and the file must have less thanr
32767 lines!
open "file" for input as #1
numlin%=1,curseek&=1
do while not eof(1)
    line input #1,text$
    seekarray&(numlin)=curseek&
    curseek&=curseek&+len(text$)+2     '+2 for CR+LF
    numlin%=numlin%+1
loop
'at this point you know where in the file is every line of text
'to retrieve the  line x you simply do

Seek #1,seekarray&(x)
line input #1,  text$

Antoni



Thu, 09 Nov 2000 03:00:00 GMT  
 How to scrol a text file that bigger then 65000k


Quote:

>>How to scrol a text file that bigger is then 65000k

>>Open "file.txt" For Input As #1
>>Text1.Text = Input(LOF(1), 1)
>>Close #1

>>This works very good but the file that i'm have is bigger then 65000k

>>can you help me

>Here's one for PowerBASIC you can get started with....

It seems to me that he's using some Visual Basic, so one for PowerBASIC
would help at all. My reasons to say this:

1. Text1.Text....it's a VB text box...[.text proberty]  (it could be a user
TYPE with Text as string, but below proves it's not)
2. QBasic/QuickBASIC (dunno about PB) CAN'T hold 65000K of text in a string,
only 32767 characters, and you can't have two of those....

- Thomas Daugaard

Quote:

>  ____    _    ____      ____  _____
> |  _ \  / \  / ___) __ | ___)(_   _)
> | |_)  / _ \ \____\/  \|  _)   | |
> |____//_/ \_\(____/\__/|_|     |_|

>     www.basicguru.com/schullian



Fri, 10 Nov 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to scrol a text file that bigger is then 65000k

2. How to scrol a text file that bigger is then 65000k

3. HELP: Finding text within a BIG file

4. Saving big arrays of char in text files

5. Divide a big text file into many small ones

6. Big .mdb file, hopeless via shared files?

7. How can I copy a big file to another file

8. scrol form programmatically

9. MSAccess-style scrol

10. Scrol-able label control?

11. Scrol a list box horizontaly

12. Vertical Scrol Bars Help Needed

 

 
Powered by phpBB® Forum Software