# What is the maximum character length of a StringField?

**URL:** <https://forum.inductiveautomation.com/t/what-is-the-maximum-character-length-of-a-stringfield/5639>\
**Category:** Module Development\
**Created:** [January 3, 2013, 6:16pm UTC](https://forum.inductiveautomation.com/t/what-is-the-maximum-character-length-of-a-stringfield/5639 "2013-01-03T18:16:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [January 3, 2013, 6:16pm UTC](https://forum.inductiveautomation.com/t/what-is-the-maximum-character-length-of-a-stringfield/5639/1 "2013-01-03T18:16:42Z")

</div>

What is the maximum character length of a com.inductiveautomation.ignition.gateway.localdb.persistence.StringField ?

Is there a way I could find this out on my own?

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 3, 2013, 6:24pm UTC](https://forum.inductiveautomation.com/t/what-is-the-maximum-character-length-of-a-stringfield/5639/2 "2013-01-03T18:24:26Z")

</div>

One of the constructors defaults the size to 4096 bytes, the other lets you specify the max size.

```auto
public StringField(SRecordMeta<?> meta, String columnName, SFieldFlags... pvals) 
public StringField(SRecordMeta<?> meta, String columnName, int maxValue, SFieldFlags... pvals) 
```

Javadoc is non-existant on these, so there’s not much you could’ve done but look at the signatures.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [January 3, 2013, 6:29pm UTC](https://forum.inductiveautomation.com/t/what-is-the-maximum-character-length-of-a-stringfield/5639/3 "2013-01-03T18:29:12Z")

</div>

Thanks Kevin.

Just a suggestion. It seems like it might be more clear if the “maxValue” argument was named something like “maxLength”.

Nick

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 3, 2013, 6:42pm UTC](https://forum.inductiveautomation.com/t/what-is-the-maximum-character-length-of-a-stringfield/5639/4 "2013-01-03T18:42:59Z")

</div>

```auto
/* Filename: StringField.java
 * Created on Nov 7, 2008
 * Author: Carl Gould
 * Copyright Inductive Automation 2008
 * Project: SRGateway
 */
```

Blame Carl 😆

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [January 3, 2013, 6:58pm UTC](https://forum.inductiveautomation.com/t/what-is-the-maximum-character-length-of-a-stringfield/5639/5 "2013-01-03T18:58:24Z")

</div>

Okay. Can’t blame him too much. Having a setting to specify the maximum length of the string field is great.
