Illegal array assignment

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

 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

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.

Hi Carl,

It points to that one line.

image

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

Perhaps you changed the dimensions instead of the string size?

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.

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. :slight_smile:

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

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

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.

1 Like