String from GETCFG to List for new_dialog - Possible?

String from GETCFG to List for new_dialog - Possible?

scot-65
Advisor Advisor
554 Views
3 Replies
Message 1 of 4

String from GETCFG to List for new_dialog - Possible?

scot-65
Advisor
Advisor

Due to possible R/W permission issues at the user level, I would like to store

a dialog position value using SETCFG.

 

Initially this will be set to '(-1 -1).

 

Using GETCFG, the value returned is a string and new_dialog will only accept a list.

 

How to convert this String "'(-1 -1)" to a List '(-1 -1)?

 

 

Thanks in advance.

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
555 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor

@scot-65 wrote:

How to convert this String "'(-1 -1)" to a List '(-1 -1)?


Hi Scot,

 

something like this, perhaps

_$ (cadr (read "'(-1 -1)"))
(-1 -1)

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 4

scot-65
Advisor
Advisor

Thank You my friend, it helped.

I also had issue going the other way - recording to, and was able to resolve.

 

For future searches (and possible Kudos), here are the related parts:

 

;set a gremlin (session variable) from a call to getcfg so
;as not having to read the configuration file every time.
;place before the call to new_dialog: (if (not USER_LCVD) ;dialog position (if (setq a (getcfg "AppData/LCVD")) (setq USER_LCVD (cadr (read a))) (setq USER_LCVD '(-1 -1)) );if );if

 

;this snippet will work for both single and
;repeating dialog boxes:

(new_dialog "LayConv" dcl_id "" USER_LCVD)

 

;record the position of the dialog into the gremlin:

 (action_tile "accept" "(LCV_GET)(setq USER_LCVD (done_dialog 1))")

;and finally, record the gremlin to the configuration file
;(this is set up for a looping dialog):

 (unload_dialog dcl_id)(setq dcl_id nil)
 (setcfg "AppData/LCVD" (vl-princ-to-string USER_LCVD))

 

Thanks again, Henrique.

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

You're welcome, Scot.
Glad I could help

Henrique

EESignature

0 Likes