ExportCell Example Errors

It seems that the examples in ExportCell( are flawed. Copying and running it generates errors:

global LineFormula
LineFormula=dbinfo("fields","")
arrayfilter LineFormula,LineFormula,¶,
    {""""+exportcell(«}+import()+{»)+""""}
LineFormula=replace(LineFormula,¶,{+","+}+¶)
execute {export "Comma.txt",}+LineFormula

There are characters included that I’m unfamiliar with, but I was able to correct the code and get it to run properly:

global LineFormula
LineFormula=dbinfo("fields","")
arrayfilter LineFormula,LineFormula,¶,{""""+exportcell(«}+import()+{»)+""""}
LineFormula=replace(LineFormula,¶,{+","+}+¶)
execute {export "Comma.txt",}+LineFormula

The multiple quotes also seem unnecessary. It works without them just fine:

global LineFormula
LineFormula=dbinfo("fields","")
arrayfilter LineFormula,LineFormula,¶, {exportcell(«}+import()+{»)}
LineFormula=replace(LineFormula,¶,{+","+}+¶)
execute {export "Comma.txt",}+LineFormula

Curious. ¬∂ is what you get when ¶ is encoded as utf8 but interpreted as Mac OS Roman.

The multiple quotes are being used to put quotes around the text in the cell, which might be useful if the text itself contained commas.

I think you are spot on Dave. This documentation page was brought over from Panorama 6 which used Mac OS Roman encoding, and I apparently didn’t notice this conversion problem. I have put in a correction (I changed it to cr() rather than ¶, but either is fine).

The documentation for formulavalue appears to have the same problem. I submitted a correction. In this case, it’s chevrons and smart quotes that were translated twice.

1 Like

I’ll stop trying to figure out what I had missed by not knowing to use the latest and greatest: ¬∂