# Editing a New() CString in a Window Text Control

**URL:** <https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678>\
**Category:** questions\
**Tags:** language\
**Created:** [October 8, 2025, 12:37pm UTC](https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678 "2025-10-08T12:37:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonW](https://clarionhub.com/user_avatar/clarionhub.com/jonw/32/1344_2.png) [@JonW](https://clarionhub.com/u/JonW)\
**Post date:** [October 8, 2025, 12:37pm UTC](https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678/1 "2025-10-08T12:37:51Z")

</div>

Hi,

I'm trying to get the ability to edit some files with code (SQL, not that it matters) in a window in Clarion. A fair number of those files are over 4K in size (the largest at the moment is 32K).

If I have a CSTRING declared at its maximum size (4K) and add that to the window, everything is hunkydory (except for I'm missing the end of some files), like:

```auto
sqltext cstring(4000)

window
  ...
 text...,use(sqltext)
end

code

open(window)

```

all works perfectly

But

```auto
sqltext &cstring

window
  ...
 text...,use(sqltext)
end

code

sqltext &= new cstring(4000)
open(window)

```

crashes on opening the window.

I'm doing this in an APP, not a hand-coded exe but I'm pretty sure it is merely the change to the cstring reference that causes the app to just go away on trying to open the window. Is there a way to do what I want? Am I missing something simple? I really don't want to have to deal with the file as a queue of chunks that I can see only one at a time.

---

<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:** [October 8, 2025, 1:00pm UTC](https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678/2 "2025-10-08T13:00:49Z")

</div>

> [@JonW](#):
>
> ```auto
> sqltext &cstring
> 
> window
> ...
> text...,use(sqltext)
> end
> 
> ```

@jslarve knows how to do this… IIRC

1. Do Not declare `Use(SqlText)` instead `Use(?TxtFeq)`
2. After window is open `?TxtFeq{PROP:Use}=SqlText`
3. Before window close `?TxtFeq{PROP:Use}='' `

```clarion
sqltext &cstring

window window('...
  text...,use(?TxtFeq)
end
  code
  sqltext &= new cstring(4000)
  open(window)
  ?TxtFeq{PROP:Use}=SqlText
  Accept 
      .... 
  End
  ?TxtFeq{PROP:Use}='' 
  Close(window)
  Dispose(Sqltext)

```

---

<div class="post-metadata">

**Author:** ![JonW](https://clarionhub.com/user_avatar/clarionhub.com/jonw/32/1344_2.png) [@JonW](https://clarionhub.com/u/JonW)\
**Post date:** [October 8, 2025, 1:16pm UTC](https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678/3 "2025-10-08T13:16:22Z")

</div>

Thanks Carl,

I did set up a little handcoded thing just to check it was the cstring ref and the window open that was the culprit (which it was).

Tried what you posted there and it worked fine, so should be fine in the app too!

Many thanks,

Jon

---

<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:** [October 8, 2025, 2:48pm UTC](https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678/4 "2025-10-08T14:48:08Z")

</div>

The same idea applies for FROM() as well.

---

<div class="post-metadata">

**Author:** ![Bruce](https://clarionhub.com/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@Bruce](https://clarionhub.com/u/Bruce)\
**Post date:** [October 9, 2025, 2:30am UTC](https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678/5 "2025-10-09T02:30:24Z")

</div>

Not at my computer, but pretty sure you can declare a cstring \> 4k.

---

<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:** [October 9, 2025, 3:33am UTC](https://clarionhub.com/t/editing-a-new-cstring-in-a-window-text-control/8678/6 "2025-10-09T03:33:32Z")

</div>

I “assumed” he was talking about 4m, but you could be right.
