Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A little array
Message
 
 
To
13/03/2002 19:50:22
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00632501
Message ID:
00632506
Views:
7
This message has been marked as a message which has helped to the initial question of the thread.
Such arrays must be in scope after the method call. Because of that you have to use eaither use PUBLIC array (not recomended) or property array and return it by reference.
RETURN @This.aNewArray
>OOPS!!! Hit the wrong key!!! Ignore thre previous!!!! we should try this again...
>
>In the myapp.checker(), I will have a string and then pass the string to the 'array' maker, strip out all the A's, and put everything left into an array, and then return the array back to myapp.checker : laFinal.
>
>
> *-- myapp.checker
> LOCAL laFinal[1], lcString
> DIMENSION laFinal[1]
> laFinal[1] = ""
> lcString = "ABBBACCCADDD"
>laFinal = newobj.convert(lcString)
>
>
> *-- myapp.convert
> LPARAMETER lcData
> LOCAL laNewArray, lnCount, lnItemLine
> DIMENSION laNewArray[1]
> STORE 0 TO lnItemLine, lnCount
> lnCount = OCCURS("A", lcData)
> *-- Checked this, lnCount = 3
> *-- now, here is some code to take out extra stuff, like line feeds, etc..
> *-- Okay, all that will be left in lcData is letters....
> FOR lnWork = 1 TO lnCount
>  *-- put the data into an array, take out each "A", etc...
>  lnItemLine = lnItemLine + 1
>  DIMENSION laNewArray[lnItemLine]
>  *-- put the line data into array row....
> NEXT
> *-- Now, at this point I have and can see laNewArray with three items:
> *-- laNewArray[1] = "BBB"
> *-- laNewArray[2] = "CCC"
> *-- laNewArray[3] = "DDD"
> *-- BUT, now I want to send it back...
> RETURN @laNewArray
>
>
>
>I am missing something because as soon as the trace returns to the myapp.checker, I get
>"laNewArray is not an array"... What am I missing??
>
>TIA
>
>Ric
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform