|
From: Marcus M. <Fla...@gm...> - 2015-06-18 22:04:49
|
Hi, I have a small problem writing symbols to a file if it contains ezunits using the following example: --------------- Filename: "D:/Simu-File_" $ asdf : tokens(timedate(),'alphanumericp) $ Filename: sconcat(Filename ,asdf[1],"-",asdf[2],"-",asdf[3],"_",asdf[4],"-",asdf[5],"-",asdf[6],".txt") ; remvalue(asdf) $ s_Datei : openw(Filename) $ printf(s_Datei, "~16s~18s~", "Bubble_Start_Radius : ", float(Bubble_Start_Radius))$ printf(s_Datei, "~4s~t;~16s~t;~12s~t;~18s~%","time","surface distance ","radius ","speed ") $ for t: 1 thru length(timeline) do ( printf(s_Datei,"~5d~t;~8,3g~t;~8,3g~t;~8,4g~%",timeline[t],Bubble__Position[t]*100,Bubble__Radius[t]*1000,Bubble__Speed[t]*100*60) )$ close(s_Datei)$ --------------- The problem is float(Bubble_Start_Radius), it triggers the following error: Maxima encountered a Lisp error: The bounding indices 9 and 10 are bad for a sequence of length 9. See also: The ANSI Standard, Glossary entry for "bounding index designator" The ANSI Standard, writeup for Issue SUBSEQ-OUT-OF-BOUNDS:IS-AN-ERROR Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. --------------- Bubble_Start_Radius contains the following information. Bubble_Start_Radius; 1/500 ` m To solve the problem I could use qty(), but I would like to keep the unit, because it depends on prior code. Is there a workaround for this case ? regards, Marcus --------------- wxbuild_info()$ wxMaxima version: Maxima version: 5.35.1.2 Maxima build date: 2015-01-15 21:27:01 Host type: i686-pc-mingw32 System type Win32 6.1.7601 (Service Pack 1) X86 Lisp implementation type: SBCL Lisp implementation version: 1.2.7 |