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 *"**** **:"*)) (*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
Gérald