Author Topic: Getting extra charcters when using RTOS  (Read 2253 times)

0 Members and 1 Guest are viewing this topic.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Getting extra charcters when using RTOS
« on: April 12, 2011, 04:04:29 PM »
So I started with some of Kerry's code and then realizing it is spitting out in real numbers and I need to convert to string form.  When I tried to do it I am getting extra characters.  Why???  If I remove the rtos, it retuns the real number in the correct form.

Quote
"3'-3 1/4\" "
_$

it should read 3'-3 1/4"

Code: [Select]
(SETQ DimEnt2  (CAR (ENTSEL "\nSelect Height Dimension :") )
         DimObj2  (VLAX-ENAME->VLA-OBJECT DimEnt2)
         Measurement2 (rtos (VLAX-GET DimObj2 'Measurement) 4 6)
)
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Getting extra charcters when using RTOS
« Reply #1 on: April 12, 2011, 04:11:03 PM »
Try the two  :-) :

(alert "3'-3 1/4\"")

(alert "3'-3 1/4")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Getting extra charcters when using RTOS
« Reply #2 on: April 12, 2011, 04:19:31 PM »
Okay?  :|   That is weird.

But I can see that I did not take it far enough.  I was just looking at what was being returned in watch window thinking that was what I was going to get.

Thank you.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Getting extra charcters when using RTOS
« Reply #3 on: April 12, 2011, 04:25:03 PM »
Okay?  :|   That is weird.

But I can see that I did not take it far enough.  I was just looking at what was being returned in watch window thinking that was what I was going to get.

Thank you.

No prob  :-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Getting extra charcters when using RTOS
« Reply #4 on: April 12, 2011, 04:25:35 PM »
Ask yourself: How does one express a quotation mark in a string without signifying the end of the string itself?

The same applies to the backslash - consider the following:

Code: [Select]
(alert "a\tb")
Code: [Select]
(alert "a\\tb")

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Getting extra charcters when using RTOS
« Reply #5 on: April 12, 2011, 04:30:21 PM »
Or try (alert (chr 34))  :lol:

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Getting extra charcters when using RTOS
« Reply #6 on: April 12, 2011, 04:31:02 PM »

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Getting extra charcters when using RTOS
« Reply #7 on: April 12, 2011, 04:34:45 PM »
Ask yourself: How does one express a quotation mark in a string without signifying the end of the string itself?

Oooooohhhhhh. 
Okay that explains it.  Thanks.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans