How do you join lines in a container
Sadhunathan Nadesan
sadhu at castandcrew.com
Thu Jun 12 13:28:00 EDT 2003
| >
| > repeat for each line x in keywords
| > put x && " :---: " && sqlData[x] & cr
| > end repeat
|
| Wouldn't this just show you the last entry in the keywords? The keys
Hi
No, it works.
As you surmise, the above snippet is not actually part of the
intended solution, it's just debugging code to show what I got
as keys in the keywords container, and as array values in the
sqlData array. It works as intended, namely, it show every
key and every value indexed by that key.
| This little test worked as I expected:
|
| on mouseUp
| put field "Input" into theArray
| split theArray by LF and "|"
| put keys(theArray) into theKeys
| put theKeys & LF into field "Report"
| combine theArray by LF and "|"
| put theArray after field "Report"
| -- From Sadhu's code...
| repeat for each line x in theKeys
| put x && " :---: " && theArray[x] & cr
| end repeat
| end mouseUp
Ok, you are using LF and that is working for you, but not for
me. Hmm... what platform are you on?
Well, maybe its a problem unique to Linux? I tried about
everything I could think of, LF, newline, numToChar(10), CR,
etc, to try to split the array and it would not split right.
Or maybe it is a bug in an older version of MC I'm using on my
home box, I'll try it on a newer engine.
More information about the metacard
mailing list