Good afternoon,
rs = TableView"\(table)".dataSet; // table = 1
Runtime Error
Unable to find dataSet into class String
Anyway around this ?
Likely a simple solution but turkey coma is having its effect.
Thanks
Good afternoon,
rs = TableView"\(table)".dataSet; // table = 1
Runtime Error
Unable to find dataSet into class String
Anyway around this ?
Likely a simple solution but turkey coma is having its effect.
Thanks
Really don't understand what you are trying to do... the error is right, you are trying yo ask for dataSet to a String in this example.
string interpolation for TableView1 --> loading tableviews,
I have 3 TableViews ( 1,2,3 ) which are loaded in loop with rs = Tableview(x).dataset , for loading each TableView where x is a variable - table = 1,2 or 3. Not clear how Gravity interprets the dot notation TableView1.dataSet
vs TableView(x).dataSet
Of course I had the statement backwards ;
TableView"\(table)".dataSet = rs; which still has a an error
Semantic Error
Wrong assignment expression.
I am really sorry @Joel_Eisenstat but I still do not understand what you are trying to do...
It is likely simple but in another area ( building a calendar control) a loop is required to populate calendar cells - button objects . I am attempting to name the button object using a variable - for example C7 with C"(i)" where i = 7. My previous IDE this was done as C[i] but I cannot seem to find my way with gravity.
for (var i in 1...10) { var name = "C" + i; Console.write(name); }
result is:
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
Thanks Marco but still obtaining error for ;
//highlight todays date
var dd = (day + offset) - 1; // formula for todays cell
var todaycolour = Color.red;
var c = "C" + dd; // dd = 36
c.backgroundColor = todaycolour; // c = C36
Runtime Error
Unable to find backgroundColor into class String
@Joel_Eisenstat C36 is not a color. If you want a string to be used as a Color then it needs to be a hexadecimal string 6 characters long (or 8 characters if you need to specify the opacity). For example: "A68484"
Ok can do that but C36 is supposed to represent a button object,
C36.backgroundColor = todaycolour; will work
var c = "C" + dd; // dd = 36
c.backgroundColor = todaycolour; doesn't work
Creo doesn't see 'c' as button object even though it is C36 , a previous declared object ?
C36 is a String, it cannot be a Button Object.
Ok in Creo if the name of an object is is calculated, as in C36, can it be used for changing property values of the named object - .text , hidden, etc ?
What you really need is a way to obtain a Creo object starting from its name.
Let me think a bit more about this request.
Exactly . That would be great help, especially as I move to classes and a proper framework.