Re: Missing keys in datagrid?
Hi Trevor, > Am 18.12.2019 um 13:51 schrieb Trevor DeVore via use-livecode > : > On Wed, Dec 18, 2019 at 6:40 AM Klaus major-k via use-livecode < > use-livecode@lists.runrev.com> wrote: >>> ... >>> So my guess is that you are populating the DataGrid with data that only >> has >>> 10 columns. Could that be the case? >> No, I really provide an array with all my columns in it, empty or not. > > Given how PrintKeys works it would appear that the keys are being removed > from the internal sDataArray array. You can inspect the array yourself by > putting the dgData of the DataGrid into a variable and setting a > breakpoint. Or assign the dgData to a tree widget as Richard suggested. yes, already did and ALL columns are visible when viewed in a TREE View widget!? So everything looks OK, I was just a bit unsure due to the discrepany of the different "views", Thanks to all! > -- > Trevor DeVore Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
On Wed, Dec 18, 2019 at 6:40 AM Klaus major-k via use-livecode < use-livecode@lists.runrev.com> wrote: > Hi Trevor, > > thanks for chiming in! > > > Am 18.12.2019 um 13:28 schrieb Trevor DeVore via use-livecode < > use-livecode@lists.runrev.com>: > > > > On Wed, Dec 18, 2019 at 2:38 AM Klaus major-k via use-livecode < > > use-livecode@lists.runrev.com> wrote: > > ... > > So my guess is that you are populating the DataGrid with data that only > has > > 10 columns. Could that be the case? > > No, I really provide an array with all my columns in it, empty or not. > Given how PrintKeys works it would appear that the keys are being removed from the internal sDataArray array. You can inspect the array yourself by putting the dgData of the DataGrid into a variable and setting a breakpoint. Or assign the dgData to a tree widget as Richard suggested. -- Trevor DeVore ScreenSteps www.screensteps.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
Hi Trevor, thanks for chiming in! > Am 18.12.2019 um 13:28 schrieb Trevor DeVore via use-livecode > : > > On Wed, Dec 18, 2019 at 2:38 AM Klaus major-k via use-livecode < > use-livecode@lists.runrev.com> wrote: > ... > So my guess is that you are populating the DataGrid with data that only has > 10 columns. Could that be the case? No, I really provide an array with all my columns in it, empty or not. > -- > Trevor DeVore Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
On Wed, Dec 18, 2019 at 2:38 AM Klaus major-k via use-livecode < use-livecode@lists.runrev.com> wrote: > Hi Bob, > > > Am 18.12.2019 um 01:13 schrieb Bob Sneidar via use-livecode < > use-livecode@lists.runrev.com>: > > > > If I recall a long time ago speaking with Trevor, printkeys() does not > necessarily return ALL keys. > > AHA! > OK, that explains something, but not all. > > Empty or not, this SHOULD list all keys, but doesn't? > One nice aspect of LiveCode is that you can inspect all of the code to see what is going on behind the scenes. For PrintKeys you can get to the script that has it in one of two ways: edit script of behavior of behavior of selobj() edit script of stack "RevDataGridLibraryBehaviorsDataGridButtonBehavior" This is the PrintKeys handler: ``` command PrintKeys pArray if pArray is not an array then put sDataArray into pArray put _PrintKeys(pArray) end PrintKeys ``` And here is the _PrintKeys() function: ``` private function _PrintKeys @pArray, pDimension if pDimension is empty then put 0 into pDimension local theKeys, theText, theTempArray put the keys of pArray into theKeys sort theKeys numeric repeat for each line theKey in theKeys if pArray[theKey] is an array then put _printCharXTimes(space, pDimension * 5) & theKey & cr after theText put pArray[theKey] into theTempArray put _PrintKeys(theTempArray, pDimension + 1) after theText else put _printCharXTimes(space, pDimension * 5) & theKey & ":" && "`" & pArray[theKey] & "`" & cr after theText end if end repeat return theText end _PrintKeys ``` As you can see, PrintKeys prints off every key and value in the sDataArray array. sDataArray contains the array that you, the developer, assigned to the DataGrid using a property such as dgData or dgText. PrintKeys doesn't take into account the columns you've created in your DataGrid. That is a separate property. So my guess is that you are populating the DataGrid with data that only has 10 columns. Could that be the case? -- Trevor DeVore ScreenSteps www.screensteps.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
Hi Bob, > Am 18.12.2019 um 01:13 schrieb Bob Sneidar via use-livecode > : > > If I recall a long time ago speaking with Trevor, printkeys() does not > necessarily return ALL keys. AHA! OK, that explains something, but not all. Empty or not, this SHOULD list all keys, but doesn't? ... put the dgdata of grp "produkte" into tt put keys of tt[1] ... > Your array does not look that large though. ... I really do not need to have a working "printkeys", I am just irritated to not see all of my keys. > Bob S > > function altPrintKeys @pArray > ... > end altPrintKeys > > Bob S Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
Hey Klaus The first thing that grabs my attention is that the two missing keys, statusstatus and abruffehler, are very similar to two other keys, status and abruffehlermeldung. I wonder if this similarity is where printKeys is pulling incomplete results. It would certainly be my initial route of examination. although why it chose the smaller and earlier of one and the larger and later of the other is a bit inconsistent. Hmmm, very interesting. All the best Sean Cole Pi Digital Prod Ltd > On 17 Dec 2019, at 20:13, Klaus major-k via use-livecode > wrote: > > Hi friends, > > I have a datagrid "produkte" of type Table with these 12 columns: > 1. lfd_nummer > 2.Titel > 3.sid > 4.währung > 5.Kupon > 6.barriere > 7. Verfallsdatum > 8.Basiswerte > 9. status > 10. statusstatus > 11. abruffehler > 12. abruffehlermeldung > > But when I fire this in the messagebox: > send "printkeys" to grp "produkte", I only get 10 keys? > 1 > Verfallsdatum: `` > abruffehlermeldung: `` > lfd_nummer: `0018` > status: `` > sid: `44` > Titel: `sdsdsdds` > Basiswerte: `Aktien` > Kupon: `50.00%` > barriere: `80.00%` > währung: `CHF` > > Same with: > put the dgdata of grp "produkte" into tt;put keys of tt[1] > Verfallsdatum > abruffehlermeldung > lfd_nummer > status > sid > Titel > Basiswerte > Kupon > barriere > währung > > Again only 10 keys from total 12!? What am I missing? > Tested on macOS 10.14.6 with LC 9.05, 9.04 and 9.5.1 GM. > > > Best > > Klaus > -- > Klaus Major > https://www.major-k.de > kl...@major-k.de > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
The easiest way to view arrays in LC these days is with the tree widget. 1. Drop a tree widget on your card 2. Set the widget's arrayStyle to true 3. Set the widget's arrayData to your array. -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ambassa...@fourthworld.comhttp://www.FourthWorld.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
If I recall a long time ago speaking with Trevor, printkeys() does not necessarily return ALL keys. Your array does not look that large though. I have an array function that may prove more helpful. I designed it so that you could "search" or filter an array for a key and/or a value. It will return text looking something like: [1] ["lastupdate"] 2016-09-07 13:56:01,[1] ["contactcell"] ,[1] ["siteidlist"] ,[1] ["contactid"] 409,[1] ["contactname"] Stonehill Technical Solutions,[1] ["contactphone"] 949-218-1258,[1] ["updateby"] Robert Sneidar,[1] ["itidlist"] |396|,[1] ["custid"] 340,[1] ["contactemail"],[1] ["contacttype"]|customer|site|it|,[1] ["position"] [2] ["lastupdate"] 2016-09-07 13:56:01,[2] ["contactcell"] ,[2] ["siteidlist"] |397|,[2] ["contactid"] 410,[2] ["contactname"] Jackie Silventez,[2] ["contactphone"] 951-943-2223,[2] ["updateby"] Robert Sneidar,[2] ["itidlist"] ,[2] ["custid"] 340,[2] ["contactemail"],[2] ["contacttype"]|site|,[2] ["position"] etc. It has the format [first root key] [first child key] [next child key] [next child key] (etc.)"key value",[first root key] [second child key]... and so on. The value to this format is you can use the filter lines command to, for example find every line containing *["custid"]340*. Each line will then contain the actual array keys for that entry, which you can use to reference the original array. In this case the root key is 1, the first child key is "custid" the value is 340. It seems complicated at first but it's not. Try it with a 3 deep multi key array. It gives you the ability using the filter lines command to find every matching array key with a single statement. Bob S function altPrintKeys @pArray put numtochar(11) into vertTab put numtochar(30) into altCr put the keys of pArray into theKeys sort theKeys numeric repeat FOR each line theKey in theKeys put "[" & theKey & "] " after theKeyList if theKey is not a number then replace "[" & theKey & "]" WITH "[" & quote & theKey & quote & "]" in theKeyList end if if pArray[theKey] is an array then put pArray[theKey] into theTempArray put altPrintKeys(theTempArray, theKeyList, pFullData) after theText put empty into the last word of theKeyList delete the last char of theKeyList put cr into the last char of theText else put "pArray " & the last word of theKeyList into theKeyName -- put "put " & theKeyName & " into theValue" into theCommand -- do theCommand put value(theKeyName) into theValue replace tab WITH vertTab in theValue replace return WITH altCr in theValue put theKeyList & tab & theValue & comma after theText put empty into the last word of theKeyList delete the last char of theKeyList end if end repeat return theText end altPrintKeys Bob S > On Dec 17, 2019, at 12:13 , Klaus major-k via use-livecode > wrote: > > Hi friends, > > I have a datagrid "produkte" of type Table with these 12 columns: > 1. lfd_nummer > 2.Titel > 3.sid > 4.währung > 5.Kupon > 6.barriere > 7. Verfallsdatum > 8.Basiswerte > 9. status > 10. statusstatus > 11. abruffehler > 12. abruffehlermeldung > > But when I fire this in the messagebox: > send "printkeys" to grp "produkte", I only get 10 keys? > 1 > Verfallsdatum: `` > abruffehlermeldung: `` > lfd_nummer: `0018` > status: `` > sid: `44` > Titel: `sdsdsdds` > Basiswerte: `Aktien` > Kupon: `50.00%` > barriere: `80.00%` > währung: `CHF` > > Same with: > put the dgdata of grp "produkte" into tt;put keys of tt[1] > Verfallsdatum > abruffehlermeldung > lfd_nummer > status > sid > Titel > Basiswerte > Kupon > barriere > währung > > Again only 10 keys from total 12!? What am I missing? > Tested on macOS 10.14.6 with LC 9.05, 9.04 and 9.5.1 GM. > > > Best > > Klaus > -- > Klaus Major > https://www.major-k.de > kl...@major-k.de > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
indeed, maybe this helps too for a selected line Data of a selected line: *if the dgHilitedLine of group "DataGrid 1" is not empty then put the dgHilitedLine of group "DataGrid 1" into theLine * *put the dgDataOfLine[theLine] of group "DataGrid 1" into tEdit** * *put tEdit["Nummer"] into field"Nummer" --etcetera* *end if* *Regards,* *JErry * Op 17-12-2019 om 21:46 schreef Klaus major-k via use-livecode: Hi Jerry, Am 17.12.2019 um 20:42 schrieb JJS via use-livecode : Ein schöne guten abend Klaus, i don't know exactly what your trying to accomplish, I need to do lots of: repeat for each key tKey in... And now I am a bit irritated that some key may be missing in my loop!? but maybe this helps, or give a further idea. I use this to export column names and data: put the dgProp[ "columns" ] of group "DataGrid 1" into tColumnTitles Yes, this does in fact show all of my 12 keys replace return with comma in tColumnTitles put the dgText of group "DataGrid 1" into tData replace tab with comma in tData put tColumnTitles & return & tData into URL ("file:" & tFileName & ".csv") i get it all I need to mess around with: the dgdata... Ciao! Jerry Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
Hi Jerry, > Am 17.12.2019 um 20:42 schrieb JJS via use-livecode > : > > Ein schöne guten abend Klaus, > i don't know exactly what your trying to accomplish, I need to do lots of: repeat for each key tKey in... And now I am a bit irritated that some key may be missing in my loop!? > but maybe this helps, or give a further idea. I use this to export column > names and data: > put the dgProp[ "columns" ] of group "DataGrid 1" into tColumnTitles Yes, this does in fact show all of my 12 keys > replace return with comma in tColumnTitles > put the dgText of group "DataGrid 1" into tData > replace tab with comma in tData > put tColumnTitles & return & tData into URL ("file:" & tFileName & > ".csv") > i get it all I need to mess around with: the dgdata... > Ciao! > > Jerry Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
Ein schöne guten abend Klaus, i don't know exactly what your trying to accomplish, but maybe this helps, or give a further idea. I use this to export column names and data: put the dgProp[ "columns" ] of group "DataGrid 1" into tColumnTitles replace return with comma in tColumnTitles put the dgText of group "DataGrid 1" into tData replace tab with comma in tData put tColumnTitles & return & tData into URL ("file:" & tFileName & ".csv") i get it all Ciao! Jerry Op 17-12-2019 om 21:36 schreef Paul Dupuis via use-livecode: I am not 100% sure about the datagrid, but in regular arrays, if your d not set a key, it will not be present. So, if you never put a value into tt[1][statusstatus] then the key [statusstatus] will not be in the list of keys for tt[1]. If you want all keys to be present for each row, then you need to set them to some value, even if an empty string by 'empty' or "" On 12/17/2019 3:13 PM, Klaus major-k via use-livecode wrote: Hi friends, I have a datagrid "produkte" of type Table with these 12 columns: 1. lfd_nummer 2.Titel 3.sid 4.währung 5.Kupon 6.barriere 7. Verfallsdatum 8.Basiswerte 9. status 10. statusstatus 11. abruffehler 12. abruffehlermeldung But when I fire this in the messagebox: send "printkeys" to grp "produkte", I only get 10 keys? 1 Verfallsdatum: `` abruffehlermeldung: `` lfd_nummer: `0018` status: `` sid: `44` Titel: `sdsdsdds` Basiswerte: `Aktien` Kupon: `50.00%` barriere: `80.00%` währung: `CHF` Same with: put the dgdata of grp "produkte" into tt;put keys of tt[1] Verfallsdatum abruffehlermeldung lfd_nummer status sid Titel Basiswerte Kupon barriere währung Again only 10 keys from total 12!? What am I missing? Tested on macOS 10.14.6 with LC 9.05, 9.04 and 9.5.1 GM. Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
Hi Paul, > Am 17.12.2019 um 21:36 schrieb Paul Dupuis via use-livecode > : > > I am not 100% sure about the datagrid, but in regular arrays, if your d not > set a key, it will not be present. > > So, if you never put a value into tt[1][statusstatus] then the key > [statusstatus] will not be in the list of keys for tt[1]. If you want all > keys to be present for each row, then you need to set them to some value, > even if an empty string by 'empty' or "" but "printkeys" DOES in fact list empty keys, see below, three empty keys: Verfallsdatum: `` abruffehlermeldung: `` status: `` And "put the keys ..." does also not omit empty keys. > On 12/17/2019 3:13 PM, Klaus major-k via use-livecode wrote: >> Hi friends, >> >> I have a datagrid "produkte" of type Table with these 12 columns: >> 1. lfd_nummer >> 2.Titel >> 3.sid >> 4.währung >> 5.Kupon >> 6.barriere >> 7. Verfallsdatum >> 8.Basiswerte >> 9. status >> 10. statusstatus >> 11. abruffehler >> 12. abruffehlermeldung >> >> But when I fire this in the messagebox: >> send "printkeys" to grp "produkte", I only get 10 keys? >> 1 >> Verfallsdatum: `` >> abruffehlermeldung: `` >> lfd_nummer: `0018` >> status: `` >> sid: `44` >> Titel: `sdsdsdds` >> Basiswerte: `Aktien` >> Kupon: `50.00%` >> barriere: `80.00%` >> währung: `CHF` >> >> Same with: >> put the dgdata of grp "produkte" into tt;put keys of tt[1] >> Verfallsdatum >> abruffehlermeldung >> lfd_nummer >> status >> sid >> Titel >> Basiswerte >> Kupon >> barriere >> währung >> >> Again only 10 keys from total 12!? What am I missing? >> Tested on macOS 10.14.6 with LC 9.05, 9.04 and 9.5.1 GM. Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Missing keys in datagrid?
I am not 100% sure about the datagrid, but in regular arrays, if your d not set a key, it will not be present. So, if you never put a value into tt[1][statusstatus] then the key [statusstatus] will not be in the list of keys for tt[1]. If you want all keys to be present for each row, then you need to set them to some value, even if an empty string by 'empty' or "" On 12/17/2019 3:13 PM, Klaus major-k via use-livecode wrote: Hi friends, I have a datagrid "produkte" of type Table with these 12 columns: 1. lfd_nummer 2.Titel 3.sid 4.währung 5.Kupon 6.barriere 7. Verfallsdatum 8.Basiswerte 9. status 10. statusstatus 11. abruffehler 12. abruffehlermeldung But when I fire this in the messagebox: send "printkeys" to grp "produkte", I only get 10 keys? 1 Verfallsdatum: `` abruffehlermeldung: `` lfd_nummer: `0018` status: `` sid: `44` Titel: `sdsdsdds` Basiswerte: `Aktien` Kupon: `50.00%` barriere: `80.00%` währung: `CHF` Same with: put the dgdata of grp "produkte" into tt;put keys of tt[1] Verfallsdatum abruffehlermeldung lfd_nummer status sid Titel Basiswerte Kupon barriere währung Again only 10 keys from total 12!? What am I missing? Tested on macOS 10.14.6 with LC 9.05, 9.04 and 9.5.1 GM. Best Klaus -- Klaus Major https://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode