Discussion:
Permanently Sort Data
Steven Prins
2017-02-13 00:47:45 UTC
Permalink
Hello, all.

4D v13-16, OS x 10.10

Is there a way to permanently sort data for a table as it is stored?

Used to do this occasionally with "Permanent Sort” option on the “Maintain” page of 4D Tools. However, in versions of 4D since 2004 there does not appear to be an analogous function in MSC. Is there a way to accomplish this programmatically?

Any assistance would be appreciated.

Steven Prins
Santa Fe, NM

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
**************************
Keisuke Miyako
2017-02-13 00:56:16 UTC
Permalink
maybe...

ORDER BY
SQL EXPORT SELECTION
TRUNCATE TABLE
(Set database parameter + table sequence number)
SQL EXECUTE SCRIPT
Post by Steven Prins
Is there a way to accomplish this programmatically?
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
**************
Paul Ringsmuth
2017-02-13 19:36:31 UTC
Permalink
Configuration:
4D v15.4 and 16 R2 build 16R2.208523
MacBookPro OSX Sierra 10.12.3

Problem:
The shortcut for the Print command is CMD-P.
The CMD-P shortcut works in 4D v15.4 but not in 16 R2.
Using the actual menu (selecting File, then Print) works on both versions of 4D.

The result is the same for both input and output layouts throughout my entire database.

I have checked the print settings attached to the forms to be printed and they seem okay.

My print commands usually have a method assigned to them.

Anyone else seeing this? I’m considering filing a bug.

Best Regards,
Paul Ringsmuth
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
*******************
John DeSoi
2017-02-13 19:50:36 UTC
Permalink
Paul,

I filed a bug report for this (version 16.0). It now appears to be fixed in version 16 nightly builds.

It appears to be caused by the Preferences menu item being moved to the Apple menu. Any menu item with a shortcut after this item executes the menu item after it. For example, I had two menu item shortcuts, E followed by P. Command-E executes the Command-P menu item. Command-P at the end of the menu does nothing.

John DeSoi, Ph.D.
Post by Paul Ringsmuth
4D v15.4 and 16 R2 build 16R2.208523
MacBookPro OSX Sierra 10.12.3
The shortcut for the Print command is CMD-P.
The CMD-P shortcut works in 4D v15.4 but not in 16 R2.
Using the actual menu (selecting File, then Print) works on both versions of 4D.
The result is the same for both input and output layouts throughout my entire database.
I have checked the print settings attached to the forms to be printed and they seem okay.
My print commands usually have a method assigned to them.
Anyone else seeing this? I’m considering filing a bug.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
**********************************************************
Chip Scheide
2017-02-13 13:44:34 UTC
Permalink
generally I have found this is not a needed step.
just sort the data as presented to the user, or in general as needed
Post by Steven Prins
Hello, all.
4D v13-16, OS x 10.10
Is there a way to permanently sort data for a table as it is stored?
Used to do this occasionally with "Permanent Sort” option on the
“Maintain” page of 4D Tools. However, in versions of 4D since 2004
there does not appear to be an analogous function in MSC. Is there a
way to accomplish this programmatically?
Any assistance would be appreciated.
Steven Prins
Santa Fe, NM
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
------------
Hell is other people
Jean-Paul Sartre
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
********************************************************************
Scott Staley
2017-02-17 17:29:06 UTC
Permalink
Steven,

I thought I would pass on something that has been helpful for me in regards
to sorting.

Back on September 1, 2016 a gentleman by the name of Flury Oliver posted a
link to a 4D shell he calls the data browser. Here is the link to his post
(not sure if I can post a link).

http://4d.1045681.n5.nabble.com/4D-Shell-or-not-so-much-td5747143.html#a5747180

I checked his link to his shell and it appears to still work.

As a part of his shell he included a set of utility routines in a component
called FSUty.4dbase. The utility routines include two methods called
UtyLB_SaveUserSort and UtyLB_SetUserSort. The Save User Sort method is
placed in a listbox "on after sort" event and the Set User Sort method is
placed anywhere you want to update/resort the listbox. I've created a shell
of my own in which I provide many simple ways to modify a listbox selection
and I needed a simple way to maintain the sort order. This has worked
wonderfully with one exception... it doesn't handle calculated column sorts.

The methods are pretty short so I could post them here but not sure if that
would be appropriate.

Also, not sure if this will help you but I thought I would pass it on.

fyi... Just a note on the data browser shell. I've found it to be a
wonderful resource not just because of some excellent sample code that is
included but I've learned a lot of programing techniques from how Mr Oliver
does his programing. Much of it is still over my head (his use of language
objects for example) but I am very grateful for his sharing this with the 4D
community.




--
View this message in context: http://4d.1045681.n5.nabble.com/Permanently-Sort-Data-tp5750242p5750350.html
Sent from the 4D Tech mailing list archive at Nabble.com.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
********************************************************************
Douglas von Roeder
2017-02-17 17:42:12 UTC
Permalink
Scott:

Heh, good of you to bring that up.

Like you, I snagged a copy of Olivier's shell and was very impressed by it.
One of the constraints that we work against is that what we've done in the
past has brought us success and so we tend to keep doing it. Of course,
that has it's pros and cons - we keep customers happy but it also can lead
to stagnation.

That changes when good folks like Olivier have the ingenuity and skills to
bring new techniques to life and then share his work with us.

Tip of the hat to Olivier.


--
Douglas von Roeder
949-336-2902
Post by Scott Staley
Steven,
I thought I would pass on something that has been helpful for me in regards
to sorting.
Back on September 1, 2016 a gentleman by the name of Flury Oliver posted a
link to a 4D shell he calls the data browser. Here is the link to his post
(not sure if I can post a link).
http://4d.1045681.n5.nabble.com/4D-Shell-or-not-so-much-
td5747143.html#a5747180
I checked his link to his shell and it appears to still work.
As a part of his shell he included a set of utility routines in a component
called FSUty.4dbase. The utility routines include two methods called
UtyLB_SaveUserSort and UtyLB_SetUserSort. The Save User Sort method is
placed in a listbox "on after sort" event and the Set User Sort method is
placed anywhere you want to update/resort the listbox. I've created a shell
of my own in which I provide many simple ways to modify a listbox selection
and I needed a simple way to maintain the sort order. This has worked
wonderfully with one exception... it doesn't handle calculated column sorts.
The methods are pretty short so I could post them here but not sure if that
would be appropriate.
Also, not sure if this will help you but I thought I would pass it on.
fyi... Just a note on the data browser shell. I've found it to be a
wonderful resource not just because of some excellent sample code that is
included but I've learned a lot of programing techniques from how Mr Oliver
does his programing. Much of it is still over my head (his use of language
objects for example) but I am very grateful for his sharing this with the 4D
community.
--
View this message in context: http://4d.1045681.n5.nabble.
com/Permanently-Sort-Data-tp5750242p5750350.html
Sent from the 4D Tech mailing list archive at Nabble.com.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:4D_Tech-***@lists.4D.com
******************************************************************
Loading...