Search found 365 matches

by sritcp
Sat Feb 20, 2016 9:57 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: DataGrid Form Repeat FillInData problem (Database)
Replies: 4
Views: 539

Re: DataGrid Form Repeat FillInData problem (Database)

Hi newpie: 1. AddData is used to add (i.e., insert) data into a datagrid after you have already populated the datagrid. Is this true in your case? 2. theData in your example should be a 1-dimensional array, not 2D. So, use put item 1 of tmyLine into theDataA["Var1"] ....... ....... 3. theLine in you...
by sritcp
Sat Feb 20, 2016 3:50 pm
Forum: Talking LiveCode
Topic: DataGrid Multiple lines
Replies: 5
Views: 780

Re: DataGrid Multiple lines

dunbarx wrote:... Once you get that list, the only way to act on each line is, well, one at a time.
deleteIndex
deleteLine
RefreshIndex
RefreshLine
etc.
take a list of indexes or line numbers as argument.

Regards,
Sri
by sritcp
Sat Feb 20, 2016 3:41 pm
Forum: Talking LiveCode
Topic: DataGrid Multiple lines
Replies: 5
Views: 780

Re: DataGrid Multiple lines

dantomlin wrote:......and then I had to do repeat process to get the id's of the highlighted lines.
the dgHilitedIndexes
will give you the indexes of the highlighted lines directly.

Regards,
Sri
by sritcp
Fri Feb 05, 2016 4:02 pm
Forum: Off-Topic
Topic: A question about Forum etiquette
Replies: 7
Views: 2231

Re: A question about Forum etiquette

Often, a number of people respond to an original post, providing very different perspectives on the problem. Even when one of them provides the immediate solution to the OP's specific problem, the range of responses add to the broader understanding of the issue, which is probably more important to t...
by sritcp
Sun Jan 31, 2016 7:28 pm
Forum: Talking LiveCode
Topic: Data grid displaying an array of items?
Replies: 3
Views: 752

Re: Data grid displaying an array of items?

As I understand it, if I use a table, it’s each row that is clickable and will return a value, not each cell. Is that correct, or will each cell return a unique identifier when clicked which I can use to interpret the desired choice? It will identify each cell -- more correctly, the object inside t...
by sritcp
Sun Jan 17, 2016 12:47 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Swap rows and columns of a list
Replies: 12
Views: 2511

Re: Swap rows and columns of a list

..... As you point out it forces Livecode to count to the desired line every time...... I tested repeat with i = 1 to the number of lines of temp delete item 1 of line i of temp end repeat and it is virtually equally fast. Only in this specific example. If instead, we had 1000 rows, for example, an...
by sritcp
Sat Jan 16, 2016 2:02 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Swap rows and columns of a list
Replies: 12
Views: 2511

Re: Swap rows and columns of a list

repeat for each line tLine in temp delete item 1 of line tCounter of temp add 1 to tCounter end repeat the dictionary warns against this technique ......... Hi Bernd: Thanks for pointing this out. Yes, changing the container that is being looped over is dangerous. I should have made a copy of temp ...
by sritcp
Fri Jan 15, 2016 8:27 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Swap rows and columns of a list
Replies: 12
Views: 2511

Re: Swap rows and columns of a list

........ Arrays seem to retain the order of the columns while they are arrays, but lose the order when combined into a list. ..... One way to get around this problem is to save the keys and sort by them. Here's above code modified to that: on mouseUp local temp, tCounter put field "Input" into temp...
by sritcp
Fri Jan 15, 2016 3:54 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Swap rows and columns of a list
Replies: 12
Views: 2511

Re: Swap rows and columns of a list

MaxV:

You are correct.
Arrays seem to retain the order of the columns while they are arrays, but lose the order when combined into a list.

Thanks for the insight,
Sri
by sritcp
Tue Jan 12, 2016 4:41 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Swap rows and columns of a list
Replies: 12
Views: 2511

Re: Swap rows and columns of a list

Hi paulclaude: MaxV's code is different from yours in that it uses it converts the list into an array. If you can have your data in an array form, many operations are quick and efficient. Here's a variant of MaxV's code: on mouseUp local temp put field "Input" into temp set the columnDel to comma sp...
by sritcp
Thu Dec 17, 2015 5:08 am
Forum: Talking LiveCode
Topic: Weighted Random Selection Optimizing
Replies: 1
Views: 485

Re: Weighted Random Selection Optimizing

HI Bob: A simple weighted enumeration may work best if the weights are fixed beforehand but the randomization is going to be called repeatedly. # Say, tWeights[i] is the weight of option i put empty into tSelectFrom # Line up the weighted options in a single list put 1 into i repeat for each line tK...
by sritcp
Wed Dec 16, 2015 1:43 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: repeat....until
Replies: 8
Views: 1213

Re: repeat....until

Thanks Craig:

I just cut and pasted OP's code.
Forgot to get rid of "until" (I have edited the post to mark it)

Thanks,
Sri
by sritcp
Wed Dec 16, 2015 12:12 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: repeat....until
Replies: 8
Views: 1213

Re: repeat....until

Is this what you are looking for? repeat with x = 1 to 30 if (aVar - bVar) = 6 or until (bVar - aVar) = 6 then # EDIT: delete "until" (see post below) exit repeat else if item x of theString is among the items of "1,2,3,4....." then add 1 to aVar else add 1 to bVar end if end if end repeat Regards, ...
by sritcp
Tue Dec 15, 2015 4:33 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Audio + Animation problem
Replies: 7
Views: 1437

Re: Audio + Animation problem

Thank you Simon, Craig, and Klaus! After much hair pulling, I have identified the point at which it is breaking down! Although putting a breakpoint at start player "Player1" and stepping through it plays the sound (running it doesn't; see my original post), that was not the problem line in the code....
by sritcp
Mon Dec 14, 2015 12:57 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Audio + Animation problem
Replies: 7
Views: 1437

Re: Audio + Animation problem

Klaus: Thanks for the reminder! You have a terrific memory! :D I should have mentioned the gAudioFolder is a global variable containing the string (the defaultFolder) & "/Audio" And, pImage is a parameter of a handler and the name of the imported image is passed to the handler. Also, the program wor...

Go to advanced search