SC: Array and Hashtable/Hashmap/Dictionary

Features wanted...
Filehero
Posts: 2721
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SC: Array and Hashtable/Hashmap/Dictionary

Post 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

admin
Site Admin
Posts: 65339
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC: Array and Hashtable/Hashmap/Dictionary

Post by admin »

Yes, that would be useful.

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

Filehero
Posts: 2721
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SC: Array and Hashtable/Hashmap/Dictionary

Post by Filehero »

admin wrote:array_tostring()
array_fromstring()
Would be ok for me.

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: SC: Array and Hashtable/Hashmap/Dictionary

Post by PeterH »

Yes: this form of names seems meaningful to me, too.

Filehero
Posts: 2721
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SC: Array and Hashtable/Hashmap/Dictionary

Post by Filehero »

:whistle:

admin
Site Admin
Posts: 65339
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC: Array and Hashtable/Hashmap/Dictionary

Post by admin »

:) ...................... :ninja:

Post Reply