Hữu Quốc Posted December 14, 2022 Posted December 14, 2022 Good day to all, My problem is when i using open fuction: (setq file1 (open "D:\\112.csv" "r")) and then error messenger is: ; ----- Error around expression ----- ; (AL-FILE2OBJ FILEOBJ) ; in file : ; Z:\003Kojin\028 Huu Quoc\ソフト\Lisp\Dao1.lsp ; ; error : bad argument type <#<FILE "D:/112.csv">> ; expected <STRING> at [open] Anyone can help me fix that? Quote
pkenewell Posted December 14, 2022 Posted December 14, 2022 @Hữu Quốc Please send more specific information, preferably the whole lisp function and any related functions. At first glance, I do not see why that statement would cause an "Bad argument type" error. Perhaps you have a typo in your first (read-line file1), but I can't troubleshoot this issue with only one line of code. Quote
mhupp Posted December 14, 2022 Posted December 14, 2022 (edited) 25 minutes ago, pkenewell said: At first glance, I do not see why that statement would cause an "Bad argument type" error. Maybe file isn't there or a different name might cause an error. Double check the path to the file. (if (findfile (setq path "D:\\112.csv")) (setq file1 (open path "r")) (prompt (strcat "\n" path " Not Found")) ) but like @pkenewell said need the full code. Edited December 14, 2022 by mhupp Quote
pkenewell Posted December 14, 2022 Posted December 14, 2022 (edited) 11 minutes ago, mhupp said: If the file isn't there or a different name it would cause an error. Double check the path to the file. @mhupp that is true, but I think that generates a different error code (or no error code - see test below) than a "bad argument type" on a string value. Command: (open "C:\\nofilehere.csv" "r") nil from (open) function in help: Edited December 14, 2022 by pkenewell 1 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.