O-man Posted November 27, 2019 Posted November 27, 2019 Hi, Ive got a good .dcl and .lsp routine that i use but it was discovered that a bit flag (variable) can only hold 256 lines of data. when i select more that 256 files it only does 256 no more. i was thinking instead of making the bit flag (variable) i could just make it write to a file instead, kind of taking raw data to text file instead of memory. hears the pertinent .lsp code (defun FileSelect (Dir Pat) (setq DH (load_dialog "dialogbox")) (if (and DH (new_dialog "FILES" DH)) (progn (setq iExt 0) (Refresh_Display) (start_list "EXT") (mapcar 'add_list Pat) (end_list) ; (action_tile "DIR" "(new_dir $value)") (action_tile "EXT" "(new_mask $value)") (action_tile "FIL" "(picked $value)") ; (if (= (start_dialog) 0) (setq File_List nil) ) (unload_dialog DH) ) ) File_List ;<---here is where i thought i could change to write-line tofile ) ;------------------------------------------------ (defun Refresh_Display () (start_list "FIL") (end_list) (set_tile "CDIR" "Working...") (setq FL (VL-Directory-Files ;Dir Pat 1) Dir (nth iExt Pat) 1) DR (VL-Directory-Files Dir nil -1) FL (VL-Sort FL 'str_compare) DR (VL-Sort DR 'str_compare) ) (start_list "DIR") (mapcar 'add_list DR) (end_list) (start_list "FIL") (if Show_the_details (mapcar '(lambda (F) (setq Dt (VL-File-SysTime (strcat Dir F)) F1 (if Dt (strcat F "\t" (itoa_f (nth 1 Dt) 2) "/" (itoa_f (nth 3 Dt) 2) "/" (itoa_f (nth 0 Dt) 4) "\t" (itoa_f (nth 4 Dt) 2) ":" (itoa_f (nth 5 Dt) 2) ":" (itoa_f (nth 6 Dt) 2) ) (strcat F "\t\t") ) Sz (VL-File-Size (strcat Dir F)) F1 (strcat F1 "\t" (rtos Sz 2 0)) ) (add_list F1)) FL) (mapcar 'add_list FL) ) (end_list) (set_tile "DIRS" (strcat "Directories = " (itoa (length DR)))) (set_tile "FILS" (strcat "Files = " (itoa (length FL)))) (set_tile "CDIR" Dir) ) (defun New_Dir (Pth) (setq Pth (nth (atoi Pth) DR)) (cond ((= Pth ".") nil ) ((= Pth "..") ;;back up a directory ;;remove directory name up one (setq L (1- (strlen Dir)) Dir (substr Dir 1 L) ) (while (/= (substr Dir L 1) "/") (setq L (1- L))) (setq Dir (substr Dir 1 L)) ) ('T (setq Dir (strcat Dir Pth "/")) ) ) (Refresh_Display) ) ;------------------------------------------------ ;; Call back function to handle new file mask ;; selection by the user. ;; (defun New_Mask (II) (setq iExt (atoi II)) (Refresh_Display) ) ; ;------------------------------------------------ ;; Call back function for saving the selected ;; file list in the variable FILE_LIST. ;; (defun Picked (val / V) ;<--it turns out i need to write tofile here (setq val (read (strcat "(" Val ")")) ;<----any thoughts? File_List ;<---ive tried alot and am thinking i need a foreach statement (mapcar '(lambda (V) ;<---other wise ill have to switch to a macro but am limited in that (strcat Dir (nth V FL))) Val) ) ) any thoughts would be great! cheers Quote
Lee Mac Posted November 27, 2019 Posted November 27, 2019 (edited) Unfortunately, I believe this is a restriction of the DCL list box implementation, rather than of the data type of the variable used to store the selected items. Given this restriction, you may wish to consider using a paged list box, which divides the data set into groups which are each smaller than this inherent limit. Edited November 27, 2019 by Lee Mac Quote
BIGAL Posted November 28, 2019 Posted November 28, 2019 Nice Lee. 256+ files is massive, why not use some form of reducing the list, the obvious is A-Z 1st character. Or enter a pattern BIG*, Lee*. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.