where I run into problems in AS???

1 message, no reply - 427 views
Quicksort Provider » where I run into problems in AS???

Hello,

When I was in my early teens I had nothing better to do but learn AppleScript for the hell of it. I wrote little scripts to do things like clear web browser cache folders to free up space.

Fast forward to now, ~12 years later. I am dabbling in Visual Basic and often find myself first writing what I want to do in AppleScript, and then converting it to VB. This rekindled my love for AppleScript (no need to go on about how much it sucks cause this is all for fun). So I wanted to try making some AS handlers (AKA functions) to calculate mean, median, and mode on an array.

This is where I run into problems in AS. I am pretty sure in VB all I'd have to do is tell it to mode(theArray) or something like that. In AS I need to create the function from scratch as far as I know.

 

I have tried over and over again to come up with something to sort the list in ascending order but to no avail. I was thinking if someone posted some VB or AS code as an example than I could try translating it.

 

Any help is much appreciated.

Please help.

 

I didn't find the right solution from the internet.

References:

https://arstechnica.com/civis/viewtopic.php?f=20&t=164437

Best Online Adverts

 

Thank you.