Author Topic: Limits of 256 ?  (Read 3498 times)

0 Members and 1 Guest are viewing this topic.

Patrick_35

  • Bull Frog
  • Posts: 276
  • Rennes, France
Limits of 256 ?
« on: July 21, 2008, 11:23:21 AM »
Hello,

Following the example joint, I choose all the list and I do find that a maximum of 256 elements of the selection (variable sel).
Is there a trick to overcome these 256 ?

Code: [Select]
(defun c:test(/ fic fil n txt)
  (setq fil (vl-filename-mktemp "tmp.dcl")
fic (open fil "w")
  )
  (foreach txt '("test : dialog {"
"key = \"titre\";"
"is_cancel = true;"
"width = 20;"
": list_box {label = \"Test\"; key= \"sel\"; height = 30; multiple_select=true;}"
"spacer;"
"ok_cancel;"
"}"
)
    (write-line txt fic)
  )
  (close fic)
  (setq fic (load_dialog fil))
  (new_dialog "test" fic "")
  (start_list "sel")
  (setq n -1)
  (repeat 500
    (add_list (itoa (setq n (1+ n))))
  )
  (end_list)
  (action_tile "sel"    "(setq sel $value)")
  (action_tile "accept" "(done_dialog)")
  (action_tile "cancel" "(done_dialog)")
  (start_dialog)
  (unload_dialog fic)
  (vl-file-delete fil)
  sel
)

Thanks

@+
The shape even of the pyramids of Egypt shows that already the workmen tended to make some less and less.
Will Cuppy, 1884-1949.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10400
Re: Limits of 256 ?
« Reply #1 on: July 21, 2008, 11:31:27 AM »
I got all 499 using ACAD2K.
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Patrick_35

  • Bull Frog
  • Posts: 276
  • Rennes, France
Re: Limits of 256 ?
« Reply #2 on: July 21, 2008, 11:35:14 AM »
Ah !

With my A2006 & A2009, only 256  :?

There must be a parameter to settle in Autocad, see windows.

Thanks cab

@+
The shape even of the pyramids of Egypt shows that already the workmen tended to make some less and less.
Will Cuppy, 1884-1949.

Crank

  • Swamp Rat
  • Posts: 1492
Re: Limits of 256 ?
« Reply #3 on: July 21, 2008, 12:01:25 PM »
Just to confirm: I see 0-499 in Acad2008 and Acad2009.
Sorry, misunderstood :oops: The max. items of sel is 256, the list can be 500000+ items long :-o (help says only 32768).
« Last Edit: July 21, 2008, 04:30:50 PM by Crank »
Vault Professional 2022     +     AEC Collection

VovKa

  • Water Moccasin
  • Posts: 1504
  • Ukraine
Re: Limits of 256 ?
« Reply #4 on: July 21, 2008, 12:07:45 PM »
using this one you'll get a string no longer than 2001 characters
Code: [Select]
(action_tile "sel"    "(setq sel (get_tile \"sel\"))")

Jeff_M

  • King Gator
  • Posts: 4042
  • C3D user & customizer
Re: Limits of 256 ?
« Reply #5 on: July 21, 2008, 12:58:34 PM »
using this one you'll get a string no longer than 2001 characters
I am getting the return of 0 - 255, which is 913 characters.....

CAB, Crank-
ARe you guys selecting all of the numbers in the Dialog then selecting OK? THe dialog shows all 500 numbers, but the return value to the Text window only returnes 0-255, in 2002 & 2008 for me. This appears to be a limitation of the DCL's $value for a multi-select listbox. So yes, I would say the limiting factor is 256 items, not the actual output.

VovKa

  • Water Moccasin
  • Posts: 1504
  • Ukraine
Re: Limits of 256 ?
« Reply #6 on: July 21, 2008, 01:28:04 PM »
i don't understand why $value differs from get_tile. it's kinda awkward.
i wonder how CAB managed to get 499 items using acad2k, mine truncates the string to 255 characters.
both 2k4 and 2k5 return nil if the string is longer than 2001

CAB

  • Global Moderator
  • Seagull
  • Posts: 10400
Re: Limits of 256 ?
« Reply #7 on: July 21, 2008, 01:32:16 PM »
Code: [Select]
Command: test
"495 496 497 498"

Command:
Command: test  <----<<  Selecting all 500 yields this
"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
245 246 247 248 249 250 251 252 253 254 255"

Command: test
"254 255 256"

Command:
Command: test
"257 258 259"

Command:
Command: test
"254 255 256 257 258 259 260 261"

Command:
Command: test
"257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
496 497 498 499"

Command:
Command:
8-)
« Last Edit: July 21, 2008, 01:35:33 PM by CAB »
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

VovKa

  • Water Moccasin
  • Posts: 1504
  • Ukraine
Re: Limits of 256 ?
« Reply #8 on: July 21, 2008, 01:49:19 PM »
the maximum that i can get, using get_tile
Code: [Select]
Command: test
"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
525 526 527"

CAB

  • Global Moderator
  • Seagull
  • Posts: 10400
Re: Limits of 256 ?
« Reply #9 on: July 21, 2008, 02:12:43 PM »
I believe the limiting factor is string length of the return value.
In ACAD 2K the get_tile string is clipped at 254 while the "(setq sel $value)" varies
at 933-1022 for my limited testing.
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Patrick_35

  • Bull Frog
  • Posts: 276
  • Rennes, France
Re: Limits of 256 ?
« Reply #10 on: July 22, 2008, 07:14:59 AM »
Thanks for your replies guys and for the tip of get_tile.

@+

The shape even of the pyramids of Egypt shows that already the workmen tended to make some less and less.
Will Cuppy, 1884-1949.