Jump to content

mcstar

Members
  • Posts

    21
  • Joined

  • Last visited

mcstar's Achievements

Apprentice

Apprentice (3/14)

  • Conversation Starter
  • First Post
  • Collaborator
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Hi Sam, That is just what I needed to know. Thanks for your product and your help -- Mark
  2. Hi All, What are the supported character encodings for the WriteToFile function? I had success with utf-8 and ascii, but get errors with DOS or MS-DOS. Are there other valid options? Thanks - Mark
  3. Hi Sam, I'm not sure how to include that piece of code. I tried this and it failed when I called WriteToFile: RegisterGroovy( "WriteToFile( filePath ; textToWrite )" ; "//This simple version uses utf-8¶ //new File( filePath ).write( textToWrite );¶ ¶ //This more advanced version allows you to specify the character encoding¶ OutputStreamWriter writer = new OutputStreamWriter( new FileOutputStream( filePath ), "utf-8" );¶ text.replace("n","rn");¶ writer.write( textToWrite );¶ writer.close();¶ return true;" ) Did you mean for me to alter the groovyscript? If so, where does it go? Thanks -- Mark
  4. Hi All, I am using the WriteToFile function in ScriptMaster v3.33 with FM 10 Adv on Windows. I want to create a plain ASCII text file with CR/LF as the end of line characters. First I put my text field into a local variable $text and replace all CR with CR/LF using: Substitute( $text; [Char( 11); ""]; [ Char( 13); Char( 13) & Char (10)] ) Then I use WriteToFile to create the file. I have tried several character encodings when I register the WriteToFile function (ASCII, utf-8) but they replace my CR/LF with LF. I tried to specify MS-DOS but that encoding is not supported. Does anyone know what character encoding I can use? Or a simple trick to preserve the CR/LF? Thanks -- Mark
  5. I discovered this trick by accident when I saw that a merge field was displaying a simple number field as a percent. Here is how to format the numeric merge field: Go to Layout mode. Do not select an object. Choose Number from the Format menu and define the desired format for the numeric merge field, such as currency or percent. Now select Merge from the Insert menu or use the Text tool to type in the merge field. Change to Browse mode and the merge field is formatted as desired! Remember to reset the Number format to the default you normally want, such as General or Leave Data Formatted As Entered. I confirmed that this merge field formatting trick works in both FM5.5 and FM7 on number, date and time fields. Have Fun! -- Mark Mark Conrad Application Developer
  6. Serp, you wrote < Window >"Show Window" ? (Is possible to minimize menus in the data files, but no in the interface file?)>> If your UI is complete (it provides all the functionality the user needs), then the user never needs to open a data file window. You can lock up each data file with an 'On Open' script that hides+locks the status area and goes to a simple layout with a warning message and a button whose script closes the window and takes the user back to the UI file window. Hope that helps -- Mark
  7. While you may not be able to lock the field conditionally, you can use a field validation calculation to prevent users from saving changes. Get ( CurrentDate ) >= grade_begin_dt and Get ( CurrentDate ) <= grade_end_dt Be sure to display a custom message to let the user know why s/he cannot save the change.
  8. FMrobot from New Millenneium (www.nmci.com) is a tool for taking multiple files and merging them as multiple tables in a single file. However you need the developer version of Filemaker (either 5 or 7) to get started.
  9. Hi All, In FM7, how about simplifying by using the Filter function: (not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
  10. Hi All, In FM7, how about simplifying by using the Filter function: (not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
  11. Hi All, In FM7, how about simplifying by using the Filter function: (not ( IsEmpty ( Filter ( valitest ; "0123456789")))) and ( IsEmpty ( Filter ( valitest ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ")))
  12. Get(AccountName) function tells you the account name the user entered. For external authentication it returns the account name the user entered, not the [group] name of the FileMaker account.
  13. I have a system that needs to compare the before and after values of a bunch of fields. There is a calc field, cFieldValues, that strings together the important fields and separates each value by a delimiter character and carriage return. When the user clicks the button to enter the edit mode screen, the button script puts cFieldValues into a global gStartValues. When the user saves the record, the button script has an IF statement that compares the current cFieldValues to the global with a simple "=" operator. If there are changes to any field values, other stuff needs to happen. This seemed like a sure thing until I began to see records with more than 255 characters in the cFieldValues calc result. For the 256th character and above, the "=" operator does not detect inequalities if characters are changed but the total number of characters stays the same. For example, if the string does not change for 255 characters but at the 256th character "one" gets changed to "two", then the comparison sees the before and after strings as the same. If "one" gets changed to "three", then the comparison sees the strings as different. I couldn't find any documentation regarding the limit to the size of strings that the "=" operator could work with. To fix the problem I am using the PatternCount function to compare the before and after values: If (PatternCount (cFieldValues, gStartValues) + PatternCount (gStartValues, cFieldValues) <> 2, "Different", "Same") The PatternCount function seems more robust. If anyone has any comments, I'd love to hear. Bye! -- Mark
  14. This is fun stuff! Let's suppose you have records which are identified as code red, code yellow and code green. You want to distinguish these in a portal or on a report. For each code, create a global container field and maybe an extra field for code other. Use a graphics program to create red, yellow and green circles, or whatever shape. Copy from there and paste the color into the corresponding global container. (It doesn't work to use FM's coloring from the status bar.) Now create a calculation field, result container, as follows: color_calc = case(code = "Red", red_color, code = "Yellow", yellow_color, code = "Green", green_color, default_color) In the portal, place a field portal_relation::color_calc behind or beside other fields. Now each row should display the correct code color! As for getting this in email, well I don't know. Have fun -- Mark
  15. Just to amplify on Dj's suggested use of a relationship... You have a field for critter_type. Create a global text field critter_types_for_report and put it on a Find By Type layout along with some instructions to "Choose the type(s) desired and then press Continue." You probably already have a report layout. Also create the relationship "Critter Report Relationship" from critter_types_for_report to critter_type. Now create a script like this: Go to Layout [Find By Type] Pause Go To Related [show,"Critter Report Relationship"] Go To Layout [Report on Critters] Page Setup Print etc. Go to Layout [original layout] +++++++++++++++++++ Hope that helps a little more! -- Mark
×
×
  • Create New...

Important Information

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