#1 2017-06-02 18:22:12

fakie
Banned
Registered: 2016-10-28
Posts: 36

Replacement of variable name with variable value

Hi David!
I sometimes get a replacement when assigning a value to an entity...
ie:

ObjectSetProp "TestObj" "TotalRecords" "[TotalRecords]"

Will result in an entity called TestObj.28 = 28
Rather than TestObj.TotalRecords = 28

Any way to fix this - at the moment I do

ObjectSetProp "TestObj" "appTotalRecords" "[TotalRecords]"

which is a bit clunky I think..


This is my favourite quote.

Offline

#2 2017-06-02 18:28:54

fakie
Banned
Registered: 2016-10-28
Posts: 36

Re: Replacement of variable name with variable value

Don't worry - I solved it.
However, this could drive one nuts if you don't know about it..

Seems like

SetVar "TestObj.TotalRecords] [TotalRecords] "Number"

should be the preferred way to do this?

The variables/entities does not need to be created either..

SetVar "TestObj.SmileyFace] ["yeeeaaaaaah"] "String"

..will work, even though I never did an ObjectSetProp on SmileyFace

Cheers,
Fakie


This is my favourite quote.

Offline

#3 2017-06-02 19:58:16

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: Replacement of variable name with variable value

Hello fakie,

Your second post contains without doubt code that may works, but than appear not acceptable. I think you must choose the first approach (use another variable name) when you get this kind of issue.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.