Visual FoxPro Developer Center > Visual FoxPro Forums > Visual FoxPro General > aitems is not an array - error message
Ask a questionAsk a question
 

Answeraitems is not an array - error message

  • Friday, October 30, 2009 2:37 AMyanyee Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi all,

    when i tried to run oledrag and drop to my forms i encountered aitems is not an array. I had created new property aitems.

    DIMENSION THISFORM.aItems[1]

    this line cause an error. Please advice.

    Thanks.
    MCP - SQL SERVER 2k/ WINDOWS XP , VFP 6 YEARS

Answers

All Replies

  • Friday, October 30, 2009 4:21 AMKalpesh Chhatrala Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    First of all you have to create property in Form like below

    oFrm = CREATEOBJECT("FORM")
    oFrm.AddProperty("A[1]")

    then you can use this property like array


    Please "Mark as Answer" if this post answered your question. :)

    Kalpesh Chhatrala | Software Developer | Rajkot | India

    Kalpesh's Blog
  • Friday, October 30, 2009 5:47 AMyanyee Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Kalpesh,

    But i had created at form -> New property.

    I will tried your solutions as above.

    Thanks so much.
    MCP - SQL SERVER 2k/ WINDOWS XP , VFP 6 YEARS
  • Friday, October 30, 2009 6:08 AMKalpesh Chhatrala Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    created at form -> New property

    fill name as "propname[1]" 

    and press add button.

    form property created.



    Please "Mark as Answer" if this post answered your question. :)

    Kalpesh Chhatrala | Software Developer | Rajkot | India

    Kalpesh's Blog
  • Friday, October 30, 2009 6:14 AMyanyee Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Kalpesh,

    OOO need put double quote = "" ?
    I had tried

    oFrm = CREATEOBJECT("FORM")

    oFrm.AddProperty("Aitems[1]")

    but still prompt Aitems is not an array.

    Thanks.

    MCP - SQL SERVER 2k/ WINDOWS XP , VFP 6 YEARS
  • Friday, October 30, 2009 6:16 AMyanyee Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Kalpesh,

    I tried put double quotes at property but to no avail.
    But it prompt me "invalid name".

    Thanks.
    MCP - SQL SERVER 2k/ WINDOWS XP , VFP 6 YEARS
  • Friday, October 30, 2009 6:19 AMKalpesh Chhatrala Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Open form with "modify form test"

    then click form menu

    then click New Property Menu

    Type Property Name "Aitems[1]" without Quote

    write default value if you want

    and press add button



    Please "Mark as Answer" if this post answered your question. :)

    Kalpesh Chhatrala | Software Developer | Rajkot | India

    Kalpesh's Blog
  • Friday, October 30, 2009 6:22 AMtushar kanvindeMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    instead of
    DIMENSION THISFORM.aItems[1]

    use 
    thisform,addproperty('aItems[1]')

  • Friday, October 30, 2009 7:00 AMyanyee Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi kalpesh,

    It not allowed Aitem[1] even without quotes.
    It prompted me "Invalid name"


    Thanks.
    MCP - SQL SERVER 2k/ WINDOWS XP , VFP 6 YEARS
  • Tuesday, November 03, 2009 1:57 AMNaom Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I've tried right now  - created a new form, in the New property dialog typed aItems[1]
    and it worked just fine.
    Premature optimization is the root of all evil in programming.

    Donald Knuth, repeating C. A. R. Hoare

    My blog
  • Tuesday, November 03, 2009 3:29 AMyanyee Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Naom,

    yes yes so weird now its ok.
    But that day it really blocked me.

    Thanks.
    MCP - SQL SERVER 2k/ WINDOWS XP , VFP 6 YEARS