Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   arrays (https://forums.graalonline.com/forums/showthread.php?t=44714)

adam 05-04-2003 11:12 PM

arrays
 
String arrays have deletestring arrayname,index

and

removestring arrayname,string


I want the same things for numeric arrays


deleteelement array,index;

removeelement array,#;


not sure about those names though.

Basially you could delete any index in the array and it would reindex everything and be all good.

screen_name 05-10-2003 11:06 PM

Both can easily be done with a small script.

adam 05-10-2003 11:52 PM

Quote:

Originally posted by screen_name
Both can easily be done with a small script.
Depends on your definition of small. But I'd rather have a command that will do it easily for any array I wanna alter.

tlf288 05-11-2003 01:46 AM

Just create a function that you can copy and paste into your scripts. I have one that does that, but I'm sure you can script it.

Alexander 05-11-2003 06:53 PM

Trevor empty out your PMs or im me -.-
I really need to talk to you :(

Falados 05-11-2003 08:24 PM

Built-in functions are better, they take less time. Its more efficient to have a command to do this for you than do it yourself, because your script needs to be parsed, the command is built-in.

tlf288 05-11-2003 11:42 PM

Quote:

Originally posted by Falados
Built-in functions are better, they take less time. Its more efficient to have a command to do this for you than do it yourself, because your script needs to be parsed, the command is built-in.
It hardly takes much time. I see what your saying, but it doesn't take enough time to really matter.

Quote:

Originally posted by Alexander
Trevor empty out your PMs

Done.

Falados 05-12-2003 01:56 AM

Quote:

Originally posted by tlf288


It hardly takes much time. I see what your saying, but it doesn't take enough time to really matter.



Done.

What if you had a fairly large array? Or what if your array manipulation was in conjunction with other resource-heavy operations, you mustn't denounce solutions to lag you know.

adam 05-12-2003 02:07 PM

Ok, yes I know I could make some functions to do this, but, I'm hoping stefan's built in functions won't be so very laggy as the functions would no doubt have to me, using at least a for loop, and the arrays would be pretty large. I could use temporary string arrays, but those lag pretty badly when the size gets decent. And I would need multiple functions for multiple arrays. One function to translate each array, and one function to do each operation.

Kaimetsu 05-12-2003 02:50 PM

If you don't care about ordering then deletion/replacement is a piece of cake - you don't even need a for loop. My problem with these functions is that Stefan would need to make them care about ordering at all times (just in case) and so they would be far less efficient than a custom-scripted function.

adam 05-12-2003 03:40 PM

Quote:

Originally posted by Kaimetsu
If you don't care about ordering then deletion/replacement is a piece of cake - you don't even need a for loop. My problem with these functions is that Stefan would need to make them care about ordering at all times (just in case) and so they would be far less efficient than a custom-scripted function.
Well, I do care about ordering so, yeah...

Kaimetsu 05-12-2003 07:54 PM

Quote:

Originally posted by adam
Well, I do care about ordering so, yeah...
Indeed? What are you coding?

tlf288 05-13-2003 05:49 AM

Quote:

Originally posted by Kaimetsu


Indeed?

Almost everything I code depends on ordered arrays. I mean, isn't the point of an array to store ordered data?

Kaimetsu 05-13-2003 06:03 AM

Quote:

Originally posted by tlf288
Almost everything I code depends on ordered arrays. I mean, isn't the point of an array to store ordered data?
No, the point is merely to store data.

adam 05-13-2003 07:15 AM

Quote:

Originally posted by Kaimetsu


Indeed? What are you coding?

You remember your thread about random not being random? I used string arrays to do what im asking for the ability to do in arrays more easily.

It's just something I think will improve the use of arrays generally, for any sort of listing purposes. or sequential data.

Kaimetsu 05-13-2003 07:49 AM

Quote:

Originally posted by adam
You remember your thread about random not being random?
Yes.

Quote:

I used string arrays to do what im asking for the ability to do in arrays more easily.
Now I don't know what you're saying. Are you referring to a project mentioned in the random() thread? The fireworks thing? Why would they need to be ordered? And it's horribly foolish to use a string array - just code your own damn function.

Quote:

It's just something I think will improve the use of arrays generally, for any sort of listing purposes. or sequential data.
No, it won't. 90% of arrays don't need to be ordered, and use of this function would slow them down immensely.


All times are GMT +2. The time now is 12:04 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.