Author Topic: How to type SPACE in getstring  (Read 2305 times)

0 Members and 1 Guest are viewing this topic.

HasanCAD

  • Swamp Rat
  • Posts: 1422
How to type SPACE in getstring
« on: November 19, 2015, 04:41:28 AM »
Hi all
Iam trying to use getstring it is working but want to type SPACE
Code - Auto/Visual Lisp: [Select]
  1. (setq sprtr (getstring T "\nWhat is separator? "))
I want the seoarator to be " - "
the fist space does not come

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to type SPACE in getstring
« Reply #1 on: November 19, 2015, 05:18:40 AM »
Works for me !

Command: 'VLIDE
What is separator?  - - - - -
Command:
Command: !sprtr
" - - - - - "
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MickD

  • King Gator
  • Posts: 3658
  • (x-in)->[process]->(y-out) ... simples!
Re: How to type SPACE in getstring
« Reply #2 on: November 19, 2015, 03:00:07 PM »
Hi Kerry, I think the OP wants to be able to take a single space only as a separator for a csv file say, will the prompt accept just a single space " " as a valid string?

If not maybe some keyword options such as SPACE|COMMA|COLON<Other>: or similar could provide a work around?
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to type SPACE in getstring
« Reply #3 on: November 19, 2015, 07:53:55 PM »
Hi Mick,
I thought he wanted " - " < SPACE HYPHEN SPACE >

:) bit I've been incorrect before this as well ....
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MickD

  • King Gator
  • Posts: 3658
  • (x-in)->[process]->(y-out) ... simples!
Re: How to type SPACE in getstring
« Reply #4 on: November 19, 2015, 08:38:21 PM »
Hi Mick,
I thought he wanted " - " < SPACE HYPHEN SPACE >

:) bit I've been incorrect before this as well ....

Doh! Just noticed the last line in the OP, my bad, and apologies  :oops:
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How to type SPACE in getstring
« Reply #5 on: November 19, 2015, 08:46:41 PM »

No problems Mick.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.