Fwd: Getting a single column of a datagrid

Bob Sneidar bobs at twft.com
Thu May 10 17:48:14 EDT 2012


Trevor sent this to the list back in March of 2011. BTW if anyone knows him, I hope he is okay. I have not heard from him on the list for quite some time. Jerry either. 

Bob


Begin forwarded message:

> From: Trevor DeVore <lists at mangomultimedia.com>
> Date: March 21, 2011 8:56:06 PM PDT
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Re: Getting a single column of a datagrid
> Reply-To: How to use LiveCode <use-livecode at lists.runrev.com>
> 
> On Mon, Mar 21, 2011 at 8:18 PM, Bob Sneidar <bobs at twft.com> wrote:
> 
>> 
>> It would be nice if printkeys() was public domain but I don't think it is.
>> Still, sqlYoga is a good investment anyways. Heck I might have paid what he
>> charges for sqlYoga just for that function! ;-)
>> 
> 
> Here you go :-)
> 
> 
> /**
> * \brief Returns all dimensions of an array in a text format.
> *
> * \param @pArray The array to print.
> * \param pDimension The dimensions of the array to start printing. Pass in
> empty in most cases.
> * \param pFullData Pass in true if you want to print off entire value of
> each key. By default only one lines is printed.
> *
> * \return Text
> */
> 
> *function* PrintArray @pArray, pDimension, pFullData
> 
>   *if* pDimension is empty *then* *put* 0 into pDimension
> 
> 
> 
>   *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
> aftertheText
> 
>         *put* pArray[theKey] into theTempArray
> 
>         *put* PrintArray(theTempArray, pDimension + 1, pFullData) aftertheText
> 
>      *else*
> 
>         *if* pFullData *then*
> 
>            *put* _printCharXTimes(space, pDimension * 5) &  theKey & ":" &&
> pArray[theKey] & cr after theText
> 
>         *else*
> 
>            *put* _printCharXTimes(space, pDimension * 5) &  theKey & ":" &&
> line 1 of pArray[theKey] & cr after theText
> 
>         *end* *if*
> 
>      *end* *if*
> 
>   *end* *repeat*
> 
> 
> 
>   *return* theText
> 
> *end* PrintArray
> 
> 
> 
> *private* *function* _printCharXTimes pChar, pTimes
> 
>   *local* theStr
> 
> 
> 
>   *repeat* with i = 1 to pTimes
> 
>      *put* pChar after theStr
> 
>   *end* *repeat*
> 
>   *return* theStr
> *end* _printCharXTimes
> 
> -- 
> Trevor DeVore
> Blue Mango Learning Systems
> ScreenSteps: http://www.screensteps.com
> LiveCode Resources for Developers: http://livecode.bluemangolearning.com
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list