Author Topic: Vlisp-error: string too long on input  (Read 1554 times)

0 Members and 1 Guest are viewing this topic.

d2010

  • Bull Frog
  • Posts: 323
Vlisp-error: string too long on input
« on: November 15, 2021, 09:52:16 AM »
How to store a big-string inside the file .Lsp or .Fas?
How to store , the file "asm_jc_cws12.lsp" inside Drawing.dwg not inside *.lsp?
 :yelling:
If I try, collect many tines-strings(except *.DCL) to inside one-variabile.-
--then i got this error
--else
You see here aProgram  version without cws12
End-if
« Last Edit: November 15, 2021, 10:06:16 AM by d2010 »

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Vlisp-error: string too long on input
« Reply #1 on: November 15, 2021, 12:25:14 PM »
Concatenate the string at runtime using strcat?

baitang36

  • Bull Frog
  • Posts: 213
Re: Vlisp-error: string too long on input
« Reply #2 on: November 15, 2021, 06:55:04 PM »
How to store a big-string inside the file .Lsp or .Fas?
How to store , the file "asm_jc_cws12.lsp" inside Drawing.dwg not inside *.lsp?
 :yelling:
If I try, collect many tines-strings(except *.DCL) to inside one-variabile.-
--then i got this error
--else
You see here aProgram  version without cws12
End-if
The string length of AutoLISP uses two bytes, so the string length in LSP source code cannot be greater than 65535 bytes. There is no limit on the length of characters connected with the function strcat. It has been tested for a few megabytes.

baitang36

  • Bull Frog
  • Posts: 213
Re: Vlisp-error: string too long on input
« Reply #3 on: November 15, 2021, 06:57:04 PM »
Concatenate the string at runtime using strcat?
Strcat is the same as the unpublished function string-append
« Last Edit: November 15, 2021, 09:15:35 PM by baitang36 »

d2010

  • Bull Frog
  • Posts: 323
Re: Vlisp-error: string too long on input
« Reply #4 on: November 17, 2021, 03:33:58 AM »
Concatenate the string at runtime using strcat?
Strcat .. Work-VeryWell.
Thank you..
Code - Auto/Visual Lisp: [Select]
  1. (Defun jc_cws12(start count / $rs)
  2.  (setq $rs (substr asm_cws12 start count))
  3.  (if (= $rs "") (setq $rs "eCws12Failed"))
  4. $rs)
  5.  
  6. (SeTq asm_cws12 "\nAssertE=Hi! eBreakPoint kHereAiciHeirIciAqui=\nEndk04desc(mode_tile \"k8other\" (atoi (get_tile \"k04desc\")))help(alert \"Hellow World\")accept(setq dof 1)(done_dialog 1)cancel(setq dof 0)(done_dialog 0) Combine0user.dcl<a110error>Acad__eFileNotOpen\n <file>\n</file>\n <defun>:</defun>\n</a110error>pp_acribbontogglebutton_autoexec.lsp")
  7. ;;LCIDCountEMax=(nn_vmload 8)
  8. ;;LCIDMaxofSize=(dfn_dcl_i_save 55)
  9.  (princ)
  10. ;;;rem:Use this function only for DEBUG mode
  11. (Defun ACRX_T(s183 / rr) (setq rr nil)
  12.     (setq rr (if (=  (type s183) (quote STR))
  13.           s183 (prompt "\nt183errorS**")))
  14. rr)
  15.  
  16. ;;rem:dfn_cad_amain
  17. (DeFun C:q2()
  18.  (setq;|a16972896|;
  19.          dfn_pp_v1chkR nil)  
  20.   (desktop_app)
  21. )
  22.  
  23. (defun assert_cxx (/ $rr)
  24.  (setq;|a16967522|;
  25.          acad__assertNo 0
  26.          kHereAiciHeirIciAqui 0767004316
  27.          erlsp khc85)
  28. )
  29. ;;{--}
  30. (Defun asserte(mssg / $rr)
  31.  (if (=  erlsp nil) (assert_cxx) (if (/= (type acad__assertNo) (quote INT)) (setq;|a67669371|;
  32.          acad__assertNo 0))) (if (/= mssg nil) (setq;|a28775|;
  33.          erprv erlsp
  34.          acad__assertNo (+ acad__assertNo 1)
  35.          erlsp (strcat (vl-prin1-to-string mssg) ":" (itoa acad__assertNo))) (foreach $rr (list (jc_cws12 1 9) erlsp "*" erprv) (princ $rr))) (if (>= acad__assertNo kHereAiciHeirIciAqui) (alert (strcat (jc_cws12 10 37) (itoa kHereAiciHeirIciAqui))))
  36. erlsp)
  37.  
  38. (DeFun C:desktop_app()
  39.      (desktop_app )
  40. )
  41.  
  42. (prompt "\nCommand.com: Q2[enter]\n")
  43. (Defun desktop_app( / )
  44.  
  45. ;------------------------Stdcall "nn_vmload "
  46.   (setq _ax (nn_vmload ))
  47. ;------------------------
  48.  
  49.  (princ (jc_cws12 47 4))  
  50. T)
  51.  
  52. ;;(defun RenderCmds0h( / cpp);;
  53. ;;10sudo dpkg --add ;stdcall
  54. ;;(setq RenderCmd3cpp 10));;
  55. ;(User Labels)
  56. (Defun nn_vmload(/ $rr tmp ind dof ldc splash dof)
  57.  (vl_load_com) (setq;|a1836016479|;
  58.          ind (dfn_crea_dcl_epanet)) (action_tile (jc_cws12 51 7) (jc_cws12 58 49)) (action_tile (jc_cws12 107 4) (jc_cws12 111 22)) (action_tile (jc_cws12 133 6) (jc_cws12 139 27)) (action_tile (jc_cws12 166 6) (jc_cws12 172 28)) (start_dialog) (unload_dialog ind)
  59. $rr)
  60. (defun vl_load_com(/ $rr)
  61.  (if (null con_modspace)  (progn (vl-load-com) (prompt "\n\n")
  62.  (setq vlax_true :Vlax-True
  63.        vlax_false :Vlax-False
  64.        kHomeRegistry "HKEY_CURRENT_USER\\Software\\Autodesk\\AutoCAD")
  65.  (setq con_acadapp (vlax-get-acad-object))
  66.  (setq con_acdoc (vla-get-activedocument con_acadapp))
  67.  (setq con_acdocUtility (vla-get-utility con_acdoc))
  68.  (setq con_modspace (vla-get-modelspace con_acdoc))
  69.  (setq con_appwiz (vla-get-application con_acadapp))
  70.  (setq con_chspace (vlax-get-property con_acdoc
  71.           (if (zerop (getvar "CVPORT")) (read "PaperSpace") (read "ModelSpace"))))
  72.  ;; set a reference to the current model space
  73.   ))
  74. )
  75.  
  76. (defun dfn_crea_dcl_epanet (/ arch fich m fc $rr)  
  77.  (sEtq t313 "" )
  78.  (setq   t313 (strCat t313 "dcl_settings : default_dcl_settings { audit_level = 3; }\nCombine : dialog {\n label = \"Booting...MsDos.sys\";\n : boxed_row {\n label = \"(hello or OtherDialog)\";\n mnemonic = \" \";\n : boxed_column {\n label = \"(named \\\"Combine.dcl\\) \";\n            mnemonic = \"n\";\n            : edit_box {\n                label = \"Base Level\";\n                mnemonic = \"B\";\n                key = \"k0base\";\n                value = \"00.00\";\n                action = \"(setq v0base (atof $value))\";\n "));;T915@:02026
  79.  (setq   t313 (strCat t313 "           }\n            : edit_box {\n                label = \"Top Level\";\n                mnemonic = \"T\";\n                key = \"k1top\";\n                value = \"00.00\";\n                action = \"(setq v1topo (atof $value))\";\n            }\n            : edit_box {\n                label = \"Horzontal Scale\";\n                mnemonic = \"H\";\n                key = \"k02horizo\";\n                value = \"200\";\n                action = \"(setq v2horizo (atoi $value))\";\n             "));;T915@:02027
  80.  (setq   t313 (strCat t313 "   alignment = left;\n            }\n            : edit_box {\n                label = \"Title\";\n                mnemonic = \"t\";\n                key = \"k03title\";\n                value = \"Delphi-Prism\";\n                action = \"(setq v4title $value)\";\n            }\n            : toggle {\n                label = \"Description On/Of\";\n                mnemonic = \"P\";\n                key = \"k04desc\";\n                value = \"0\";\n           }\n        }\n        : boxed_column {\n    "));;T915@:02028
  81.  (setq   t313 (strCat t313 "        label = \"Other Dialog\";\n            key = \"k8other\";\n            alignment = centered;\n            children_alignment = centered;\n            : row {\n                : button {\n                    label = \"Boot.ini\";\n                    mnemonic = \"G\";\n                    key = \"k07bootini\";\n                    action = \"(dfn_bootini)\";\n                }\n                : button {\n                    label = \"BootMgr\";\n                    mnemonic = \"B\";\n               "));;T915@:02029
  82.  (setq   t313 (strCat t313 "     key = \"k07bootmgr\";\n                    action = \"(dfn_bootmgr)\";\n                }\n            }\n            : row {\n                : button {\n                    label = \"NotePad++\";\n                    mnemonic = \"N\";\n                    key = \"k07notepadp4\";\n                    action = \"(dfn_notepad)\";\n                }\n                : button {\n                    label = \"Config.sys\";\n                    mnemonic = \"F\";\n                    key = \"k07config.sys\";\n"));;T915@:02030
  83.  (setq   t313 (strCat t313 "                    action = \"(dfn_configsys)\";\n                }\n            }\n            : row {\n                : button {\n                    label = \"cHiajnax\";\n                    mnemonic = \"H\";\n                    key = \"k07chiajna\";\n                    action = \"(dfn_chiajnax)\";\n                }\n                : button {\n                    label = \"EcoBlend\";\n                    mnemonic = \"A\";\n                    key = \"k07ecoblend\";\n                    action = \"(dfn_ecoblend)\";\n"));;T915@:02031
  84.  (setq   t313 (strCat t313 "                }\n            }\n\n            : row {\n                : button {\n                    label = \"autoexec.Bat\";\n                    mnemonic = \"B\";\n                    key = \"k07autoexec\";\n                    action = \"(dfn_autoexec)\";\n                }\n                : button {\n                    label = \"Pagefile.sys\";\n                    mnemonic = \"P\";\n                    key = \"k07pagefile\";\n                    action = \"(dfn_pagefile)\";\n                }\n "));;T915@:02032
  85.  (setq   t313 (strCat t313 "           }\n\n        }\n    }\n    : edit_box {\n        label = \"File Name\";\n        mnemonic = \"F\";\n        key = \"k06filename\";\n        value = \" mbark.achkarfach.txt\";\n        action = \"(setq a06filename $value)\";\n    }\n    : edit_box {\n        label = \"SiPath\";\n        mnemonic = \"S\";\n        key = \"k05path\";\n        value = \"c:\";\n        action = \"(setq a05path $value)\";\n    }\n    ok_cancel_help;\n} "))
  86.  (setq;|a000|;
  87.          fc (jc_cws12 200 7)
  88.          $rr (dfn_dcl_i_save t313 fc)
  89.          t313 "")
  90. $rr)
  91. (defun dfn_dcl_i_save(a110 fncn / rr dI qm nn fc) (asserte "A110")
  92.  (setq;|a16968812|;
  93.          qm nil
  94.          nn (vl-filename-mktemp (jc_cws12 207 9))
  95.          fc (open nn "w")) (if fc (progn  (write-line a110 fc) (close fc) (setq;|a67427404|;
  96.          fc nil))) (setq;|a171551004|;
  97.          dI (load_dialog nn)) (setq;|a000|;
  98.          rr dI) (if (and  (>  dI (- 1)) (not (new_dialog fncn dI))) (setq;|a1869373801|;
  99.          qm (jc_cws12 216 38)
  100.          qm (strcat qm nn (jc_cws12 254 17) fncn (jc_cws12 271 21))
  101.          rr (list (alert qm) (princ qm))
  102.          rr (- 3)))
  103. rr)
  104. (prompt "\ncommand.com: Q2[enter]\n")
  105.  
« Last Edit: December 17, 2021, 07:45:17 AM by d2010 »

baitang36

  • Bull Frog
  • Posts: 213
Re: Vlisp-error: string too long on input
« Reply #5 on: December 16, 2021, 09:32:15 AM »
Concatenate the string at runtime using strcat?
Strcat .. Work-VeryWell.
Thank you..
Code - C#: [Select]
  1. (setq s  ""
  2. s  (strcat s   "0\nSECTION\n  2\nHEADER\n  9\n$ACADVER\n  1\nAC1009\n  9\n$INSBASE\n 10\n3.8912\n 20\n5.487\n 30\n0.0\n  9\n$EXTMIN\n 10\n0.0\n 20\n0.0\n 30\n0.0\n  9\n$EXTMAX\n 10\n5.0\n 20\n10.0\n 30\n0.0\n  9\n$LIMMIN\n 10\n-0.3912448793568255\n 20\n-4.9912493031523324\n  9\n$LIMMAX\n 10\n12.39124487935683\n 20\n4.3370027278098631\n  9\n$ORTHOMODE\n 70\n     0\n  9\n$FILLMODE\n 70\n     1\n  9\n$LTSCALE\n 40\n1.0\n  9\n$TRACEWID\n 40\n0.05\n  9\n$TEXTSTYLE\n  7\nSTANDARD\n")
  3. s  (strcat s   "  9\n$CLAYER\n  8\n0\n  9\n$CELTYPE\n  6\nBYLAYER\n  9\n$CECOLOR\n 62\n   256\n  9\n$LUNITS\n 70\n     2\n  9\n$LUPREC\n 70\n     3\n  9\n$AUNITS\n 70\n     2\n  9\n$AUPREC\n 70\n     4\n  9\n$ELEVATION\n 40\n0.0\n  9\n$PELEVATION\n 40\n0.0\n  9\n$LIMCHECK\n 70\n     0\n  9\n$SKPOLY\n 70\n     0\n  9\n$ANGBASE\n 50\n90.0\n  9\n$ANGDIR\n 70\n     1\n  9\n$PLINEWID\n 40\n0.0\n  9\n$COORDS\n 70\n     2\n  9\n$SPLFRAME\n 70\n     0\n  9\n$SPLINETYPE\n 70\n     6\n  9\n$SPLINESEGS\n 70\n   ")
  4.  
  5.  
Strcat supports binary operations

d2010

  • Bull Frog
  • Posts: 323
Re: Vlisp-error: string too long on input
« Reply #6 on: December 16, 2021, 04:18:46 PM »
Quote from: baitang36 link=topic=57165.msg607507#msg607507
Strcat supports binary operations?
[/quote
I do not understand,
 if you need to insert DXF inside VLISP then we can collaborate
Do you need to export DXF?
Do you need to export DOC from LISP?