Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: trim memo fied in corel paradox 8



> Just come back from a long holiday and suddenly i feel like that ->
>Replace the chr(10) and chr(13) with space then trim it then i should
>get the answer i want right?

Chr(10) does not occupy a character position in the same way chr(13) does.
Could get tricky.

If you want to fix this permanantly, at table level, you could use the
following scan code where "YourTable" is the table name and "YourField" is the
field name. It will remove the CR characters only at the front of the text.
BACKUP the table before executing this in a script.

;**************************
var
a,b,textvar string
tc tcursor
endvar

tc.open("YourTable")
tc.edit()

SCAN tc:
;//assign the field value to a string var
textvar=tc.YourField

;//ignore and loop if blank value
if textvar="" then loop endif

;//temporarily remove all chr(10)...they will come back
while(textvar.match("..\n..",a,b))
textvar=a+b
endwhile

;//remove chr(13) at the front
while(textvar.substr(1,1)="\r")
textvar=textvar.substr(2,textvar.size()-1)
endwhile

;//assign the new text string back to field
tc.YourField=textvar
ENDSCAN
tc.close()
;**********************

It is one way. Hope it helps.

Randy




<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.