Discussion:
replace in VdB 5.7
(too old to reply)
Bob Newman
2008-09-22 20:43:31 UTC
Permalink
Can anyone explain this behavior when replacing a field value in a table in another work area?

current alias is retact
replace mn_info->ntax with retp->ntaxdue && works
replace mn_info->gsales with nGSales && does not work

To get the value of the nGSales memory variable into mn_info, I must first select mn_info and then issue the replace...
Seems that going from table to table is Okay, but not variable to table.
TIA
Bob Newman
2008-09-30 15:08:20 UTC
Permalink
No expert help or opinions on this one?
Post by Bob Newman
Can anyone explain this behavior when replacing a field value in a table in another work area?
current alias is retact
replace mn_info->ntax with retp->ntaxdue && works
replace mn_info->gsales with nGSales && does not work
To get the value of the nGSales memory variable into mn_info, I must first select mn_info and then issue the replace...
Seems that going from table to table is Okay, but not variable to table.
TIA
Mervyn Bick
2008-09-30 18:14:34 UTC
Permalink
Post by Bob Newman
Can anyone explain this behavior when replacing a field value in a table
in another work area?
current alias is retact
replace mn_info->ntax with retp->ntaxdue && works
replace mn_info->gsales with nGSales && does not work
To get the value of the nGSales memory variable into mn_info, I must
first select mn_info and then issue the replace...
Seems that going from table to table is Okay, but not variable to table.
TIA
I don't have 5.7 available so I can't try it out but I seem to remember
that earlier versions of dBase could get confused when replacing fields
with memory variables especially if the names were the same. Although
this is not the case here you could try the work-around that fixed that
old problem. (All this was a LONG time ago so maybe it's me that is
confused and not dBase. <g>)

All memory variables in pre-OODML versions of dBase had an alias of M (and
dBase Plus still recognises this even though it is probably never used
now) so "replace mn_info->gsales with m->nGSales" might solve your
problem. If that doen't do the trick you will have to set the work area
to mn_info before the replace and then set it back to retact afterwards.

Mervyn.
Bob Newman
2008-10-02 18:13:39 UTC
Permalink
Thanks, Mervyn. I will try that.
Post by Mervyn Bick
Post by Bob Newman
Can anyone explain this behavior when replacing a field value in a table
in another work area?
current alias is retact
replace mn_info->ntax with retp->ntaxdue && works
replace mn_info->gsales with nGSales && does not work
To get the value of the nGSales memory variable into mn_info, I must
first select mn_info and then issue the replace...
Seems that going from table to table is Okay, but not variable to table.
TIA
I don't have 5.7 available so I can't try it out but I seem to remember
that earlier versions of dBase could get confused when replacing fields
with memory variables especially if the names were the same. Although
this is not the case here you could try the work-around that fixed that
old problem. (All this was a LONG time ago so maybe it's me that is
confused and not dBase. <g>)
All memory variables in pre-OODML versions of dBase had an alias of M (and
dBase Plus still recognises this even though it is probably never used
now) so "replace mn_info->gsales with m->nGSales" might solve your
problem. If that doen't do the trick you will have to set the work area
to mn_info before the replace and then set it back to retact afterwards.
Mervyn.
Bob Newman
2008-10-02 20:21:54 UTC
Permalink
That didn't work, so I guess one must select the work area to replace a field with a memory variable variable.
Post by Mervyn Bick
Post by Bob Newman
Can anyone explain this behavior when replacing a field value in a table
in another work area?
current alias is retact
replace mn_info->ntax with retp->ntaxdue && works
replace mn_info->gsales with nGSales && does not work
To get the value of the nGSales memory variable into mn_info, I must
first select mn_info and then issue the replace...
Seems that going from table to table is Okay, but not variable to table.
TIA
I don't have 5.7 available so I can't try it out but I seem to remember
that earlier versions of dBase could get confused when replacing fields
with memory variables especially if the names were the same. Although
this is not the case here you could try the work-around that fixed that
old problem. (All this was a LONG time ago so maybe it's me that is
confused and not dBase. <g>)
All memory variables in pre-OODML versions of dBase had an alias of M (and
dBase Plus still recognises this even though it is probably never used
now) so "replace mn_info->gsales with m->nGSales" might solve your
problem. If that doen't do the trick you will have to set the work area
to mn_info before the replace and then set it back to retact afterwards.
Mervyn.
Loading...