Array not working


#1

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=Clipboard()
B = replace(B," ",¶)
C=array(B,3,¶) ;or any array number

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


#2

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=Clipboard()
B = replace(B," ",¶)
displaydata B

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

#3

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


#4

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


#5

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.


#6

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


#7

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.


#8

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


#9

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.


#10

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


#11

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.