problema con gli elementi della legendaIn JMP18 (18.1.1) questo esempio dall'indice di scripting non funziona:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Variables( X( :height ), Y( :weight ), Overlay( :sex ), Color( :age ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
server = gb << Get Legend Server;
items = server << Get Legend Items;
For Each( {item, index}, items[1],
item << Set Label( "Item " || Char( index ) )
);
Produce il messaggio di errore:

quindi, Legend Server << ottieni gli elementi della legenda()
non restituisce oggetti programmabili?
Automazione e scriptingRe: ottieni oggetti della legenda: nessun oggetto programmabilesoluzione alternativa:
usa ottieni elemento legenda
Non dimenticare di pre- valutare per ottenere l'oggetto leggenda
- per l'etichetta impostata non è necessaria alcuna pre-valutazione.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Variables( X( :height ), Y( :weight ), Overlay( :sex ), Color( :age ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
server = gb << Get Legend Server;
Nitems = Nitems(( server << Get Legend Items)[1]);
for(i=1, i<= Nitems, i++,
Eval(Eval Expr(item = server << Get Legend Item(1, Expr(i))));
item << Set Label( "Item " || Char( i ) )
);
Re: ottieni oggetti della legenda: nessun oggetto programmabileProssima trappola: non funziona con i grafici a barre?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb =Graph Builder(
Variables( X( :age ), Y( :weight ), Overlay( :sex ) ),
Elements( Bar( X, Y ) )
);
server = gb << Get Legend Server;
items = server << Get Legend Items;
show(items);
server << get legend item(1,1) // error message

modifica: non sono riuscito a riprodurre il problema su un altro computer / dopo un riavvio di JMP (?).
Re: ottieni oggetti della legenda: nessun oggetto programmabileIn realtà restituisce oggetti scriptabili. Sembra che questo sia un bug con For Each(). Se modifichi il codice in qualcosa che dovrebbe essere equivalente, funziona.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Variables( X( :height ), Y( :weight ), Overlay( :sex ), Color( :age ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
server = gb << Get Legend Server;
items = server << Get Legend Items;
For Each( {item, index}, items[1],
items[1][index] /*isn't this exactly what item is?*/ << Set Label( "Item " || Char( index ) )
);Re: ottieni oggetti della legenda: nessun oggetto programmabileAh, scusa, hai ragione, i singoli elementi sono effettivamente programmabili.
Interesting: a batch message like items << get label produces the same issue.
maybe batch messages use per ciascuno in the background ?
Scavando più a fondo, ho trovato un vecchio biglietto: TS-00128192
Fortunatamente, nel frattempo il problema è stato risolto in JMP19 (EA5):

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Variables( X( :height ), Y( :weight ), Overlay( :sex ), Color( :age ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
server = gb << Get Legend Server;
items = server << Get Legend Items;<BR /><BR />items << get label // same issue as with for each
show(items[1][1])
items[1][1] << get label(); // OK, on the lowest level, there <U>is</U> a scriptable object
Show(tmp = items[1][1::2]); // then this is a list of ...
tmp[1] << get Label(); // ...no
Re: ottieni oggetti della legenda: nessun oggetto programmabile
@mmarchandFSLR ha scritto:
In realtà restituisce oggetti programmabili.
d'altra parte... un po' sorprendente:

JMP19:
