# Displaying large text in a text box using Clarion 6.3

**URL:** <https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134>\
**Category:** questions\
**Tags:** c6, stringtheory\
**Created:** [April 8, 2023, 8:41pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134 "2023-04-08T20:41:08Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 8, 2023, 8:41pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/1 "2023-04-08T20:41:08Z")

</div>

Hi,

I have this large text that I want to display which I get from a file using String Theory, and the size of this text exceeds the variable limits in clarion.

I felt that RTF text control could handle it and did few tests but failed.

Any suggestions are appreciated.  
I am using Clarion 6.3

Regards

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [April 8, 2023, 10:09pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/2 "2023-04-08T22:09:43Z")

</div>

The max I think you can load is like 20-30k in C6.3. And that max changes as you add more text controls to the window. I think I recall using the RTF attribute to get more in there.

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [April 8, 2023, 10:15pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/3 "2023-04-08T22:15:03Z")

</div>

Doc shows the max for a string is 4MB  
What you can do is put the file into a queue and show the contents in a list.

You can work out the line wrapping by putting part of the file into a text control and extract the lines via property syntax  
see ?Text{prop:line,n} and ?Text{prop:linecount}

Another approach would be to use scintilla. See the open source KSS as an example of how to use scintilla in your code

> **[GitHub - mriffey/KSSOpen: Search tool that is a wrapper around Microsoft's...](https://github.com/mriffey/KSSOpen)**
>
> Search tool that is a wrapper around Microsoft's FindStr, making it easy to work with search results. Supports many programming languages (see Devuna docs).

---

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 8, 2023, 11:26pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/4 "2023-04-08T23:26:13Z")

</div>

> [@MarkGoldberg](#):
>
> You can work out the line wrapping by putting part of the file into a text control and extract the lines via property syntax

I already did something similar by slicing the st.GetValue() using the SUB function to display one part of the value in a screen variable with 4MB length each time controlled by back and forward buttons (Paging) and it is working fine.

But I was thinking about finding a way to display the value of the string fully in one box.

Thank you for your suggestion.

Regards

---

<div class="post-metadata">

**Author:** ![anon77170705](https://clarionhub.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@anon77170705](https://clarionhub.com/u/anon77170705)\
**Post date:** [April 8, 2023, 11:45pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/5 "2023-04-08T23:45:45Z")

</div>

> [@MarkGoldberg](#):
>
> Doc shows the max for a string is 4MB

This is the limit for size of any declared variable or structure. There is no such restriction for data objects allocated in the heap. For example,

```auto
SR &STRING,AUTO
...
  SR &= NEW STRING (64*1024*1024)

```

is good.

“Normal” TEXT controls can display text of size less than 64K. This is restriction for Windows controls with class “Edit”. RTF controls can display text of practically any size.

---

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 9, 2023, 12:59am UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/6 "2023-04-09T00:59:43Z")

</div>

> [@anon77170705](#):
>
> This is the limit for size of any declared variable or structure. There is no such restriction for data objects allocated in the heap. For example,

Yes you are right (and this is what I used in paging) as using st.value in this process delays the display, so I adjust the width of the variable to save the st.value to . But still I could not get it to fit in the box.

Thank you

---

<div class="post-metadata">

**Author:** ![Julian](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@Julian](https://clarionhub.com/u/Julian)\
**Post date:** [April 9, 2023, 10:25am UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/7 "2023-04-09T10:25:18Z")

</div>

I have displayed some large text files using a browser control, ie: shell.explorer.2 .. might that be an option?

---

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 9, 2023, 5:56pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/8 "2023-04-09T17:56:12Z")

</div>

If I understand correctly, the file will be displayed outside the opened window. right?

Regards

---

<div class="post-metadata">

**Author:** ![noyantis](https://clarionhub.com/user_avatar/clarionhub.com/noyantis/32/922_2.png) [@noyantis](https://clarionhub.com/u/noyantis)\
**Post date:** [April 9, 2023, 6:31pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/9 "2023-04-09T18:31:05Z")

</div>

Hi,

Just a thought… The SyntaxEdit control from Codejock will allow you to view and / or edit large text files.

The control itself is an ActiveX but can be added to your clarion app and in a clarion window in minutes using our wrapper template.

A demo is available on our website - [noyantis.com](http://noyantis.com)

All of our templates are c6.3 to c11.1 compatible.

Regards,

Andy

---

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 9, 2023, 6:35pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/10 "2023-04-09T18:35:18Z")

</div>

I will check that. thank you

Regards

---

<div class="post-metadata">

**Author:** ![vitesse](https://clarionhub.com/user_avatar/clarionhub.com/vitesse/32/837_2.png) [@vitesse](https://clarionhub.com/u/vitesse)\
**Post date:** [April 9, 2023, 11:49pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/11 "2023-04-09T23:49:13Z")

</div>

As well as all the other suggestions, check out the built in “View an Ascii File” template in case that is useful to you.

---

<div class="post-metadata">

**Author:** ![Julian](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@Julian](https://clarionhub.com/u/Julian)\
**Post date:** [April 10, 2023, 10:15am UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/12 "2023-04-10T10:15:38Z")

</div>

No, it displays in a control on a Clarion application window, see this example which opens a .pdf, just change the filename to your own.

[https://clarionhub.com/t/pdf-not-working-in-clarion-image-control/5462/4](https://clarionhub.com/t/pdf-not-working-in-clarion-image-control/5462/4)

---

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 11, 2023, 1:16am UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/13 "2023-04-11T01:16:22Z")

</div>

yes you are right.

anyhow I tested the method and it was ok for normal size files but for big files it starts displaying and suddenly the box turns to blank (screen is still active and working), so it seems it loads until a certain limit only.

Thank for suggesting this point.

Regards

---

<div class="post-metadata">

**Author:** ![noyantis](https://clarionhub.com/user_avatar/clarionhub.com/noyantis/32/922_2.png) [@noyantis](https://clarionhub.com/u/noyantis)\
**Post date:** [April 11, 2023, 8:20am UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/14 "2023-04-11T08:20:28Z")

</div>

Hi,

I quickly tested the Codejock SytntaxEdit control inside a clarion app - it was our demo app compiled in c10, but the results should be the same for a c6 app too.

I tested text files of the following sizes - all opened and allowed you to continue editing etc…

10k, 100k, 1mb, 10mb, 100mb and 1gb

I have to admit moving around and typing additional text did slow down when using the 1gb text file - but considering the size of the content I think that’s ok 🙂

Anyway, just thought I’d let you know the results. If you do need it testing in c6.3 then let me know and I’ll re-run the tests on a Win7 VM I have for c6 dev / testing.

Regards,

Andy  
[noyantis.com](http://noyantis.com)

---

<div class="post-metadata">

**Author:** ![anon77170705](https://clarionhub.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@anon77170705](https://clarionhub.com/u/anon77170705)\
**Post date:** [April 11, 2023, 1:12pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/15 "2023-04-11T13:12:01Z")

</div>

How large is the text size? I just converted 2 e-books to RTF and they were loaded and displayed without problems using the RichEdit demo program. One of RTF files has size 19 MB, other one - almost 39 MB. Texts includes different fonts and embedded images.

 ![RTF](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/3/38618157a0fa22ce3a96b46eeea9ae8a044de53b.png)

---

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 12, 2023, 11:28am UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/18 "2023-04-12T11:28:15Z")

</div>

Sorry to surprise you but I am talking about 1.8GB text file (actually csv) which can be operated but not displayed inside the clarion screen except by paging as I mentioned before.

The file can be opened with a third party like Notepad++ (which I am using now using RUN command)

Thank you for sharing.

Regards,

---

<div class="post-metadata">

**Author:** ![anon77170705](https://clarionhub.com/letter_avatar_proxy/v4/letter/a/ecccb3/32.png) [@anon77170705](https://clarionhub.com/u/anon77170705)\
**Post date:** [April 12, 2023, 2:40pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/19 "2023-04-12T14:40:57Z")

</div>

> [@sk2107](#):
>
> Sorry to surprise you but I am talking about 1.8GB text file (actually csv) which can be operated but not displayed inside the clarion screen except by paging as I mentioned before.

Win32 programs can access only 2 GB memory below address 80000000h. All stuff working not in the kernel/driver mode must be loaded below this bound. So, really, files of size 1.8GB can’t be loaded to the program memory completely. Loading such files by pages is the only way. 64-bit programs do not load such large files completely too.

---

<div class="post-metadata">

**Author:** ![CarlBarnes](https://clarionhub.com/user_avatar/clarionhub.com/carlbarnes/32/1859_2.png) [@CarlBarnes](https://clarionhub.com/u/CarlBarnes)\
**Post date:** [April 12, 2023, 8:46pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/20 "2023-04-12T20:46:20Z")

</div>

> [@sk2107](#):
>
> Sorry to surprise you but I am talking about 1.8GB text file (actually csv)

Not until the 18th post you mention that your “large” is 1.8 GB ☹ . You do mean 1.8 Billion bytes?

I wonder _who_ is going to page through 1.8 GB of CSV data and glean anything. At 100 bytes/line that is 18 million lines. I would guess you just want a peek at the top and bottom of the file to see it is as expected. That the bottom as the new records you expect.

Since C9 or C10 the BASIC driver supports PREVIOUS. That would let you can view a CSV file using the normal Browse template so it is page loaded like with a TopSpeed file.

Since you are in C6 then I would build a TPS file to Index the CSV file. Something with minimal info

```auto
CsvIndex FILE,DRIVER('TopSpeed'),PRE(CsvInx)
KeyLineNo KEY(CsvInx:LineNo)
  RECORD
LineNo LONG
SliceBeg LONG
SliceLen LONG

```

Then you can Browse that TPS file allowing page loading. In Format Element of the Browse Queue do a GET(CsvFile,SliceBeg,SliceLen) to have the CSV line to show in the Browse. I would probably use the DOS driver for that GET. You could put a STRING and a KEY if you wanted a way to sort. I would be trying to keep the TPS small.

My helper class Bug Bang for String Theory shows how to make a Virtual List Box view an ST CSV file:

> **[GitHub - CarlTBarnes/StringTheory-Tools: StringTheory tools BigBangTheory, Scratch Theory,...](https://github.com/CarlTBarnes/StringTheory-Tools#bigbangtheory-value-and-split-lines-viewer)**
>
> StringTheory tools BigBangTheory, Scratch Theory, Split Theory and Write Theory to assist in writing, testing and debugging ST code. Similar Bang String class for non-ST.

---

<div class="post-metadata">

**Author:** ![sk2107](https://clarionhub.com/user_avatar/clarionhub.com/sk2107/32/3135_2.png) [@sk2107](https://clarionhub.com/u/sk2107)\
**Post date:** [April 12, 2023, 10:16pm UTC](https://clarionhub.com/t/displaying-large-text-in-a-text-box-using-clarion-6-3/6134/21 "2023-04-12T22:16:10Z")

</div>

In one of my previous posts, I mentioned that I have been using clarion since 2000.

Although it is not the language I use for work, I enjoy using it for personal projects. I find it fun to create my own tools to help me in my digital life, and I believe that clarion can produce applications that are comparable to well-known tools.

This presents a challenge for me, and while some may ask why I bother reinventing the wheel, I see it as an opportunity to learn something new every time I encounter a new problem.

Rather than simply seeking a solution, I am interested in exploring different perspectives and approaches to problem-solving. Thank you all for your contributions.
