Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
equivalent QM code for loops through in a PowerShell pipeline
#2
succeed

Macro Macro3
Code:
Copy      Help
out
_s=
;A Key
;-
;Hello 1
;World 1
;---
;B Key
;-
;Hello 2
;
;World 2
;---
;C Key
;-
;Hello 3
;World 3

_s.replacerx("(?m)^-$" "+")
ARRAY(str) a
tok(_s a -1 "-" 0x2000)

str d
int c=65

for _i 0 a.len
,ARRAY(str) b
,tok(a[_i] b -1 "+" 0x2000)
,d.formata("str %c=[] %s[]str %cv=" c b[0] c)
,foreach _s b[1]
,,d.formata("[] %s" _s)
,d.formata("[]%cv.findreplace(''[91]]'' ''┋'')[][]" c)
,c+1

d.formata("str kv=[]F[]")

for _i 65 c
,d.formata(" {%c}={%cv}[]" _i _i)

d.formata("DynamicLV(kv)")
out d

There may be a better solution, if anyone knows, please let me know, thanks


Messages In This Thread
RE: equivalent QM code for loops through in a PowerShell pipeline - by Davider - 11-21-2022, 10:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)