I'am new to OriginLab and try to work on some data.
My question is; why do I get 2 different results by write the same code?
1. range rPGain = [Book2]1!Col(59);
2. int GS = -1+rHS[76]*6; (=59) range rPGain = [Book2]1!Col(GS);
For the first example I get a number as output but for the second example I get only a - as output.
And how can I make the second example working?
Thanks islan :)
Edit - I try to rephrase my problem:
I have to "Books" one is a database and in the oter I work with new data. For calculations I need information from the database, but it is not always the same column I need.
So how can one implement a variable column number in the range command? i.e.
int ColumnNumber = x; range database = [Book2]1!Col(ColumnNumber);
The COL( ) function can take numbers OR column names as an argument. When you said range rPGain = [Book2]1!Col(GS); Origin was looking for a column named "GS".
We also have the WCOL( ) function which ONLY expects a number. If text is passed to the function then we assume it is a numeric variable and interpret the value as the column number.
So, int ColumnNumber = x; range database = [Book2]1!WCol(ColumnNumber); should work.