PDA

View Full Version : VLisp Console : bad argument value: non-negative: -1



stusic
2016-03-28, 09:47 PM
I'm trying to compile a vlx file but run into the title error message when I'm adding the following subroutine to the list of dependant files to be compiled. I can't see anything wrong with it and it runs fine when I run it after loading the source files from my project. Any ideas?

Thanks for any help :beer:



(defun _implode (data delim / str n)
(if (and (= (type data) 'LIST)
(= (type delim) 'STR)
(> (strlen delim) 0)
)
(foreach n data
(if str
(setq str (strcat str delim n))
(setq str n)
)
)
)
)

Opie
2016-03-28, 09:52 PM
I have no problems compiling that routine to VLX.

stusic
2016-03-28, 10:00 PM
Hmm...

Do you think it can be caused by the order which I'm trying to load my subs? My main routine is dependent on a sub, which in turn is dependent on this sub.

Opie
2016-03-29, 01:04 AM
Yes. The dependent routines need to be loaded before loading your main routine.

stusic
2016-03-29, 03:44 PM
Well, I'm not sure exactly what was going on, but I got around it by embedding the sub I posted into its dependent sub.

stusic
2016-03-29, 05:17 PM
I swear I searched and didn't find this (although it's got the exact same title...) (http://forums.augi.com/showthread.php?14586-Compiling-Error-quot-error-bad-argument-value-non-negative-1-quot), but I think this is my problem (MS-DOS filename compatibility).