July 24, 200520 yr I'm building a program to look up an area code and display the time it is currently in that area code. I have a script which enters find mode, then I want it to perform the find and after the record is found and displayed, calculate and display the time at that area code. The problem is that after entering find mode it immediately goes to the calculation line. Putting a pause it doesn't stop this. Any ideas how to do this in the same script?
July 25, 200520 yr Author I just do the following: Enter Find Mode[] Set Field[AreaCode::Curr_Time; ... (it does a long calculation here to find out the time difference, but I'll skip the details) The script enters Find Mode and goes right to the calculation before I can put in the new area code. I know I could do this in two separate scripts, the first to Find the record and then making the end-user click on a 'Calculate Time' button, but would like to do it automatically each time a new area code is chosen.
July 26, 200520 yr You are never performing the find, it seems. You are also entering the Curr_Time as find criteria, instead of setting a found record in Browse Mode. Allow User Abort [Off] Set Error Capture [On] Enter Find Mode [Pause] Perform Find [ ] If [not Get(FoundCount)] Modify Last Find Show Custom Dialog ["No records found."] Show All Records End If Set Field [AreaCode::Curr_Time; ...] But, why not just use an unstored calculation to determine the time? If you do it the scripted way, only the first found record will be accurate.
Create an account or sign in to comment