Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Want to substitute a blank field ditto?

Want to substitute a blank field ditto?

Want to substitute a blank field ditto?

I am importing an Excel spreadsheet (from ASCII) where every "record" incorporates 5 lines. This results in a table where there is a 1 lines with a desciption including an item number followed by 5 line where that field is empty. Where table is open, I "shift-control-z" (find and replace)Pardadox finds the blank fields, but won't take control-D keystroke. I could do this manually, but the table has 7000 records..Is there a way to do this with OPAL script?(using Paradox-7)

RE: Want to substitute a blank field ditto?


I have worked blind here and for example purposes assumed that you end up with a table (let's call it test) which has columns named A, B.....

Table Test
Column A             B

Value_1              xcxcx
Value_2              vvvvv

and so on.  

In column A you want the blank fields to be the duplicates of the preceding field which holds a value so in my example Column A rows 2-5 would be populated with Value_1 and rows 6 - 10 would be populated with Value_2 and so on through the 7000 plus rows. (Of course if I have misunderstood your requirement then all of the following is useless)

An ObjectPal way of dealing with this is set out below
  TC  TCursor
  Str String

;Below please substitute "test" with your own table name
;and path as necessary
;also substitute "A" with your own field name

TC.open("test"); open a TCursor to read your table
TC.edit();set the TCursor to edit the table

;use the TCursor to scan the table. Everytime it gets to
;a value in column A this is stored in a variable
;called Str. The next blank fields is given the value
;stored in Str.  Str changes the next time it encounters a
;a non blank field.
Scan TC:
if TC."A".isblank()=False  then


I have commented the code quite heavily so that you can see what it is doing. I am confident that it will work on version 7.  It just needs to be pasted into a button on a form in between Method and EndMethod.

I hope that this works.  If you have any problems please post again.



RE: Want to substitute a blank field ditto?

Worked very well ("instantly")-thanks

RE: Want to substitute a blank field ditto?

Pleased to be of service.



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close