Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - CatouSan

#1
Quote from: Ocean on 2011-Nov-28
Quote from: CatouSan on 2011-Nov-28
You guys gave me some ideas I will apply to create a solution, it will be a pain, but it will also be elegant.

Thanks again  :)

how can something elegant e a pain?
Elegant in how it works, a pain to write.   :P
#2
You guys gave me some ideas I will apply to create a solution, it will be a pain, but it will also be elegant.

Thanks again  :)
#3
I see. So when you say types use one routine, are you referring to all types? Ex. I can use one function to sort an array of dogs, and later an array of cats?
#4
How could arrays of types and extended types use the same routine as arrays of ints and floats? I have been pulling out my hair trying to figure that out..
#5
Wouldn't I have to duplicate and modify my existing functions to do that though?
#6
SORTARRAY already has the ability to sort all different kinds of arrays, I just wanted to possibly create a library with all different kinds of sorts (for fun and experience mostly.. ). I can still make the library but I will only be able to sort arrays of integers or floats. I would have liked for it to be more flexible than that...
#7
O.. K..  :'(

I thought there had to be away but nevermind, I'll be better off working with C++ in codeblocks. Thanks for your input guys.
#8
Sorry I'm being too vague about what I'm looking to do. Ok so the reason I brought up the built in sorting function is because it can sort ANY kind of array. I know how to pass an array into a function just fine, the only problem is I can't call the function and input an array of a different type than what I specified. Is there a certain specification I have to make to an argument to allow any kind of array I want to be passed into the same function (in the same argument) when called? I know it sounds weird, but I need to be able to do this for a project I am working on.



#9
I know I can sort things lol, what I mean is that I want to be able to pass an array of any type into a function.
#10
Not sure if this topic is in the correct location.

Anyway, I noticed that manual states the "cmd%" argument of SORTARRAY  requires you to get the address of your own comparison function using ADDRESSOF or leave it as 0 to use the default behavior. The SORTARRAY function also allows you to input an array of any type into it.

My question's are.. Can I recreate SORTARRY's behavior with my own functions in glbasic? and if so How would I go about it?