Custom Functions Discussions
General Discussions on developing custom functions with FileMaker Advanced
Subforums
-
- 23,100 visits to this link
-
A new community resource for custom functions.
- 19,405 visits to this link
490 topics in this forum
-
Hi Gang, I was hoping someone can assist me with a CF to convert a LIST into the code for an Ordered/Unordered HTML list while retaining the CSS text formatting and hard returns. I want to use the PIPE "|" character to identify where the indent will be placed. Here is an example: This is some test text |This is some test text |This is some test text ||This is some test text |||This is some test text ||This is some test text |This is some test text |This is some test text This is some test text This is some test text |This is some test text |This is some test text This is some test text This is some test text [color:re…
-
- 1 reply
- 1.8k views
-
-
Hi, I wonder if there is already a custom function out there that does the following: parameter: listField, that would be a field with a list of items, e.g. oranges apples bananas I would need the following result: NumberListItems(listField) = 0001 oranges 0002 apples 0003 bananas Any ideas? Thanks in advance!
-
- 2 replies
- 1.8k views
-
-
Hi Folks, I need some help with a Recursive CF. I need to compare each value in a MASTER list to the same value in another List (A). The result will be a percentage of exact matches of the master list. Example: List A = A¶B¶B¶A¶C¶C¶A¶A¶D¶D MASTER = A¶B¶B¶A¶C¶C¶A¶A¶D¶D Matches=10/10 Result= 100 List A = A¶B¶B¶A¶C¶C¶A¶A¶D¶D MASTER = A¶B¶C¶A¶C¶B¶A¶A¶D¶D Matches=8/10 Result= 80 List A = A¶B¶B¶A¶C¶C¶A¶A¶D¶D MASTER = B¶B¶C¶A¶C¶B¶A¶A¶A¶B Matches=5/10 Result= 50 etc... Both List will have the the same amount of values although the quantity of values (lines) will vary. Some values in List A will be null or blank…
-
- 4 replies
- 2k views
-
-
Hi, I have a Person table related to an Index table. In the Index table is a Locator_Number field and a Symbol field. The Index table will always have at least 1 related record and maybe as many a 12 or so. There will always be data in the Locator_Number field but not always in the Symbol field. I want to get a field populated in the Person table that will combine all Locator_Number data and Symbol data formatted like this: 10, 25+, 56, 90, 101*, 150 I have written a script which will do this, it Loops through the found Persons (3000 - 5000 records) and at each record it Loops through the related data and compiles the field. This works but I wanted explore the pos…
-
- 3 replies
- 1.8k views
-
-
Hi, This is a windows mini app that I made. It's a program that allows the user to open a file via the command line and add the username and the password. Might be usefull for someone who needs it. Requirement : - Windows - Framework 2.0 Use: fmStarter [theFile.fp7] [username] [password] Example: fmStart c:temptest.fp7 admin mypass I didn't test it very much, but it is working on my side. fmStarter.zip
-
- 0 replies
- 1.7k views
-
-
Read up on the Get( ApplicationVersion ) function.
-
- 2 replies
- 1.8k views
-
-
Name & Parameters: [color:red][big] FormulaCall ( function ; param ) [/big] Description: Universal recursive custom function Write your functions OUTSIDE of the custom function editor and just pass them to this function. Only two parameters can be passed; your function; and a parameter list Use $variable or $$variables within your function expression if necessary Sample Input: Let( [ $formula=""; $separator = " "; //tab $cellSeparator ="¶ "; rowStart = " "; rowEnd = " dataList = "2¶3¶4¶77¶37¶98" ; multiplyValues = "GetValue($param; 1) * Case( ValueCount($param) > 1; FormulaCall ($formula; RightValues($param; ValueCount($p…
-
- 2 replies
- 2.5k views
-
-
The recently posted Distribution function mostly solved the problem I described (in the wrong forum, I guess) here: http://www.fmforums.com/forum/showtopic.php?tid/197082/ The Distribution function is here: http://www.briandunning.com/cf/890 My one remaining question is how I can change the sort order of the output. Currently, the function outputs a list sorted alphanumerically by the order of uniqueList, I think. I would like the list sorted by the number of occurrences (of the members of uniqueList in dataList), most occurrences first. Is this hard to do? Any pointers would be much appreciated.
-
- 9 replies
- 2.3k views
-
-
This is my first post; please let me know if it's not in the right place. My question is probably standard, and no doubt has been answered before, but I'm not sure how to look for answers, because I don't what the key terms are to describe the issue. I have a database that is meant to map a debate, and this database contains a many-to-many relationship between People and Propositions (meaning assertions, arguments, claims). So I have a Persons table, with info on Al, Bob, Chris, etc.; a Propositions table with info on Prop1, Prop2, Prop3, etc., and a join table, with one record for each time a particular person asserts a particular proposition. I know how to cre…
-
- 1 reply
- 1.7k views
-
-
I would like help writing a CF that given the following inputs: StartDate Interval (in Days) List of Holidays (from user entered table) outputs a non-weekend, non-holiday date. That is add 1 to the result if it's a weekend or holiday until it's an acceptable date. I can find pieces of what I need on B. Dunning, but can't put it together. I can do this with a looping script, but something tells me this is a perfect job for a CF. Much thanks to any who offer help. PS:I'm reposting bcs I believe the original was lost in yesterday's server problems.
-
- 28 replies
- 7.7k views
-
-
Hello, Does someone have a CF that will substitute by list? For example, I have the following: SourceText="A01¶A02¶A03¶A04¶A05¶A06¶A07" FindList="A02¶A05¶A07" ReplaceText="Red¶Blue¶Yellow" It the CF was: SubstituteByList(SourceText, FindList,ReplaceList) the result would be: "A01¶Red¶A03¶A04¶Blue¶A06¶Yellow" Appreciate any help ;-)
-
- 9 replies
- 2.3k views
-
-
Hello, I am trying to produce a 14x30 GRID using style sheet code. I want to use 28 rep fields (30 cells each) to populate the Stylesheet Grid Array via custom function. 14 fields the give the color ID and 14 fields that determine the TEXT: Here is an example of ONE row: � � � � � � � � � � � � � � I have defined a CF below that produces the above but fear when I use the CF 30 times it will take too long to evaluate. Here it is: Let([ rep=1; code= " |avt1|¶ |apt1|¶ |avt2|¶ |apt2|¶ |avt3|¶ |apt3|¶ |avt4|¶ |apt4|¶ |avt5|¶ |apt5|¶ |avt6|¶ |apt6|¶ |avt7|¶ |apt7|¶…
-
- 0 replies
- 1.6k views
-
-
I have had a search around and can't seem to find a custom function for what I have in mind. I am trying to get a field to show the total number of working days in the current month (based on working monday to saturday with sundays off) and another field to show the remaining working days in current month. I currently have a couple of calculation fields that someone on this forum kindly put together but there is some errors in there and for some reason December shows the wrong numbers!) I also need the day to switch over at 4.30pm has anybody come across such a custom function?
-
- 3 replies
- 5.3k views
-
-
I've looked and I can't find so please forgive if this has already been solved I want to extract the url containing the word (or part of word) contact from a list of urls. Here is an example of the raw list: [23] http://192.168.0.200/FEEDBACK.HTM[24] http://192.168.0.200/ADVERTISE.HTM[25] http://192.168.0.200/CONTACTS.HTM[26] I would like to have his returned: http://192.168.0.200/CONTACTS.HTM Any ideas would be appreciated (I've bashed my head against this for hours) Cheers Pete
-
- 7 replies
- 2.5k views
-
-
I am hoping someone has a simple solution to this problem I have been working on for a while now. I am trying to create a Cost Code for our barcode labels that will show the item cost but not be so obvious to the customer. Ex: 08995205 08= year 9952= item cost of 25.99 05= month I can get the year and month right but the item cost to inverse aludes me. I'm trying to use the InverseText ( text )custom function in Brian Dunnings list of custom functions. Unfortunately when I add this custom function it has an error here InverseText ( text3 ) ) It needs an operation at the 1st parenthesis. Sample Input:InverseText ( "Goodmorning" ) Sample …
-
- 20 replies
- 4.4k views
-
-
I've got two databases, and one of them contains a whole bunch of custom functions I've written. I'd like to copy those custom functions into the other database. Is there a way to copy or import a bunch of functions from one database to another? Thanks
-
- 2 replies
- 3.1k views
-
-
Hello, Can you assist: I have a CF: _GetNthRecordSet - (fieldName, recordNumStart, recordNumEnd) = Let ([ startParam = recordNumStart ; start = Case ( startParam < 1 ; 1 ; startparam ) ; end = recordNumEnd ; thisVal = Case (IsValid ( GetNthRecord ( fieldName ; start ) ) ; GetNthRecord ( fieldName ; start ) ) ; nextStart = start + 1 ] ; thisVal & Case ( IsValid ( GetNthRecord ( fieldName ; nextStart ) ) and ( ( end = "" or end = 0 ) or nextStart <= end ) ; "¶" & _GetNthRecordSet ( fieldName ; nextStart ; end ) ; )) This works fine on non-repeating fields, BUT I want the result of this CF to calculate in EVERY CELL …
-
- 10 replies
- 2.3k views
-
-
Hi, I am a new user at this forum. I have used FileMaker for many years, but never really delved in to its possibilities. But when I started reading about custom functions I became very interested. I work with travelling exhibitions which involves a lot of logistic planning of packing and shipping. I usually make pretty basic FileMaker-databases for all the crates and objects in the exhibition, but this time I would like to make it a bit more sophisticated by using a barcode scanner. Here’s what I want to do: For each item in the exhibition I want to create a custom barcode consisting of 13 numbers. The first two numbers tell which part of the exhibition th…
-
- 8 replies
- 2.9k views
-
-
I have in a call system, a field named Subject in which users input data related to the phone call received. They set the important data with the first character of the word capitalized. I would need a Custom Function that will extract that data in list. Needless to say that such data will be used for self-join relationship for portal fast searching. Example. Input (courtesy of Macintouch) Charismac released Discribe 6, an update of its CD and DVD burning software. This release is a Universal Binary and includes Leopard compatibility and an improved interface. Output: Charismac Discribe CD DVD Universal This Binary Leopard Th…
-
- 9 replies
- 5.2k views
-
-
I need help with defining a recursive CF to use for building a relational KEY field. I have sorted time (and Type ID) list like the following (5 minute intervals) 08:00:00 10 08:05:00 10 08:10:00 10 08:15:00 10 09:00:00 12 09:05:00 12 09:10:00 12 09:15:00 12 I need a CF that will determine how many times proceed each time line without a break in the sequence (just the time not the TYPE field) and then builds a key based on those values. First determine proceeding times: 08:00:00 10 = 3 08:05:00 10 = 2 08:10:00 10 = 1 08:15:00 10 = 0 09:00:00 12 = 3 09:05:00 12 = 2 09:10:00 12 = 1 09:15:00 12 = 0 Then the key is gen…
-
- 10 replies
- 2.3k views
-
-
Name & Parameters: [color:red][big] LastDayOfMonth ( theDate, theDifference ) [/big] Description: Returns the date of the last day of a month, measured from the date (theDate) plus the number of months in the future (theDifference) from that date. All positive, whole numbers and zero are valid for “theDifference" Sample Input: LastDayOfMonth ( 12/2/2007 ; 2 ) Results: 2/29/2008 Recursive: no Formula: Let ( [ //The number of months ahead Dif = theDifference ; //The number of the month that's Dif months ahead + 1 endMonthPlusOne = Case ( Mod ( Month ( theDate ) + Dif ; 12 ) + 1 ≤ 12 ; Mod ( Month ( theDate ) + Dif ;…
-
- 4 replies
- 3k views
-
-
I have not used custom functions before, and I need to use one to name a global variable. I have found several, the easiest to understand for me is this one I found on Matt Petrowsky's web site called SetGlobalVariable. The problem I have,is I don't know how to implement it in a script. In other words, what script step do I use to get it to name the variable ? It is supposed to replace the SetVariable" step, but with what script step? I am baffled, and I feel like it is right in front of me but I have been staring at it too long. Any clues ? Here's Matt's text: Hi Guys, I recently had the need (or more likely the desire) to set global variables dynam…
-
- 14 replies
- 3.5k views
-
-
Can anyone point me in a direction that would educate me on custom functions. Especially recursive functions. I bought John Mark Osbornes training cd's and he spends a minimal amount of time on them but I guess my skull is a little thicker than most. The light bulb just hasn't turned on yet and I'm anxious to become a novice at this. Thanks, Mel
-
- 2 replies
- 2.2k views
-
-
Name & Parameters: [color:red][big] parse_string ( string ; pos ; delimiter ) [/big] Description: This function will return a section of a string determined by the parameters. string = The string to be read from pos = The section to read delimiter = The section definer For the delimiter, it is recommended to use one character long delimiters, for FM returns unconsistent values. This isn't saying it won't work, just don't count on it. Sample Input: parse_string ( "I like to have fun|This is useful|good for script arguments", 3, "|" ) Results: good for script arguments Recursive: no Formula: GetValue( Substitute ( string…
-
- 2 replies
- 6.8k views
-
-
Hi, I have a record that contains a field of "body" text - I need a custom function that will extract all the text items enclosed in square braces into a separate list eg: Body_text = "Cats and dogs and [s1t1] make [s1t2] pets though they need [s2y1] handling." The result would be a paragraph delimited list containing "s1t1"¶"s1t2"¶"s2y1" Does anybody know of such/a similar function or have any pointers on how to create such a cf Many thanks
-
- 11 replies
- 2.1k views
-
-
Name & Parameters: [color:red][big] remove_section ( string ; pos ; delimiter ) [/big] Description: Will remove a section from the given string. string = The string to be altered pos = The section to remove delimiter = The section definer For the delimiter, it is recommended to use one character long delimiters, for FM returns unconsistent values. This isn't saying it won't work, just don't count on it. Sample Input: remove_section ( "this-is-not-so-cool" , 3 , "-" ) Results: this-is-so-cool Recursive: no Formula: Let ([ $cfstr = string; $cfstr = Substitute ( $cfstr ; delimiter ; "¶" ); $cflen = Length (GetValue( $c…
-
- 0 replies
- 2.5k views
-
-
Name & Parameters: [color:red][big] change_section ( string ; pos ; to ; delimiter ) [/big] Description: For the given arguments this function will return a string with the given section changed to what argument "to" is set to. string = The string to be altered pos = The section you wish to be changed (1=the first section) to = What the section will be changed to delimiter = The section definer For the delimiter, it is recommended to use one character long delimiters, for FM returns unconsistent values. This isn't saying it won't work, just don't count on it. Sample Input: change_section ( "1.23.53.1.3.2" , 4 , "102" , "." ) Results: …
-
- 0 replies
- 2.2k views
-
-
Hello, I wish to make a field history i.e. a log entry each time I modify a field. To do that I added 2 excellent custom functions by NightWing Enterprises (SuperLog and ScriptLog) to my solution: http://www.nightwing.com.au/FileMaker/demos8/demo809.html It is exactly what I need and works quite well. The only problem is that to make a log entry after the field was modified, the user has to go MANUALLY to the next field. See example1.fp7 If the field is modified and then the user clicks on the "history" button without going first to the next field, no log entry is done. (Adding "going to next field" function or similar to the "Open Field History" s…
-
- 7 replies
- 2.6k views
-
-
Hi All There is proby an existign CF I could re-jig, but I want to create a function which returns the NUMBER of a WEEK from a startDate to myDate... ie, how many weeks between startDate and myDate Something like WeekOfTerm (startDate ; myDate) startDate is the date in the first week and could be any day M-F (or even Sat or Sun)(by default if myDate = startDate then WeekOfTerm = 1... but I also want it to work so that if myDate falls in the same Mon-Sun week as startDate it also returns 1. I want to fix it so that regardless of when the dates fall the function deals with whole weeks at a time. Eg. if startDate falls on a thursday then if myDa…
-
- 4 replies
- 2.3k views
-
-
Hello all, This is my first attempt at a recursive cf. I have managed to get the desired output for one line of input text. However I need it to work on multiple , return delimited lines of text. Can't get my head around how to make it recursive for n number of lines. pl see atatched file with cf. thanks. RecCF.zip
-
- 7 replies
- 1.9k views
-
-
Name & Parameters: [color:red][big] RectCoordinates ( pieceA ; pieceB ; materialA ; materialB ) [/big] Description: Returns the coordinates of rectangles (with dimensions pieceA x pieceB,) that can be cut from an area of materials (with dimensions materialA x materialB.) This is designed to be used by the xmChart plugin to generate a graphic representation of how to cut the most pieces from the material. Sample Input: RectCoordinates(12;12;15;25) Results: AddRect(0; 0; 25; 15; gray) AddRect( 0;0;12;12;white) AddFrame(0;0;12;12;1;black) AddRect( 12;0;12;12;white) AddFrame(12;0;12;12;1;black) Recursive: no Formula: …
-
- 1 reply
- 3.1k views
-
-
Name & Parameters: [color:red][big] AmountText ( amount ) [/big] Description: Not quite mine, just adapted from a formula posted on the FMP website. Returns the check-style text line given a dollar amount in a number field referenced by the "amount" parameter. As posted, only works with US Currency, but I'm sure it can be modified for anything. Sample Input: 123.45 Results: One Hundred Twenty Three Dollars and Forty Five cents Recursive: no Formula: Choose(Int(Mod(amount;10^12) / 10^11); ""; "One Hundred "; "Two Hundred "; "Three Hundred "; "Four Hundred "; "Five Hundred "; "Six Hundred "; "Seven Hundred "; "Eight Hundred "; "Nine H…
-
- 8 replies
- 6.7k views
-
-
Name & Parameters: [color:red][big] MagicDates ( range ) [/big] Description: This one gives you FM-Find Friendly date ranges based on User-Friendly input. Works great with the "range" specified as a script parameter. The ranges you can use are: Today Yesterday Tomorrow ThisWeek LastWeek NextWeek ThisMonth LastMonth NextMonth ThisYTD LastYTD NextYTD ThisYear LastYear NextYear ThisQuarter LastQuarter NextQuarter So, say you had a script that put you in Find mode. You could set up a series of buttons on a "Find" layout, each of which ran a script called "SetDate," with the date range options as script parameters. The scrip…
-
- 0 replies
- 2.6k views
-
-
Hello All! I have to create a file for export in Fixed Width format. I came up with this custom function, and want to see if anyone here has any ideas to make it more streamlined/clean. I want to post it to Brian Dunnings site as soon as it is nice and clean. The user supplies the "Text" to be put in to FW Format, the "Size" of the FW field, and the "Blanks" or empty space. The Function is: FixedWidth ( Text ; Size ; Blanks ) The CF is: /* TEXT is the text that is to be put into a fixed width format SIZE is how big the fixed width format field is BLANKS is what character to fill the fixed width field with after the TEXT */ Let( [//X1 is supp…
-
- 8 replies
- 1.9k views
-
-
Name & Parameters: [color:red][big] isNumeric ( value ) [/big] Description: This function checks if a value is numerical. If it is the case it return true otherwise false. Sample Input: "-1234.423" Results: True Recursive: no Formula: Let ( [ trimmedValue = Trim (value); filteredValue = Filter ( trimmedValue ; "0123456789.-" ); lengthOk = If (Length (trimmedValue) = Length (filteredValue); True; False); dotOccurence = PatternCount (filteredValue; "."); dotOk = If (dotOccurence = 0 or dotOccurence = 1; True; False); minusIndex = Position (filteredValue; "-"; 1; 1); minusOk = If (minusIndex =…
-
- 3 replies
- 5.3k views
-
-
Name & Parameters: [color:red][big] CommonValues ( ListA ; ListB ; Match ) [/big] Description: CommonValues will take 2 value lists and return a list of values that they have in common. Sample Input: VetList = "birds¶cats¶dogs¶pigs" ClientList = "cats¶horses¶pigs" Results: CommonValues(VetList;ClientList;"") = "cats¶pigs" *** the empty quotes are necessary and should always be empty *** *** you should use strict validation and value lists for reliable results *** Recursive: Yes Formula: /* If ListA has at least 1 member and ListB has at least 1 member */ If( ValueCount(ListA) ≥ 1 and ValueCount(ListB) ≥ 1; /* Then - Loop…
-
- 10 replies
- 5.2k views
-
-
Hi All, Is is possible to have endless parameters in a custom function (like there are in the Case function, for example)? Thoughts? Thanks!
-
- 5 replies
- 1.5k views
-
-
I'd like to be able to calculate the number of business days in a given year. Business days being Monday through Friday. Any help would be appreciated.
-
- 12 replies
- 5.2k views
-
-
Name & Parameters: [color:red][big] Numerology ( _Date ) [/big] Description: Calculate numerology number for Birthday or date. Also for people which haven't fpm advanced can find calculation field. Happy FileMakering Sample Input: 26/2/1951 Results: 8 Recursive: no Formula: Mod ((Day ( _Date ) + Month ( _Date ) + Year ( _Date )) ; 9) Required Functions: Author(s) ino Date: 04/07/07 Credits: Disclaimer: FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deem…
-
- 0 replies
- 3.1k views
-
-
I'm designing a custom function and I'm most of the way there, but I'm stuck on one aspect. The CF is designed to concatenate all standard fields into an indexable calculated field, which can then be searched. Concatenate(TableName; Start) = //This function will create a value delimited list of all the stored values in all the fields of a table. Start should always be 0. TableName should be in quotes. Let([ File = Get(FileName); FieldList = FieldNames(File;TableName); NumberFields = ValueCount(FieldList); Counter = Start+1; FieldName = GetValue(FieldList;Counter); FullFieldName = TableName & "::" & FieldName; Storage = LeftWords(FieldTy…
-
- 9 replies
- 1.4k views
-
-
Name & Parameters: [color:red][big] Employ ( DateStart, DateEnd ) [/big] Description: This formula is accurate in almost all cases if someone want to express time in format: y years, m months, d days. I think that this is an invetion because accuracy was always a problem is such formulas in cases we want to express time not only as a number. Sample Input: Results: Recursive: no Formula: Let ([ Τ0=dateEnd-dateStart; T1=dateEnd-dateStart+1; T2=Day(dateEnd)-Day(dateStart); T3=Month(DateStart)=2 and Day(DateStart)=1; Τ4=Day(DateStart)=1 and Day(DateEnd)=31; T6=Month(DateStart)=1 and Month(DateEnd)=2; T7=Day(DateStart)=…
-
- 29 replies
- 8.8k views
-
-
Name & Parameters: [color:red][big] LineNumbering ( text ; start ; suffix ) [/big] Description: LineNumbering custom function Author: Daniele Raybaudi Format: LineNumbering ( text ; start ; suffix ) Parameters: text - the text that we want to view with numbered lines start - the number that we want to start from ( tipically 1 ) suffix - the string that we want to add to each line number ( minimum 2 chars ! ) Returns the given text with numbered lines You can: 1. add one ore more new lines 2. break one or more lines 3. modify one or more lines 4. delete one or more lines 5. the max number of lines is 999 Sample Inp…
-
- 0 replies
- 2.6k views
-
-
Name & Parameters: [color:red][big] GetStyledWords ( text ; style ) [/big] Description: GetStyledWords custom function revision 1: now finds plain text, too. Author: Daniele Raybaudi Format: GetStyledWords ( text ; style ) Parameters: text - the given text where there are some styled words style - the style to search for ; if it is empty the function will search for "plain" Returns all the styled words ( in list view ) within the given text Sample Input: I'm going to learn English GetStyledWords ( text ; "" ) Results: I'm to learn Sample Input: I'm going to learn English GetStyledWords ( text ; "bold"…
-
- 1 reply
- 2.6k views
-
-
Name & Parameters: [color:red][big] ListMatrix ( ListOne ; ListTwo ; separator ; counter1 ; counter2 ; result ) [/big] Description: While the FileMaker function "Combinations" predits the amount of combinations from two lists, ListMatrix actually outputs all unique combinations. You can also add a ListOne offset, specify a separator for the values from ListOne and ListTwo, and add a header to the result. Sample Input: ListMatrix( "a¶b¶a", "1¶2¶3¶4¶2"; " and "; ""; ""; "Combinations of Alpha and Nums:¶" ) Results: Combinations of Alpha and Nums: a and 1 a and 2 a and 3 a and 4 b and 1 b and 2 b and 3 b and 4 Recursive: yes …
-
- 3 replies
- 3.1k views
-
-
I am trying to implement this Formula into my solution and am getting an invalid result. It is a Haversine Function and below is what I created as a custom Function with: Can any one figure out what I am doing wrong here? //Computes the Distance between two points on Earth's Surface // input: // lat1,long1,lat2,long2 = lat and long of two points, in DECIMAL DEGREES // units = "miles" or "km" // output: Distance between the two points in miles or kilometers Let ([ D = Case( Trim(Lower(Left(units;1))) = "m"; 3958.75; 6367.45 ); // Diameter of Earth in miles or km lat1R = Radians(lat1); lat2R = Radians(lat2); …
-
- 8 replies
- 2.5k views
-
-
Name & Parameters: [color:red][big] Elapse ( StartDate ; EndDate ) [/big] Description: I posted this in www.briandunning.com a while back, but forgot to post it here. This is an adaptation to a FileMaker Tech Article ID 870. Sample Input: 2/28/2000 and 2/27/2004 Results: 3 Years 11 Months 29 Days Recursive: no Formula: //Calculating Elapsed Time Between Two Dates Broken Into Year, Month, And Day Let( Number_of_Days = EndDate - StartDate; Let( Month_Length =Case(Month(StartDate) = "1"; "31"; Month(StartDate) = "2" ; "28" ; Month(StartDate) = "3" ; "31" ; Month(StartDate) = "4" ; "30" ; Month(StartDate) = "5" ; "31" ; Mont…
-
- 1 reply
- 4.3k views
-
-
Name & Parameters: [color:red][big] QuickSort ( listvalues ) [/big] Description: This implements the nearly optimal QuickSort algorithm developed by C. Hoare and made well known by Donald Knuth in his tome The Art of Computer Programming. Originally written by Jeremy Bante, I updated it for version 8.5. It makes me crazy that people are still using the atrocious BubbleSort algorithm! Sample Input: Bravo Delta Alpha Charlie Results: Alpha Bravo Charlie Delta Recursive: yes Formula: /* QuickSort ( listvalues ) Sorts a list with the popular and reasonably efficient QuickSort algorithm It requires the ValuesLessTh…
-
- 1 reply
- 3.5k views
-
-
Name & Parameters: [color:red][big] ValuesGreaterThan ( listvalues ; reference ) [/big] Description: Returns all values in a list that are greater than the reference parameter. Originally written by Jeremy Bante, OshVay Systems, Inc., but was lost, so I rewrote it. Also changed parameter name to listvalues to avoid new reserved word list Used by QuickSort( list ), also originally written by Jeremy Sample Input: Results: Recursive: yes Formula: /* ValuesGreaterThan ( listvalues; reference ) Returns all values in list that are greater than the reference parameter Theo Gantos - TEKA, Inc. - www.tekainc.com Originally writte…
-
- 1 reply
- 2.7k views
-
-
I have a BASIC program to calculate sunrise and sunset times which I am trying to rewrite for FMA 8.5. So far, I have been able to create fields and global variables for the BASIC subroutines, but the main program calls a loop to evaluate the validity of data for each hour in the day, As far as I can see, the only way to generate a loop is through scripting, and I think the complexity involved will make it quite difficult. Is there a way to create a loop by calculation or custom functions? Here is the BASIC txt file and the code I have written so far. I'm not altogether certain what some of the individual calcs are doing, so I have done quite a bit of literal tr…
-
- 8 replies
- 2.3k views
-
-
I'm trying to create a recursive custom function that will compute a special type of checksum digit. I have a wrapper function that does some initial setup, and some sub-functions that are basically lookup tables, which are used in computing the checksum. All that stuff works fine. I've go a working script that uses a loop to generate the checksum, and that is also working correctly. But I'm trying to move from a script to a recursive custom function, and I suck at thinking recursively. Anyone willing to give me a hand?
-
- 14 replies
- 2.8k views
-
-
I just stepped up from v6 to v8 Advanced. I found this phone formatting function on Filemaker Advisor. It handles a number with and without an area code, so everything should be properly formatted. However, it seems to be missing a sub function ('PhoneFormatRight'), which I don't know what to do with so I can't get it to run. Here it is: Case( not IsEmpty(Format) or not IsEmpty(Phone); // coding after the "or" added by editor to prevent formatting of a blank Phone Let( [ NumbersOnly = Filter (Phone; "0123456789"); newFormat = Left(Format; Length(Format) - 1); // return all but the rightmost character newNumber = Left(NumbersOnly; Length(NumbersOn…
-
-
- 14 replies
- 4.7k views
-
-
Have a 3 tables Guardian, Child, and a join table. In the join file there is a "relationship" filed. The child and the parent also have a "gender" field. I am trying to come up with a custom function that will calculate the inverse family relationship depending on my context view or what was entered in to the relation field Example... From the Guardian record looking at a list of joined child the relation in the portal should be to that of the guardian and the user would type or select from the list (depending on gender) Guardian: Mike Brady Child: Greg Brady Relation: Son Child: Peter Brady Relation: Son Child: Bobby Bra…
-
- 11 replies
- 3.6k views
-
-
I am in a bit of a quandry. I have created a database to keep track of complex contact management information. This is loaded on a Filemaker server at a main office. The real trick is this I have 5 users traveling with laptops in the field that need to have that info locally (they won't always have the ability to be on the net). If one of the mobile users makes a change on the road they need to be able to sync those changes when they open the database and are connected to the net (my thought is when they open the program it will try and do a sync). Is there a plugin out there for this or a simple way to do this? Anyone, anyone...Bueller, Bueller?
-
- 5 replies
- 2k views
-
-
Hi Guys, Just having some problems. I'm trying to evaluate an expression that is based on The CF Paramaters: FieldListSeperatedByPipe ; CustomExpression ; n ; total FieldListSeperatedByPipe is just that The CustomExpression is meant to be a case statement that references currentField, but that's the bit i can't get to work. Let([ n = If(IsEmpty(n) ; 1 ; n ) ; list = Substitute(FieldListSeperatedByPipe ; "|" ; ¶ ) ; y = ValueCount( list ) ; currentField = GetField(GetValue( list ; n )) ; z = Sum(Evaluate(CustomExpression); total ) ]; If( n < y ; SumConditionalFieldsCustomExpression( FieldListSeperatedByPipe ; CustomExpression …
-
- 2 replies
- 1.5k views
-
-
This custom function snips text between two delimiters (user specified) SNIP.zip
-
- 0 replies
- 1.1k views
-
-
I have a field that displays information calculated from a variety of other fields called "Listing Full". I would like the text within that field to change colors based on radio buttons from a field called "Verify". I was able to creat a field ("Listing Verified Color") that gets the information entered into it to change colors based on the chosen radio button. This is a text field with an auto entered calculated value of - TextColor ( Listing Verified Color ; Case ( Verify = "Unverified" ; RGB ( 150 ; 150 ; 150 ); Verify = "Verified" ; RGB ( 0 ; 255 ; 0 ); Verify = "Unlisted" ; RGB ( 255 ; 0 ; 0 ) )) -it works perfectly. I was also able to …
-
- 1 reply
- 1.3k views
-
-
Dear All I understand from my reading of the documentation that you need to own a copy of Filemaker Advanced to *create* a Custom Function, and I only have plain old ordinary Filemaker 8.5. But I have found in BrianDunning.com a Custom Function I would like to use. Can I use it without owning FMAdvanced, and if so how??? The page it is on (http://www.briandunning.com/cf/59) shows the formula with a button marked "Select All" and the instruction to "copy & paste into FileMaker Advanced", which obviously I cannot do! Can CFunctions be downloaded as a type of pre-compiled plugin? And if so, how do I add it to my database? Excuse my ignorance. :
-
- 9 replies
- 1.9k views
-
-
Paul Turnbull, Canada, posted Oct 13 2005 a CF to check the syntax of an email address ( Brian Dunning Custom Functions) The custom function has some quirks that have to be ironed out. See example file. Who can help to perfect the CF? EMail_Is_Valid.zip
-
- 7 replies
- 2.4k views
-
-
This must exist, but I haven't been successful at finding it.. Has anyone seen a custom function that will parse the "From" field in an email ? "Full Name" to--> first name: last name: email address: The tricky part is that Full Name can be last, first first last first initial last first mi. last etc. I'm writing something that takes a good guess at this, and realize nothing will be perfect because of the crap in crap out rule.. (if a person has "yoda" in for their full name, my function will fail.. but I want to take the best possible stab? Am I reinventing the wheel and if so, can someone point me to it ? thanks :)
-
- 2 replies
- 1.1k views
-
-
I am trying to creat a CF to do the following given: Input: startDate = starting date for range endDate = ending date for range dateList = list of dates we would like to test count = initial value of 0 Output: count of the number of times a date from dateList falls within the range [startDate, endDate] parse each element of the list: dateList (a list of dates) to check if startDate <= currentDate <= endDate, if it is increment counter by 1 dateList is a return separated list of dates (MM/DD/YYYY). I'm familar with recursion, but can't seeem to get my head around this. I also wonder if someone els…
-
- 4 replies
- 1.5k views
-
-
I am using 24uDialog to do some processing. I use 2 lists of data, and compare them. I want to create a custom function that will sort a block of data line by line. I figure I have to use a recursive CF for this, and I've been unable thus far to wrap my head around recursive CFs. So, if I send this data to the CF: 523456 Account Name Yada 1239384 Account Name More 7346234 Account Name Yeah I want it to return: 1239384 Account Name More 523456 Account Name Yada 7346234 Account Name Yeah Help or suggestions? Thanks! Brian Hightower
-
- 5 replies
- 1.7k views
-
-
You guys always seem to come through when my brain starts to freeze up like my computer so here goes. I am working on a simple (?) work schedule for up to 20 employees. I have a file with 13 layouts, 1 admin and 12 months to show the calendar months. I've created 366 fields showing the day of the month, ( M, T, W, T, F, S, S ) which autopopulate after the first day of the year is chosen. I have a script to add Feb.29th for leap years and recalculate the days. So far so good. Next I want to create a display of work shifts for my 20 employees. What I had in mind is a repeating field named "Jan1" with 20 reps. This way I set this field below the "Day1of36…
-
- 5 replies
- 1.5k views
-
-
Name & Parameters: [color:red][big] DrawRect ( positionX ; positionY ; sizeX ; sizeY ; downOrAcross ; quantity ) [/big] Description: Returns strings for drawing the specified quantity of rectangles of sizeX, sizeY starting from positionX, positionY, either "Down" or "Across". This produces strings that can be used by the xmChart plugin. This is a sub function of RectCoordinatesSub(), located here: http://www.fmforums.com/forum/showtopic.php?tid/179078/ Sample Input: DrawRect(0;0;12;12;"Across";2) Results: AddRect( 0;0;12;12;white)¶ AddFrame(0;0;12;12;1;black)¶ AddRect( 12;0;12;12;white)¶ AddFrame(12;0;12;12;1;black)¶ Recursiv…
-
- 0 replies
- 4k views
-
-
Name & Parameters: [color:red][big] RectCount ( pieceA ; pieceB ; materialA ; materialB ) [/big] Description: Returns the number of rectangles (with dimensions PieceA x PieceB,) that can be cut from an area of materials (with dimensions MaterialA x MaterialB. Sample Input: RectCount(20;30;40;80) Results: 5 Recursive: yes Formula: //RectCount ( pieceA ; pieceB ; materialA; materialB ) /* Returns the number of rectangles (with dimensions PieceA x PieceB,) that can be cut from an area of materials (with dimensions MaterialA x MaterialB.) Sub function of: RectCoordinatesSub(). CFs Required: None 10-13-2005 Rev: 7-29-06 By …
-
- 0 replies
- 2.1k views
-
-
Name & Parameters: [color:red][big] RectCoordinatesSub ( pieceA ; pieceB ; materialA ; materialB ; positionX ; positionY ) [/big] Description: Returns the coordinates of rectangles (with dimensions pieceA x pieceB,) that can be cut from an area of materials (with dimensions materialA x materialB), starting from positionX, positionY. This is designed to be used by the xmChart plugin to generate a graphic representation of how to cut the most pieces from the material. This is a sub function of RectCoordinates(), located here (along with a demo) http://www.fmforums.com/forum/showtopic.php?tid/179077/post/216239/#216239/ Sample Input: RectCoordin…
-
- 0 replies
- 2.7k views
-
-
Name & Parameters: [color:red][big] ExpirationDate ( StartDate ; Terms ) [/big] Description: Calculates the expiration date when given the a starting date and the total of months. Sample Input: TermExpirationDate ( "1/1/2005"; "16") Results: 5/1/2006 Recursive: no Formula: Date ( Case ( Mod ( (Month( StartDate ) - 12) + Terms ;12 ) = 0; 12; Mod ( (Month( StartDate ) - 12) + Terms ;12 )) ; Day ( StartDate ); Case ( Case ( Mod ( (Month( StartDate ) - 12) + Terms ;12 ) = 0; 12; Mod ( (Month( StartDate ) - 12) + Terms ;12 )) = 12; Int(Year ( StartDate ) + (Terms + GetAsNumber ( Month ( StartDate ) )) / 12) - 1; Int(Year ( StartDate )…
-
- 2 replies
- 2.6k views
-
-
Hi all, I've been trying to write this Custom Function for days now and I just can't seem to get it. What I would like to do is show a return-separated list of a payment schedule. In other words, if I have 4 payments to make in a 1 year period and my first payment is on 6/22/2006, I'd like my list to show: 6/22/06 10/22/06 2/22/07 6/22/07 The 3 parameters I'm using are: StartDate, Interval (# of days between payments) , NumberOfPayments. This is what I've come up with thus far but it doesn't work. FileMaker won't accept it because it doesn't know the definition of "cfPledgeSchedule" in the Case () function. --------- //cfPledgeSched…
-
- 25 replies
- 3.5k views
-
-
Name & Parameters: [color:red][big] Extract ( source ; start ; end ) [/big] Description: Extracts data from HTML text when using the Filemaker web viewer Sample Input: First, here is a sample HTML string from where you want to extract the state for an address from whitepages.com: TML_STATE_ESC_=NY& The function would be: Extract("TML_STATE_ESC_=NY&","TML_STATE_ESC_=","&") Results: NY Recursive: no Formula: Middle (source ; Position ( source ; start ; 1 ; 1 ) + Length ( start ) ; Position ( source ; end ;Position (source; start ; 1 ; 1 ) ; 1 )-(Position ( source ; start ; 1 ; 1 ) + Length ( start ))) …
-
- 0 replies
- 1.8k views
-
-
there is a new built in function in FileMaker Pro 8.5 called "List ( field {; field...} ) If you have created a custom function or are using a custom fuction that uses the word "list" as a parameter you may be experience undesireable resutls. If you are trying to paste in a CF forumula into your solution you will be prevented from using that term in your function, forcing you to rename all instances from your CF unless you are actually using the built in List function with the correct parameters.. As described in the FileMaker 8.5 Help. Format List(field{;field...}) Parameter field - any related field, repeating field, or set of non-repeating…
-
- 0 replies
- 928 views
-
-
Hello all, I am a newbie so consider yourselves warned! Here's the deal. I created a phone log that pulls automatically the phone numbers of the callers from Contacts upon entering first and last name. I also created a delete button at the end of each new record so once the call is completed it can be removed from said list. Problem: I no longer want the deleted call to disappear into nothingness. I want to delete the call from the active call list and have it get dumped into a "graveyard" (some call it "heaven")so we will always have a record of calls completed from our office, of which I can print, access, even edit (i.e., accidently send a call t…
-
- 3 replies
- 1.2k views
-
-
I'd like to have a generic glossary/dictionary/hash function that takes a keyword and returns the corresponding value. I'm storing these in a simple table that has two fields: Keyword, Value. I've got it working just fine with Custom Functions and GetNthRecord() recursive function. However, it seems that this will only work when the context is in a table that is related to the keyword/value table. I'd like to be able to use this anywhere in my solution, on any layout, without worrying about adding new TOs. In other words, I'd like to have a relationship that functions as a global cartesian join between every table and this one particular data table. …
-
- 5 replies
- 1.9k views
-
-
Name & Parameters: [color:red][big] GetFirstName ( FullName ) [/big] Description: Return a person's first name. Skips over titles, will also return a hyphenated first name, or a second name where the person uses his first name initial. Sample Input: 1) Mrs. Ann-Marie Smith 2) Dr. J. Harry Morton 3) John Doe Results: 1) Ann-Marie 2) Harry 3) John Recursive: no Formula: /* CF: Returns A Contact's First Name from a Full Name CF: GetFirstName FullName */ Let ( [ name= Substitute ( FullName; "-" ; "00" ); // Needed because FM treats lots of characters as separators fw= LeftWords ( name…
-
- 5 replies
- 3.3k views
-
-
Name & Parameters: [color:red][big] GetLastName ( FullName ) [/big] Description: Returns a person's Last Name. Ignores suffixes such as 'Jr', 'Sr', 'III'. Also returns a hyphenated Last Name Sample Input: 1) Prof. Henry James 2) John Smith-Peters 3) Henry Higgins PhD Results: 1) James 2) Smith-Peters 3) Higgins Recursive: no Formula: /* CF: Returns A Contact's Last Name from a Full Name CF: GetLastName FullName */ Let ( [ name= Substitute ( FullName; "-" ; "00" ); // Needed because FM treats lots of characters as separators nword= WordCount( name ); rw= RightWords ( name …
-
- 0 replies
- 1.7k views
-
-
Has anyone written or seen custom CFs to extract the first and last names from a field? Simple algorithms don't do the trick...they're easy to write but won't work in cases such as 'Ann-Marie Smith' or 'John Mark Osborne' or hyphenated last names such as 'Robert Smith-Jones', and the cases of names with middle initials and names with a suffix such as 'Jr.' Steve
-
- 6 replies
- 2.5k views
-
-
How do you make a Custom Function Recursive?
-
- 1 reply
- 1.4k views
-
-
Name & Parameters: [color:red][big] Default mail address ( ) [/big] Description: Sample Input: Results: Recursive: no Formula: I'm working on the following calculation. Case( Mail To = "Home"; Mailing Full Name & "¶" & Home Street & ¶ & Home City & "," & " "& Home State & " " & Home Zip Code; Mail To = "Work"; Mailing Full Name & Case(IsEmpty ( Title );""; ", " & Title) & Case(IsEmpty (Company) ; "";¶ & Company & ¶ & Work Street & ¶ & Work City & "," & " " & Work State & " " & Work Zip Code; Mail To ="Spous…
-
- 5 replies
- 2.4k views
-
-
I'm using this calc for my Phone Number custom function. I got this either off this site or CC support forum. Everytime I enter a number I get an error message. I then re-input the same number and it works fine. Case (IsEmpty ( Phone Number );" "; Length(Phone Number) = 7;Left(Phone Number;3) & "-" & Right(Phone Number;4); (Length(Phone Number) = 10); "(" & Left(Phone Number;3) & ") " & Middle(Phone Number; 4; 3) & "-" & Right(Phone Number;4); "Wrong number format") Can anyone tell me what's wrong? Thanks, Al
-
- 7 replies
- 1.4k views
-
-
I need to split old comments (from another program) and turn them into records in our current comments. I am not even sure I need a custom function but I guess if I'm wrong, I can move it. But I figure I might need CF because I have to mark the blocks to combine. A comment is preceeded by a text date of various forms. I can easily find valid dates and the new word-break rules really come in handy here but I'm still stuck. I get strange breaks in the string and I can't understand where my logic is wrong. A date should NOT be colored if it is followed by a period or carriage return (because it means it's part of the sentence itself). This works. In addition to t…
-
- 3 replies
- 1.3k views
-
-
Name & Parameters: [color:red][big] MergeFieldsB ( text ; openBrac ; closeBrac ) [/big] Description: Much Better solution! Fills in Merge Fields embedded in a text string (<>). It works just like the Merge Fields you use in text in Layout Mode. You can also substitute other kinds of bracketing characters for the double greater than and lesser than signs, "<<" and ">>". For instance, you could use square brackets like this: "[Field]". This is a much more elegant solution than the other onethat I posted yesterday (MergeFields1 and MergeFields2). It just goes to show that if you spend too much time fiddling around instead of being produ…
-
- 1 reply
- 1.8k views
-
-
Name & Parameters: [color:red][big] MergeFields2 ( text ; openBrac ; closeBrac ; counter ) [/big] Description: Works with MergeField1 to replace "Merge Fields" in a text with data from fields. (See full description in MergeFields1) Sample Input: Results: Recursive: yes Formula: Case ( counter < PatternCount ( text ; openBrac ); GetField ( Middle ( text ; Position (text ; openBrac ; 1 ; counter ) + Length ( openBrac ); Position ( text ; closeBrac ; 1 ; counter ) - Position (text ; openBrac ; 1 ; counter ) - Length ( openBrac ))) & Middle ( text ; Position ( text ; closeBrac ; 1 ; counter ) + Length ( closeB…
-
- 0 replies
- 1.5k views
-
-
Name & Parameters: [color:red][big] MergeFields1 ( text ; openBrac ; openBrac ) [/big] Description: This Custom Function works together with MergeFields2 to enable you to take Merge Fields from a text field and fill in with data from fields. (i.e. "Dear <>, etc."). Once they are installed, use MergeFields1 in your calculations and ignore MergeFields2. Note: "openBrac" and "closeBrac" allow you to use whatever kind of bracketing characters you wish to delineate the merge fields. I have used "<>" but you might want to use square brackets or some other character. Note2: I made a mistake when I first put this up. The parameter, "table", was a l…
-
- 0 replies
- 1.5k views
-
-
Just started to create my first own custom function. Functionname: Hexcode Parameter: farg The problem is that the function returns the 6 letter code but without the "#" "#" & Case( farg="aqua";"00FFFF"; farg="beige";"F5F5DC"; farg="blå";"0000FF"; farg="blåviolett";"8A2BE2"; farg="brun";"A52A2A"; farg="chocklad";"D2691E"; farg="cyan";"00FFFF"; farg="svart";"F5F5DC"; farg="korall";"FF7F50"; farg="Mörkblå";"00008B"; farg="Mörkcyan";"008B8B" ) Something I missed?
-
- 3 replies
- 1.2k views
-
-
I am trying to set up an AuditLog system. In the interest of experimentation I have tried to implement this in a db that has the data file and the interface file separated. The idea is that log will contain modifications from all tables in the data file so you need to capture the name of the table as well as the name of the field that has been modified. The Custom Function is in the data file. It is triggered when one of the defined fields in the data table is modified. The code in the function is: Let([ $$RecID= Get (RecordID); $$Fnm = Get(ActiveFieldName); $$TableName = Get(ActiveFieldTableName); $$Fval = GetField($$Fnm); $$Nval = If(Length($$Fval); $$Fva…
-
- 2 replies
- 1.5k views
-
-
Name & Parameters: [color:red][big] LastRepNumber ( repeatingField ; maxRepeat ) [/big] Description: Returns the number of the last not empty repetition, much like Last(repeatingField) returns its contents. Can be used with both 7 and 8 version of FileMaker, but is most useful with 8, where fields can be reached specifying the repetition number by a calculation. For example, to set the next empty repetition to "whatYouWant" you can use: Set Field [repeatingField [LastRepNumber ( repeatingField ; 10 ) +1];"whatYouWant"] (where repeatingField has 10 rep). This function comes in hand also if you want to clear all repetitions. A simple loop: Lo…
-
- 0 replies
- 1.4k views
-
-
Name & Parameters: [color:red][big] RPN ( expression ) [/big] Description: This CF will allow you to evaluate an expression with Rerverse Polish Notation. where entry detrmines order of operation, using a stack to push and pull from. RPN input would be written 10 25 2 * + 40 + Infix input would be written : ((25 * 2) + 10) + 40 For more info: http://en.wikipedia.org/wiki/Reverse_Polish_notation Sample Input: 10 25 2 * + 40 + Results: 100 Recursive: yes Formula: // RPN( expression ) or Reverse Polish Notation // by Stephen Dolenski Let ([ exp = Substitute( expression ; " " ; ¶) ; // pivot expression into a re…
-
- 0 replies
- 1.8k views
-
-
Hi all, I've been trying to figure out how to write this one for some time now and I'm stumped. Here's the scenario: In a table I have a field called DaysClosed. It's a checkbox field showing all 7 weekdays. I have another field called Range. It holds a numerical value representing the number of weeks that the field DaysClosed is valid for. What I want a calculation to do is return a carriage return separated value of the dates that occur on DaysClosed for the number of weeks in Range. An example would be: Today is Thursday, 3/16/06. If the value in DaysClosed is: Saturday Sunday and the Range is 3, then the calculation would return: …
-
- 6 replies
- 1.4k views
-
-
Hi Guys I'm working on a Mail Merge system to allow users to create template letters and use these templates to create letters to contacts. I've written a custom function to make the substituition of real data with the merge fields but I'm using it in a looping script and I'm sure it could be recursive. Any help much appreciated. MergeTest.zip
-
- 5 replies
- 2.5k views
-
-
Hello all, I would like to know if anyone can help .. I have a wrestling app. in fmp8 that assigns a unique # based on the number of wrestlers within a wht-class... (5 wrestlers in wht-class 125lb) so wrt#1 wrt#2...... wr#5. Now heres the tricky part... i want to use a custum function to show a list of every wrt# and match it up with every wrt#, without any repeats or matching itself.. 1-2 3-4 5-Bye 2-3 4-5 1-Bye 3-5 1-4 2-Bye 1-5 2-4 3-Bye 2-5 1-3 4-Bye I know there are some functions CombineValues( list1, list2, divider ) that combins all values in two lists but they have repeats and match ... ( 1-1¶5-5) (2-4¶ …
-
- 4 replies
- 1.4k views
-
-
Is it possible to create a custom function in 1 file and have it be available across all files? I've created a FormatAsDate function in 1 file and would like to be able to access it in any file I open so that I don't have to create a new custom function in each file that requires it. Thanks.
-
- 3 replies
- 1.3k views
-
-
This isn't brain surgery I know, but it's pretty useful. So far, this technique has held up for the last 4 years. You need to standard 4 address fields: Address, City, State and Zip. "http://www.mapquest.com/maps/map.adp?searchtype=address&country=US&addtohistory=&searchtab=home&formtype=address&popflag=0&latitude=&longitude=&name=&phone=&level=&cat=&address=" & Substitute ( street; " "; "+") & "&city=" & Substitute ( city; " "; "+") & "&state=" & Substitute ( state; " "; "+") & "&zipcode=" & Substitute ( zip; " "; "+") I have another on…
-
- 0 replies
- 1.4k views
-
-
Hey, Is there anyway to do searches or anything that looks like searches in a custom function? What i want to do is to have a custom function that calculates availability for an article between and startdate and an enddate. Available(ArticleNumber, StartDate, EndDate) Right now i do this in a script and therefore have to "push a button" everytime i want to run that script. It's done by going thru the ArticlesOut table where an article is saved with ArticleNumber, StartDate, EndDate and NumberOut. This probably doesn't make any sense but hopfully someone can answer.
-
- 2 replies
- 1.2k views
-
-
I have and order DB with a portal of event tickets assigned to that order. Once the tickets have been assigned I would like to summarize the assigned ticket numbers. e.g. 234-255, 301, 305, 350-358 Could this be solved with a GetNthRecord custom calc or would you use a looping script.
-
- 4 replies
- 1.3k views
-
-
Hi To All, I am trying to parse some files into another format. It would really help if I could use a replace function that would search for a start occurence and an end occurence that could be defined and then replace anything in between with defined text. I found the following function SubstituteRange ( text; beginString; endString; replaceString ) at the following url http://www.briandunning.com/cf/122 (ps thanks to brian for all his cool functions) But cannot get it to work! Any help would be much appreciated Thanks, Lance
-
- 6 replies
- 1.5k views
-
-
Can someone with more experience of custom functions help on this please? A field within a table is basically an html page containing the usual html code. A sample layout is below: %C+%the dog jumped over the moon%C-% Other page content and html code here %C+%then another dog tried as well%C-% The "%C+%" and "%C-%" tags denote the beginning and end of capitalisation (or use of FM's Proper function) and trying unsucessfully so far to create a function which act on all "starting tags" and find the "ending tag" and Capitalise all content between, then remove the start and end tag. Any clues or suggestions would be much appreciated Thank…
-
- 5 replies
- 1.3k views
-
-
Here's a Custom Function that formats phone numbers. It removes a leading '1' and handles 10 and 7 digits. If the format is incorrect (not 7 or 10), it changes the text color to red as an indicator for the user. It requires 1 function parameter called 'Phone': Let ( [ num = Filter ( Phone ;"0123456789" ); num = Case(Left(num;1)= "1"; Middle(num;2;20); num); len = Length(num) ]; Case( len = 10; TextColor(Left( num; 3) & " " & Middle( num; 4; 3) & "-" & Middle( num ;7;4); RGB(0;0;0)); // with area code len = 7; TextColor( Left( num; 3) & "-" & Middle( num;4;4); RGB(0;0;0)); // without area c…
-
- 5 replies
- 1.5k views
-
-
Here is a first attempt at a CF to round a value to a given precision using bankers' rounding. //BRound( value; precision ) //By Simon Joyner //26/01/2006 //Returns rounded to using Bankers' Rounding. Accepts negative precisions and negative values. Let([ polarity = Sign(value); decimalPos = Position( Abs(value); "."; 1; 1 ); fullNum = Filter ( value ; "1234567890" ); leftNum = Left( fullNum; (decimalPos - 1) + precision); rounder = Middle( fullNum; (decimalPos + precision); 1); lastNum = Right(leftNum; 1); leftRounded = Case( rounder > 5 or (rounder = 5 and Mod(lastNum; 2) ≠ 0); …
-
- 12 replies
- 1.8k views
-
-
with two fields, Quantity and Repeat. Can I have a recursive calc. in the Repeating field that will sequentially fill each repeat based on the Quantity value. so if Quantity = 6, this first six repetitions of the Repeat field would fill in accordingly: 1 2 3 4 5 6
-
- 3 replies
- 1.3k views
-
-
I need some help with a Custom Function that removes everything between "<" and ">" in a text field. It can, and will occur Numermous times So it needs to be some kind of a replace function. I'm having a huge brain freeze today, can anyone help me out? Example of Text Field: 1123 3242 I'm replacing the "" and "" with what I want, but the rest of the stuff can be ANYTHING, even special characters. Can have up to 150 Lines in it of the same thing. The stuff after "" (other than the value 1123) and after the value are useless to me, I need to get rid of them. Also, the values can include anything they want in there. Some of them are text fiel…
-
- 4 replies
- 1.2k views
-
-
Anyone try this? I know the new relational model helps in this area, but I would love to have one portal accessing 4 fields and have a multi key created that has a prefix before exploding the field...ie prefix1_a prefix1_ap prefix1_app prefix2_M prefix2_Mi prefix2_Mik prefix2_Mike Left side would be a calc field with the prefix supplied from a popup and then the user entered criteria.....ideal solution would be clarivoyance type feature after the user has selected prefix and begins to type into the criteria field. I have found some explodedstrings CFs but none that include prefixes. Anyone? I am still a newbie to FMP8....sorry if this…
-
- 1 reply
- 1.1k views
-
-
Below is a CF that you kindly re-wrote for me. It has a small, but annoying bug. Here's the CF..it formats phone numbers: Let ( [ input = Filter ( phone ; "0123456789" ) ; formatChar = Case ( Length ( format ) ; Right ( format ; 1 ) ; "#" ) ; inputChar = Right ( input ; 1 ) ; nextFormat = Left ( format ; Length ( format ) - 1 ) ; nextFormatChar = Right ( nextFormat ; 1 ) ; nextInput = Left ( input ; Length ( input ) - ( formatChar = "#" ) ) ] ; Case ( Length ( nextInput ) or Length ( input ) and nextFormatChar ≠ "#" ; PhoneFormat ( nextInput ; nextFormat ) ) & Case ( formatChar = "#" ; inputChar ; formatChar )) It works fine if the pho…
-
- 7 replies
- 1.5k views
-
Recently Browsing 0
- No registered users viewing this page.
Who's Online (See full list)
- There are no registered users currently online