Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Derrick Bruce
  Where is Derrick Bruce?
 Charlestown
 Indiana - United States
 Derrick Bruce
 Tags
Subject: RE: Carriage Return Symbol Stored in Data
Thread ID: 228691 Message ID: 228802 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, May 21, 2009 4:48:58 PM         
   


> >
> > On lostfocus from edit box you have to clean using strtran function chr(13) and chr(10) characters
> >
> > Camil Ghircoias
>
> Yeah, already had to do this on one field to clear out characters that would crap out the import - it would end up being about 25 fields to clean up in the end and was really hoping that the edit box had a function on it that did this similar to supressing the line feeds. Thanks. This is a single row cursor, before anyone gets on me for my very general UPDATE command.
>

Hey, why do you use SQL Update ... :-)

>
cpjob = csrcontrol.pojob
> IF EMPTY(cpjob)
> cpjob = ''
> ELSE
> cpjob = STRTRAN(cpjob,"'",' ')
> cpjob = STRTRAN(cpjob,'"',' ')
> cpjob = STRTRAN(cpjob,'`',' ')
> cpjob = STRTRAN(cpjob,'~',' ')
> UPDATE csrcontrol SET pojob = cpjob
> endif


Seriously, I'd use ChrTran() and Replace, e.g.:

REPLACE pojob WITH CHRTRAN(pojob, ['"`~],'') in csrcontrol



-Stefan

ENTIRE THREAD

Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/20/2009 8:42:24 PM
RE: Carriage Return Symbol Stored in Data Posted by Ammar Hadi @ 5/20/2009 9:03:14 PM
RE: Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/21/2009 4:30:11 PM
RE: Carriage Return Symbol Stored in Data Posted by Camil Ghircoias @ 5/20/2009 9:04:44 PM
RE: Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/21/2009 4:39:16 PM
RE: Carriage Return Symbol Stored in Data Posted by Stefan Wuebbe @ 5/21/2009 4:48:58 PM
RE: Carriage Return Symbol Stored in Data Posted by Derrick Bruce @ 5/21/2009 7:51:05 PM