What is the easiest control to use for my project? [SOLVED]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: What is the easiest control to use for my project?
Klaus,
I just PMd you with the file.
Thanks again.
Mike
I just PMd you with the file.
Thanks again.
Mike
Re: What is the easiest control to use for my project?
LOL. I always try to break off before 3 AM.karmacomposer wrote: OMG!!!!!!!! That's what programming till 4am does to you.

BTW, if you're signed up for the conference streaming, I'm doing a talk on how to use the debugger. It's an invaluable tool and there have been requests on the mailing list for a tutorial on it. Questions about debugging come up here on the forums too, so I figured it would be a good topic. Once you know how to use it, you won't be able to work without it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: What is the easiest control to use for my project?
Code: Select all
set the dgText ["itemPurchased"] of group "dgItems" to tThingBought
Look at the definition of dgText.
Code: Select all
http://lessons.runrev.com/m/datagrid/l/7344-data-grid-api
Code: Select all
set the dgText of group "dgItems" to tThingBought
Code: Select all
put true into pFirstLineContainsHeaders
set the dgText[pFirstLineContainsHeaders] of group "dgItems" to tThingBought
So at the end, if nothing shows up in your Datagrid, 2 possible causes :
-your array is empty
-or the key names... of your array do not match the name (not label) of your datagrid's columns
One advice :
-check you arraw (with break point in the debugger) like Klaus said
-if indeed you have a content, then create a new DG, with only 1 or 2 columns, with proper names matching keys name of your array, and try set the dgData.
Re: What is the easiest control to use for my project?
For the tax issue, just limit the addition to the cases where it's really a number (no try structure needed this way) :
Code: Select all
if tSalesTax is a number then add tSalesTax to tTotalSalesTax
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: What is the easiest control to use for my project?
Did not work because there are numbers in these strings.jacque wrote:For the tax issue, just limit the addition to the cases where it's really a number (no try structure needed this way) :
Code: Select all
if tSalesTax is a number then add tSalesTax to tTotalSalesTax
Example of strings that are causing trouble:
KZX9VLWATAXE8
bc81d6e1e9746-a-HTTP/1.1 200 OK
2bb86cd8efa40-a-HTTP/1.1 200 OK
d301c2117b74f-a-HTTP/1.1 200 OK
bce1f2028989e-a-HTTP/1.1 200 OK
425e5cffbe5b1-a-HTTP/1.1 200 OK
d5330af7ef40a-a-HTTP/1.1 200 OK
446ee3c475e60-a-HTTP/1.1 200 OK
All valid numbers are either 0.00, 00.00, 000.00 or 0000.00
They won't go over that. How do I limit this field to ONLY allow two to four numbers, a decimal and then another two numbers?
Mike
Re: What is the easiest control to use for my project?
None of those example lines are recognized as numbers by themselves, "bc81d6e1e9746-a-HTTP/1.1 200 OK" isn't a number. But I think you're extracting the second item, based on an item delimiter of "=". In that case, the second item is empty, and LiveCode will translate empty to zero. That shouldn't affect the final value after addition. Are you getting a script error?
You can try "if tSalesTax is a number and tSalesTax is not empty then..." But you shouldn't have to. How exactly does it fail?
You can try "if tSalesTax is a number and tSalesTax is not empty then..." But you shouldn't have to. How exactly does it fail?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: What is the easiest control to use for my project? [SOLV
Thanks to all of you and especially Klaus' help, my code now works and it will be finished in a matter of days.
Any help, however, on how to take a highlighted section of the datagrid and then add up all the data in a column would be a great help.
For example, one column has the sales tax for each sale and the client wants to see what the sales tax was for a 2 week period, so he highlights the rows that amount to 14 days. I would then like to automatically add up all the sales tax numbers in the selected rows and show them in a dedicated field.
Mike
Any help, however, on how to take a highlighted section of the datagrid and then add up all the data in a column would be a great help.
For example, one column has the sales tax for each sale and the client wants to see what the sales tax was for a 2 week period, so he highlights the rows that amount to 14 days. I would then like to automatically add up all the sales tax numbers in the selected rows and show them in a dedicated field.
Mike