Jump to content

elipsett

Members
  • Content Count

    77
  • Joined

  • Last visited

Community Reputation

0 Neutral

About elipsett

  • Rank
    member

Profile Information

  • Gender
    Male
  • Location
    Kumamoto, Japan

Contact Methods

  • Website URL
    http://www.kurodahan.com

FileMaker Experience

  • Skill Level
    Intermediate
  • FM Application
    13 Advanced

Platform Environment

  • OS Platform
    Mac
  • OS Version
    10.9--10.12, Win7

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Restore completed with no errors, and multiple other scripts (internal to this file, or calling it from other files) all work perfectly, and have worked for at least a decade. It is unlikely (but certainly possible) that some internal error is causing all this. If FileMaker is tripping over a Japanese character I would be astonished, and FileMaker would probably be bankrupt. A manual FIND results in a 401, but performing the same FIND programmatically does not. I can only assume that internally they are processed differently.
  2. When I said it didn't work, I meant no 401 is ever returned. I also tried removing the ErrorCapture=ON and dialog steps completely, but it still will not capture 401. If both fields are found, the script works (no error code), which is what I want. The problem is that it does not return a 401 if there is no record with both fields found. It always returns errorcode=0 on BOTH dialogs. (The dialogs are only there to try to see what the script is doing; script functions the same way even if they are both disabled). I used the setfield commands deliberately to try to clarify exactly what the script is doing; normally I would use a single execute find command. If I use foundcount=0 instead, however, the script functions perfectly.
  3. Update: If I use FoundCount=0 instead of ErrorCode=401, the script works perfectly.
  4. I believe I followed your explanation, and tried it as shown. Results are the same (error code = 0) even when the target record does not exist. If I manually set the two fields and search with the specified values, it reports no records match the find criteria. Have I made an error in rewriting the script as you suggested?
  5. Still trying to figure out what the problem is. When I run this script in a test file, it reports a 401 if the specified field value is not found. The field names have been made identical to those in my real file. When I run the identical code in the real file, the first dialog shows LastError=0 Foundcount=1 (1 of 2000 records), and the screen is the find screen with the ID number (4182) showing, all correct. In other words, there is currently one record (the FIND screen). There is no record with that number, so the second dialog should say 401/0. It DOES say 401/0 in the test file, but in the real file it says 0/0, and the screen shows 0 of 2000 records. If I manually enter the SAME find (4182), it says "No records match this find criteria." Is there any possible explanation for this behavior? Assuming the only possible explanation is file corruption, is it safe to assume I can make a zero-data copy of the file, and then bulk copy over all data from the old file to the new file? Or is that approach likely to reproduce the corruption as well?
  6. That is exactly how I wrote the first iteration of the script.... I changed my test.fmp to work properly, and added code to do X or Y depending on whether the error code is 401 or not, and verified it. The code in my original script is exactly the same, with the single exception of the FIND line itself, which compares a - Table A text ID to a $$ID variable created from a Table B text ID AND IN THE SAME FIND - Table A status = fixed text string "paid" I'm going to make a simple file to test this. Maybe find and errorcode handling don't like variables? The test file appears to work perfectly, drat. Time to call it a night. Thanks very much for your assist! I'll try to find a solution, and let you know.
  7. It does indeed return a 401 code... but only in the dialog immediately after the FIND. The setfield lines are not working. Let me fiddle a bit more... I just added code to catch 401, and it does appear to work... just like I would have thought my original script should have worked. Time to try again. Thanks!
  8. So apparently my understanding of error capture is wrong... What would I add to the find3 script to get it to return an errorcode=401, since there is no target=3 record?
  9. It occurred to me that the dialog might be an issue, and I tried disabling it, too. The script functions the same. I made a new DB with VERY simple scripts. I think there are only two possibilities left: - I am making a fundamental error in this code or - My copy of FileMaker is broken test.fmp12
  10. Hmm. I created a new text field Text01, and a 2-line script. If I search manually, FMP correctly either finds it or reports no such record can be found. If I run this script and the record exists, the script finds it, and the dialog is 0 and 1. If the record does not exist, the script shows a form with all blank fields, and the dialog is STILL 0 and 1.
  11. OK, I did that. The script halted immediately after the find. The layout is displayed with all fields blank (like a FIND with nothing specified yet). DataViewer says that $$ID is set to the correct ID value. Since there is no unpaid Table A record with that ID, I think this is the correct action. The record count shows that it is displaying (0 of 2000) records of the entire set, which (again) appears to be a FIND screen. If I disable the HALT line and run the script, it proceeds normally through every record in Table B, reporting the correct $$ID for every one, but creates no new records in Table A. It is very unlikely that the file is corrupt... there are dozens of other scripts in this file, or calling it from other files, and there have never been and still aren't any problems with any of them. I'm just trying to automate a task that is done manually at present.
  12. So, replace the dialog line with a halt? That should be possible.
  13. I remembered that I can change the program language, vastly simplifying things. I attach a screenshot. Various field names are still in Japanese, tho... sorry... The table on the first line is Table B, line 6 is Table A. The problem is in line 8, which searches for ID=$$ID and PaymentStatus=Unpaid The IF statement after the find creates a new record if one is not found, and the rest is just cleanup. The dialog is there for troubleshooting, so I can see what error code was returned. When error code handling is ON, it always shows code=0 count=1, and the displayed layout is blank (in the same way it would be blank for a search). My current guess is that for some reason the $$ID is not being searched for, and instead it is searching for ID="".
  14. Having a bit of trouble getting the find function in a script to run. I can't really post the script here because I'm using the Japanese-language version, and most of you wouldn't be able to read the text, but the only problem is with the find function. I have two tables in a single DB. Table A is list of people I need to pay, each person with a unique ID (text). Each record is marked with that ID, and a calculated field saying "Paid" or "Unpaid." This list is used to actually calculate the total amount payable to each person that month. Table B is a list of payables, each record for a single payable, and marked by amount and ID. The script is supposed to go through the list of payables, one at a time, and only see if that ID already has an open (Unpaid) record in Table A. If there is a record, the script loops and moves to the next record in Table B, repeat. If there is no record in Table A with that ID marked Unpaid, then the script creates a new record in Table A with that ID and marks it Unpaid. The script looks at the current ID in in Table B, and assigns it to a variable $$ID. Goto Table A and search for ID=$$ID AND Status=Unpaid. This is where the problem occurs. If there is a matching record, it is found correctly, and the program correctly ignores it, whether error capture is on or not. If error capture is OFF and there is no matching record, FMP returns an error message saying no records match the criteria (correct). If error capture is ON and there is no matching record, FMP says error code=0 and Record count = 1 (the screen at that point shows a layout with no ID displaying). Prior to the FIND, the DataViewer shows the correct settings for ID and $$ID. If I search for either criterion the script works, but I need to search for both. I've been trying to capture either the error code (401) or find count (should be zero), but they always return Error=0 and Count=1 whether the matching record exists or not. Obviously I'm overlooking something. I think that's enough information... Any suggestions on what I did wrong? Thanks for your time.
×
×
  • Create New...

Important Information

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