Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Setting value in an array with SetAttribute

Setting value in an array with SetAttribute 5 years 2 hours ago #10272

  • FoxMan
  • FoxMan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 10
  • Karma: 3
Hi Proview Experts,

I’m trying to set a boolean value in an array from a script with „SetAttribute“, but no success.

The tree looks like shown in the attached picture, and I use the command:

SetAttribute( “heks-ISP01-WCSuedOst2OG.Zeitplan.WeekDays[0].Hours[0]”, 1);

Reading the value with “GetAttribute” works as expected.

I‘m using Proview V5.5.0-1 compiled from source.

Any suggestions?

Thanks in advance
Martin
Attachments:
The administrator has disabled public write access.

Setting value in an array with SetAttribute 4 years 11 months ago #10274

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Martin,

I've tried to reproduce this fault but I'm not able to do that. Do you have write access? Can you write other boolean?

I'm a little confused about the 'Used' boxes for Bezeichnung and Out. Is it a function object? What kind of attribute types have you used (Attribute or Intern).

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: FoxMan

Setting value in an array with SetAttribute 4 years 11 months ago #10277

  • FoxMan
  • FoxMan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 10
  • Karma: 3
Hi Claes,

I do not use a runtime script, I'm working in the configurator and try to preset some values from LibreOffice Calc (csv-file). Write permissions should not matter here (?). Farther down in the tree I have an integer array, in which I can set the values without problems:

SetAttribute( “heks-ISP01-WCSuedOst2OG.Zeitplan.SetCmd[0]”, 1); works as expected

For the moment I've used the Backupfile Utility to preset the values. From there I can see, that I'm using the correct name.

From the attached pictures you can see the class definitions and the names in the Backup Utility.

When I run

set attribute /name=heks-ISP01-WCSuedOst2OG-Zeitplan /attribute=WeekDays[0].Hours[0] /value=1

from the wtt command line, I get the message

Parameter type not correct

in the ProviewR console.

set attribute /name=heks-ISP01-WCSuedOst2OG-Zeitplan /attribute=WeekDays[1].Hours[1] /value=1

gives

heks-ISP01-WCSuedOst2OG-Zeitplan.WeekDays[1] = (Y/N/Q/A): Parameter type not correct

Any suggestions of what I did wrong?

Kind regards
Martin
Attachments:
Last Edit: 4 years 11 months ago by FoxMan. Reason: Problems with the attachements
The administrator has disabled public write access.

Setting value in an array with SetAttribute 4 years 11 months ago #10278

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi Martin,

I just assumed that it was an xtt script. In the development script, I found that it's using some old piece of code with an oldfashioned handling of arrays that doesn't work for arrays in a class inside another class. This has to be rewritten. Unfortunately 'set attribute' uses the same code so I can't see any way around it.

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.399 seconds