to sort system date in a list, and special effect with sliders (XP)

Klaus Major klaus at major-k.de
Tue Nov 29 09:53:18 EST 2005


Tach Günter :-)

> Hello all of this very helpful list,
>
> I am a consultant and supporter of a well known ERP-Software in  
> germany.
> Since 6 months I am programming tools for that ERP-System and I do  
> it with revolution.

what is ERP?

> I think this was the best idea I've ever had.
> My customers are very happy to get the tools they need in a very  
> short time and for a low price.
> Until now I wasn't an active user of this list, because my english  
> isn't very good, as you see.

In that case, welcome to the list :-)

> I have a question about date sort in a list. Because my customers  
> are german, they want to see the german date format (system date).  
> Is there a way to sort a list by an item that contains a system date?
>
> I wrote a little function for this problem:
>
> function sortContainerBySystemDate pContainer, pItemToSort, pSortOrder
>    local nOL
>    local nOI
>    local x
>         if (pContainer is empty) or (pItemToSort is not a number)  
> or (pItemToSort < 1) then
>        put empty into sortedContainer
>        return sortedContainer
>        exit sortContainerBySystemDate
>    end if
>       set the itemDel to tab
>    put the number of lines of pContainer into nOL
>    put the number of items of line 1 of pContainer into nOI
>       if nOL < 2  or nOI < pItemToSort then
>        put  pContainer into sortedContainer
>        return sortedContainer
>        exit sortContainerBySystemDate
>    end if
>       repeat for each line x in pContainer
>        convert item pItemToSort of x from system date to seconds
>    end repeat
>       if pSortOrder = 1 then
>        sort lines of pContainer descending numeric by item  
> pItemToSort of each
>    else
>        sort lines of pContainer ascending numeric by item  
> pItemToSort of each
>    end if
>       repeat for each line x in pContainer
>        convert item pItemToSort of x from seconds to system date
>    end repeat
>       put pContainer into sortedContainer
>       return sortedContainer
> end sortContainerBySystemDate
>
>
> It works for me. But may be there is a better and shorter way to do  
> that!?

What about, supposed the german date (like 29.11.2005) is the third  
item in the field:

...
   set the usesystemdate to true
   ##!!! Check the docs!
   sort lines of fld xyz datetime by item 3 of each
...

Might be a BIT shorter ;-)

> Another Problem:
>
> Because my costumers are working on windows machines, they have  
> very different Versions (98,2000,XP).
> I'm programming on a windows XP with Classic Style for Windows and  
> gadgets.
> I did a tool that contains sliders and it works fine.
> I installed it on a customers machine with XP and XP Style. I was  
> scared -- the knop of the slider was not there and there was no way  
> to do anything with the slider.
> When I turned the Style to Classic on that machine, the knob was  
> there again. But the employee wants to have the XP Style, hmmm.
>
> Is this a well known effect and is there a possible solution?

Sorry, no idea...

> Best,
> Günter
> ---------------------------------------------------------------------- 
> --
>
> *gaich software service    Günter Gaich
> *
> *fon: +49 (0) 6452-91101-55
> fax: +49 (0) 6452-91101-57
> mobil: +49 (0) 172 970 26 51
> service at gaich.de*

Regards und liebe Grüße

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list