If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Remove Hyphens with a Paradox 9 Script

I am trying to create a process script in Paradox 9 that will remove hyphens from a field. The field name is P_SSN and the data is social security numbers with hyphens. Before I can export the data to another application, the hyphens must go. Here is my script so far:

When I check the syntax, I get an "Error: Identifier Expected" on the first 'strTemp'. What am I doing wrong? Am I even close or waaaaaayyyyyyy off? And yes...I am a newb at the ol' Paradox. Please be gentle Seriously, any and all help would be greatly appreciated. Thanx.

P.S.
I have attached a text document with my string statement for editing purposes. Once again, thank you.

Your variable declaration was not formed properly and the insertion of the string keyword was incorrect as well.

You can make the procedure (I believe, I did not test it) as edited above however I would use a tcursor and use a scan instead, see below. It would take care of the entire table in one quick pass. The "yourtable.db" is the name of the paradox table and it must be double quoted iside the parentheses.

I have taken your script and reworked it so that it would match my table. However I get an Unknown Identifier Error on tcfix.strp_ssn=x+y. Does p_ssn need to be defined elsewhere or does Paradox autmatically know that it is a field within the table. If not, could that be the root cause of the error. Here is the revised script so far:

I do not have anything else under the run, var, const, etc etc in this script defining p_ssn. If it needs to be defined where and how would that be accomplished? I have attached the script to a text file in case anyone wants to look at it. I really do appreciate all the help so far. Cheers

I'm sorry replace tcfix with nohyphen tcfix was a name leftover from my script which i pulled over and modified for your problem. Also if strp_ssn is not the name of your field (meaning it is really p_ssn) then strip out the str where ever it exists as well. Paradox knows the field name and will fail if it doesn't match.

Also looks like you might be missing a closing parenthesis at tcfix.endedit (. (soon to be nohypen.endedit().)

Final Result of Script

With a lot of help (if not all) from Maroonotmoron here is the final resulting script that was developed (The name of my database file was "Abraxport.DBF" and the field that I needed to have the hyphens removed was P_SSN) :