Expansion of explode() and implode()

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

Expansion of explode() and implode()

Post by PeterH »

Hey - I'm just missing something...
With explode() we can fill a list into an indexed array.
I'd need the ability to fill a list with elements like 'name1=value1' into an associative array.
E.g.: the output of SetLayout(, ';')
Result would be like
Explode($Apane[], SetLayout(, ';'), ';', 'a'); // 'a' = create assoc array

This would enable us to change a kind of 'Control-List' to a 'Control-Array = Control-Structure' by just 1 command, where after that all values could directly be accessed by e.g.
$p1w = $Apane['Pane1Width'];

The same, please, for the opposite direction, for implode().

Would allow for (just one shortened example, hopefully w/o :bug: ):

Code: Select all

  Explode($Apane[], SetLayout(, ';'), ';', 'a'); // list2array
  $p1w = $Apane['Pane1Width'];                   // temp store
  $Apane['Pane1Width'] = $Apane['Pane2Width'];   // exchg
  $Apane['Pane2Width'] = $p1w;                   // exchg other
  SetLayout(Implode($Apane, , ';', 'a'), ';');   // fine that implode can *return* it's result :-)
  SetLayout($panelist, ';');                     // set result 
I think this shows enough advantages of this enhancement?

(Sorry for the mess of separators - but explode and setlayout use different dflts :whistle: )

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

Re: Expansion of explode() and implode()

Post by admin »

I'll look into it after 64-bit.

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

Re: Expansion of explode() and implode()

Post by PeterH »

I couldn't expect more!

So thanks,
and much luck with TB and 64bit!

Raf
Posts: 143
Joined: 31 Jul 2024 15:34

Re: Expansion of explode() and implode()

Post by Raf »

+1
I would like to use this feature to display the contents of the dictionary to the user. It is unwise to duplicate the contents of the dictionary in a separate text message.

Post Reply