Quantcast

Subject: Re: Don't amputate numberformat

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
Mike Kerner: "Well, that would be a nice thing to have in a field widget,
but I run into
formatting issues with databases, as well, especially when sorting."

I am using all kinds of formatting functions with databases. There is
always this overhead which could be minimized using a database adapter as
provided in other languages, or writing your own.

But fields, the visual objects used most, are a focus for any data
management. They always deserve attention, and unless there will be such
new widget, actually our already nice fields would be candidate for such
and other improvements.

And also, it is a widely adopted standard that left, top, right and bottom
boundaries could be formatted separately.

I do not know much about the internal workings of the machine, but could
such work be outsourced? Maybe someone could raise funding? I would rather
like to see the improvements in the core engine instead of as a LC Builder
widget since it is so basic.

Roland
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
I've talked about doing some microfinancing projects in LC, but so far I
haven't heard a lot of interest.  I'm all for it.

On Mon, Apr 24, 2017 at 8:13 AM, Roland Huettmann via use-livecode <
[hidden email]> wrote:

> Mike Kerner: "Well, that would be a nice thing to have in a field widget,
> but I run into
> formatting issues with databases, as well, especially when sorting."
>
> I am using all kinds of formatting functions with databases. There is
> always this overhead which could be minimized using a database adapter as
> provided in other languages, or writing your own.
>
> But fields, the visual objects used most, are a focus for any data
> management. They always deserve attention, and unless there will be such
> new widget, actually our already nice fields would be candidate for such
> and other improvements.
>
> And also, it is a widely adopted standard that left, top, right and bottom
> boundaries could be formatted separately.
>
> I do not know much about the internal workings of the machine, but could
> such work be outsourced? Maybe someone could raise funding? I would rather
> like to see the improvements in the core engine instead of as a LC Builder
> widget since it is so basic.
>
> Roland
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Do you guys know about Hugh Senior’s Field Formatter? http://www.flexiblelearning.com/fieldformatter/ <http://www.flexiblelearning.com/fieldformatter/>

Dave



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
This is why I want to try to get a more centralized repo of all the cool
stuff that everyone's done in LC, especially if it's available in-app, sort
of like a widget store, if we ever get one of those...

On Mon, Apr 24, 2017 at 9:57 AM, Dave Kilroy via use-livecode <
[hidden email]> wrote:

> Do you guys know about Hugh Senior’s Field Formatter?
> http://www.flexiblelearning.com/fieldformatter/ <
> http://www.flexiblelearning.com/fieldformatter/>
>
> Dave
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
On 2017-04-24 14:13, Roland Huettmann via use-livecode wrote:

> Mike Kerner: "Well, that would be a nice thing to have in a field
> widget,
> but I run into
> formatting issues with databases, as well, especially when sorting."
>
> I do not know much about the internal workings of the machine, but
> could
> such work be outsourced? Maybe someone could raise funding? I would
> rather
> like to see the improvements in the core engine instead of as a LC
> Builder
> widget since it is so basic.

The field is a rather large, difficult and very very picky piece of
engine
code so pretty much nothing related to it is far from 'easy' to do. Of
course, the
'how one would implement something' has to be preceded by 'how would
such a thing
work' and the latter is not entirely clear in this case...

Mike's suggestion of a 'field widget', I'd perhaps suggest would be a
'field'
much more inline with a database 'field' - i.e. it would be a single
thing
which had a 'format' property (think type of column). The 'field' would
hold
a single value, and the 'format' would determine how that (typeless)
value would
be interpreted and rendered.

Trying to do a similar thing with the current field is a little more
complex
because the field allows char level access to its contents.

In your previous post you suggested it would be nice to be able to do
something
along the lines of:

   put "1.234" into field 1
   set the format of field 1 to "currency"

In this case, assuming the user's currency format was something like
'£0.00' then
you would see '£1.23' in the field. (I don't think I can understate how
neat
this would be).

However, the question to ask (and I've been asking myself in the back of
my mind
since I read your post) is: what, in this context does 'put char 1 to 3
of field 1'
mean?

Does it mean '1.23' or '£1.'?

The problem here is that which it should mean very much depends on what
you
are wanting to do.

The idea of the feature is that it completely separates computational
value (1.234)
from display value (£1.23) - however, fields have a large number of
features which
work (and can only work) if it is based on display value.

For example, it would be slightly unsettling to a user if they could not
select a
portion of '£1.23' to copy onto the clipboard - the way the field
presents its selection
is using 'char X to Y' so that immediately gives us a constraint that
the displayed
chars of the value would be used for char X to Y evaluation.

However, from a computational point of view, it is kinda important that
the following
is true:

   put "1234" into field 1
   put char 1 to 4 of field 1 is "1234"

So that immediately gives us a constraint that it would have to be the
computational
value that would be used for char X to Y evaluation. So we end up going
back round
in a circle...

Warmest Regards,

Mark.

P.S. I should say that the above should not be taken as 'this is not
possible to do',
more that a naive approach to doing it probably isn't going to work so
something a
little cleverer is needed... And like most things, things which are a
little cleverer
just require a little more application of the 'little grey cells' :)

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
I had a whole system for doing this in another app. I should probably resurrect it. A user could right-click a field in pointer mode and with the normal contextual menu would also get options for setting some standard validations. The user could pick from pre, mid, and post validations. Pre would validate/format when the field was populated. Mid would validate/format when the user closed the field, and post would validate/format when the form was saved. The pre and post allowed values in the database to be different than the ones used by livecode, for instance the sql value of 1 or 0 for a column of type BOOLEAN, and the hilited of a button being true or false. The mid allowed for instance an integer of the proper length to be formatted as a phone number using the formatPhone() function I wrote for it.

I have a library of nothing but format and validations like formatIP, isIP etc.

Bob S


> On Apr 24, 2017, at 07:27 , Mark Waddingham via use-livecode <[hidden email]> wrote:
>
> The field is a rather large, difficult and very very picky piece of engine
> code so pretty much nothing related to it is far from 'easy' to do. Of course, the
> 'how one would implement something' has to be preceded by 'how would such a thing
> work' and the latter is not entirely clear in this case...
>
> Mike's suggestion of a 'field widget', I'd perhaps suggest would be a 'field'
> much more inline with a database 'field' - i.e. it would be a single thing
> which had a 'format' property (think type of column). The 'field' would hold
> a single value, and the 'format' would determine how that (typeless) value would
> be interpreted and rendered.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
In reply to this post by Mark Wieder via use-livecode
Mike Kerner wrote:

 > Well, that would be a nice thing to have in a field widget, but I run
 > into formatting issues with databases, as well, especially when
 > sorting.

The DB issue may be best handled through an accessor library.  Many
other error-correction and conveniences could be added to that as well.

But with fields, a formatting enhancement need not be a Widget per se.
That would require first reproducing the entire field object, and then
adding the small bits we're discussing here.  Daunting.

Simpler would be a behavior script, with a custom properties called
something like "rawText" and "displayText", with formatting determined
by "displayFormat", e.g.:

set the displayFormat of fld 1 to "$0.00"
set the rawText of fld 1 to 5 -- shows "$5.00"
get the displayText of fld 1 -- returns "$5.00"
get the rawText of fld 1 -- return "5"

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
It's only daunting because of the overhead of creating the widget.  I think
that the overhead of creating LC and maintaining LC is well worth it
compared to the cognitive load that I face dealing with other tools.
Laptops also rejoice that they do not have to endure having their screens
ripped from their bases when I am trying to debug a pointer referencing
issue, so DO IT FOR THE LAPTOPS!

On Mon, Apr 24, 2017 at 11:30 AM, Richard Gaskin via use-livecode <
[hidden email]> wrote:

> Mike Kerner wrote:
>
> > Well, that would be a nice thing to have in a field widget, but I run
> > into formatting issues with databases, as well, especially when
> > sorting.
>
> The DB issue may be best handled through an accessor library.  Many other
> error-correction and conveniences could be added to that as well.
>
> But with fields, a formatting enhancement need not be a Widget per se.
> That would require first reproducing the entire field object, and then
> adding the small bits we're discussing here.  Daunting.
>
> Simpler would be a behavior script, with a custom properties called
> something like "rawText" and "displayText", with formatting determined by
> "displayFormat", e.g.:
>
> set the displayFormat of fld 1 to "$0.00"
> set the rawText of fld 1 to 5 -- shows "$5.00"
> get the displayText of fld 1 -- returns "$5.00"
> get the rawText of fld 1 -- return "5"
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  ____________________________________________________________________
>  [hidden email]                http://www.FourthWorld.com
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
Mike Kerner wrote:

 > On Mon, Apr 24, 2017 at 11:30 AM, Richard Gaskin wrote:

 >> But with fields, a formatting enhancement need not be a Widget per
 >> se. That would require first reproducing the entire field object,
 >> and then adding the small bits we're discussing here.  Daunting.
 >>
 > It's only daunting because of the overhead of creating the widget.

Well, that and several thousand lines of very tricky code.

If you're up for translating all that from C++ to LC Builder that would
be cool.

But if it may take longer than an idle afternoon, perhaps a backscript
might do. :)

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subject: Re: Don't amputate numberformat

Mark Wieder via use-livecode
Think of the laptops.  Do it for them.

On Mon, Apr 24, 2017 at 2:49 PM, Richard Gaskin via use-livecode <
[hidden email]> wrote:

> Mike Kerner wrote:
>
> > On Mon, Apr 24, 2017 at 11:30 AM, Richard Gaskin wrote:
>
> >> But with fields, a formatting enhancement need not be a Widget per
> >> se. That would require first reproducing the entire field object,
> >> and then adding the small bits we're discussing here.  Daunting.
> >>
> > It's only daunting because of the overhead of creating the widget.
>
> Well, that and several thousand lines of very tricky code.
>
> If you're up for translating all that from C++ to LC Builder that would be
> cool.
>
> But if it may take longer than an idle afternoon, perhaps a backscript
> might do. :)
>
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  ____________________________________________________________________
>  [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...