LENGTH OF SEQUENCES
- Posted by ZNorQ <znorq at holhaug.com> Feb 17, 2005
- 443 views
I tried looking around for a solution to my problem, but I haven't found one yet, so please bare with me on this one if it's been explained before. The length function is sometimes not sufficient for me, as I might want to determin the TRUE length of a sequence. Let's say i have a sequence 'Stuff' that has the following structure; { {"Data1.1", 0, 0}, {"Data2.1", "Data2.2"}, {"Data3.1", {"Data3.2.1", "Data3.2.2"}} } Now, if I'm not mistaking, the length of 'stuff' - length(stuff) - would in this case result in 3 as it counts only the upper levels of the sequence. And, as you can see, the data structure is inconsistent and it might (afaik) take some programming to determin the true structure of 'stuff'. What I want is to have a function that returns the whole content of a structure in a one level sequence, eg. for 'stuff' this would be; {"Data1.1", 0, 0, "Data2.1", "Data2.2", "Data3.1", "Data3.2.1", "Data3.2.2"} or in other words; the whole structure of 'stuff' converted into a string. I'm gonna use this to display the content sequences in a readable format for message_box. (Where I will ofcourse exchange non-printable char's into a "." - or what ever char i decide to use.) Hope I haven't misunderstood the foundation of sequences and made an ass of myself! :D PS! I'm a w32True noob in Euphoria, but I've had alot of experience with programming on a hobby basis. (Made a few app's for my colleages at work to ease their pains, but not in Euphoria YET.) Regards Kenneth aka ZNorQ