Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loop through datasessions
Message
De
21/03/2003 14:04:08
 
 
À
21/03/2003 13:46:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00768648
Message ID:
00768723
Vues:
35
Duh, silly me! You are right. The below works correctly in VFP7 and VFP8:
* *** begin test
SET UDFPARMS TO REFERENCE
ACTIVATE SCREEN
clear
DIME a_UsedDS(1,1)
NumOfDSFound = GETSESSIONS(@a_UsedDS)
?NumOfDSFound
DISPL MEMO LIKE a_UsedDS
return
* *** end test

* *** **********************************************************************
* *** GETSESSIONS()
* *** by Gunnar Philipp
* *** 03/21/2003
* *** **********************************************************************
FUNC GETSESSIONS
   LPARA ;
      ArrayPointer
   LOCAL ;
      ReturnValue, ;
      i, ;
      MaxLoop, ;
      GotError, ;
      OldError, ;
      OldDS

   * *** set var
   OldDS		= SET("datasession")
   ReturnValue	= 0
   MaxLoop		= 50
   OldError	= ON("error")
   ON ERROR GotError = .T.

   * *** proccess
   FOR i=1 TO MaxLoop
      GotError = .F.
      SET DATASESSION TO i
      IF GotError = .F.
         * *** existing datasession
         MaxLoop = MaxLoop + 1
         ReturnValue = ReturnValue + 1
         DIME ArrayPointer(ReturnValue, 1)
         ArrayPointer(ReturnValue, 1) = i
      ENDIF
   ENDFOR

   * *** clean-up
   ON ERROR &OldError
   SET DATASESSION TO OldDS
   RETURN(ReturnValue)
ENDFUNC

>>I ran it in VFP7 and VFP8 as a test. That must be the difference.
>
>that's the reason because i named it the same as the native 'ASESSIONS()' function in Vfp7 and up. so your Vfp actually used the native function, not the code. you would have to rename the function to test it in vfp7 or 8.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform