Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REPLACE command

Status
Not open for further replies.

millsrs

Programmer
Feb 16, 2009
21
US
Greetings All!

I am working on an old FoxPro 2.0 for DOS system. Things usually work well but recently I bumped into the following situation:

1) From within FoxPro via the Command Window, a new table was created normally.

2) However, a Date field, a Numeric field and 1 of 4 Character fields behaved surprisingly. (Size is not the issue.)

3) At the Command Window putting data of each type into a properly Declared and Initialized variable and then using the REPLACE command to store the corresponding variables into the proper fields in the new table there was NO problem.

4)When doing the exact same populating process using the REPLACE command within a program the value from the correct variable would NOT be stored in the table's corresponding field. (IT WOULD, however, store values put into it from another table's field of correct data type.)

5) The debugger was used to make sure that the above was truly happening and the debugger clearly showed the table fields NOT getting populated with the REPLACE command.

Any ideas or suggestions? All responses are greatly appreciated.

 
Are you using a screen with an input mask? From what I read you are replacing multiple fields at the same time and the rest work but this one doesn't? Are you sure that you are storing the data in a field with the right alias? Personally I always store everything to memory variables then transfer it to the table(s) with an append blank followed by the replaces.

I have done initialization of variables and still do. It can be helpful in some cases.
 
To All Contributors:

I have learned a great deal from you all. Thank you! The program with the issue is working fine with the way I worked around the issue. It doesn't do as much as we wanted, but it does get the basic job done.

I am now choosing to close this thread.

Again, thank you for all your excellent ideas.

MillsRS 8/8/2015
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top