Ciao, sto riscontrando problemi nell'usare un ciclo for per creare alcuni grafici. Ho una lista di parole e voglio che vengano selezionate dalla tabella dati e inserite in una finestra. Voglio farlo un numero di volte con parole diverse. Ho incluso ciò che ho finora, tuttavia il mio ciclo for farà solo la prima parola nella lista.
C'è anche un alias in caso di loop, poiché voglio solo che il grafico venga creato se c'è un numero di corrispondenze maggiore di 0.
graph = {"abc", "123"};
n_g = N Items( graph );
For( i = 1, i <= n_g, i++,
dt << Select Where( Contains( :Column, graph[i] ) );
num = N Rows( dt << get selected rows );
If( num > 0,
mess = Char( num ) || " from" || Char( graph[i] );
dt << Subset(
Output table name( " from " || Char( graph[i] ) ),
Selected Row( 1 ),
Selected Column( 0 )
);
biv = Graph Builder(
Size( 1300, 1100 ),
Show Control Panel( 0 ),
Variables( X( :Slack ), Y( :Comb ) ),
Elements( Points( X, Y, Legend( 4 ) ) ),
SendToReport(
Dispatch( {}, "Slack", ScaleBox, {Add Ref Line( 0, "Dashed", "Medium Dark Red", "", 4 )} ),
Dispatch( {}, "Comb", ScaleBox, {Add Ref Line( 25, "Dashed", "Medium Light Yellow", "", 4 )} ),
Dispatch(
{},
"Graph Builder",
FrameBox,
{Add Text Annotation( Text( mess ), Text Box( {8, 14, 251, 34} ) )}
)
)
);
jrn << Append(
Outline Box( "from " || Char( graph[i] ),
Text Box( "There are" || Char( n_g ), Markup( 1 ) ),
m << New Data Box(),
biv << Report
)
);
,
jrn << Append(
Outline Box( " from " || Char( graph[i] ),
Text Box( "There are no paths that begin with " || Char( graph[i] ), Markup( 1 ) )
)
);
);
dt << Clear Select();
);
La sintassi corretta per il tuo sottoinsieme è
dt << Subset(
Output table name( " from " || Char( graph[i] ) ),
Selected Rows( 1 ),
Selected Columns( 0 )
);
Inoltre, non vedo il codice del journal che stai aggiungendo. Presumo, il
jrn << Append(
Outline Box( "from " || Char( graph[i] ),
Text Box( "There are" || Char( n_g ), Markup( 1 ) ),
m << New Data Box(),
biv << Report
)
);<BR />
jrn riferimento è da qualche parte in precedenza nel codice e non è incluso in questo snipet.