Live byte count possible whilst *in* a field?

Live byte count possible whilst *in* a field?

am 03.12.2007 18:18:48 von Christoph Bouthillier

Dear Listeners:

Is it possible in FMP 6 and/or 9 to have a live byte counter?

When composing an SMS/text message in a field with its max. 160 bytes it
would be nice to have a live counter besides the field, instead of having to
click various times outside the field to check how far one has progressed.
Any chance to realize this in FMP?

I built an SMS sending app (works just fine, via simple http requests at
www.world-text.com), and this would make it work the same way as e.g.
web-based SMS services where you can see the countdown running as you type.


--
Met vriendelijke groet / Mit freundlichen Gruessen / With kind regards
Christoph Bouthillier
p o s t <> oh-no-spam t e k s t o t a a l << d o t >> c o m
Forget the oh-no-spam

Re: Live byte count possible whilst *in* a field?

am 03.12.2007 18:32:55 von unknown

Post removed (X-No-Archive: yes)

Re: Live byte count possible whilst *in* a field?

am 03.12.2007 21:04:16 von Helpful Harry

In article , Martin
Trautmann wrote:

> On Mon, 3 Dec 2007 18:18:48 +0100, Christoph Bouthillier wrote:
> > Dear Listeners:
> >
> > Is it possible in FMP 6 and/or 9 to have a live byte counter?
> >
> > When composing an SMS/text message in a field with its max. 160 bytes it
> > would be nice to have a live counter besides the field, instead of having
> > to click various times outside the field to check how far one has
> > progressed. Any chance to realize this in FMP?
> >
> > I built an SMS sending app (works just fine, via simple http requests at
> > www.world-text.com), and this would make it work the same way as e.g.
> > web-based SMS services where you can see the countdown running as you type.
>
> You can run a background task which would check the file size every
> second (or even faster) and then select the field again. This will take
> much of your cpu, feeling a little bit clumsy. Even worse, you may loose
> the capability to position the cursor within text (FMP 6).
>
> Try it yourself. Build a script
>
> loop
> set field (length) to length of SMS
> goto field SMS /* position cursor if possible */
> pause 1 second /* shorter if possible */
> exit loop if current field is not SMS /* or other conditions apply */
> end loop

Good grief! Not the AWFUL AWFUL AWFUL "Pause [1 second]" script again.
That's an attrocious abomination against all usability!! :oO


FileMaker can't do anything while you're still in a field. You would
need an extra plug-in to do a "live count" like that, and assuming such
a plug-in exists it'll probably be expensive.

A better way would be to simply use a monospaced / non-proportional
font like Courier for the field, then you can set the field's width and
height to fit the 160 characters. The problem being that a carriage
return won't display as a character, so you would still need a
Validation check to make sure users don't go past that limit anyway.

In the new version of FileMaker you can of course have a "web portal"
that simply displays the World-Text.com website anyway and use they
existing features.


At the end of the day, FileMaker is a DATABASE tool, not a "programming
environment". Unless you're planning on storing the SMS messages for
other uses, you're really using the wrong tool for the job. Try
something like REALBasic or even a variant of C.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Live byte count possible whilst *in* a field?

am 03.12.2007 23:44:20 von Christoph Bouthillier

"Martin Trautmann" schreef in bericht
news:slrnfl8fe7.ni.t-use@ID-685.user.individual.de...
> On Mon, 3 Dec 2007 18:18:48 +0100, Christoph Bouthillier wrote:
>> Dear Listeners:
>>
>> Is it possible in FMP 6 and/or 9 to have a live byte counter?
>>
>> When composing an SMS/text message in a field with its max. 160 bytes it
>> would be nice to have a live counter besides the field, instead of
>> having to
>> click various times outside the field to check how far one has
>> progressed.
>> Any chance to realize this in FMP?
>>
>> I built an SMS sending app (works just fine, via simple http requests at
>> www.world-text.com), and this would make it work the same way as e.g.
>> web-based SMS services where you can see the countdown running as you
>> type.
>
> You can run a background task which would check the file size every
> second (or even faster) and then select the field again. This will take
> much of your cpu, feeling a little bit clumsy. Even worse, you may loose
> the capability to position the cursor within text (FMP 6).
>
> Try it yourself. Build a script
>
> loop
> set field (length) to length of SMS
> goto field SMS /* position cursor if possible */
> pause 1 second /* shorter if possible */
> exit loop if current field is not SMS /* or other conditions apply */
> end loop


Hello Martin:

Thanks for the help. I had to tinker with the script a bit and got it
running generally in FMP9 (haven't tried v6 yet). I did the following:

If [length(t.sms.text) >=160]
Go to field [(t.sms.text)]
Halt Script
Else
Loop
Exit Loop if [length(t.sms.text) >=160]
Go to field [(t.sms.text)]
Pause/Resume script [(Duration (seconds): 0,1]
Go to field []
End loop
End If

I made the menu bars and the status bar invisible - they would
otherwise flicker as mad.

I then added a calc field that says "Stop input with Escape key" as long as
the
bytecount is <160 and "The message is too long" as long as the bytecount
>160. Without the Esc key the user cannot get out of the loop if he wants
to write a message with less than 160 bytes. This can also be achieved with
a button that does "Halt script".

I tried shorter pauses, too, but that did not help/was not necessary.

The first part of the script is necessary for cases when the user had
entered more than 160 bytes (this is (and must be for editing reasons)
possible after the loop has been left) and needs to edit the message and to
shorten it.

The button for the script should logically be assigned to the text message
field itself.

As soon as the 160 bytes have been reached, the script has ended but the
cursor remains in the field and the user can edit
the message freely at that moment.

There are however some glitches I could not overcome: spaces entered in the
SMS text field do not raise the byte count, even not under Unicode. And once
the user has left the field but wants to enter it again to edit it, the
cursor jumps always to the end, it's therefore impossible to edit
somewhere in the middle of the text. I believe I give up... anyway, it was a
nice try/exercise and thanks again for the input.



--
Met vriendelijke groet / Mit freundlichen Gruessen / With kind regards
Christoph Bouthillier
p o s t <
> oh-no-spam t e k s t o t a a l << d o t >> c o m
Forget the oh-no-spam

Re: Live byte count possible whilst *in* a field?

am 04.12.2007 10:39:38 von unknown

Post removed (X-No-Archive: yes)

Re: Live byte count possible whilst *in* a field?

am 04.12.2007 10:45:14 von unknown

Post removed (X-No-Archive: yes)

Re: Live byte count possible whilst *in* a field?

am 04.12.2007 20:48:47 von Helpful Harry

In article , Martin
Trautmann wrote:

> On Tue, 04 Dec 2007 09:04:16 +1300, Helpful Harry wrote:
> > > Try it yourself. Build a script
> > >
> > > loop
> > > set field (length) to length of SMS
> > > goto field SMS /* position cursor if possible */
> > > pause 1 second /* shorter if possible */
> > > exit loop if current field is not SMS /* or other conditions apply */
> > > end loop
> >
> > Good grief! Not the AWFUL AWFUL AWFUL "Pause [1 second]" script again.
> > That's an attrocious abomination against all usability!! :oO
>
> Yes, it is - but I do not know another solution on FMP6 yet.

Except that it isn't a "solution" to anything at all. It's a script
technique for making the database almost completely unusable. :o(

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)