469,964 Members | 1,754 Online

# Transform string : "c;b;a;e;d" -> "a;b;c;d;e" ?

Indrid
Nov 13 '05 #1
32 2375
On Mon, 11 Jul 2005 22:47:26 -0400, "Indrid Colt" <in****@colt.com>
wrote:

Well, you could use the Split function to create an array with 5
elements. Then use any suitable sorting algorithm to sort these items.
Then use the Join function to stitch the elements back together.

-Tom.

Indrid

Nov 13 '05 #2
Tom van Stiphout <no*************@cox.net> wrote in
news:fk********************************@4ax.com:
On Mon, 11 Jul 2005 22:47:26 -0400, "Indrid Colt"
<in****@colt.com> wrote:

Well, you could use the Split function to create an array with 5
elements. Then use any suitable sorting algorithm to sort these
items. Then use the Join function to stitch the elements back
together.

For a case where the values are all one character, why not just use
a ReverseString() function like the one posted after my sig?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc

Public Function ReverseString(strInput As String) As String
Dim i As Integer
Dim tmpString As String
Dim tmpOutput As String

tmpString = strInput
For i = 1 To Len(strInput)
tmpOutput = tmpOutput & Right(tmpString, 1)
tmpString = Left(tmpString, Len(tmpString) - 1)
Next i
ReverseString = tmpOutput
End Function
Nov 13 '05 #3

David W. Fenton wrote:
For a case where the values are all one character, why not just use
a ReverseString() function like the one posted after my sig?

Huh? Please explain what you're suggesting. I'll probably call myself
an idiot for not seeing it. Anyway, perhaps the individual letters
represent strings or numbers?

James A. Fortune

Nov 13 '05 #4
On Tue, 12 Jul 2005 22:07:46 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:

?ReverseString("c;b;a;e;d")
d;e;a;b;c
The OP wanted "a;b;c;d;e"

-Tom.

Tom van Stiphout <no*************@cox.net> wrote in
news:fk********************************@4ax.com :
On Mon, 11 Jul 2005 22:47:26 -0400, "Indrid Colt"
<in****@colt.com> wrote:

Well, you could use the Split function to create an array with 5
elements. Then use any suitable sorting algorithm to sort these
items. Then use the Join function to stitch the elements back
together.

For a case where the values are all one character, why not just use
a ReverseString() function like the one posted after my sig?

Nov 13 '05 #5
Tom van Stiphout <no*************@cox.net> wrote in
news:m0********************************@4ax.com:
On Tue, 12 Jul 2005 22:07:46 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:

?ReverseString("c;b;a;e;d")
d;e;a;b;c
The OP wanted "a;b;c;d;e"

This is the main reason I don't like posts that put the question in
the subject, and don't repeat it in the body of the post.

Yes, I have two chances to read the subject, but in this case, I
thought my first reading was correct, so I didn't check. Obviously,
it wasn't.

I don't know why the subject shouldn't have been "sort string..."

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6
Tom van Stiphout wrote:
On Tue, 12 Jul 2005 22:07:46 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:

?ReverseString("c;b;a;e;d")
d;e;a;b;c
The OP wanted "a;b;c;d;e"

-Tom.

You're suggesting late night coding induced dyslexia. I've been there.
I'll take a look at the OP's problem.

James A. Fortune

Nov 13 '05 #7
Tom van Stiphout wrote:
On Mon, 11 Jul 2005 22:47:26 -0400, "Indrid Colt" <in****@colt.com>
wrote:

Well, you could use the Split function to create an array with 5
elements. Then use any suitable sorting algorithm to sort these items.
Then use the Join function to stitch the elements back together.

-Tom.

I am assuming you don't want to use ADO to put the items in a table for

'Begin test code behind command button
Dim varList As Variant
Dim varOut As Variant

varList = Array("10", "2", "1")
varOut = SortMe(varList)
MsgBox ("varOut(0) = " & varOut(0))
MsgBox ("varOut(1) = " & varOut(1))
MsgBox ("varOut(2) = " & varOut(2))
'End test code behind command button

'Begin code behind the same form
Private Function SortMe(ByVal varArray As Variant) As Variant
Dim N As Integer
Dim I As Integer
Dim J As Integer
Dim FoundAt As Integer
Dim varMin As Variant
Dim varOutput As Variant

'Assuming the number of items is small, say < 100, an
'inefficient sort method such as one used by a card
'player (insertion sort) is adequate and easy to understand
varOutput = varArray
For N = UBound(varArray) To 0 Step -1
varMin = varArray(0)
FoundAt = 0
For I = 1 To N
If varArray(I) < varMin Then
varMin = varArray(I)
FoundAt = I
End If
Next I
varOutput(UBound(varArray) - N) = varArray(FoundAt)
For J = FoundAt To N - 1
varArray(J) = varArray(J + 1)
Next J
Next N
SortMe = varOutput
End Function
'End code behind the same form
Output when the command button is clicked:
1 10 2

When varList = Array(10, 2, 1) the output becomes:
1 2 10

You can probably use the Split function to get the input string into
varList directly. The sort function works by finding the minimum from
the first N elements, placing it in the output, then sliding the array
elements down starting where the minimum was found, then decrementing N
by one. The time for this sort is proportional to the number of
elements squared. Test this code well before using.

James A. Fortune

Nov 13 '05 #8
You could try this:

Public Function SortedList(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
WorkingList = Split(vList, vDelimiter)
With WizHook
.Key = 51488399
.SortStringArray WorkingList
End With
SortedList = Join(WorkingList, vDelimiter)
End Function

Sub test()
Dim TestString As String
TestString = "c;b;a;e;d"
Debug.Print SortedList(TestString, ";")
End Sub

Nov 13 '05 #9
Wow !

Thank a lot, it's work perfectly !

Indrid

<ly******@yahoo.ca> a écrit dans le message de news:
You could try this:

Public Function SortedList(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
WorkingList = Split(vList, vDelimiter)
With WizHook
.Key = 51488399
.SortStringArray WorkingList
End With
SortedList = Join(WorkingList, vDelimiter)
End Function

Sub test()
Dim TestString As String
TestString = "c;b;a;e;d"
Debug.Print SortedList(TestString, ";")
End Sub

Nov 13 '05 #10
"ly******@yahoo.ca" <ly******@yahoo.ca> wrote in
You could try this:

Public Function SortedList(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
WorkingList = Split(vList, vDelimiter)
With WizHook
.Key = 51488399
.SortStringArray WorkingList
End With
SortedList = Join(WorkingList, vDelimiter)
End Function

Sub test()
Dim TestString As String
TestString = "c;b;a;e;d"
Debug.Print SortedList(TestString, ";")
End Sub

So, Lyle, why do you make a fetish of posting things like this and
making no effort to explain them?

Specifically, the WizHook WITH block, and the meaning of the
property and method you've used.

How did you find this?

And what is the meaning of the key?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #11

David W. Fenton wrote:
So, Lyle, why do you make a fetish of posting things like this and
making no effort to explain them?

Specifically, the WizHook WITH block, and the meaning of the
property and method you've used.

How did you find this?

And what is the meaning of the key?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc

Start at about post #7 of:

where Lyle uses a recordset to do the sorting (maybe I'm psychic) then
gets a wizhook solution from peter walker. It looks like Lyle started
using the .Key = 51488399 around late 2003. I don't know what it means
since that's the nature of undocumented methods. Anyway, it won't work
for the users who have A97 so for me it will stay undocumented unless
Lyle tells us more. I'm all for unorthodox methods but this one seems
a little more fragile than most.

James A. Fortune

Nov 13 '05 #12
ji********@compumarc.com wrote:
where Lyle uses a recordset to do the sorting (maybe I'm psychic) then
gets a wizhook solution from peter walker. It looks like Lyle started
using the .Key = 51488399 around late 2003. I don't know what it means
since that's the nature of undocumented methods. Anyway, it won't work
for the users who have A97 so for me it will stay undocumented unless
Lyle tells us more. I'm all for unorthodox methods but this one seems
a little more fragile than most.

or:

Sub ShellSort(pstrArray() As String, plngMaxItem As Long)

' Sort Array of string into order
Dim lngSpan As Long
Dim i As Long, j As Long
Dim strDummy As String

' Get to middle of list
lngSpan = plngMaxItem \ 2

Do While lngSpan > 0
For i = lngSpan To plngMaxItem - 1
j = i - lngSpan + 1
For j = (i - lngSpan + 1) To 1 Step -lngSpan
If pstrArray(j) <= pstrArray(j + lngSpan) Then
Exit For
End If
' Swap array elements that are out of order.
strDummy = pstrArray(j + lngSpan)
pstrArray(j + lngSpan) = pstrArray(j)
pstrArray(j) = strDummy
Next j
Next i
lngSpan = lngSpan \ 2
Loop

End Sub

Yeah I know the code could be updated to use lbound and ubound instead
of assuming starting at 1 and using a parameter for the number of
elements but it was written yonks ago (back in the DOS days).

I did try a few algorithms including bubble and quick, quicksort was
supposed to be the fastest but that was only true in a programming
language that used pointers for strings like C. Bubble sort was quickest
if the array was only slightly out of order, for most other
circumstances I found the shell Sort to be quickest in BASIC, and the
second simplest in complexity. The Bubble sort is the simplest and for
small lists like the one in the subject you wouldn't notice a difference
in speed. Bubble Sort below:

Sub BubbleSort(pstrArray() As String, plngMaxItem As Long)
Dim i As Long
Dim fSwitched As Boolean
Dim strTemp As String

Do
fSwitched = False
For i = 1 To plngMaxItem - 1
If pstrArray(i) > pstrArray(i + 1) Then
' item out of place, move it
fSwitched = True
' swap items
strTemp = pstrArray(i)
pstrArray(i) = pstrArray(i + 1)
pstrArray(i + 1) = strTemp
End If
Next
Loop While fSwitched
End Sub

--
[OO=00=OO]
Nov 13 '05 #13
Access/VBA has many hidden members.

One can see them by opening a module, clicking on the object browser,
right clicking in the object browser window and selecting "Show Hidden
Members"

Some of these can be very useful. My favourite is Collect, a member of
both DAO and ADO recordsets. Collect returns the value of a recordest
field referenced by an ordinal or name. TTBOMK Collect is the second
fastest (and much the simplest) way to retrieve the value of a
recordset field. Creating a field DAO or ADO object and referencing its
Value property is minimally faster (demonstrated by Dimitri Furman).
The dot and Recordset.Fields("FieldName" OR Ordinal) are appreciably
slower.

Wizhook and its seeming clone _Wizhook are hidden objects. To use any
if its methods one must first enter a key: 51488399. I can only
speculate as to Why; perhaps it is because MS does not want us to use
them? Wizhook was first available in Access 2000.
I first learned of Wizhook in the thread James Fortune cites, in a
discussion with Peter Walker about sorting arrays. Michael Kaplan
discourages the use of Wizhook, for the reason that most of its members
do not work, do not work well, or work in an unpredictable way.
The are a few of Wizhook's members that I find useful:

FileExists(File As String) As Boolean

FullPath(RelativePath As String, FullPath As String) As Integer

IsValidIdent(Identifier As String) As Boolean

SortStringArray(Array() As String)

SplitPath(Path As String, Drive As String, Dir As String, File As
String, Ext As String)

TableFieldHasUniqueIndex(Table As String, Columns As String) As Boolean

WizMsgBox(bstrText As String, bstrCaption As String, wStyle As Long,
idHelpID As Long, bstrHelpFileName As String) As Long

I have not had problems with these not working; that is no guarantee
there never will be problems.

Some of these require passing parameters that acquire values wanted, by
reference, something that is not so common in VBA scripting.

IMO Wizhook should be used only by experienced, capable, professional
developers, and, I suspect, many of these would recommend against its
use alrogether.

Nov 13 '05 #14
"ly******@yahoo.ca" <ly******@yahoo.ca> wrote in
Access/VBA has many hidden members.

My question was not so much a question as a comment about posting
style. My preference is that someone posting about undocumented
methods using hidden members should endeavor to explain the meaning
of them when offering them as a solution.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #15
"ly******@yahoo.ca" <ly******@yahoo.ca> wrote in
IMO Wizhook should be used only by experienced, capable,
professional developers, and, I suspect, many of these would
recommend against its use alrogether.

Don't you think you have a responsibility to say this explicitly
when offering a WizHook solution to a problem?

I certainly think you have that obligation.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #16
Sorry by my cheap "posting style", but my english is very poor, and i have
many difficulty to explain adequately my question.
so, indeed the undocumented "Wizhook" is very interresting and why Microsoft
hide this methods ? is not reliable ?

Indrid

"David W. Fenton" <dX********@bway.net.invalid> a écrit dans le message de
news: Xn**********************************@24.168.128.74 ...
"ly******@yahoo.ca" <ly******@yahoo.ca> wrote in
Access/VBA has many hidden members.

My question was not so much a question as a comment about posting
style. My preference is that someone posting about undocumented
methods using hidden members should endeavor to explain the meaning
of them when offering them as a solution.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc

Nov 13 '05 #17
"Indrid Colt" <in****@colt.com> wrote in
news:0Z*****************@weber.videotron.net:
Sorry by my cheap "posting style", but my english is very poor,
and i have many difficulty to explain adequately my question.
so, indeed the undocumented "Wizhook" is very interresting and why
Microsoft hide this methods ? is not reliable ?

Well, it's undocumented, which means that MS uses it internally.
Because no one outside MS is supposed to know about it, the people
inside the Access development team see it as something they can
alter from version to version without needing to inform users of the
changes (because it's undocumented in the first place).

Thus, you can't depend on your use of it to continue working after

Since it's undocumented, if it breaks, you may not be able to figure
out how to fix it.

If you're happy about an implementation that is specific to a
particular Access version and not concerned about future maintenance
issues, go for it.

I wouldn't use it, myself. I'd program the sort myself so that I
know how it worked, and could control the code in the future.

you don't even have to write your own.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #18
"Indrid Colt" <in****@colt.com> wrote in
news:0Z*****************@weber.videotron.net:
Sorry by my cheap "posting style", but my english is very poor,
and i have many difficulty to explain adequately my question.
so, indeed the undocumented "Wizhook" is very interresting and why
Microsoft hide this methods ? is not reliable ?

Well, it's undocumented, which means that MS uses it internally.
Because no one outside MS is supposed to know about it, the people
inside the Access development team see it as something they can
alter from version to version without needing to inform users of the
changes (because it's undocumented in the first place).

Thus, you can't depend on your use of it to continue working after

Since it's undocumented, if it breaks, you may not be able to figure
out how to fix it.

If you're happy about an implementation that is specific to a
particular Access version and not concerned about future maintenance
issues, go for it.

I wouldn't use it, myself. I'd program the sort myself so that I
know how it worked, and could control the code in the future.

you don't even have to write your own.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #19
I suppose a standard way David and most of the regulars would support
would be:

Public Function SortedList2(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
Dim SQL As String

WorkingList = Split(vList, vDelimiter)

SQL = Join(WorkingList, "' AS Element FROM MSysObjects UNION SELECT
'")
SQL = "SELECT '" & SQL & "' AS Element FROM MSysObjects ORDER BY
Element;"

SortedList2 =
, , vDelimiter)), vDelimiter, "", , 1))
End Function

'... assumes an ADO reference and the existence of MSysObjects.

I'm all for simplicity and clarity.

Nov 13 '05 #20
I suppose a standard way David and most of the regulars would support
would be:

Public Function SortedList2(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
Dim SQL As String

WorkingList = Split(vList, vDelimiter)

SQL = Join(WorkingList, "' AS Element FROM MSysObjects UNION SELECT
'")
SQL = "SELECT '" & SQL & "' AS Element FROM MSysObjects ORDER BY
Element;"

SortedList2 =
, , vDelimiter)), vDelimiter, "", , 1))
End Function

'... assumes an ADO reference and the existence of MSysObjects.

I'm all for simplicity and clarity.

Nov 13 '05 #21
ly******@yahoo.ca wrote:
I suppose a standard way David and most of the regulars would support
would be:

Public Function SortedList2(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
Dim SQL As String

WorkingList = Split(vList, vDelimiter)

SQL = Join(WorkingList, "' AS Element FROM MSysObjects UNION SELECT
'")
SQL = "SELECT '" & SQL & "' AS Element FROM MSysObjects ORDER BY
Element;"

SortedList2 =
, , vDelimiter)), vDelimiter, "", , 1))
End Function

'... assumes an ADO reference and the existence of MSysObjects.

So what's the problem with a simple bubble sort that would work
reliably any where any time using constructs found in any language.
No smoke. No mirrors. No references. Just a simple time tested
algorithm.
Nov 13 '05 #22
ly******@yahoo.ca wrote:
I suppose a standard way David and most of the regulars would support
would be:

Public Function SortedList2(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
Dim SQL As String

WorkingList = Split(vList, vDelimiter)

SQL = Join(WorkingList, "' AS Element FROM MSysObjects UNION SELECT
'")
SQL = "SELECT '" & SQL & "' AS Element FROM MSysObjects ORDER BY
Element;"

SortedList2 =
, , vDelimiter)), vDelimiter, "", , 1))
End Function

'... assumes an ADO reference and the existence of MSysObjects.

So what's the problem with a simple bubble sort that would work
reliably any where any time using constructs found in any language.
No smoke. No mirrors. No references. Just a simple time tested
algorithm.
Nov 13 '05 #23
Nothing is wrong with it. We have many regulars who can and do post
such things. They do a good job of it.

But what's the fun in that?
What does one learn from that?

One can do a search in Google and find a time tested algorithm PDQ.

If one posts here, surely one wants some discussion, some deliberation,
more than one outlook, new ideas.

We used to have a lot of discussion here; we used to have lots of new
and innovative ideas here. I have seen fewer and fewer of these over
the past few years.

When one fools around with things like the third whimsical solution I
am giving for this problem (below) one may learn something. I grew up
(sort of) in the forties and fifties. In those days learning was
generally considered to be a good thing. One has only to look at the
language of 90% of the posts here to realize that this idea is no
longer in vogue.

Public Function SortedList3(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
Dim FilteredList() As String
Dim z As Long

WorkingList = Split(vList, vDelimiter)

For z = 65 To 90
FilteredList = Filter(WorkingList, Chr(z), True, vbTextCompare)
SortedList3 = SortedList3 & " " & Join(FilteredList,
vDelimiter)
Next z

SortedList3 = Trim(SortedList3)
SortedList3 = Replace(SortedList3, " ", vDelimiter)
End Function

I make no apology for posting attempts at new solutions, or just
whimsical code.
Those who demand Access 101 should move me into their kill files. For
those who are dead in the seats in front of their computers, I
recommend Gilbert Highet's The Art of Teaching. I read this when I was
18 and it has forever shaped my attitude towards learning and by
extension, living.

I think this is the fifth algorithm I've suggested (over the years) for
array sorting. TTBOMK four are original. Wizhook was introduced by
Peter Walker. When I have some spare time, I'll try to do a sixth: that
is to create a Windows Script (JScript) Component that may be
referenced as a COM object; through it all the magnificent methods of
the Javascript Array object should be exposed to VBA. 'Tis a
consummation, devoutly to be wished!.

.....
Come, my friends,
'T is not too late to seek a newer world.
Push off, and sitting well in order smite
The sounding furrows; for my purpose holds
To sail beyond the sunset, and the baths
Of all the western stars, until I die.
It may be that the gulfs will wash us down:
It may be we shall touch the Happy Isles,
And see the great Achilles, whom we knew.
Tho' much is taken, much abides; and tho'
We are not now that strength which in old days
Moved earth and heaven, that which we are, we are;
One equal temper of heroic hearts,
Made weak by time and fate, but strong in will
To strive, to seek, to find, and not to yield.

Nov 13 '05 #24
Nothing is wrong with it. We have many regulars who can and do post
such things. They do a good job of it.

But what's the fun in that?
What does one learn from that?

One can do a search in Google and find a time tested algorithm PDQ.

If one posts here, surely one wants some discussion, some deliberation,
more than one outlook, new ideas.

We used to have a lot of discussion here; we used to have lots of new
and innovative ideas here. I have seen fewer and fewer of these over
the past few years.

When one fools around with things like the third whimsical solution I
am giving for this problem (below) one may learn something. I grew up
(sort of) in the forties and fifties. In those days learning was
generally considered to be a good thing. One has only to look at the
language of 90% of the posts here to realize that this idea is no
longer in vogue.

Public Function SortedList3(ByVal vList As String, _
Optional ByVal vDelimiter As String = ",") _
As String
Dim WorkingList() As String
Dim FilteredList() As String
Dim z As Long

WorkingList = Split(vList, vDelimiter)

For z = 65 To 90
FilteredList = Filter(WorkingList, Chr(z), True, vbTextCompare)
SortedList3 = SortedList3 & " " & Join(FilteredList,
vDelimiter)
Next z

SortedList3 = Trim(SortedList3)
SortedList3 = Replace(SortedList3, " ", vDelimiter)
End Function

I make no apology for posting attempts at new solutions, or just
whimsical code.
Those who demand Access 101 should move me into their kill files. For
those who are dead in the seats in front of their computers, I
recommend Gilbert Highet's The Art of Teaching. I read this when I was
18 and it has forever shaped my attitude towards learning and by
extension, living.

I think this is the fifth algorithm I've suggested (over the years) for
array sorting. TTBOMK four are original. Wizhook was introduced by
Peter Walker. When I have some spare time, I'll try to do a sixth: that
is to create a Windows Script (JScript) Component that may be
referenced as a COM object; through it all the magnificent methods of
the Javascript Array object should be exposed to VBA. 'Tis a
consummation, devoutly to be wished!.

.....
Come, my friends,
'T is not too late to seek a newer world.
Push off, and sitting well in order smite
The sounding furrows; for my purpose holds
To sail beyond the sunset, and the baths
Of all the western stars, until I die.
It may be that the gulfs will wash us down:
It may be we shall touch the Happy Isles,
And see the great Achilles, whom we knew.
Tho' much is taken, much abides; and tho'
We are not now that strength which in old days
Moved earth and heaven, that which we are, we are;
One equal temper of heroic hearts,
Made weak by time and fate, but strong in will
To strive, to seek, to find, and not to yield.

Nov 13 '05 #25
ly******@yahoo.ca wrote:
I make no apology for posting attempts at new solutions, or just
whimsical code.

I wouldn't think to suggest you should apologize for anything or
change your style in any way.

You're an icon.
Nov 13 '05 #26
ly******@yahoo.ca wrote:
I make no apology for posting attempts at new solutions, or just
whimsical code.

I wouldn't think to suggest you should apologize for anything or
change your style in any way.

You're an icon.
Nov 13 '05 #27
ly******@yahoo.ca <ly******@yahoo.ca> wrote:
: When one fools around with things like the third whimsical solution I
: am giving for this problem (below) one may learn something. I grew up
: (sort of) in the forties and fifties. <snip>

: Public Function SortedList3(ByVal vList As String, _
: Optional ByVal vDelimiter As String = ",") _
: As String
<etc>

: For z = 65 To 90
: FilteredList = Filter(WorkingList, Chr(z), True, vbTextCompare)
: SortedList3 = SortedList3 & " " & Join(FilteredList,
: vDelimiter)
: Next z
<snip>

: SortedList3 = Replace(SortedList3, " ", vDelimiter)
: End Function

: I make no apology for posting attempts at new solutions, or just
: whimsical code.

Nor do you show any compassion for the abandoned numeral, the
tossed away ?, the hardworking but now lost, >.

thelma
vintage that same whimsical generation.

: Those who demand Access 101 should move me into their kill files. For
: those who are dead in the seats in front of their computers, I
: recommend Gilbert Highet's The Art of Teaching. I read this when I was
: 18 and it has forever shaped my attitude towards learning and by
: extension, living.

: I think this is the fifth algorithm I've suggested (over the years) for
: array sorting. TTBOMK four are original. Wizhook was introduced by
: Peter Walker. When I have some spare time, I'll try to do a sixth: that
: is to create a Windows Script (JScript) Component that may be
: referenced as a COM object; through it all the magnificent methods of
: the Javascript Array object should be exposed to VBA. 'Tis a
: consummation, devoutly to be wished!.
Nov 13 '05 #28
ly******@yahoo.ca <ly******@yahoo.ca> wrote:
: When one fools around with things like the third whimsical solution I
: am giving for this problem (below) one may learn something. I grew up
: (sort of) in the forties and fifties. <snip>

: Public Function SortedList3(ByVal vList As String, _
: Optional ByVal vDelimiter As String = ",") _
: As String
<etc>

: For z = 65 To 90
: FilteredList = Filter(WorkingList, Chr(z), True, vbTextCompare)
: SortedList3 = SortedList3 & " " & Join(FilteredList,
: vDelimiter)
: Next z
<snip>

: SortedList3 = Replace(SortedList3, " ", vDelimiter)
: End Function

: I make no apology for posting attempts at new solutions, or just
: whimsical code.

Nor do you show any compassion for the abandoned numeral, the
tossed away ?, the hardworking but now lost, >.

thelma
vintage that same whimsical generation.

: Those who demand Access 101 should move me into their kill files. For
: those who are dead in the seats in front of their computers, I
: recommend Gilbert Highet's The Art of Teaching. I read this when I was
: 18 and it has forever shaped my attitude towards learning and by
: extension, living.

: I think this is the fifth algorithm I've suggested (over the years) for
: array sorting. TTBOMK four are original. Wizhook was introduced by
: Peter Walker. When I have some spare time, I'll try to do a sixth: that
: is to create a Windows Script (JScript) Component that may be
: referenced as a COM object; through it all the magnificent methods of
: the Javascript Array object should be exposed to VBA. 'Tis a
: consummation, devoutly to be wished!.
Nov 13 '05 #29
Thelma Lubkin wrote:
Nor do you show any compassion for the abandoned numeral, the
tossed away ?, the hardworking but now lost, >.

Huh?

Nov 13 '05 #30
Thelma Lubkin wrote:
Nor do you show any compassion for the abandoned numeral, the
tossed away ?, the hardworking but now lost, >.

Huh?

Nov 13 '05 #31
ly******@yahoo.ca <ly******@yahoo.ca> wrote:
: Thelma Lubkin wrote:
:>Nor do you show any compassion for the abandoned numeral, the
:>tossed away ?, the hardworking but now lost, >.

: Huh?

Your code is restricted to the alphabet. It handles the OP's
specific problem, but I think that whimsical solutions should have
a little more ambition than that. Of course, the code would have
to make a decision on how to sort non-alphabetic characters, and
it doesn't even have to be the standard ascii that I had in back
--thelma
Nov 13 '05 #32
ly******@yahoo.ca <ly******@yahoo.ca> wrote:
: Thelma Lubkin wrote:
:>Nor do you show any compassion for the abandoned numeral, the
:>tossed away ?, the hardworking but now lost, >.

: Huh?

Your code is restricted to the alphabet. It handles the OP's
specific problem, but I think that whimsical solutions should have
a little more ambition than that. Of course, the code would have
to make a decision on how to sort non-alphabetic characters, and
it doesn't even have to be the standard ascii that I had in back