Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP syntax for this VB statement
Message
De
21/05/2007 13:28:19
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01227095
Message ID:
01227362
Vues:
16
>>>>>>What is obj? Was it created with CREATEOBJECT() command before? My point is that array in VB defines an array, so the property should be an array property.
>>>>>
>>>>>it is Adobe InDesing CS3
>>>>>
>>>>>myInDesign = CreateObject("InDesign.Application.CS3")
>>>>>myDocument = myInDesign.Documents.Add
>>>>>myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
>>>>>myTextFrame.GeometricBounds = Array("6p", "6p", "24p", "24p")
>>>>>myTextFrame.Contents = "Hello World!"
>>>>>
>>>>
>>>>Try:
>>>>
>>>>DECLARE myArray[4]
>>>>myArray[1] = "6p"
>>>>myArray[2] = "6p"
>>>>myArray[3] = "24p"
>>>>myArray[4] = "24p"
>>>>myTextFrame.GeometricBounds = myArray
>>>>
>>>
>>>same error
>>>
>>>OLE IDispath exception code 30477 from InDesing.exe: Invalid value for set property 'GeometricBounds'.
>  Expected Array of 4 Units (Doubles or String), but received "6p"
>>>
>>
>>VB is 0 based for the array. Change your indices from 1...4, to 0...3.
>
>You can't in VFP :-) That is why COMARRAY() is used.


No, not the VFP array, the VB object property that's expecting an array. I think if you reference it with the 0...3, it would work.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform