Array not working

Using a list of names copied to the clipboard, this works in Panorama 6, but not Panorama X. I can’t seem to find the problem.

B = replace(B," ",¶)
C=array(B,3,¶) ;or any array number

The names come into the field but the assignment doesn’t work.

I entered this code, and it returned the correct name each time. Seemed to be working. Am I missing something about the problem?

local B, C
clipboard()="John Jim Jane Jill"

B = replace(B," ",¶)
displaydata B

C=array(B,1,¶) ;or any array number
message C

Thanks for the feedback. On PanX right? It just imports the clipboard, then does nothing here.

I just tried the code Tom posted on Panorama X, worked fine.

I just did it using fields named B and C instead of variables and it also worked fine. I do vaguely recall something similar in the shadows of my memory with field cells not retaining input on a file until I quit Panorama X and reloaded the file again. It then worked properly - but it was a long time ago when it happened.

Yes, I’m using fields, not variables. It refuses to work on my Mac. No idea why. Thanks to all

Everyone seems to be assuming the list in the clipboard is space separated. Is that a safe assumption? The results you describe are exactly what I would expect if they were separated by line feeds.

I believe so since it works in Panorama 6 with the same file and replacing spaces.

In Panorama 6, the clipboard automatically converts line feeds to carriage returns, so a replace( that doesn’t actually replace anything, followed by an array( function that uses those carriage returns as separators will work in Panorama 6. In Panorama X, the line feeds will remain line feeds.

As always, you are correct. Changing line feed to return works.

By the way, there is a function just for that – lftocr(. Of course there is also a crtolf( function. Just to make this easier, of course you could also do this with the replace( function.