Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Structured one dimension Array


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2007, 02:02 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,314
Default Structured one dimension Array

Hi

I'm reading data from a file(ini) wich as the follwing data:

peaches-20
aples-15
bananas12

I defined an array like this:

Dim Type(Fruit,Quantity) Basket(3)

Now I whant to populate the array with the data read from the file
Since this is a finite and short list I am reading line-by-line, but how do I populate the array?

I tryed this
r=FileRead(c1)
Basket(0)=StrSplit(r,"-")

But it return an error message saying that basket is not a one dimension array...

Help?!
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #2 (permalink)  
Old 06-27-2007, 02:17 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

You can't do it directly. (It will be supported in the next version)
For now you will need something like:

Sub Globals
Dim Type(Fruit,Quantity) Basket(3)
Dim Type(Fruit,Quantity) Temp
End Sub

For i = 0 to 2
r = FileRead(c1)
Temp() = StrSplit(r,"-")
Basket(i).Fruit = Temp.Fruit
Basket(i).Quantity = Temp.Quantity
Next
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nullifying an Array mjcoon Questions & Help Needed 1 06-20-2008 06:20 PM
Array but not array Cableguy Questions & Help Needed 1 09-22-2007 09:09 PM
Array of Array possibility? Stellaferox Basic4ppc Wishlist 0 09-18-2007 01:16 PM
How to access the 2nd dimension hung Questions & Help Needed 4 08-15-2007 05:24 AM
More Dimensional Array Xardas Questions & Help Needed 4 07-01-2007 03:11 PM


All times are GMT. The time now is 02:25 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0