Macro SET INDEX TO &more_than_one

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2108
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Macro SET INDEX TO &more_than_one

Post by AUGE_OHR »

hi,

have make more Test with SET INDEX

Code: Select all

         DO CASE
            CASE iMax = 1
*               SET INDEX TO &cRet
                SET INDEX TO &(aPara[1])
            CASE iMax = 2
            altd()
               SET INDEX TO &(aPara[1]), &(aPara[2])
            CASE iMax = 3 ; SET INDEX TO &(aPara[1]), &(aPara[2]), &(aPara[3])
            CASE iMax = 4 ; SET INDEX TO &(aPara[1]), &(aPara[2]), &(aPara[3]), &(aPara[4])
            CASE iMax = 5 ; SET INDEX TO &(aPara[1]), &(aPara[2]), &(aPara[3]), &(aPara[4]), &(aPara[5])
            CASE iMax = 6 ; SET INDEX TO &(aPara[1]), &(aPara[2]), &(aPara[3]), &(aPara[4]), &(aPara[5]), &(aPara[6])
            CASE iMax = 7 ; SET INDEX TO &(aPara[1]), &(aPara[2]), &(aPara[3]), &(aPara[4]), &(aPara[5]), &(aPara[6]), &(aPara[7])
            CASE iMax = 8 ; SET INDEX TO &(aPara[1]), &(aPara[2]), &(aPara[3]), &(aPara[4]), &(aPara[5]), &(aPara[6]), &(aPara[7]), &(aPara[8])
            CASE iMax = 9 ; SET INDEX TO &(aPara[1]), &(aPara[2]), &(aPara[3]), &(aPara[4]), &(aPara[5]), &(aPara[6]), &(aPara[7]), &(aPara[8]), &(aPara[9])
         ENDCASE
it "seems" to work ... but it is wrong while i can use a Index which does not belong to DBF :oops:

---

i have think about last Answer an got to this Solution

Code: Select all

   IF !EMPTY( cRet )
      ORDLISTCLEAR()
      aPara  := AtInside( ",", cRet )
      iMax := LEN(aPara)
      FOR i := 1 TO iMax
         cIndex := aPara[i]
         lRet   := .F.
         bError := ERRORBLOCK( { | oErr | BREAK( oErr ) } )
         BEGIN SEQUENCE
            SET INDEX TO &cIndex ADDITIVE
            lRet := .T.
         END SEQUENCE
         ERRORBLOCK( bError )
      NEXT
now i use "one-by-one" Index with ADDITIVE and that Way seem to work. :D
SETINDEX2.ZIP
(2.28 KiB) Downloaded 119 times
---

Question : how to make a Form "always on Top" :idea:

sometimes a Form is behind other Form and all seems to "hang" ... but other Form "behind" is waiting
have fun
Jimmy
User avatar
serge_girard
Posts: 3364
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Macro SET INDEX TO &more_than_one

Post by serge_girard »

Jimmy ,
Try TOPMOST!

Serge
There's nothing you can do that can't be done...
User avatar
AUGE_OHR
Posts: 2108
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Macro SET INDEX TO &more_than_one

Post by AUGE_OHR »

serge_girard wrote: Tue Feb 04, 2020 8:04 am Try TOPMOST!
YES :!:
have fun
Jimmy
Post Reply