Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.filemaker > #2673
| From | Helpful Harry <HelpfulHarry@BusyWorking.com> |
|---|---|
| Newsgroups | comp.databases.filemaker |
| Subject | Re: Script to Increment an arbitrary Field |
| Date | 2016-08-13 09:48 +1200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <130820160948389357%HelpfulHarry@BusyWorking.com> (permalink) |
| References | (3 earlier) <1mrt89w.k4rd3u1cxowv4N%clkaufmann@gmx.ch> <b0550$57ac2e9e$53559afc$20447@news.ziggo.nl> <0001HW.D3D31AC308E20FE2B02919BF@news.astraweb.com> <nokaur$2ir$1@dont-email.me> <0001HW.D3D34D2D08EDE0D2B01029BF@news.astraweb.com> |
In article <0001HW.D3D34D2D08EDE0D2B01029BF@news.astraweb.com>, Nelson <nelson@nowhere.com> wrote: > On Fri, 12 Aug 2016 07:12:26 -0400, ursus wrote > (in article <nokaur$2ir$1@dont-email.me>): > >>> > >>> PseudoPseudoCode > >>> You number your fields (instead of naming them field1 _ fieldx) just 1 > >>> and 2 etc. > >>> GetFieldName as number > >>> SetField(number+1) as NewValue > >> > >> The problem is that the button doesn't activate the associated field so > >> any of the functions which operate on the active field such as > >> GetFieldName or GetFieldName as number don't reference the desired > >> field. > > > > The button can be named as well. BUt why do you need a field to act as a > > button in the first place? If it is because you need to see the contents > > of the field on the button then there are other ways to accomplish that. > > like create and name a button. then put your field on top if it. Group > > them and assign a script to the group. parse the name of the button to > > the script as a variable. > > I have several fields which are just counters starting at 0. I want > them to increment when I click on them rather than have to manually > enter the next integer. I could use a script trigger like "On Object > Enter", but that wouldn't allow me to change my mind or decrement the > field. Plus I could make the field active accidentally. > > The way I have it set up now, the field is formatted as a button. > Clicking on it increments the value, Option-Clicking on it decrements > the value. Works for me. The script associated with the button has to > have the field name hard coded into it so I have to have a different > script for each counter. Putting a button next to the field just > clutters up the interface and that button has the same issue of needing > the field name. Having a Field as a Button (or a Button layered over Field) is that you then can't click into the Field itself. Either your Script will also need to select the Field or you'll need a second copy of the Field (perhaps on a different Layout) that can be clicked into so that you can manually edit the data if needed. That's why it's usually best to have something like a "+" and "-" Button next to the Field or, depending on how it's used, automating the increment as an auto-enter Field or Script associated with a function (e.g. "New Record"). > Not a big deal but I was looking for some sort of generic solution. I think the only way is to pass the Field name as a parameter, which means hardcoding the Field names into the Button definitions ... but since they're attached to the appropriate Button / Field anyway, I don't think that matters too much (as long as you remember to change it if you duplicate a Field / Button and change which Field it uses). Helpful Harry :o)
Back to comp.databases.filemaker | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Script to Increment an arbitrary Field Nelson <nelson@nowhere.com> - 2016-08-09 15:06 -0400
Re: Script to Increment an arbitrary Field Helpful Harry <HelpfulHarry@BusyWorking.com> - 2016-08-10 08:59 +1200
Re: Script to Increment an arbitrary Field Nelson <nelson@nowhere.com> - 2016-08-10 12:00 -0400
Re: Script to Increment an arbitrary Field clkaufmann@gmx.ch (Christoph Kaufmann) - 2016-08-11 09:19 +0200
Re: Script to Increment an arbitrary Field Ursus <ursus.kirk@ziggo.nl> - 2016-08-11 09:51 +0200
Re: Script to Increment an arbitrary Field Nelson <nelson@nowhere.com> - 2016-08-12 06:18 -0400
Re: Script to Increment an arbitrary Field ursus <ursus.kirk@gmail.com> - 2016-08-12 13:12 +0200
Re: Script to Increment an arbitrary Field Nelson <nelson@nowhere.com> - 2016-08-12 09:53 -0400
Re: Script to Increment an arbitrary Field Helpful Harry <HelpfulHarry@BusyWorking.com> - 2016-08-13 09:48 +1200
Re: Script to Increment an arbitrary Field Martin Τrautmann <t-usenet@gmx.net> - 2016-08-14 12:56 +0000
Re: Script to Increment an arbitrary Field Nelson <nelson@nowhere.com> - 2016-08-12 06:14 -0400
Re: Script to Increment an arbitrary Field clkaufmann@gmx.ch (Christoph Kaufmann) - 2016-08-14 20:51 +0200
csiph-web