Lounge of Tomorrow

€uromeinke, FEJ. and Ghoulish Delight RULE!!! NA abides.  


Go Back   Lounge of Tomorrow > A.S.C.O.T > Egg Head
Swank Swag
FAQ Members List Calendar Today's Posts Clear Unread

Reply
 
Thread Tools Search this Thread Display Modes
Old 04-11-2012, 07:46 PM   #1
Kevy Baby
Chowder Head
 
Kevy Baby's Avatar
 
Join Date: Jan 2005
Location: Yes
Posts: 18,500
Kevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of cool
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")

LOOP
    IF ABC = 1
        DUPLICATE RECORD
        INSERT TEXT "" (into field "ABC")
        EXIT LOOP IF [1 = 1]
    ELSE
        GO TO NEXT PORTAL ROW
    END IF
END LOOP

(Command to copy certain text)

LOOP
    IF ABC = 1
        INSERT TEXT "" (into field "ABC")
        EXIT LOOP IF [1 = 1]
    ELSE
        GO TO NEXT PORTAL ROW
    END IF
END LOOP
Wouldn't "EXIT LOOP IF [1 = 1]" mean just to exit the loop (since 1 will always equal 1!)? If so, what is the point of a loop?
__________________
The thing about quotes on the internet is that you cannot verify their validity.
- Abraham Lincoln
Kevy Baby is offline   Submit to Quotes Reply With Quote
Old 04-11-2012, 09:25 PM   #2
Alex
.
 
Join Date: Feb 2005
Posts: 13,354
Alex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of coolAlex is the epitome of cool
Not an expert as it has been a long time so I may be forgetting some idiosyncrasy but it looks that way.
Alex is offline   Submit to Quotes Reply With Quote
Old 04-11-2012, 11:06 PM   #3
Ghoulish Delight
I Floop the Pig
 
Ghoulish Delight's Avatar
 
Join Date: Jan 2005
Location: Alternative Swankstyle
Posts: 19,348
Ghoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of cool
Send a message via AIM to Ghoulish Delight Send a message via Yahoo to Ghoulish Delight
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.
__________________
'He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.'
-TJ

Ghoulish Delight is offline   Submit to Quotes Reply With Quote
Old 04-11-2012, 11:12 PM   #4
Kevy Baby
Chowder Head
 
Kevy Baby's Avatar
 
Join Date: Jan 2005
Location: Yes
Posts: 18,500
Kevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of cool
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?
__________________
The thing about quotes on the internet is that you cannot verify their validity.
- Abraham Lincoln
Kevy Baby is offline   Submit to Quotes Reply With Quote
Old 04-11-2012, 11:23 PM   #5
Ghoulish Delight
I Floop the Pig
 
Ghoulish Delight's Avatar
 
Join Date: Jan 2005
Location: Alternative Swankstyle
Posts: 19,348
Ghoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of cool
Send a message via AIM to Ghoulish Delight Send a message via Yahoo to Ghoulish Delight
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.
__________________
'He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.'
-TJ

Ghoulish Delight is offline   Submit to Quotes Reply With Quote
Old 04-16-2012, 07:37 AM   #6
DreadPirateRoberts
Senior Member
 
Join Date: Mar 2006
Posts: 2,483
DreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of coolDreadPirateRoberts is the epitome of cool
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.
DreadPirateRoberts is offline   Submit to Quotes Reply With Quote
Old 04-16-2012, 08:17 AM   #7
Ghoulish Delight
I Floop the Pig
 
Ghoulish Delight's Avatar
 
Join Date: Jan 2005
Location: Alternative Swankstyle
Posts: 19,348
Ghoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of coolGhoulish Delight is the epitome of cool
Send a message via AIM to Ghoulish Delight Send a message via Yahoo to Ghoulish Delight
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.
__________________
'He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.'
-TJ

Ghoulish Delight is offline   Submit to Quotes Reply With Quote
Old 04-16-2012, 12:03 PM   #8
Kevy Baby
Chowder Head
 
Kevy Baby's Avatar
 
Join Date: Jan 2005
Location: Yes
Posts: 18,500
Kevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of coolKevy Baby is the epitome of cool
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:
Originally Posted by Ghoulish Delight View Post
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.
Yes, the routine is to duplicate a record. Unfortunately, when I try to replicate (repurpose) the code, it wasn't working. Hopefully when I look at this with a fresh mind, the problem will become apparent.
__________________
The thing about quotes on the internet is that you cannot verify their validity.
- Abraham Lincoln
Kevy Baby is offline   Submit to Quotes Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 12:06 PM.


Lunarpages.com Web Hosting

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.