Bonjour, j'ai de la difficulté à utiliser une boucle for pour créer quelques graphiques. J'ai une liste de mots et je veux qu'ils soient sélectionnés dans la table de données et tirés dans un grpah. Je veux que cela soit fait plusieurs fois avec des mots différents. J'ai inclus ce que j'ai jusqu'à présent, cependant ma boucle for ne fera que le premier mot de la liste.
Il y a aussi une boucle na si, car je souhaite que le graphique ne soit construit que s’il existe un nombre de correspondances supérieur à 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 syntaxe correcte pour votre sous-ensemble est
dt << Subset(
Output table name( " from " || Char( graph[i] ) ),
Selected Rows( 1 ),
Selected Columns( 0 )
);
De plus, je ne vois pas le code de journal auquel vous ajoutez. Je suppose que le
jrn << Append(
Outline Box( "from " || Char( graph[i] ),
Text Box( "There are" || Char( n_g ), Markup( 1 ) ),
m << New Data Box(),
biv << Report
)
);<BR />
La référence JRN est quelque part plus tôt dans le code et n'est tout simplement pas incluse dans ce snipet.