Cancel
Showing results for 
Search instead for 
Did you mean: 

problem with "find" and "cursorX" function in Table

Pioneer
Pioneer

Hallo,

 

i have 2 column in table. And i want to find the Ydim of column. There is a function .GetColumnYDim to do this. But when i use find and .cursorX to get the column number. The pointer is alway equal 1. Here is my code:

 

var x,y:integer

Tabelle.find({1,1}..{*,1},.Modelle.Netzwerk.Einzelstation1)
x:=Tabelle.CursorX
Variable_X:=x
y:=Tabelle.getColumnYDim(x)
variable_Y:=y

 

And the Table:

table.PNG

 

The result is X=1,Y=3. But it should be X=2,Y=5.  

4 REPLIES

Re: problem with "find" and "cursorX" function in Table

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
you find with find the einzelstation1 in cell 1,1, so cursorX is one, that is right

getColumnYDim returns the number of rows in the given column, if you pass 1 --> it returns 3, this is also okay

if you want to read the number of entries in column2 you need to call
Tabelle.getColumnYDim(2)
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: problem with "find" and "cursorX" function in Table

Pioneer
Pioneer

I want to find the column using the object. How can i point to the column whose columnindex is .Modelle.Netzwerk.Einzelstation1? 

Re: problem with "find" and "cursorX" function in Table

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
you can use the Einzelstation1 directly as key for the column e.g.

Tabelle[einzelstation1,1]
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: problem with "find" and "cursorX" function in Table

Pioneer
Pioneer

I have already solve the problem with function .getColumnNo