我正在創建一個供同事使用的介面,以便他們可以啟動一個合理的目錄,然後導航到資料檔案所在的特定位置並打開它們。我只想保存它們導航到的路徑,以供將來在 JSL 程式碼中使用。但我似乎不知道如何實現這一點。任何建議將不勝感激。
Names Default To Here( 1 );
Set Path Variable( "dir_rawdata", "C:\" );
dt = Open(
Pick File( "Select Data File ", "$dir_rawdata/", {"CSV Files|csv", "All Files|*"} ),
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Comma, CSV( 1 ) ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start( 2 ),
Data Starts( 3 ),
Lines To Read( "All" ),
Year Rule( "20xx" )
)
);
將 Pick File 傳回的結果儲存在變數中。 您可以使用各種字串函數從該字串中取得路徑。