Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loop through datasessions
Message
From
21/03/2003 13:24:53
 
 
To
21/03/2003 13:17:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00768648
Message ID:
00768704
Views:
25
Works Great Gunnar, thanks! I had to change the line:

NumOfDSFound = ASESSIONS(a_UsedDS)

to work for me.

Thanks again!
Tracy

>to everybody:
>
>after some talk with Fred and discovering there is no way get a valid list of datasessions in VFP6, i have decided to write a function to act like the ASESSIONS() in Vfp7 and up. Here is what i came up with.
>This function will test 50 datasession numbers obove the last valid DS found which should cover all (i hope). if any one can use it - feel free to add this to your project.
>
>
* *** begin test
>clear
>DIME a_UsedDS(1,1)
>NumOfDSFound = ASESSIONS(@a_UsedDS)
>?NumOfDSFound
>DISPL MEMO LIKE a_UsedDS
>return
>* *** end test
>
>* *** **********************************************************************
>* *** ASESSIONS()
>* *** by Gunnar Philipp
>* *** 03/21/2003
>* *** **********************************************************************
>FUNC ASESSIONS
>   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
.·*´¨)
.·`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"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform