Come ottenere il titolo di OutlineBox con 'Get Script'CIAO,
Sto cercando di usare la funzione "get script" per recuperare informazioni su un report che posso combinare in un file .jrp (simile ai dettagli di questo post , tranne per il fatto che aggiungerò alcuni componenti extra che verranno eseguiti all'avvio per il file .jrp, motivo per cui non sto usando la funzione "Save Report Window"). Il problema che ho è che devo recuperare anche i titoli di OutlineBox (che sono denominati dallo script e vengono tracciati in caso di modifiche nel mio progetto più ampio), altrimenti non posso ricreare il report. Vedi l'esempio qui sotto.
Mi manca qualcosa nella funzione "get script" per importare anche i titoli di OutlineBox?
names default to here(1);
report_win = New Window("Testwindow",
Outline Box("tester",
Textbox("Test")
)
);
report_win << Get Script;
//RESULT: V List Box( V List Box( Outline Box( Text Box( "Test" ) ) ) )
//If I were to take that same script and try to recreate as a jrp file works....
//New Window("test", V List Box( V List Box( Outline Box( Text Box( "Test" ) ) ) ))
//resulting failure: expected character arg 1 in access or evaluation of 'Outline Box' , Outline Box/*###*/(Text Box( "Test" ))
Automazione e scriptingRe: Come ottenere il titolo di OutlineBox con 'Ottieni script'Non sono sicuro che tu possa usare << Get Script per quello che stai cercando di fare. E quello che potresti/dovresti fare dipende dal tuo obiettivo finale. Sono abbastanza sicuro di non aver capito perché non potresti usare << Save Window Report, ma potrebbe essere un'opzione.
Names Default To Here(1);
report_win = New Window("Testwindow", << Type("Report"), Outline Box("tester", Text Box("Test")));
report_win << Save Window Report("$TEMP/test.jrp");
s1 = report_win << get script;
wait(0);
s2 = Parse(Load Text File("$TEMP/test.jrp"));
wait(0);
Delete File("$TEMP/test.jrp");
Show(s1, s2);
ob_script = Extract Expr(s2, Outline Box(WildList()));
s1 = V List Box(V List Box(OutlineBox(Text Box("Test"))));
s2 = New Window("Testwindow", Outline Box("tester", Text Box("Test")));
Outline Box("tester", Text Box("Test"))
Re: Come ottenere il titolo di OutlineBox con 'Ottieni script'Penso che usare XPath potrebbe essere più semplice e diretto. Guarda questa illustrazione:
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = dt << Bivariate( Y( :weight ), X( :height ), Fit Line( 1 ) );
rpt = biv << Report;
outlineNames = (rpt << XPath( "//OutlineBox" )) << Get Title;