` Printed Icetips Article

Icetips Article



Par2: Displaying more than 64k in a Text control
2013-08-10 -- Graham Dawson
 
You can use the DOS file driver and slice the text in the control using 
prop:text eg

dosFile file,driver('DOS')
record    record
line        string(65565)
          end
        end


LoadText routine

dosFile{prop:name} = 'fullpathOfYourFile'
open(dosFile)
set(dosFile)
loop
  next(dosFile)
  if errorcode() then break end
  if not bytes(dosFile) then break end
  ?Text1{prop:text} = ?Text1{prop:text} & |
         dosFile.line[1 : bytes(dosFile)]
end
close(dosFile)

Obviously above needs error checking - but just tested with a 109KB CLW 
source file, an ordinary TEXT control (_not_ RTF) with horizontal and 
vertical scrollbars and everything loads OK.

So the text control itself doesn't have a 64KB limit.



Printed May 3, 2024, 11:36 am
This article has been viewed/printed 35121 times.