Autoload using complete path failing for no apparent reason

So i am using this simple code (see below) to autoload my custom commands in my On_doc_load.lsp. While it works as intented for nearly all of them (command gets loaded and execute when called), one of them simply won't be found by autoload even though i double check everything...
The command name is «MES». I don't think it is a known alias? Plus, it does works correctly on V13 (I'm using V21).

I get the following error :

The file *fullpath*PiquerMesure.lsp (.des/.lsp/.brx/.drx/.dbx/.arx) was not found in your search path folders.
Check the installation of the support files and try again.nil

My code is in this form :

(defun MyAutoLoad ( path Lisps2load / no )
    (setq no 0)
    (repeat (length Lisps2load)
        (autoload (strcat path (car (nth no Lisps2load)) ".lsp") (cdr (nth no Lisps2load)))
        (setq no (1+ no))
    )
)

; where *fullpath* is the path where the command lisps are located using double backslashes.
(MyAutoLoad "*fullpath*"
    (list
    '("BatHatch" "QBH")
    '("PiquerMesure.lsp" "MES")
    ; [...]
    )
)

Thoughts?

Adding the path to the support paths worked but I do not wish to do so. Again, the provided path (using strcat in the function) works with other commands...

Comments

  • Maybe you can use (findfile) to see if at least the API is indeed locating the file

  • Hello,
    seems it is that code :

    (autoload (strcat path (car (nth no Lisps2load)) ".lsp")

    because the second entry in your list-to-be-loaded already has .lsp specified :

    '("PiquerMesure.lsp" "MES")

    try with

    '("PiquerMesure" "MES")

    without extension. like the first entry in that list ... I assume it will work then :-)

    many greetings !

  • @Daniel Marcotte , Yes findile does find the file...

    @Torsten Moses : My real code does not have the «.lsp» indeed. This is an error in my post. Sorry for that. I cannot edit my post...

  • I just see in your earlier post, about the code :

    ; where *fullpath* is the path where the command lisps are located using double backslashes.
    (MyAutoLoad "*fullpath*"
    

    is that fullpath variable really passed as string, wrapped in apostrophes ?
    maybe

    (MyAutoLoad *fullpath*
    

    many greetings !

  • @Torsten Moses said:

    is that fullpath variable really passed as string, wrapped in apostrophes ?
    maybe
    

    No, it is the real string path in the form of "C:\Users\1LandSurveyor\Documents\CustomCommands\"
    There is no a variable.

    If there was a problem with the notation, i wouldn't be able to autoload all the other commands... i don't see why one of them would fail like that.

  • I think it doesn't display properly in my last reply and i cannot edit it, but yes, there are 2 backslashes in the path string...

  • Somebody had the same issue as me! But that thread doesn't provide an answer...

    I guess i'll have to work with support paths in V21 :neutral:
    This is so weird since everything works fine in V13... using the same exact code files.

  • hmmm - thanks for explanations, seems to be strange indeed;
    if you could reproduce with a kind of stripped-down sample, using that failing ("PiquerMesure" "MES") and a non-failing variant, and send to SupportRequest system, I could try to reproduce ...
    which I would really like to do ... eventually there is a hidden bug (?);

    You can even try to adjust SRCHPATH at runtime (during your app startup), the SRCHPATH is not cached so that any change is effective in realtime.
    many greetings !

  • @Torsten Moses , I don't know how could I have provided anything usefull since I seemed to be the only one with this issue in my office. The code was working fine for everybody else.

    Since (load ...) and (findfile ...) lisp commands were working for the fullpath\PiquerMesure.lsp, i tried to simply stop specifiying the ".lsp" in my MyAutoLoad function and now everything works fine...

    (defun MyAutoLoad ( path Lisps2load / no )
        (setq no 0)
        (repeat (length Lisps2load)
            (autoload (strcat path (car (nth no Lisps2load))) (cdr (nth no Lisps2load))) ; Removed ".lsp" in the strcat function
            (setq no (1+ no))
        )
    )
    
    

    Thanks a lot for your time and efforts.

  • glad to hear :-)
    many greetings !