# Illegal array assignment

**URL:** <https://clarionhub.com/t/illegal-array-assignment/7071>\
**Category:** questions\
**Tags:** compiler, language\
**Created:** [April 2, 2024, 9:54pm UTC](https://clarionhub.com/t/illegal-array-assignment/7071 "2024-04-02T21:54:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![WesVec](https://clarionhub.com/user_avatar/clarionhub.com/wesvec/32/2256_2.png) [@WesVec](https://clarionhub.com/u/WesVec)\
**Post date:** [April 2, 2024, 9:54pm UTC](https://clarionhub.com/t/illegal-array-assignment/7071/1 "2024-04-02T21:54:38Z")

</div>

The below has worked fine but I increased the number of characters in the insurance name field and when compiling receive illegal array assignment.

```clarion
 COV:MCNUMBER=COV1:MCNUMBER
 COV:DATE=deformat(COV1:DATE,@d2)
 COV:COVCODE=COV1:Type
 COV:POLICY=COV1:POLICY
 COV:XSINGLE=day(cov:date)
 COV:month=month(cov:date)
 cov:insurancecompany=cov1:company
 append(coverage)

```

I remove cov:insurancecompany and compiles ok. Guess something happened when I changed the field size. Clarion 9.1

---

<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 2, 2024, 10:07pm UTC](https://clarionhub.com/t/illegal-array-assignment/7071/2 "2024-04-02T22:07:42Z")

</div>

May help to see File declration for COV: and COV1: ? Maybe you have a DIM() on something so an [Array Subscript] is needed.

Does the error point to a specific line in code? And what is the source on that line. You can paste a screen capture of the editor opened when you click on the error line.

---

<div class="post-metadata">

**Author:** ![WesVec](https://clarionhub.com/user_avatar/clarionhub.com/wesvec/32/2256_2.png) [@WesVec](https://clarionhub.com/u/WesVec)\
**Post date:** [April 2, 2024, 10:46pm UTC](https://clarionhub.com/t/illegal-array-assignment/7071/3 "2024-04-02T22:46:32Z")

</div>

Hi Carl,

It points to that one line.

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/b/b3f98fec5c555e8ada5469ccfa5ae21d53416829.png)

I delete the insurancecompany field and compiles. Not sure what would cause it

---

<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 3, 2024, 12:04am UTC](https://clarionhub.com/t/illegal-array-assignment/7071/4 "2024-04-03T00:04:24Z")

</div>

Perhaps you changed the dimensions instead of the string size?

---

<div class="post-metadata">

**Author:** ![WesVec](https://clarionhub.com/user_avatar/clarionhub.com/wesvec/32/2256_2.png) [@WesVec](https://clarionhub.com/u/WesVec)\
**Post date:** [April 3, 2024, 1:44am UTC](https://clarionhub.com/t/illegal-array-assignment/7071/5 "2024-04-03T01:44:33Z")

</div>

Found it - the dim box was accidently checked. Thanks.

Don Harvey

Hi Jeff, Yeah, dim was checked - now running into the error 47 - been so long forgotten how to solve this.

---

<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 3, 2024, 5:27am UTC](https://clarionhub.com/t/illegal-array-assignment/7071/6 "2024-04-03T05:27:06Z")

</div>

Hi Don - If it’s TPS, I’ve always just created a conversion program, which can be a PITB. So if you have any other changes to make, now is the time. 🙂

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [April 3, 2024, 1:49pm UTC](https://clarionhub.com/t/illegal-array-assignment/7071/7 "2024-04-03T13:49:00Z")

</div>

If you are using TPS files, then I strongly recommend FM3 from Capesoft for managing file structure changes.

---

<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 3, 2024, 4:03pm UTC](https://clarionhub.com/t/illegal-array-assignment/7071/8 "2024-04-03T16:03:14Z")

</div>

> [@WesVec](#):
>
> now running into the error 47 - been so long forgotten how to solve this.

If you do not need a Conversion program to run at end user site, you can convert one time simply in the DCT by right clicking on the file and choose Browse Database. If the current file design does not match the disk TPS it will ask if you want it converted. It will not write a program.

It does save the old file in a Backup folder. This may not work as desired. You have to view the result file (i.e. Browse Database in DCT). E.g. your change from DIM(1) to no DIM() may confuse it and it will skip the field so you will see it as blank.

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/c/c5976b9f60a8966acc6c6cf3f05c99ce58e2c554.png)

The “Generate Conversion Program” writes a little handcode CLW project that is not hard to work with. You will have to edit the code in AssignRecord Routine as the default is usually a simple Record=Record that will not work unless all the new fields are at the end.
