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.


How to access the 2nd dimension


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2007, 08:53 AM
Junior Member
 
Join Date: Jul 2007
Location: Hong Kong
Posts: 42
Send a message via MSN to hung Send a message via Yahoo to hung Send a message via Skype™ to hung
Default How to access the 2nd dimension

I have declare array as below:

dim type (x, y) shape(1000, 500)
first dimension is points in a polygon shape, e.g. shape(0, 1) to shape(1000,1) , that I use to draw polygon. shape(0, 2) to shape(1000,2) refers to another polygon.

when draw polygon, I use the code below:

for jj = 0 to cntshape - 1
for ii = 0 to cntpt(jj) - 1
ptstmp(ii).x = shape(ii, jj).x
ptstmp(ii).y = shape(ii, jj).y
next
form1.polygon(ptstmp(), 0, cntpt(jj) - 1, cBlack, F)
next


I found that in PPC, the above for ii loop takes time (i.e. slow as one second when draw over 10 shapes).

If I can refer to one of the dimension I should be able to avoid the for ii loop.
e.g.
form1.polygon(shape(,jj), 0, cntpt(jj) -1 , cBlack, F)

Or any other way to do so?
__________________
Yours,

Dopod D810 WM6 GPS HSDPA 3G Wifi Bluetooth
Reply With Quote
  #2 (permalink)  
Old 08-14-2007, 11:49 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,985
Default

You can't "take" a part of a multi dimension array.
You should try to use a one dimension array from the start, or use ArrayLists instead.
This feature will be available in a future update (version 6.00).
Reply With Quote
  #3 (permalink)  
Old 08-15-2007, 01:32 AM
Junior Member
 
Join Date: Jul 2007
Location: Hong Kong
Posts: 42
Send a message via MSN to hung Send a message via Yahoo to hung Send a message via Skype™ to hung
Wink

Thanks

I am planning to keep a series of shapes that each shape is a series of points.

I can not define like

dim type (x, y) pts(500)
dim shape(1000) as pts

So I have to two dimensions array.

It would be great if the version 6.0 allows variable decaration using self defined type like pts (points).
__________________
Yours,

Dopod D810 WM6 GPS HSDPA 3G Wifi Bluetooth
Reply With Quote
  #4 (permalink)  
Old 08-15-2007, 03:20 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,985
Default

You could define:
Dim Type(x,y) pts(500000)
And now store the shapes in one sequence and draw each shape with something like:
Code:
Form1.Polygon(pst(),ShapeNumber * 1000,LengthOfShape,...)
That way there is no need to copy the points each time.
Reply With Quote
  #5 (permalink)  
Old 08-15-2007, 04:24 AM
Junior Member
 
Join Date: Jul 2007
Location: Hong Kong
Posts: 42
Send a message via MSN to hung Send a message via Yahoo to hung Send a message via Skype™ to hung
Default

Thanks.
__________________
Yours,

Dopod D810 WM6 GPS HSDPA 3G Wifi Bluetooth
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
Support for Access databases Peter Basic4ppc Wishlist 3 03-18-2008 11:39 AM
Network access skipper Questions & Help Needed 4 02-19-2008 08:21 AM
Microsoft Access Query somersetrc Questions & Help Needed 2 11-29-2007 08:29 AM
Access to Outlook contacts Big JR Code Samples & Tips 3 09-26-2007 10:16 AM
Structured one dimension Array Cableguy Questions & Help Needed 1 06-27-2007 01:17 PM


All times are GMT. The time now is 04:09 AM.


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