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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field's value can't display after conversion from 3.0 to 6.0

Status
Not open for further replies.

FranklinYeung

Programmer
Apr 20, 2001
31
0
0
HK
Hi all,

An application was developed in VFP3.0 few years ago and I want to have the setupdisk of the application in VFP6.0 format now, as well as a exe file built from 6.0 version.

I reopened that project by VFP6 + SP5, VFP promoted me whether to preform conversion and of course, I go ahead, after very quick conversion, and no any errors promoted, i rebuild the application, rebuild the exe file and recreate the setupdisk. Everything seems alright and without any problems.

While I copy the program file (from VFP6) to overwrite the exising VFP3 program file in the production workstation, and VFP prompted me again the conversion box, i follow the instruction and seems every alright this time.

However, when i activate some function, I found that the outcome on some function screen is different, The VFP6 exe can't display some fields and leave blank while VFP3 exe works normally. I am sure the fields must have values filled.

I checked with my code and find that the text box control source values is binded with a variable called m.id, m.name, m.trx_dt, etc. Firstly, I suspected the m.xxx variable was released before the screen init, but i am wrong as the variable is still valid. Why the textbox value can't binded again in VFP6.0?

Hence, i perform 2 testes
1) Change my code like this
with thisform.
.id.value = m.id
.name.value = m.name
.trx_dt.value = m.trx_dt
..
..
endwith

2) Declare m.xxx variable in public before
pulic m.id, m.name, m.trx_dt
store ID to m.id
store Name to m.name
store TRX_DT to m.trx_dt


Both works again to show the fields value, but I wonder whether VFP6 can identify the variable named m.xxx and link the controlsource of the textbox to such kind of 'old-standard' variable naming
OR just my 'dirty-write' of the declaration of variable
OR the conversino problem??

Also, Why VFP 3.0 works but VFP 6.0 NOT works for the same routine or logic?? Anything that need to be specially tackled or changed before converting the project 3.0 to 6.0.

As i need to report this to my top-management but i can't find any related and resonable information on web, Please help or share if you encounter such problems before.

Many Many Thanks!!

Franklin
:(
 
While I copy the program file (from VFP6) to overwrite the exising VFP3 program file in the production workstation, and VFP prompted me again the conversion box, i follow the instruction and seems every alright this time.

after creating the install, you have to run the install program disk, not copy the exe over the old one.
Attitude is Everything
 
HI Danceman,

I tried to restore the production environnment in VFP3.0 version and install the setup diskes built from VFP6.0 and finally return the same problem, i.e. some fields's value is empty.

Many thanks

Franklin
 
HI Franklin,

The m. indicator refers to the memory variable of the equivalent fields created obviously with SCATTER MEMVAR.
This SCATTERed MEMVAR stays as local variables unless bound to some text boxes controls immediately when the variables are available. Once you leave the method/function which does the SCATTER as a local variable, the values are lost.

A quicky to solve this problem will be to use
SCATTER MEMVAR NAME M
This will craete an Object by name M and M.fieldname should solve your problem. Remeber to GATHER MEMVAR NAME M to save back. This quick solution is off my head in this instance and I would suggest try and test before releasing.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Hi ramani,

Thanks first, But why the same code or logic works in VFP3.0 but not works in VFP6.0. Is there any difference between the declaration of (public, private, local) variables between two VFP versions.

Any comments?

Franklin
 
If there is an object "M", with property "Field1", the expression "M.Field1" does NOT refer to the property of the object... if there is a memory variable "Field1", "M.Field1" will refer to that variable... if there isn't a memvar by that name, VFP will report "Variable 'Field1' does not exist". (I tested this to be sure)

To get to the properties of the object, you need to refer to it as "M.M.Field1", however, the Scoping of the SCATTER NAME M object should be the same as the SCATTER MEMVAR variables that were created (untested).

I don't have any firm explanations for the problem, But I have a couple "rules of thumb":
1) VFP3 had many default settings to make it more compatible with conversions from Fox2.6 which default differently in VFP6/7, so something may be defaulting differently and therefore acting differently
2) The Conversion tool itself has seemed flaky every time I've used it: I don't trust a converted screen till I've worked through the settings of every object in it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top