Benutzereingabe als neue Variable festlegenHallo,
Ich möchte ein Skript erstellen, das Benutzereingaben entgegennimmt und diese Eingaben in eine Datentabelle ausgibt.
Mein Skript unten gibt eine Datentabelle aus, fügt jedoch keine Benutzervariablen ein. Könnte jemand helfen, da ich glaube, dass ich möglicherweise falsch verstehe, wie man sie einfügt?
v1 = text = " ID"; // two numbers with default
w = New Window( "Synch Request", // opens a window with a title and this content...
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "Please select the tool you wish to view and the date to view from" ) ), // a second title, centered
Spacer Box( size( 1, 30 ) ), // a little vertical space
H List Box( Text Box( "Tool: " ), tool = Text Edit Box( v1 ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "Date: " ), date = Calendar Box( ) ), // more data entry
Spacer Box( size( 1, 30 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "Execute", // this script runs when the button is pressed...
// make a new table with the values...
tool_val = tool << GetSelected();
date_val = date << GetSelected();
dt = New Table( "Untitled",
New Column( "a", Character, Set Values( tool_val ) ),
New Column( "b", Numeric,
"Continuous",
//Required due to original format
Format("y/m/d h:m:s"), Set Values( {date} ) ) );
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);Erweiterte statistische ModellierungAutomatisierung und SkripterstellungVerbraucher- und MarktforschungVersuchsplanungMassenanpassungQualitäts- und VerfahrenstechnikBetreff: Benutzereingabe als neue Variable festlegenSchauen Sie sich das Protokoll an, was passiert
show(date_val);
drucken?
Bei der Datumsausgabe könnte es sich auch um dieses Format handeln:
Format("y/m/d h:m:s"),
JMP kann mit Formaten von Zeit zu Zeit etwas knifflig sein. Sie können die Formatierung aus der Spalte „b“ entfernen und prüfen, ob sie die Zeile mit dem Datenwert füllt. Dann können Sie versuchen, im Formatmenü zu sehen, welche Formate Ihnen zur Verfügung stehen.


Betreff: Benutzereingabe als neue Variable festlegenBei mir funktioniert es unter Windows 10, mit JMP 15 und JMP 16.Welche JMP-Version und welches Betriebssystem?
Betreff: Benutzereingabe als neue Variable festlegenVielen Dank, die Hauptidee des Skripts besteht darin, diese beiden Variablen in ein separates Skript einzugeben.
Bei mir funktioniert die erste Variable der ID, das Datum scheint jedoch nicht zu funktionieren.
Betreff: Benutzereingabe als neue Variable festlegenSchauen Sie sich das Protokoll an, es gibt eine ziemlich gute Fehlermeldung.
Hier ist möglicherweise ein festes Skript mit einigen unterstützenden Ausdrucken (ich erhalte Werte mit etwas anderem als << werden ausgewählt, außerdem stelle ich Werte auf andere Weise als in der neuen Tabelle ein).
Names Default To Here(1);
v1 = text = " ID"; // two numbers with default
w = New Window("Synch Request", // opens a window with a title and this content...
Border Box(top(20), bottom(20), Left(20), Right(20), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box(Text Box("Please select the tool you wish to view and the date to view from")), // a second title, centered
Spacer Box(size(1, 30)), // a little vertical space
H List Box(Text Box("Tool: "), tool = Text Edit Box(v1)), // data entry
Spacer Box(size(1, 10)), // a little vertical space
H List Box(Text Box("Date: "), date = Calendar Box()), // more data entry
Spacer Box(size(1, 30)), // a little vertical space
H Center Box( // center the button
Button Box("Execute", // this script runs when the button is pressed...
// make a new table with the values...
tool_val = tool << get text;
show(tool_val);
date_val = date << get date;
show(date_val);
dt = New Table("Untitled",
New Column("a", Character, Values(Eval List({tool_val}))),
New Column("b",
Numeric,
"Continuous",
//Required due to original format
Format("y/m/d h:m:s"),
Values(Eval List({date_val}))
)
);
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);
Abhängig von Ihrem Skript kann es auch eine gute Idee sein, die Verwendung eines modalen Fensters in Betracht zu ziehen