stann Posted May 13, 2004 Posted May 13, 2004 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) ]
Lee Smith Posted May 13, 2004 Posted May 13, 2004 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 [
Fitch Posted May 13, 2004 Posted May 13, 2004 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.
Lee Smith Posted May 13, 2004 Posted May 13, 2004 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
Fitch Posted May 14, 2004 Posted May 14, 2004 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.
Lee Smith Posted May 14, 2004 Posted May 14, 2004 Hi Tom, Me too. You sure had me going there though Lee
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now