(in-package :custom) (use-package :OLI) (sd-defdialog 'pw_table_foo :dialog-title "Tabelle einlesen" :variables '() :ok-action '(pw_create_ltab) :local-functions '( (pw_create_ltab () (progn (pw_read_table_csv_build) ) ) ) ) (defun pw_read_table_csv_build () (let (A1 A2 A3 A4 ZEILE_STRING_IN ZEILE_STRING_LISTE FI NEW_LIST) (with-open-file (FI (sd-convert-filename-to-platform "C:/tab.csv") :direction :input :if-does-not-exist nil) (sd-create-logical-table "Kegelsenkung" :columns '(:Schraube :Bohr_dm :Senk_dm :Senk_tf) :columnNames (sd-string-split (read-line FI nil) ",") :types '(:string :length :length :length ) :units '( nil :mm :mm :mm ) :contents '( ) ) (setf ZEILE_STRING_IN (read-line FI nil)) (loop while ZEILE_STRING_IN do (display "naechste Zeile") (display ZEILE_STRING_IN) (setf ZEILE_STRING_LISTE (sd-string-split ZEILE_STRING_IN ",")) (setf A1 (nth 0 ZEILE_STRING_LISTE)) (setf A2 (read-from-string (nth 1 ZEILE_STRING_LISTE))) (setf A3 (read-from-string (nth 2 ZEILE_STRING_LISTE))) (setf A4 (read-from-string (nth 3 ZEILE_STRING_LISTE))) (display A1) (display A2) (display A3) (display A4) (setf NEW_LIST (list A1 A2 A3 A4)) (display NEW_LIST) (sd-insert-logical-table-row "Kegelsenkung" :position :bottom :overwriteIfExists nil :contents NEW_LIST ) (setf ZEILE_STRING_IN (read-line FI nil)) ) (sd-create-display-table "Kegelsenkung" :tableTitle "Kegelsenkung" :logicalTable "Kegelsenkung" :columns '(:Schraube :Bohr_dm :Senk_dm :Senk_tf) :applyColumns '(:Bohr_dm :Senk_dm :Senk_tf) :displayHeight 580 :filterStatusLine nil :selectionMode :single-row :applyAction :default-tokens ) (sd-show-display-table "Kegelsenkung" :position '("TOP-MENU-TOOLBOX-TB" :bottomleft 330 250) ) ) ) )