Excel List to Clarion Array

Given a list in Excel of sixty REALs, is there an easy way to copy that as an assignment to an array in Clarion?

BASIC had a DATA statement and READ command that allowed embedding simple data in the code that would be nice. in Clarion you could encode it in a STRING() comma delimited then write a simple parser.

One idea use Excel’s fill down and formulas to make the Code in Columns:


So you paste it, then maybe remove the extra spaces:

  ArrayVariable	[	1	]=	111
  ArrayVariable	[	2	]=	222
  ArrayVariable	[	3	]=	333
  ArrayVariable	[	4	]=	444
  ArrayVariable	[	5	]=	555
  ArrayVariable	[	6	]=	666
  ArrayVariable	[	7	]=	777
  ArrayVariable	[	8	]=	888
  ArrayVariable	[	9	]=	999
  ArrayVariable	[	10	]=	1110

1 Like


I use Excel like that as well on occasion. Saves time if I have a lot of variables of the same type.

If you are dealing with the Windows Clipboard anyway, perhaps you could just copy the cells you want to the clipboard, then process the CLIPBOARD() contents in Clarion?

The rows are delimited by <13,10>, and the columns by <9>.

StringTheory makes short work of parsing it.

I used to have ways to import/export from/to that format (with some validation of the clipboard contents). That was pretty useful to the user. They could assemble data (in the expected format dictated by the program) in Excel, then copy it and “paste” it into the Clarion app, which would parse/validate the contents. They could also “copy in Excel Friendly format” to paste into their spreadsheet.
No OLE anything. A very simple way to help the user immensely.