Login
`
Templates, Tools and Utilities
|
||
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
Files, drivers etc.: Loop a file within a loop on that same file 2003-05-08 -- Michael Ware Newsgroups: softvelocity.products.c55ee
> Is this possible :
> Having a file loen_fast
> SET(LOF:key,LOF:key)
> loop
> if access:loen_fast.next() then break.
> ! Do a lot of things on this loen_fast
> LOF:field2 = 'Something in this record of loen_fast'
> set(LOF:Key2,LOF:key2)
> loop
> if access:loen_fast.next() then break.
> !Update some Loen_fast records end
> end
>
> IE : Inside a loop of the records in one sort order, i want to make a lopp
> in another sort order without interrupting the 'Outside' loop.
I've done this a few times. Works like this:
SET(LOF:key,LOF:key)
loop
if access:loen_fast.next() then break.
! Do a lot of things on this loen_fast
HldPos = Position(LOF:key)
LOF:field2 = 'Something in this record of loen_fast'
set(LOF:Key2,LOF:key2)
loop
if access:loen_fast.next() then break.
!Update some Loen_fast records
end
reset(LOF:key,HldPos)
access:loen_fast.next()
end
The trick is you need to issue a next after the reset to get back to were
you were.
-Mike
Today is November 21, 2024, 3:34 am This article has been viewed 35376 times. Google search has resulted in 19 hits on this article since January 25, 2004.
|
|