Page 2 of 2

Re: SC: Array and Hashtable/Hashmap/Dictionary

Posted: 29 Sep 2017 21:40
by Filehero
Idea for Arrays 1.0

Code: Select all

toarray()

  Returns an array for a tokenized string.

Syntax

  toarray(string, [separator="|"])

  string Tokenized source string.

  separator Separator of tokens; defaults to "|".
  If empty ("") then the string is separated by char creating a char array.

  return The array. If the string passed is empty, the array returned will have a length = 0.

Code: Select all

tostring()

  Returns a tokenized string for an array.

Syntax

  tostring(array, [separator="|"])

  array The array to be converted into a tokenized string.

  separator Separator used for tokenization; defaults to "|".
  If empty ("") then all array elements simply are concatenated.

  return The string. If the array passed has no element, the empty string "" is returned.
This way we would get to complementary adapters to the existing SC API, thus you can focus on the syntax changes.

FH

Re: SC: Array and Hashtable/Hashmap/Dictionary

Posted: 04 Oct 2017 11:17
by admin
Yes, that would be useful.

I would probably prefix all array related functions, like this:
array_tostring()
array_fromstring()

Re: SC: Array and Hashtable/Hashmap/Dictionary

Posted: 04 Oct 2017 12:09
by Filehero
admin wrote:array_tostring()
array_fromstring()
Would be ok for me.

Re: SC: Array and Hashtable/Hashmap/Dictionary

Posted: 04 Oct 2017 13:14
by PeterH
Yes: this form of names seems meaningful to me, too.

Re: SC: Array and Hashtable/Hashmap/Dictionary

Posted: 26 Sep 2020 20:19
by Filehero
:whistle:

Re: SC: Array and Hashtable/Hashmap/Dictionary

Posted: 26 Sep 2020 20:54
by admin
:) ...................... :ninja: