Jump to content

This topic is 7574 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello

I have a script below that

finds the first place that 2 fields in a record are empty.

I have my files in list mode and they show up as a kind of report. The Problem I cannot figure out is how to get the cursor to go to the 1st record when it is empty, I always have 200 records to start. The present script below gets the cursor to the right place (the first empty record ) but that is not the case when there are filled in records beyond record 1 and a second empty record was for instance, record 16 , the cursor goes to record sixteen but not where it should to record one. (Because record one is emtpy. )

This is used for an auction and the 200 records serve as a constant of the number of places that may be reserved.

So my problem is correcting the script below to make the cursor go to record one to field "controlA" when it is empty. If record 1 and record 12 have the empty field " LANE A::combinedtofind" it goes to record 12 instead of 1. I need help to solve this.

Thanks very much.

Go to Layout [ "Lane "A"" (LANE A) ]

Set Field [ LANE A::gnumA; 200 ]

Freeze Window

Go to Record/Request/Page

[ First ]

If [ IsEmpty ( LANE A::combinedtofind ) ]

Go to Record/Request/Page

[ First ]

Go to Field [ LANE A::controlA ]

Commit Records/Requests

[ No dialog ]

End If

Loop

Go to Record/Request/Page

[ Next; Exit after last ]

Go to Field [ LANE A::combinedtofind ]

Exit Loop If [ IsEmpty(LANE A::combinedtofind) ]

Set Field [ LANE A::gnumA; LANE A::gnumA ]

If [ not LANE A::gnumA ]

Show Custom Dialog [ Message: "The Are NO Available slots in this A lane!"; Buttons: "OK", "Cancel" ]

Halt Script

End If

End Loop

Go to Field [ LANE A::controlA ]

Pause/Resume Script [ Indefinitely ]

Go to Layout [ "REGISTRATION" (REGISTRATION) ]

Posted

Hi Stann,

I'm not any expert with scripts, so maybe others will give you a better one, or something that is better suited for version 7.

However, this one will take you to the first open dealer field.

Go to Layout [

Posted

Are you saying if the field is empty in record 12, you want it to go back to record 1? Well, you have two steps that go to the first record up at the top of the script -- the second one is not really doing anything, maybe you meant to put it inside the loop.

Posted

Fitch said:

Are you saying if the field is empty in record 12, you want it to go back to record 1?

Yes, in the process of entering data, records are skipped, so in a sense they would need to look from the start to find the next blank record. Record 1 could be empty.

Fitch also said:

Well, you have two steps that go to the first record up at the top of the script -- the second one is not really doing anything, maybe you meant to put it inside the loop.

How about an example of how this should be written to accomplish the goal stated.

As I stated, I'm not an expert with scripts,

Lee

laugh.gif

Posted

Lee, I tend to use the Quick Reply box, so although it appears I was responding to your post, I was actually attempting to respond to the original post. Look at the script in that post and you'll see what I mean.

This topic is 7574 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.