Jump to content

One liner add from array


Recommended Posts

I want to somehow string out the command that will add cols from 0 to 2 with SRER (im gussing) which will run with "execute"

Thanks

#include <Array.au3>

Local $array[0][4], $b = ","
_ArrayAdd($array, "soda,pop,cola", 0, $b)

; the usual way i'd do it
_ArrayAdd($array, $array[0][0] & $b & $array[0][1] & $b & $array[0][2] & $b & "Added", 0, $b)
_ArrayDisplay($array)

;One liner
$AddToCols = "0-2"
;~ ..

 

Link to comment
Share on other sites

??

#include <Array.au3>

Local $array[0][4], $b = ","
_ArrayAdd($array, "soda,pop,cola", 0, $b)

; the usual way i'd do it
_ArrayAdd($array, $array[0][0] & $b & $array[0][1] & $b & $array[0][2] & $b & "Added", 0, $b)
_ArrayDisplay($array)

;One liner
$AddToCols = "0-2"
;~ ..

; ??
Local $iPeekRow = 0
_ArrayAdd($array, _ArrayToString($array, $b, $iPeekRow, $iPeekRow, '', 0, 2) & $b & "Added2", 0, $b)
_ArrayDisplay($array)

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

When I first saw this post I thought “eh, seems tough, maybe later”.

but then the pot was sweetened with:

5 hours ago, Deye said:

Even if it was possible, it could not be an elegant one liner...

Well played, sir!

Code hard, but don’t hard code...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...