default text

I've done this, but I have forgotten.
I want to have a default text input for a lisp routine. I am wanting a routine that draws an arrow and places text for roof pitches. If I
remember, I have before set a global variable the first time through a routine and if the variable IS SET the getstring uses it in the prompt with a simple return using the default.
but the exact syntax escapes me at the moment.
make me feel real stupid. sample code snippet handy?
thanks.
roy
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I believe we have what you're looking for at http://www.caddproductivity.com/pickntext.htm
It's not Lisp but it should serve your purpose. All the features are described on the site. The software is free to use for 30 days.
Regards, snipped-for-privacy@caddproductivity.com
roy wrote:

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
This is a multi-part message in MIME format. --------------080002000402080603000808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit
Hello, i can give you a sample code :
*/;/**/****************************************************************************/* */;/**/;**/divers//**/ modified /**/getstring/**/ /**/ to keep las value in memory and purpose it as default /**//msg/**/ /**/var/* */;/**/**/**/ /**/argument/**/ /**/:/**/ /**/"message"/**/ /**/"varname"/* */;/**/** return : the variable value /**/
/*(*defun* pw_getstringmem ( msg var / tmp iget strdef ) (*if* (*eval* (*read* var)) (*setq* strdef (*eval* (*read* var)) iget *0*) */;/**/;/**/ /**/0/**/ value don't change anything /* (*setq* strdef *"**"* iget *1*) */;/**/;/**/0/**/ value suppress the possibility of return/* ) (*initget* iget) (*setq* msg (*strcat* msg *"**<"* strdef *"**>** **:"*)) (*while* (= *"**'"* (pw_1stcara (*setq* tmp (*getstring* 't msg)))) */;/**/;if the user zoom inside the command /*(*Prompt* *"**\ncannot** **enter** **zoom** **command"*) ) (*if* (/= tmp *"**"*) (*set* (*read* var) tmp) ) (*eval* (*read* var)) ) */;/**/;end code***************************************************************************/*
This routine contains also pw_1stcara that is defined in Powerclic library if you don't wish to install powerclic, you can remove the possibility to intercept zoom command Now this is a sample using pw_getstringmem and creating an aligned dimension:
*/;/**/;sample/**/ /**/of/**/ /**/routine/**/ /**/using/**/ /**/pw_gestringmem/* (*defun* c:mydim ( ) (*if* (*not* mydimtext) (*setq* mydimtext *"**Mydefaultvalue"*) ) (*command* *"**_dim"* *"**_aligned"* pause pause pause) (pw_getstringmem *"**\nDimension** **texte** **value** **?"* *"**mydimtext"*)*/;/**/;note/**/ /**/that/**/ /**/mydimtext/**/ /**/is/**/ /**/entered/**/ /**/as/**/ /**/string/* (*command* mydimtext) (*command* *"**_exit"*) )
What you must also note is that varname used by *pw_getstringmem* are global variable, don't give it a short name like "str" ... PowerClic library contains several commands like pw_getstringmem :
*pw_getintmem pw_getkwordmem pw_getrealmem pw_getdistmem * They can be used the same way
Grald
--
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
PowerClic: http://www.g-eaux.com/powerclic/explorer/english.html
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.