dbTalk Databases Forums  

Frustrated with data entry people

comp.databases.paradox comp.databases.paradox


Discuss Frustrated with data entry people in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ike
 
Posts: n/a

Default Frustrated with data entry people - 06-28-2007 , 12:15 PM






We have a Paradox database. It contains information about products we
copy off the 'Net. We have a custom utility that cleans text in
Windows clipboard of any forbidden characters like carriage
return/line feeds (CRLF). I have told the employees time and again to
NEVER paste text directly from a web page into a Paradox field. But
they sometimes do and when the field contains a CRLF it signifies to
Paradox that it is the end of the record when we export the data to a
flat ASCII file. Any data after the CRLF is gone. Is there any
mechanism in Paradox that will filter out forbidden characters so this
no longer happens?

Reply With Quote
  #2  
Old   
Jim Hargan
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-28-2007 , 12:55 PM






On Thu, 28 Jun 2007 10:15:37 -0700, Ike wrote:

Quote:
We have a Paradox database. It contains information about products we
copy off the 'Net. We have a custom utility that cleans text in
Windows clipboard of any forbidden characters like carriage
return/line feeds (CRLF). I have told the employees time and again to
NEVER paste text directly from a web page into a Paradox field. But
they sometimes do and when the field contains a CRLF it signifies to
Paradox that it is the end of the record when we export the data to a
flat ASCII file. Any data after the CRLF is gone. Is there any
mechanism in Paradox that will filter out forbidden characters so this
no longer happens?
Two possibles:
1. CR/LF is legal in a memo field.
2. Write OPAL code that intercepts the ctrl-v, and instead of doing the
default paste event, substitutes your own custom method. This method would
paste the text into a string variable and then, perhaps, step through it
looking for illegal characters. If you only want to scrub CR/LF, a
breakApart will do it in a single whack. Personally, I step through the
entire string and expunge *all* low and high ascii, including tabs (each of
which gets replaced with three spaces).


Jim Hargan


Reply With Quote
  #3  
Old   
Jim Moseley
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-28-2007 , 02:31 PM




Jim Hargan,

Quote:
when the field contains a CRLF it signifies to Paradox
that it is the end of the record when we export the data
to a flat ASCII file.
Option 3 - change your export routine to clean up the data. Do you 'manually'
export or control it via a script/form/library? if the latter, just put
your code in there.

HTH,
Jim Moseley


Reply With Quote
  #4  
Old   
Liz McGuire
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-28-2007 , 03:29 PM



Better option, forget trapping paste and instead, use the changeValue
event to look for and remove illegal characters - then, no matter how
they got there, you remove them.

I prefer this over doing it at export because then your database has
good data, not just your export.

Liz


Jim Hargan wrote:
Quote:
On Thu, 28 Jun 2007 10:15:37 -0700, Ike wrote:

2. Write OPAL code that intercepts the ctrl-v, and instead of doing the
default paste event, substitutes your own custom method. This method would
paste the text into a string variable and then, perhaps, step through it
looking for illegal characters. If you only want to scrub CR/LF, a
breakApart will do it in a single whack. Personally, I step through the
entire string and expunge *all* low and high ascii, including tabs (each of
which gets replaced with three spaces).


Jim Hargan

Reply With Quote
  #5  
Old   
Ike
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-28-2007 , 05:13 PM



On Thu, 28 Jun 2007 14:29:45 -0600, Liz McGuire
<liz (AT) paradoxcommunity (DOT) com> wrote:

Quote:
Better option, forget trapping paste and instead, use the changeValue
event to look for and remove illegal characters - then, no matter how
they got there, you remove them.

I prefer this over doing it at export because then your database has
good data, not just your export.

Liz
They are all good ideas. My preferrence would be to strip the
forbidden characters before they are accepted by Paradox. Though I
have quite a bit of programming experience, mostly scripting, I have
found OPAL to be quite obtuse. I would love to learn, but I have yet
to find a book teaching the beginner how to program in OPAL.
Suggestions? Thank you.


Reply With Quote
  #6  
Old   
Liz McGuire
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-28-2007 , 05:57 PM



Ike wrote:
Quote:
They are all good ideas. My preferrence would be to strip the
forbidden characters before they are accepted by Paradox.
The changeValue event will do that, as long as you don't call doDefault
first.

Quote:
Though I
have quite a bit of programming experience, mostly scripting, I have
found OPAL to be quite obtuse. I would love to learn, but I have yet
to find a book teaching the beginner how to program in OPAL.
Suggestions? Thank you.
In the changeValue event:

var
stNewValue String
arBreak Array[] String
liCounter longInt
stBadChars String
endVar

stBadChars = "\n\r\t" ;// line feed, carriage return, tab
;// add additional characters as desired

stNewValue = string(eventInfo.newValue())

stNewValue.breakApart(arBreak,stBadChars)

stNewValue = arBreak[1]
if arBreak.size() > 1 then
for liCounter from 2 to arBreak.size()
stNewValue = stNewValue + " " + arBreak[liCounter]
endFor
endIf

eventInfo.setNewValue(stNewValue)

....the End.

Liz


Reply With Quote
  #7  
Old   
Ike
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-29-2007 , 01:17 PM



On Thu, 28 Jun 2007 16:57:23 -0600, Liz McGuire
<liz (AT) paradoxcommunity (DOT) com> wrote:

Quote:
Ike wrote:

They are all good ideas. My preferrence would be to strip the
forbidden characters before they are accepted by Paradox.

The changeValue event will do that, as long as you don't call doDefault
first.

Though I
have quite a bit of programming experience, mostly scripting, I have
found OPAL to be quite obtuse. I would love to learn, but I have yet
to find a book teaching the beginner how to program in OPAL.
Suggestions? Thank you.

In the changeValue event:

var
stNewValue String
arBreak Array[] String
liCounter longInt
stBadChars String
endVar

stBadChars = "\n\r\t" ;// line feed, carriage return, tab
;// add additional characters as desired

stNewValue = string(eventInfo.newValue())

stNewValue.breakApart(arBreak,stBadChars)

stNewValue = arBreak[1]
if arBreak.size() > 1 then
for liCounter from 2 to arBreak.size()
stNewValue = stNewValue + " " + arBreak[liCounter]
endFor
endIf

eventInfo.setNewValue(stNewValue)

...the End.

Liz
Liz, you have gone far beyond what I would expect and I sincerely
appreciate it. Your assumption about stripping out CRLF and Tabs is
correct. Your code is straight forward and I understand what each line
is doing.

But, my problem is when I try to read the help tutorial, I can't even
find WHERE to put your code, or if it gets attached to an object, etc.
In other words, it is like trying to learn to drive a car, and the
instructions have omitted how to first shift into gear. I have always
learned by example. But the Paradox tutorial assumes too much, IMO,
and does not begin with the basics. I am sure I could learn how to
program in OPAL if I could just get over that first hump. I know there
are many things I would like to be able to do in OPAL. I have searched
for some kind of tutorial book, but have never found anything useful.

I certainly do not expect someone from this forum to teach me. What I
really need is a reference other than Paradox's help files.

Thank you again,
-Ike


Reply With Quote
  #8  
Old   
Liz McGuire
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-29-2007 , 01:27 PM



Ike wrote:
Quote:

But, my problem is when I try to read the help tutorial, I can't even
find WHERE to put your code, or if it gets attached to an object, etc.
Go to Tools > Settings > Developer Preferences...; make sure the
ObjectPAL level is set to Advanced and Show developer menus is checked.

Now go into design mode on your form and select the field object (not
the label, not the editRegion, but the field) and press Ctrl+Spacebar to
open the Object Explorer.

On the Events tab should be an event named changeValue. Open it up.
Put my code between the pre-existing method..endMethod lines. Check
syntax, edit as needed and run.

Liz


Reply With Quote
  #9  
Old   
Ike
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-29-2007 , 05:07 PM



On Fri, 29 Jun 2007 12:27:37 -0600, Liz McGuire
<liz (AT) paradoxcommunity (DOT) com> wrote:

Quote:
Ike wrote:


But, my problem is when I try to read the help tutorial, I can't even
find WHERE to put your code, or if it gets attached to an object, etc.

Go to Tools > Settings > Developer Preferences...; make sure the
ObjectPAL level is set to Advanced and Show developer menus is checked.

Now go into design mode on your form and select the field object (not
the label, not the editRegion, but the field) and press Ctrl+Spacebar to
open the Object Explorer.

On the Events tab should be an event named changeValue. Open it up.
Put my code between the pre-existing method..endMethod lines. Check
syntax, edit as needed and run.

Liz,

I put you code in as you said to do and I have it working. I like it!
I have noticed that when it replaces a CRLF it replaces it with two
spaces, which makes sense because it is two different character
values. But, I do not understand why a Tab is replaced with three
spaces. Shouldn't it be just one space? I do not see anything in your
code that would account for this. From what I see, it should be turned
into just one space. Maybe you could enlighten me with why the tab is
turned into three spaces? Is this a default of Paradox?

Actually, my preference is that each bad character is replaced with a
null instead of the space. I currently have it doing this so I am a
happy camper.

I plan to study your code further and with a bit of luck, be on my way
to write my own OPAL routines.

I truly appreciate you going far beyond what I expected. Thank you . .
.. thank you . . . thank you!
-Ike


Reply With Quote
  #10  
Old   
Jim Hargan
 
Posts: n/a

Default Re: Frustrated with data entry people - 06-29-2007 , 05:49 PM



On Fri, 29 Jun 2007 11:17:25 -0700, Ike wrote:

Quote:
What I
really need is a reference other than Paradox's help files.
IMHO your best option is the articles on www.thedbcommunity.com, the host
site of these groups. Lots of good stuff there, tho' no step-by-step. First
choice is "Where To Put Code":
http://www.thedbcommunity.com/index....13&Item id=44

Then check out the FAQs, available from the Corel Newserver
(cnews.corelcom) as the corel.Paradox-FAQ newsgroup. They are really
articles.

Finally, Mike Prestwood's book seems be available from his website:
http://www.prestwoodboards.com/commu...ooks/official/
although I couldn't get the "In Stock Order It Now" link to work. You might
try emailing him.

While it says Version 9, there are nearly no changes in V10 and V11, the
current version. Just something called the StringList type, supposed to be
useful for internationalizing applications.

FWIW

Jim Hargan


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.