Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace
Message
From
17/12/2006 09:44:53
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/12/2006 08:44:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01178386
Message ID:
01178393
Views:
13
>hi all,
>
>is there a way to convert it to vfp code
>
>for i= thisform.text1.value to  thisform.text12.value
> if (i)any text <>space""
>    REPLACE (thisform.text2.Value) WITH NEWNAME
>    REPLACE (thisform.text3.Value) WITH NEWNAME
>    REPLACE (thisform.text4.Value) WITH NEWNAME
>    REPLACE (thisform.text5.Value) WITH NEWNAME
>..
>..
>..
>..
>..
>    REPLACE (thisform.text11.Value) WITH NEWNAME
>    REPLACE (thisform.text12.Value) WITH NEWNAME
> ENDIF
>ENDFOR
>
>thanks.

I am not sure exactly what you want to do.

To loop through the textboxes, you might use something like this:
for i = 1 to 12
  loTextBox = eval("ThisForm.Text" + trans(i))
  loTextBox.Value = ...
  loTextBox.Visible = ...
  loTextBox.Top = ...
  * or whatever other property you want to change in each TextBox
next
REPLACE is used for fields in a table. To change the TextBox, just use the .Value property.

If you want to REPLACE table fields, where do you have the name of the fields, and the values?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform