Author Topic: List Question  (Read 4132 times)

0 Members and 1 Guest are viewing this topic.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
List Question
« on: July 15, 2004, 10:09:14 AM »
Is there a maximum number of characters that can be in a list?
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

SMadsen

  • Guest
List Question
« Reply #1 on: July 15, 2004, 10:16:59 AM »
Of characters? Do you mean maximum number of items in a list or maximum number of characters in a string?

To either: no maximum ('cept for memory limitations)

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
List Question
« Reply #2 on: July 15, 2004, 10:21:04 AM »
Quote

Of characters? Do you mean maximum number of items in a list or maximum number of characters in a string?


Yes, Sorry I mean items.
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
List Question
« Reply #3 on: July 15, 2004, 12:42:56 PM »
never tried, but there is a 1024 character limit on certain strings
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
List Question
« Reply #4 on: July 15, 2004, 01:33:09 PM »
FWIW, here is the string length of an Mtext object in one of my drawings. I have no problem setting/retrieving a variable assigned to the string.

Command: (strlen (vla-get-textstring (vlax-ename->vla-object (car (entsel)))))
Select object: 7987

Jeff

SMadsen

  • Guest
List Question
« Reply #5 on: July 15, 2004, 02:44:37 PM »
Just did a test with this:
Code: [Select]
(defun strLenTest (/ astr)
  (defun makeFirstString (/ str a)
    (setq a 65 str "")
    (repeat 1024
      (setq str (strcat str (chr a))
            a   (cond ((<= a 122) (1+ a))(65)))
    )
    str
  )
  (setq astr (makeFirstString))
  (while (not (vl-catch-all-error-p astr))
    (setq astr (vl-catch-all-apply 'strcat (list astr astr)))
    (princ (strlen astr))(terpri)
  )
)


It got to make a string with 268,435,456 characters and then ran into an access violation when trying to concatenate two times 268,435,456 characters.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
List Question
« Reply #6 on: July 15, 2004, 03:04:23 PM »
this is what I get;
Code: [Select]

Command: (strlentest)
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
4194304
8388608
16777216
33554432
67108864
134217728
; error: ; error:
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
List Question
« Reply #7 on: July 15, 2004, 04:22:36 PM »
Probably depends on available heap space. But 134,217,728 is a pretty long string, too :)

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
List Question
« Reply #8 on: July 15, 2004, 04:49:30 PM »
Same here..

Code: [Select]

Command: (STRLENTEST)
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
4194304
8388608
16777216
33554432
67108864
134217728
268435456
; error: ; error:
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
List Question
« Reply #9 on: July 15, 2004, 10:31:08 PM »
Perhaps I should have made myself a little clearer ... try to put a string in a lisp file that is greater than 1024 characters...you can strcat them together till you run out of heap space, but the string itself must be below that length.... I had that problem in some programs I had written and had to put the items in dofferent variables first, then strcat them together in the program.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

SMadsen

  • Guest
List Question
« Reply #10 on: July 16, 2004, 03:13:12 AM »
Quote from: Keith
Perhaps I should have made myself a little clearer ...

Oh, the test was not to prove you wrong or anything .. it was simply pure curiosity.

I know there are limitations on string input and strings in entity data and such. Personally, I've not experienced a limitation on strings in lisp files - probably because I never stuffed a 1024+ character string anywhere. Are you referring to limitations for I/O functions?