1

I'm working in Dyalog APL version 17.0 and I'm having some trouble getting a line to execute:

SYNTAX ERROR
switch[10] ('CP.B',(⍕zloc),'.Caption')←capt
                                      ∧

capt is a character vector, and zloc is a scalar number. I know a lot of people don't use this language, but any help would be appreciated.

Adám
  • 6,573
  • 20
  • 37
icicle
  • 87
  • 3

2 Answers2

1

Assuming you're meaning to imitate executing CP.B_.Caption←capt for a given number replacing the underscore, this would work:

⍎'CP.B',(⍕zloc),'.Caption←capt'

Try it online!

You're trying to assign a vector to to an unnamed character vector, which isn't valid in APL. This code, instead, evaluates a full APL expression.

If possible, however, storing CP's contents as an array would be much better.

dzaima
  • 388
  • 3
  • 9
1

I assume you're changing the Caption property of a GUI object.

You can do so with ⎕WS (Window Set property):

('CP.B',⍕zloc) ⎕WS 'Caption' capt
Adám
  • 6,573
  • 20
  • 37