Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: IVarList sort in natural order / as per class definition Date: Sat, 5 Sep 2020 09:53:22 +0200 Lines: 44 Message-ID: References: <40414534-8edf-4756-82eb-f35545c4cb60o@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: individual.net EVBUgA75ByE0qfuv90rQUA4P1OJOQFqJJEEcxkc57R4iW6fPg= Cancel-Lock: sha1:TO9Vm6pWCSvxDJyRAZF58NbXtvQ= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:13065 Hi Robert, you can't either. If you need the same order every time you need to sort it yourself. And compile time symbols are case independent - so no chance to get back the original case from symbols. Wolfgang Robert Pope wrote: > Does anyone know if there is a way to get IVarList() (or another > similar function) to return its array output in the same order as > they were defined in the class? For example, if I have: > > CLASS MyClass > > EXPORT MyVar1 AS STRING > EXPORT MyVar2 AS STRING > EXPORT MyVar3 AS STRING > EXPORT MyVar10 AS STRING > EXPORT MyVar4 AS STRING > > Then I would like IVarList to return {#MyVar1, #MyVar2, #MyVar3, > #MyVar10, #MyVar4}. > > IVarList seems to be a bit random with its sorting. For example I > might get {#MyVar2, #MyVar1, #MyVar3, #MyVar10, #MyVar4} as its > output. That random order seems to be maintained until the next > compile, where it might shuffle again slightly. > > The object I am actually trying to encode has about 20 exports (some > of them are references to other objects / arrays). > > Bonus points if you can get the elements in their original case too. > IVarList returns an array of symbols, so my mixed case names are > being lost too. > > Cheers! --