![]() |
A Question for the Programmers
While I have a lot more free time on my hands, I am helping a friend of mine who owns a small business. I am making some updates in his FileMaker Pro (FMP) database. I am not trained as a programmer and have very little experience, mostly just stumbling my way through.
I am reverse engineering some code that someone else used to repurpose for my use. However, I am running into challenges and there is one small bit that I don't understand (though I may be overthinking it). I have put the (non-standard) FMP language in more understandable (hopefully) terms and I put some parts in (parenthesis). The part that has me stumped is the "EXIT LOOP IF [1 = 1]": Code:
INSERT TEXT "1" (into field "ABC") |
Not an expert as it has been a long time so I may be forgetting some idiosyncrasy but it looks that way.
|
Hmm. Is there no "break" statement in FMP? That would be the only thing I can think of, that someone kludged a break statement in. If finding the first instance where ABC = 1 is good enough, with no need to continue through the full loop, that would make sense.
|
No break -- it's a very old version (v. 6 and they just released v. 12).
So, any idea why a loop might have been built in? |
If I follow correctly, the "Insert" line adds the value "1" to any record that matches "ABC". The loop then goes through all the records looking for a "1". If it finds a "1", then there must have been a record matching "ABC", so "ABC" is a duplicate.
Or something like that. |
Looks like that's how they exited the loop, as GD said, it's used as the break statement to get out of the loop.
|
Actually, on another read it looks like what it's doing is trying to duplicate an existing record, rather than find a duplicate (stupid English). So it goes through the loop until it finds the record it wants to duplicate, then breaks out.
|
On rereading, I see my error in misreading. The loop exit only occurs when ABC equals 1: I was erroneously reading the string that the routine would never loop because of the "1=1" exit.
Hopefully I can figure out the bigger problem on Wednesday. Quote:
|
All times are GMT -7. The time now is 09:50 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.