Search found 164 matches

by edgore
Thu Aug 01, 2013 4:50 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicate lines?

@MaxV In a multiuser environment I would still have to randomly generate a unique table name, create it and drop it for each user in order to avoid conflicts though, right? It is cool that I can just create a database file within using livecode and then populate it with whatever tables I need on dem...
by edgore
Thu Aug 01, 2013 4:44 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicate lines?

@sritcp Just tested it with a field that contains item 1 item 2 item 3 item 4 item 4 item 4 item 5 And you are right, it comes back with a single line, containing "item 5", so it is only working when the first word is unique. I knew there had to be a catch - that is what I get for playing with array...
by edgore
Wed Jul 31, 2013 8:05 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicate lines?

Oh, agreed - all experimentation is good. I was just saying why the DB solution was not a good fit for what I was doing. Also, there should be a section in the docs talking about using SQLite - the only reference I could find in the docs is a paragraph saying there is a driver for it. Since I didn't...
by edgore
Wed Jul 31, 2013 5:03 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicate lines?

That requires having an SQLite database running outside of Livecode though, right? I am trying to avoid external dependencies. I had thought about using a database to accomplish this, but that opens up a set of external requirements for the code to function that I would like to avoid. Also, in a mul...
by edgore
Tue Jul 30, 2013 6:31 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: I need help with Unicode converter
Replies: 8
Views: 5834

Re: I need help with Unicode converter

Hmmm...does this mean the examples in the lessons are wrong?
by edgore
Mon Jul 29, 2013 11:53 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicates?

Found a bug - it adds a space on to the end of each line. I have updated the routine above to correct this
by edgore
Mon Jul 29, 2013 10:04 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicates?

I figured there *had* to be some way of leveraging unique keys in arrays to do this, just took a while to work it out. Hopefully there is not a downside that I am not thinking about. My initial need, and all of my testing were for a single word on the line, but I just tested it with longer lines and...
by edgore
Mon Jul 29, 2013 4:58 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicates?

Aha! I figured it out! the script below results in ridiculously fast duplicate removal: on mouseUp put deleteDuplicateLines(field 1) into noDupes put the number of lines in field 1 && the number of lines in noDupes end mouseUp function deleteDuplicateLines theList --this function removes duplicate l...
by edgore
Mon Jul 29, 2013 4:53 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Re: Faster way to remove duplicates?

Oh, and I also tried this: on mouseUp put deleteDuplicateLines(field 1) into noDupes put the number of lines in field 1 && the number of lines in noDupes end mouseUp function deleteDuplicateLines theList split theList by return combine theList by return return theList end deleteDuplicateLines which ...
by edgore
Mon Jul 29, 2013 4:23 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Faster way to remove duplicate lines?
Replies: 28
Views: 20491

Faster way to remove duplicate lines?

I have some very long (25K lines) lists that I would like to filter for duplicates, and I am wondering if there is a faster way to do this than what I am currently doing. Right now I have tried on mouseUp put field 1 into Temp --field 1 contains about 25K lines put empty into noDupes put the millise...
by edgore
Sat Jul 27, 2013 3:39 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: I need help with Unicode converter
Replies: 8
Views: 5834

Re: I need help with Unicode converter

I thought I knew the answer to this, but apparently, I don't. According to the tutorial at http://lessons.runrev.com/buckets/1228/lessons/20441 this should come down to the fact that unicode characters are 16 bits rather than 8 bits long (or double-byte). However, only the charToNum and the NumToCha...
by edgore
Sat Jul 27, 2013 3:05 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Filter without empty misses empty last line(s)
Replies: 11
Views: 6682

Re: Filter without empty misses empty last line(s)

I don't think that - I know that there are 4 chars in the field. What I was saying was: If you ask livecode for the number of lines in field 1 it would answer "1" If you ask for the number of chars in that line it would answer "3" So one could draw the conclusion that there are three characters in f...
by edgore
Fri Jul 26, 2013 5:18 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Filter without empty misses empty last line(s)
Replies: 11
Views: 6682

Re: Filter without empty misses empty last line(s)

What I was referring to is that the return char is not counted as one of the chars of a line - and that this is the behavior that you would want, because it's a delimiter and when you ask for the number of characters in a line you almost always want to know how many visible characters there are. The...
by edgore
Thu Jul 25, 2013 10:35 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Filter without empty misses empty last line(s)
Replies: 11
Views: 6682

Re: Filter without empty misses empty last line(s)

The thing to remember (and I knew this in the back of my head already, but I am frequently dumb unless I stop and think things through) is that what you are seeing displayed in a field is the location of *the insertion point* - the place where the next character typed will appear. So the insertion p...
by edgore
Thu Jul 25, 2013 9:27 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Filter without empty misses empty last line(s)
Replies: 11
Views: 6682

Re: Filter without empty misses empty last line(s)

Yeah, I guess I will always just have to do a "if the last char of variable is return then delete the last char of variable', because really what filter without empty does is the equivalent of "replace return & return with return", which makes sense in most cases. I run into problems because the dow...

Go to advanced search