Page 1 of 2

DCHTMLVIEWER

Posted: Thu Nov 12, 2015 8:29 am
by Victorio
Hi,

What limit for file size is with DCHTMLVIEWER ?
I want use it for open Ascii text files. But if file is small, all is ok,then if file has about severam MB, fine not open, show only "clock".
What is better for show ascii text files (reports) ?
I need in it function for search, and print, also for print blocks of text.

I know, can generate PDF, but I have many many existing files in archive, and do not want convert it to PDF.

Thanks.

Victorio

Re: DCHTMLVIEWER

Posted: Fri Nov 13, 2015 6:20 am
by rdonnay
DCHTMLVIEWER creates a web browser control.

This is not appropriate for your needs.

How large is one of your ASCII files?

Re: DCHTMLVIEWER

Posted: Sat Nov 14, 2015 10:00 am
by Victorio
Ascii files has several MB, for example 12MB, but can be also 50-100MB.

Re: DCHTMLVIEWER

Posted: Sat Nov 14, 2015 10:10 am
by rdonnay
A file that large could be loaded into an array and then you could use DCBROWSE to view the array. You can set the presentation parameters so it will look like a text viewer.

Re: DCHTMLVIEWER

Posted: Sat Nov 14, 2015 10:21 am
by Victorio
Thanks, I look at it.

Re: DCHTMLVIEWER

Posted: Sat Nov 14, 2015 2:36 pm
by rdonnay
Use the DC_Txt*() functions.

Here is an example:

Code: Select all

aText := {}
nHandle := DC_TxtOpen('MyFile.Txt')

DO WHILE !DC_TxtEof(nHandle)
  cLine := DC_TxtLine(nHandle)
  AAdd(aText,{ cLine })
  DC_TxtSkip(nHandle)
ENDDO

DC_TxtClose(nHandle)

Re: DCHTMLVIEWER

Posted: Sat Nov 14, 2015 8:36 pm
by Auge_Ohr
Victorio wrote:What is better for show ascii text files (reports) ?
I need in it function for search, and print, also for print blocks of text.
what you want is not a simple Function :lol: ... you want something like WORD (or Wordpad) ...

Code: Select all

RunShell( cFile, "Wordpad.exe", .T. )
Victorio wrote:Ascii files has several MB, for example 12MB, but can be also 50-100MB.
who does "read" 50 MB ASCI Text ... :o

Re: DCHTMLVIEWER

Posted: Sun Nov 15, 2015 9:00 am
by Victorio
Roger: I used DC_Txt function in my source in other place for read file and processing, and work fine.
I will try it .

Jimmy : :oops: yes, notepad, or wordpad I can use, I am looking for a complicated solution and simple exist...
But some problem exist :
1. notepad or wordpad is in language Windows installation, but I need every dialogues in Slovak language (many users do not understand english :( )
2. notepad or wordpad allows editation, and in my application I can not allow this (I do not know, maybe wordpad or notepad can run with parameter to restriction edit .
Because I need text viewer with my full control in my application,

In old Clipper programs I have used Fileview, (uses FView.obj), that has several basic function listing, print, select block, search.

First I examine wordpad, notepad,... or some other viewers, but must be 32 and 64bit, can set code page,.
And also DCBROWSE.

Re: DCHTMLVIEWER

Posted: Sun Nov 15, 2015 9:32 am
by c-tec
Hello Victorio,
The Windwos editor has always the installed language, so Slovak language should not be a problem. And when you writeprotect the file bevor opening, the user cannot save changes to the content,
regards
Rudolf

Re: DCHTMLVIEWER

Posted: Sun Nov 15, 2015 1:06 pm
by Victorio
Rudolf: yes I tryed change read only atribute, it is not problem.
Language : If user has Windows set to english, or slovak dialogues, I always want to my dialogues will be all in slovak. User for example know "switch on" computer, login, and click to icon on screen.
Yes, it is only problem, if :
1. user has "english" windows and do not know, how to switch to Slovak, or cannot switch to slovak (some installations)
.and.
2. user do not understand english

Other problem is, that I have two type of ASCII files, coded with DOS LAtin 2 and coded in Windows 1250.
Then I must control it and show Ascii files in two modes. In Alaska I can use SET CHARSET TO ANSI, or OEM, but if I run for example wordpad, is is problem (must first convert large file...)

Also I test DCPRINT, but I must set it to best settings to show better readable text.