Author Topic: Prompt echo timing  (Read 2893 times)

0 Members and 1 Guest are viewing this topic.

CincyJeff

  • Newt
  • Posts: 89
Prompt echo timing
« on: November 20, 2015, 08:49:19 AM »
I have a routine that copies a 6 meg Excel file across a not-so-fast network. I have a princ statement informing the user that the file is copying placed before the vl-file-copy call, but the command line does not echo the prompt until after the file has copied. I've tried (princ), (graphscr), and (grread t) to no avail.
Does anyone know, and be willing to share, how to force the command line to update before the copy runs?

hmspe

  • Bull Frog
  • Posts: 362
Re: Prompt echo timing
« Reply #1 on: November 20, 2015, 08:57:21 AM »
I think we would need to see the routine to help with this.
"Science is the belief in the ignorance of experts." - Richard Feynman

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Prompt echo timing
« Reply #2 on: November 20, 2015, 09:03:21 AM »
Use \n after the princ string
(princ  "\n Working - Please Wait\n")
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CincyJeff

  • Newt
  • Posts: 89
Re: Prompt echo timing
« Reply #3 on: November 20, 2015, 09:14:17 AM »
Thanks for the replies.
The \n did not make any difference.
The code is:
Code - Auto/Visual Lisp: [Select]
  1. (princ (strcat "\nCopying \n" networkfile " to \n" fullname ".\n"))
  2. (setq itcopied (vl-file-copy networkfile fullname))
  3. (EXCL:OPEN fullname "Engineering Request" t)
The prompt does not appear in the command line until Excel is open.

ChrisCarlson

  • Guest
Re: Prompt echo timing
« Reply #4 on: November 20, 2015, 09:20:44 AM »
Do you really need each text on it's own line? What happens when you replace the princ with an alert?

Code - Auto/Visual Lisp: [Select]
  1. (alert (strcat "\nCopying " networkfile " to " fullname " ."))
  2.  

CincyJeff

  • Newt
  • Posts: 89
Re: Prompt echo timing
« Reply #5 on: November 20, 2015, 09:28:30 AM »
Yes, the paths are very long and difficult to read if they wrap. I also do not want to require the user to make a selection. I just want to inform them that a process is working when they experience a delay. Impatient users will escape out even though the program is running properly. It's a small point but it can really be more user friendly. I just don't understand why the code isn't processed in order.

ChrisCarlson

  • Guest
Re: Prompt echo timing
« Reply #6 on: November 20, 2015, 09:44:11 AM »
I understand but we are trouble shooting. It's just a test to see if a prompt will pop up before the vl-file-copy.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Prompt echo timing
« Reply #7 on: November 20, 2015, 09:44:16 AM »
Try this
  • (princ (strcat "\nCopying \n" networkfile " to \n" fullname "."))
  • (print)
  • (setq itcopied (vl-file-copy networkfile fullname))
  • (EXCL:OPEN fullname "Engineering Request" t)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CincyJeff

  • Newt
  • Posts: 89
Re: Prompt echo timing
« Reply #8 on: November 20, 2015, 12:38:18 PM »
Chris,
The alert box does pop up before the vl-file-copy. What does that really tell us?

CAB,
The (print) statement did not make a difference.

ChrisCarlson

  • Guest
Re: Prompt echo timing
« Reply #9 on: November 20, 2015, 12:42:29 PM »
I was just checking to make sure it's not in a loop or something funky. princ is finicky at times and some quick research quickly confirms this

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/princ-lines-not-showing-up/m-p/4878458#M320422

CincyJeff

  • Newt
  • Posts: 89
Re: Prompt echo timing
« Reply #10 on: November 20, 2015, 12:46:47 PM »
Thanks for the link and your input, although I'm not happy about the content. It looks like I'll just have to inform the users of how AutoCAD works.

ChrisCarlson

  • Guest
Re: Prompt echo timing
« Reply #11 on: November 20, 2015, 12:48:55 PM »
Is it a substantial delay?

CincyJeff

  • Newt
  • Posts: 89
Re: Prompt echo timing
« Reply #12 on: November 20, 2015, 01:02:06 PM »
I wouldn't call it substantial, 15-20 seconds. It's not a big issue, just something that would be nice to have run in order. It doesn't do much good to display a prompt after the fact.

ChrisCarlson

  • Guest
Re: Prompt echo timing
« Reply #13 on: November 20, 2015, 01:34:54 PM »
What about....


Code - Auto/Visual Lisp: [Select]
  1. ;(princ (strcat "\nCopying \n" networkfile " to \n" fullname ".\n"))
  2. (setq itcopied (vl-cmdf "SHELL" (strcat "\"esentutl /y \"" networkfile \"" /d \"" fullname \""/o \"")))
  3. (EXCL:OPEN fullname "Engineering Request" t)
  4.  
  5.  

This will give you a progress bar, you just need to make sure you pass \\ for variables networkfile and fullname

CincyJeff

  • Newt
  • Posts: 89
Re: Prompt echo timing
« Reply #14 on: November 20, 2015, 03:29:39 PM »
Never heard of esentutl. I combined it with dos_exewait and it works beautifully. Thanks so much. My users will love the progress bar.