Testing strings/floats/ints

Discussion in 'AutoCAD' started by shanesparks, Dec 16, 2003.

  1. shanesparks

    shanesparks Guest

    Does anyone know how to test for the validity
    of a string, float or int without producing an error
    if not a valid test. We can test for validity of a list
    with listp, but when we try to test with something
    like strcat for a string it will crash if fed a real.

    Maybe there is something easy, but I have not found it
    yet.

    Shane
     
    shanesparks, Dec 16, 2003
    #1
  2. It's tempting to write code for you, but generally speaking, you should know the data type you are dealing with and use it accordingly rather than relying on a convert all function like vl-princ-to-string.

    A starter might be to look / read up on the lisp functions -- type, itoa, rtos, vl-princ-to-string, vl-symbol-name ...

    Cheers.
     
    michael puckett, Dec 16, 2003
    #2
  3. shanesparks

    CJ Follmer Guest

    try the function TYPE to check what a variable is.

    cj
     
    CJ Follmer, Dec 19, 2003
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.