Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Columnorder equals zero?
Message
 
À
10/05/2006 11:45:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01120588
Message ID:
01120723
Vues:
24
James,

I doubt there is an obvious answer to your question.
I believe that the answer lies somewhere in your code. And therefore the additinal information may help to see what is going on.


>Yuri --
>
>Sorry, but I don't see the relevance of your queries.
>
>My original question (still outstanding) has to do with how it is possible to have a column where the columnorder is zero. My understanding was that the values for columnorder were always ordinal numbers (1, 2, ... n).
>
>I am using a loop like
For Each loColumn in .Columns
so that loColumn refers to one of the columns in my grid (and is certainly not null). I have demonstrated that the value for columnorder for one of those columns is zero. How is that possible?
>
>Jim
>
>
>>In other languages like VB they may start counting from 0. Probably it is not the case, but what is the "current" column name? Does it happen on the very first column in the loop? What is isnull(locolumn)?
>>(You can get it from your onerror routine, I believe)
>>
>>
>>
>>>loColumn is the current column, as I loop through all columns (in a For Each loop).
>>>
>>>Note that this code works 99.99% of the time, and it only fails when I get a value (zero) for columnorder that is not possible, so all I'm trying to determine is how it is possible to get that zero value.
>>>
>>>Jim
>>>
>>>
>>>
>>>>What is loColumn, how do you declare/create it?
>>>>What is its .Name ?
>>>>
>>>>
>>>>>Yuri --
>>>>>
>>>>>My error is caused specifically because columnorder = 0. The error occurs in a routine that's exporting to Excel, and the error occurs because the following statement:
>>>>>
	lnColIndex=loColumn.ColumnOrder
>>>>>	lcColName=ExcelCellName(lnColIndex)
>>>>>
yields a gibberish name for the Excel column, because lnColIndex is zero. My error routine captures these values when the actual error occurs at a later line.
>>>>>
>>>>>Jim
>>>>>
>>>>>>Hi James,
>>>>>>
>>>>>>What is the error message ?
>>>>>>Why do you think that it is caused by columnorder = 0 ?
>>>>>>Do you have any on error routine that can identify the line of code and the code module where the error occurs?
>>>>>>
>>>>>>
>>>>>>>My users are sporadically getting errors that are caused by columnorder = 0 for a column. I cannot duplicate this.
>>>>>>>
>>>>>>>What gives? I thought columnorder values were ordinal numbers 1, 2, thru n. (Note that these errors are not occurring because of any programmatic or user change to columnorder; and when the user restarts the application and tried again, all works fine.)
>>>>>>>
>>>>>>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform