Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy fields(data)
Message
From
06/11/2005 06:53:58
 
 
To
06/11/2005 06:40:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01065805
Message ID:
01065813
Views:
18
hi
i try as under, som thing missing.
only add one record.
local lnCurrentRecord, lnTotalRecords
lnTotalRecords = reccount()
go top
scan while recno() <= lnTotalRecords && Don't include newly added records
m.char1=char1
m.char2=char2
m.char3=char3
m.char4=char4
m.char5=char5
m.char8=char8


  lnCurrentRecord = recno() && remember record position
use home
  append blank
      replace customer_tel WITH m.char8
      replace home         WITH m.char2
      replace qdate        WITH m.char3
      replace name         WITH m.char4
      replace account      WITH m.char5
      replace bus          WITH space(10)
      replace survey_no    WITH space(10)
      replace list_no      WITH val(m.no) 
      replace flag         WITH 0
      replace n_try        WITH 0  goto (lnCurrentRecord)  && go back to previous record position
  ...&& what i must add
endscan
thanks.
>>hi,
>>thank you for reply,and advice
>>
>>but my code get(append) to new table (home) one record only and exit.
>>
>>any idea.
>>thanks.
>
>That is because the APPEND BLANK will go to the end of the table, so there are no more records to process.
>
>You can correct this (by remembering the record position and going back to it), you will go into an endless loop, because the newly appended records will also be copied, again and again.
>
>If you want to make a duplicate all records, you might do the following changes:
>
>
>local lnCurrentRecord, lnTotalRecords
>lnTotalRecords = reccount()
>go top
>scan while recno() <= lnTotalRecords && Don't include newly added records
>  ...
>  lnCurrentRecord = recno() && remember record position
>  append blank
>  replace ...
>  goto (lnCurrentRecord)  && go back to previous record position
>  ...
>endscan
>
>
>
>>>This error means that m.no is not of the expected type. Because of the previous code, m.no is already of type numeric. Just omit the val() function.
>>>
>>>On the contrary, I think you have to convert back to character, to save to the field, which seems to be of type character. In this case, you can use the str() function or the transform() function.
>>>
>>>>hi all,
>>>>
>>>>any idea,help
>>>>
>>>>i try to choise fields from mytable to insert it to new table as under,
>>>>i get error message syntax error
>>>>
>>>>USE am2
>>>>scan
>>>>m.char1=char1
>>>>m.char2=char2
>>>>m.char3=char3
>>>>m.char4=char4
>>>>m.char5=char5
>>>>m.char8=char8
>>>>
>>>>
>>>>       USE home
>>>>
>>>>m.no=val(list_no)+1
>>>>
>>>>       APPEND blank
>>>>
>>>>       replace customer_tel WITH m.char8
>>>>       replace home         WITH m.char2
>>>>       replace qdate        WITH m.char3
>>>>       replace name         WITH m.char4
>>>>       replace account      WITH m.char5
>>>>       replace bus          WITH space(10)
>>>>       replace survey_no    WITH space(10)
>>>>       replace list_no      WITH val(m.no) && error messageFunction argument value, type, or count is inval
>>>>       replace flag         WITH 0
>>>>       replace n_try        WITH 0
>>>>endscan
>>>>
>>>>thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform