Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this an Assignment Bug in VFP 8.0?
Message
De
28/04/2003 15:46:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00782412
Message ID:
00782434
Vues:
14
Strictly a SWAG...

I wonder if the FOR statement operation has been revised to match the Help, which says "If the value of nIncrement is negative and the initial value nInitialValue is greater than the final value nFinalValue, the counter is decremented each time through the loop." to now need an nIncrement specified to cause -1 to be the STEP value???

What of the 2 values are you expecting?

good luck


>Hi
>
>The following code is in the Init method of a command group that is contained in another container which is contained in another container. The problem is highlighted below. This code worked perfectly in VFP 7.0 and works properly in VFP 8.0 when it is not contained in the Init Method of the command group.
>
>The code basically sizes a set of navigation buttons and determines if a second row of buttons should be setup to insure the buttons are not too small.
>
>Any ideas about what the problem might be? Am I missing the obvious?
>
>Thanks,
>Simon
>
>
>Local lnButtonWidth1,ln,laButton(1,2),lnButtonWidth2,l2ndRow,ln1,ln2
>With This
>   .Width=.Parent.Width
>   Store .Width/.ButtonCount To lnButtonWidth1,lnButtonWidth2
>   l2ndRow=lnButtonWidth1<DC_MINBUTTONWIDTH
>   Dimension laButton(.ButtonCount,2),laButton2(.ButtonCount,2)
>   Store 0 to ln1,ln2
>   Store "999" To laButton,laButton2
>
>   For ln=1 To .ButtonCount
>      If l2ndRow.And.Right(.Buttons(ln).Tag,1)="2"
>         ln2=ln2+1
>         laButton2(ln2,1)=.Buttons(ln)
>         laButton2(ln2,2)=.Buttons(ln).Tag
>      Else
>         ln1=ln1+1
>         laButton(ln1,1)=.Buttons(ln,1)
>         laButton(ln1,2)=.Buttons(ln,1).Tag
>      EndIf
>   EndFor
>   =ASort(laButton,2)
>   =ASort(laButton2,2)
>   lnButtonWidth1=.Width/ln1
>   lnButtonWidth2=.Width/Max(ln2,1)
>
>   For ln=1 To ln1-1
>*******************************************************
>* Ths following line of code results in two different values being assigned
>* laButton(ln,1).width becomes 180 ?????
>* lnBB2 becomes 25.7143
>*******************************************************
>
>      Store lnButtonWidth1 To laButton(ln,1).Width,lnBB2
>
>********************************************************
>
>      laButton(ln,1).Left=IIf(ln=1,1,laButton(ln-1,1).Left+laButton(ln-1,1).Width)
>   EndFor
>EndWith
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform