dbTalk Databases Forums  

Re: My scan isn't scannin'...?

comp.databases.paradox comp.databases.paradox


Discuss Re: My scan isn't scannin'...? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Hargan
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:12 PM






In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

--
Jim Hargan

On Wed, 13 Aug 2008 12:20:00 -0400, Kenneth wrote:

Quote:
Howdy,

I am trying to write some code that is to compare records in
two tables. If it finds a particular record in one table but
does not find a slightly different record in the other
table, it is to do some stuff.

The tCursors open fine, but when I try to scan tCursor 2 it
seems not to increment.

I put in some view statements to try to sort things out, but
as I step through the code the same record number and phone
number keep displaying.

As I step through, I never get to DO STUFF. Instead, I am
returned to the line " ident = tc2."num" " without ident
having incremented.

The code could not be much simpler, but I can't spot the
problem:


scan tc2:
ident = tc2."num"
ident.view()
phone = tc2."info"
phone.view()

if (tc2.locate ("num", ident, "desc", "W") and
not (tc1.locate ("num", ident, "desc", "W1")))
then

;// DO STUFF

else
endIf
endScan


Many thanks for any help, as always,

Reply With Quote
  #2  
Old   
Jim Hargan
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:12 PM






In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

--
Jim Hargan

On Wed, 13 Aug 2008 12:20:00 -0400, Kenneth wrote:

Quote:
Howdy,

I am trying to write some code that is to compare records in
two tables. If it finds a particular record in one table but
does not find a slightly different record in the other
table, it is to do some stuff.

The tCursors open fine, but when I try to scan tCursor 2 it
seems not to increment.

I put in some view statements to try to sort things out, but
as I step through the code the same record number and phone
number keep displaying.

As I step through, I never get to DO STUFF. Instead, I am
returned to the line " ident = tc2."num" " without ident
having incremented.

The code could not be much simpler, but I can't spot the
problem:


scan tc2:
ident = tc2."num"
ident.view()
phone = tc2."info"
phone.view()

if (tc2.locate ("num", ident, "desc", "W") and
not (tc1.locate ("num", ident, "desc", "W1")))
then

;// DO STUFF

else
endIf
endScan


Many thanks for any help, as always,

Reply With Quote
  #3  
Old   
Jim Hargan
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:12 PM



In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

--
Jim Hargan

On Wed, 13 Aug 2008 12:20:00 -0400, Kenneth wrote:

Quote:
Howdy,

I am trying to write some code that is to compare records in
two tables. If it finds a particular record in one table but
does not find a slightly different record in the other
table, it is to do some stuff.

The tCursors open fine, but when I try to scan tCursor 2 it
seems not to increment.

I put in some view statements to try to sort things out, but
as I step through the code the same record number and phone
number keep displaying.

As I step through, I never get to DO STUFF. Instead, I am
returned to the line " ident = tc2."num" " without ident
having incremented.

The code could not be much simpler, but I can't spot the
problem:


scan tc2:
ident = tc2."num"
ident.view()
phone = tc2."info"
phone.view()

if (tc2.locate ("num", ident, "desc", "W") and
not (tc1.locate ("num", ident, "desc", "W1")))
then

;// DO STUFF

else
endIf
endScan


Many thanks for any help, as always,

Reply With Quote
  #4  
Old   
Jim Hargan
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:12 PM



In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

--
Jim Hargan

On Wed, 13 Aug 2008 12:20:00 -0400, Kenneth wrote:

Quote:
Howdy,

I am trying to write some code that is to compare records in
two tables. If it finds a particular record in one table but
does not find a slightly different record in the other
table, it is to do some stuff.

The tCursors open fine, but when I try to scan tCursor 2 it
seems not to increment.

I put in some view statements to try to sort things out, but
as I step through the code the same record number and phone
number keep displaying.

As I step through, I never get to DO STUFF. Instead, I am
returned to the line " ident = tc2."num" " without ident
having incremented.

The code could not be much simpler, but I can't spot the
problem:


scan tc2:
ident = tc2."num"
ident.view()
phone = tc2."info"
phone.view()

if (tc2.locate ("num", ident, "desc", "W") and
not (tc1.locate ("num", ident, "desc", "W1")))
then

;// DO STUFF

else
endIf
endScan


Many thanks for any help, as always,

Reply With Quote
  #5  
Old   
Jim Hargan
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:12 PM



In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

--
Jim Hargan

On Wed, 13 Aug 2008 12:20:00 -0400, Kenneth wrote:

Quote:
Howdy,

I am trying to write some code that is to compare records in
two tables. If it finds a particular record in one table but
does not find a slightly different record in the other
table, it is to do some stuff.

The tCursors open fine, but when I try to scan tCursor 2 it
seems not to increment.

I put in some view statements to try to sort things out, but
as I step through the code the same record number and phone
number keep displaying.

As I step through, I never get to DO STUFF. Instead, I am
returned to the line " ident = tc2."num" " without ident
having incremented.

The code could not be much simpler, but I can't spot the
problem:


scan tc2:
ident = tc2."num"
ident.view()
phone = tc2."info"
phone.view()

if (tc2.locate ("num", ident, "desc", "W") and
not (tc1.locate ("num", ident, "desc", "W1")))
then

;// DO STUFF

else
endIf
endScan


Many thanks for any help, as always,

Reply With Quote
  #6  
Old   
Jim Giner
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:57 PM



Yes - you have it now. The scan will allow you to "see" all the records in
tc2. When you see one you like, you "locate" in the other table. If it's
not there, you "do stuff", otherwise I assume you just move on.
"Kenneth" <usenet (AT) soleSPAMLESSassociates (DOT) com> wrote

Quote:
On Wed, 13 Aug 2008 13:12:21 -0400, Jim Hargan
contact (AT) harganonline (DOT) com> wrote:

In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the
first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

Hi Jim,

Many thanks for the speedy and very helpful response...

But I am still not sure I correctly understanding how I
should set things up to do stuff only if something is found
in the first table, but not in the second.

Should that look something like this:

scan tc2:
If tc2."num" = ident and tc2."desc" = "W" and
not tc1.locate("num",ident,"desc",W1)
then

do something

All the best,
--
Kenneth

If you email... Please remove the "SPAMLESS."



Reply With Quote
  #7  
Old   
Jim Giner
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:57 PM



Yes - you have it now. The scan will allow you to "see" all the records in
tc2. When you see one you like, you "locate" in the other table. If it's
not there, you "do stuff", otherwise I assume you just move on.
"Kenneth" <usenet (AT) soleSPAMLESSassociates (DOT) com> wrote

Quote:
On Wed, 13 Aug 2008 13:12:21 -0400, Jim Hargan
contact (AT) harganonline (DOT) com> wrote:

In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the
first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

Hi Jim,

Many thanks for the speedy and very helpful response...

But I am still not sure I correctly understanding how I
should set things up to do stuff only if something is found
in the first table, but not in the second.

Should that look something like this:

scan tc2:
If tc2."num" = ident and tc2."desc" = "W" and
not tc1.locate("num",ident,"desc",W1)
then

do something

All the best,
--
Kenneth

If you email... Please remove the "SPAMLESS."



Reply With Quote
  #8  
Old   
Jim Giner
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:57 PM



Yes - you have it now. The scan will allow you to "see" all the records in
tc2. When you see one you like, you "locate" in the other table. If it's
not there, you "do stuff", otherwise I assume you just move on.
"Kenneth" <usenet (AT) soleSPAMLESSassociates (DOT) com> wrote

Quote:
On Wed, 13 Aug 2008 13:12:21 -0400, Jim Hargan
contact (AT) harganonline (DOT) com> wrote:

In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the
first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

Hi Jim,

Many thanks for the speedy and very helpful response...

But I am still not sure I correctly understanding how I
should set things up to do stuff only if something is found
in the first table, but not in the second.

Should that look something like this:

scan tc2:
If tc2."num" = ident and tc2."desc" = "W" and
not tc1.locate("num",ident,"desc",W1)
then

do something

All the best,
--
Kenneth

If you email... Please remove the "SPAMLESS."



Reply With Quote
  #9  
Old   
Jim Giner
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:57 PM



Yes - you have it now. The scan will allow you to "see" all the records in
tc2. When you see one you like, you "locate" in the other table. If it's
not there, you "do stuff", otherwise I assume you just move on.
"Kenneth" <usenet (AT) soleSPAMLESSassociates (DOT) com> wrote

Quote:
On Wed, 13 Aug 2008 13:12:21 -0400, Jim Hargan
contact (AT) harganonline (DOT) com> wrote:

In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the
first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

Hi Jim,

Many thanks for the speedy and very helpful response...

But I am still not sure I correctly understanding how I
should set things up to do stuff only if something is found
in the first table, but not in the second.

Should that look something like this:

scan tc2:
If tc2."num" = ident and tc2."desc" = "W" and
not tc1.locate("num",ident,"desc",W1)
then

do something

All the best,
--
Kenneth

If you email... Please remove the "SPAMLESS."



Reply With Quote
  #10  
Old   
Jim Giner
 
Posts: n/a

Default Re: My scan isn't scannin'...? - 08-13-2008 , 12:57 PM



Yes - you have it now. The scan will allow you to "see" all the records in
tc2. When you see one you like, you "locate" in the other table. If it's
not there, you "do stuff", otherwise I assume you just move on.
"Kenneth" <usenet (AT) soleSPAMLESSassociates (DOT) com> wrote

Quote:
On Wed, 13 Aug 2008 13:12:21 -0400, Jim Hargan
contact (AT) harganonline (DOT) com> wrote:

In this line:
if (tc2.locate ("num", ident, "desc", "W") ...
the locate() moves your tCursor within the scan. The next time the scan
loops, it will take over from this new position. And this new position is
always the same position, as locate() always sends the tCursor to the
first
matching record. So your scan gets stuck on one record.

Never move either the scanning tCursor or any records within a scan loop.

The scan should be sending tc2 straight to the correct records, as with:
scan tc2 for tc2."num" = ident and tc2."desc" = "W":
;do something
endscan
or else testing withing the scan, as with:
scan tc2:
if tc2."num" = ident and tc2."desc" = "W"
then ;do something
else loop
endif
endscan

Hi Jim,

Many thanks for the speedy and very helpful response...

But I am still not sure I correctly understanding how I
should set things up to do stuff only if something is found
in the first table, but not in the second.

Should that look something like this:

scan tc2:
If tc2."num" = ident and tc2."desc" = "W" and
not tc1.locate("num",ident,"desc",W1)
then

do something

All the best,
--
Kenneth

If you email... Please remove the "SPAMLESS."



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.