Author Topic: same function...different result  (Read 1525 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
same function...different result
« on: May 30, 2017, 11:17:29 AM »
Hi all,...i'm actually experenting new bug...
with (ver)

Code: [Select]
(vl-string-subst "" "Visual LISP " "Visual LISP 2017 (en)")
;result =   "2017 (en)"

(vl-string-subst "" "Visual LISP " "Visual LISP 2012 (fr)")
;result =    "Visual LISP 2012 (fr)"

?? anyone already have something like that ?

Keep smile...

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: same function...different result
« Reply #1 on: May 30, 2017, 11:36:22 AM »
Works for me - AutoCAD Architecture 2017
James Buzbee
Windows 8

Crank

  • Water Moccasin
  • Posts: 1503
Re: same function...different result
« Reply #2 on: May 30, 2017, 11:47:20 AM »
Looks like a bug in Acad2012 has been fixed.
Vault Professional 2023     +     AEC Collection

Andrea

  • Water Moccasin
  • Posts: 2372
Re: same function...different result
« Reply #3 on: May 30, 2017, 12:05:26 PM »
ok Thanks....
I thought i was missunderstanding the Vlisp function... :)

Keep smile...

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: same function...different result
« Reply #4 on: May 30, 2017, 12:51:12 PM »
How about:
Code - Auto/Visual Lisp: [Select]
  1. (substr (ver) 13)

To check the 'bug', what does this return in both versions?:
Code - Auto/Visual Lisp: [Select]
  1. (vl-string->list (ver))

Andrea

  • Water Moccasin
  • Posts: 2372
Re: same function...different result
« Reply #5 on: May 30, 2017, 01:38:22 PM »
Thanks Lee...

I use

Code: [Select]
(read (substr (ver) 13 4))

:)
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: same function...different result
« Reply #6 on: May 30, 2017, 01:44:53 PM »
or....

Code: [Select]
(substr (setq caption (vla-get-caption (vlax-get-acad-object)))
        (- (vl-string-search "-" caption) 4) 4
        )
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: same function...different result
« Reply #7 on: May 30, 2017, 01:58:45 PM »
or...

Code: [Select]
(read
(substr
    (setq prNg (vl-registry-read (strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key)) "ProductNameGlob"))
    (- (strlen prNg) 3)
    )
)
Keep smile...