EZ way to Alphabetizing a List

Z

-z

With FP2K, I have a list of Employers hiring located in a table...

Is there an ez way to keep that list in alphabetical order

If not in a tbl, any suggestion how I can do it

Thank you
 
L

Lisa Wollin \(Microsoft\)

The easiest way I can think of is to use a script to store an array of the
names and then use the Sort method to sort the names. Alternatively, you
could store the names in a database and sort the table in the database. Not
sure scripting is the friendliest way to do this, but here's a sample
script.

<script language="javascript">

var list = new Array("apples", "oranges", "grapes", "kiwis", "grapefruit",
"pomegranates", "pears");

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

list.sort();
document.writeln();

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

</script>
 
Z

-z

Thank you

This should put me on the right track

I will explore this

Peace


Lisa Wollin (Microsoft) said:
The easiest way I can think of is to use a script to store an array of the
names and then use the Sort method to sort the names. Alternatively, you
could store the names in a database and sort the table in the database. Not
sure scripting is the friendliest way to do this, but here's a sample
script.

<script language="javascript">

var list = new Array("apples", "oranges", "grapes", "kiwis", "grapefruit",
"pomegranates", "pears");

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

list.sort();
document.writeln();

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

</script>

--
Lisa Wollin
Programmer Writer
Microsoft Corporation
-z said:
With FP2K, I have a list of Employers hiring located in a table...

Is there an ez way to keep that list in alphabetical order

If not in a tbl, any suggestion how I can do it

Thank you
 
L

Lisa Wollin \(Microsoft\)

To be honest, Mike, I'm not sure about earlier versions of JavaScript, but I
did find reference info on the Netscape site for sorting arrays, so my guess
is that for most newer browsers (specifically IE, Netscape Navigator, and
Mozilla), the sort method would work.

--
Lisa Wollin
Programmer Writer
Microsoft Corporation

MD WebsUnlimited.com said:
Lisa,

I don't believe .sort available in all version of the JavaScript is it?
--
Mike -- FrontPage MVP '97-'02
J-Bots Plus 2002 End of Summer Sale You Save $20.00
http://www.websunlimited.com
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
-------------------------------------------------------------------------- --
--------------------
If you think I'm doing a good job, let MS know at (e-mail address removed)

Lisa Wollin (Microsoft) said:
The easiest way I can think of is to use a script to store an array of the
names and then use the Sort method to sort the names. Alternatively, you
could store the names in a database and sort the table in the database. Not
sure scripting is the friendliest way to do this, but here's a sample
script.

<script language="javascript">

var list = new Array("apples", "oranges", "grapes", "kiwis", "grapefruit",
"pomegranates", "pears");

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

list.sort();
document.writeln();

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

</script>

--
Lisa Wollin
Programmer Writer
Microsoft Corporation
-z said:
With FP2K, I have a list of Employers hiring located in a table...

Is there an ez way to keep that list in alphabetical order

If not in a tbl, any suggestion how I can do it

Thank you

 
Z

-z

Ms. Wollin:

Hope it isn't too late to ask a Follow Up Qt...

I want to experiment with your JavaScript suggestion

Where do I put it in a page?

Let's say for demonstration purposes, the Title of the Page will be "Sorting
Example" and the body is "blahblah"

As is, all I can see in "Preview" is the code, NOT the results

Thank you
 
S

Stefan B Rusynko

Paste it in HTML view (from Notepad) in the BODY of the page




| Ms. Wollin:
|
| Hope it isn't too late to ask a Follow Up Qt...
|
| I want to experiment with your JavaScript suggestion
|
| Where do I put it in a page?
|
| Let's say for demonstration purposes, the Title of the Page will be "Sorting
| Example" and the body is "blahblah"
|
| As is, all I can see in "Preview" is the code, NOT the results
|
| Thank you
|
|
| | > With FP2K, I have a list of Employers hiring located in a table...
| >
| > Is there an ez way to keep that list in alphabetical order
| >
| > If not in a tbl, any suggestion how I can do it
| >
| > Thank you
| >
| >
| >
| >
| >
| >
|
|
 
M

MD WebsUnlimited.com

Lisa,

I don't believe .sort available in all version of the JavaScript is it?
--
Mike -- FrontPage MVP '97-'02
J-Bots Plus 2002 End of Summer Sale You Save $20.00
http://www.websunlimited.com
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
----------------------------------------------------------------------------
--------------------
If you think I'm doing a good job, let MS know at (e-mail address removed)

Lisa Wollin (Microsoft) said:
The easiest way I can think of is to use a script to store an array of the
names and then use the Sort method to sort the names. Alternatively, you
could store the names in a database and sort the table in the database. Not
sure scripting is the friendliest way to do this, but here's a sample
script.

<script language="javascript">

var list = new Array("apples", "oranges", "grapes", "kiwis", "grapefruit",
"pomegranates", "pears");

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

list.sort();
document.writeln();

for(i = 0; i < list.length; i++)
{
document.writeln(list);
}

</script>

--
Lisa Wollin
Programmer Writer
Microsoft Corporation
-z said:
With FP2K, I have a list of Employers hiring located in a table...

Is there an ez way to keep that list in alphabetical order

If not in a tbl, any suggestion how I can do it

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top