Modify

Opened 12 years ago

Last modified 2 years ago

#2652 assigned Feature Request

Allow ExpandVarStrings to expand com properties as well.

Reported by: this-is-me Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

The ExpandVarStrings option does not currently expand if the variable is actually a com property. It would be nice if expansion could happen on these properties as well.

Opt("ExpandVarStrings", 1)

Global $objJSONScript = ObjCreate("ScriptControl")
With $objJSONScript
    .language = "Jscript"
    .AddCode("Array.prototype.item=function(i){return this[i]};Object.prototype.item=function(i){return this[i]};Object.prototype.addProp=function(prop,val){eval('this.'+prop+'='+val)};")
EndWith

$vars = JSON('{' & _
'"widget": {' & _
'    "debug": "on",' & _
'    "window": {' & _
'        "title": "Sample Konfabulator Widget",' & _
'        "name": "main_window",' & _
'        "width": 500,' & _
'        "height": 500' & _
'    }' & _
'}' & _
'}')

MsgBox(0,"",$vars.widget.window.title)
MsgBox(0,"","$vars.widget.window.title$")

Func JSON($def = "{}")
    $objJSONScript.Eval("var z=" & StringReplace($def, "\", "\\"))
    Return $objJSONScript.Eval("z")
EndFunc   ;==>JSON

Attachments (1)

113.au3 (1.4 KB ) - added by anonymous 3 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by J-Paul Mesnage, 5 years ago

Owner: set to J-Paul Mesnage
Status: newassigned

Hi,
I introduce a new option to expand expression
Opt("ExpandExpStrings", 1)
to expand string containing expression such as "($vars.widget.window.title)"
a COM evariable must be evaluated before it can be used.

Fix sent to Jon

by anonymous, 3 years ago

Attachment: 113.au3 added

comment:2 by J-Paul Mesnage, 2 years ago

Owner: changed from J-Paul Mesnage to Jon

Modify Ticket

Action
as assigned The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.