Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace only one line in a memofield
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01028840
Message ID:
01028844
Views:
9
Has stated, you have to replace the whole content of the memo, but the following will allow you the change a specific word, in a specific line of a memo field.
Private nCount,lcstr
lcstr = ''
Create Cursor mycursor (comments m)
Insert Into mycursor (comments) Values ('There are many ways to get data from a specific line in a memofield.'+Chr(13)+ 'But are there any commands or functions to replace a specific line with a new characterstring, or do I have to replace the whole memofield?')
Modify Memo comments
nCount = Alines(myArray,comments)
For i = 1 To nCount
	If i = 2
		lcstr2=Strtran(myArray[i],'characterstring','character string')
		lcstr = lcstr+Chr(13)+lcstr2
	Else
		If i = 1
			lcstr = lcstr+myArray[i]
		Else
			lcstr = lcstr+Chr(13)+myArray[i]
		Endif
	Endif
Endfor
Select mycursor
Replace comments With lcstr
Modify Memo comments
>Hallo!
>There are many ways to get data from a specific line in a memofield. But are there any commands or functions to replace a specific line with a new characterstring, or do I have to replace the whole memofield?
>If I want to replace the contens of line 67, can I do that without touching the other lines?
>
>Thankyou
>/Kjell
Previous
Reply
Map
View

Click here to load this message in the networking platform