See the top rated post in this thread. Click here

Results 1 to 2 of 2

Thread: How long is too long?

  1. #1
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default How long is too long?

    When I use this program, there's no way to stop it.
    I've been thinking of measuring the character length with STRLEN of Phrase$ and denying any that are too long.
    My question is how long is too long, and how short is too short?
    Or is there a way of canceling the routine in the middle?
    I've also been thinking of using SUBSTR to shorten the string length.


    Code:
    (defun c:SayIt ()
    
     (setq Phrase$ (getstring T "Enter string: "))
     (setq Phrase$l (strlen Phrase$))
     (if (< Phrase$l 256)
      (progn
    
       (vl-load-com)
       (setq sapi (vlax-create-object "Sapi.SpVoice"))
       (vlax-invoke sapi "Speak" Phrase$ 0)
       (vlax-release-object sapi)
    
     ));end progn/if
    
    
     (princ)
    );defun c:SayIt
    Attached Files Attached Files
    Last edited by aaronic_abacus; 2018-02-04 at 02:33 AM.

  2. #2
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    1

    Default Re: How long is too long?

    So, I settled for this. Now the program limits the character length to 1000, which takes less than 1.5 minutes to read.


    Code:
    (defun c:SayIt ()
     (setq Phrase$ (getstring T "Enter string: "))
     (setq Phrase$l (strlen Phrase$))
     (if (> Phrase$l 1000) (setq Phrase$ (substr Phrase$ 1 1000)))
     (vl-load-com)
     (setq sapi (vlax-create-object "Sapi.SpVoice"))
     (vlax-invoke sapi "Speak" Phrase$ 0)
     (vlax-release-object sapi)
     (princ)
    );defun c:SayIt
    Attached Files Attached Files
    Last edited by aaronic_abacus; 2018-02-05 at 12:22 AM.

Similar Threads

  1. 2011: lat long to v&h
    By mytt in forum AutoCAD General
    Replies: 3
    Last Post: 2013-05-07, 04:29 PM
  2. How long does it take? or ROI...
    By dandlf in forum Revit Architecture - General
    Replies: 10
    Last Post: 2009-02-18, 11:00 AM
  3. Long, long list of Keywords
    By rjcrowther in forum Revit - API
    Replies: 3
    Last Post: 2007-12-10, 08:22 AM
  4. How long does this take.....
    By DoTheBIM in forum Revit Architecture - General
    Replies: 27
    Last Post: 2005-03-09, 08:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •