Discussion:
Ignores REPLACE commands
(too old to reply)
Dan Anderson
2008-11-14 19:18:20 UTC
Permalink
In the example below my program ignores all of the REPLACE commands. It
begins with a blank field. nUnits and nAccurate are both equal to 8. What
would cause it to ignore REPLACE commands?

SELECT 2
USE :UBIquotes:Quotes_new.dbf order tag quotenum
SEEK cQuotenum
REPLACE QUOTES_NEW->VEHICLESACCURATE WITH "xxx"
IF nAccurate = nUnits
REPLACE Quotes_new->VehiclesAccurate WITH "YES"
ENDIF
IF nUnits - nAccurate = 0
REPLACE Quotes_new->VehiclesAccurate WITH "YES"
ENDIF

SET TALK ON
? Quotes_new->quotenum
? nAccurate+" "+nUnits+"
VehiclesAccurate="+Quotes_new->VehiclesAccurate
SET TALK OFF
--
Dan Anderson
UBI .
***@ubinc.com
800-444-4824 ext 128
bigMike
2008-11-14 21:04:29 UTC
Permalink
Try giving the table an ALIAS ...

change:
USE :UBIquotes:Quotes_new.dbf order tag quotenum
to
USE :UBIquotes:Quotes_new.dbf order tag quotenum ALIAS NewQuotes

...and then do ...

REPLACE NewQuotes->VEHICLESACCURATE WITH "xxx"

...and see what that does for you.

bigMike
Post by Dan Anderson
In the example below my program ignores all of the REPLACE commands. It
begins with a blank field. nUnits and nAccurate are both equal to 8.
What would cause it to ignore REPLACE commands?
SELECT 2
USE :UBIquotes:Quotes_new.dbf order tag quotenum
SEEK cQuotenum
REPLACE QUOTES_NEW->VEHICLESACCURATE WITH "xxx"
IF nAccurate = nUnits
REPLACE Quotes_new->VehiclesAccurate WITH "YES"
ENDIF
IF nUnits - nAccurate = 0
REPLACE Quotes_new->VehiclesAccurate WITH "YES"
ENDIF
SET TALK ON
? Quotes_new->quotenum
? nAccurate+" "+nUnits+"
VehiclesAccurate="+Quotes_new->VehiclesAccurate
SET TALK OFF
--
Dan Anderson
UBI .
800-444-4824 ext 128
Geoff Wass [dBVIPS]
2008-11-15 06:31:44 UTC
Permalink
Post by Dan Anderson
In the example below my program ignores all of the REPLACE commands. It
begins with a blank field. nUnits and nAccurate are both equal to 8. What
would cause it to ignore REPLACE commands?
Dan,

Instead of USE :UBIquotes:Quotes_new.dbf, how about using SET DATABASE
TO UBIquotes and then USE Quotes_new.dbf. Or use OOP. :-)
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Bruce Beacham
2008-11-16 08:40:07 UTC
Permalink
Post by Dan Anderson
In the example below my program ignores all of the REPLACE commands.
It begins with a blank field.
Post by Dan Anderson
USE :UBIquotes:Quotes_new.dbf order tag quotenum
SEEK cQuotenum
if found(quotes_new)
Post by Dan Anderson
REPLACE QUOTES_NEW->VEHICLESACCURATE WITH "xxx"
...

else
msgbox("Didn't find " + cQuotenum, "", 48)
endif


Bruce Beacham
Bruce Beacham
2008-11-16 13:51:32 UTC
Permalink
Post by Bruce Beacham
if found(quotes_new)
Sorry, that should be:

if found("quotes_new")



Bruce

Loading...