![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I wanted to draw a moving polygon
to store the 5 coordinates I did dim x(5) dim y(5) Q1) rather than saying x(0)=0 x(1)=100 x(2)=120 x(3)=140 etc.... is there a quick way assigning the array such as> x()=[0,100,120,140,80] Q2) The polygon command errored - what is wrong with form1.polygon(x(),0,y(),0,5,cBlue) which should be the right format to say x() starting at 0, y() starting at 0,count 5, in colour Blue) But it didnt work, please help? |
|
|||
|
Silly me,
I had set the values of x(0) etc in the Sub Globals and not the App_start, I thought you could define the values of variables in either! Ive seen it done before like in clock prog Sub Global mytime=0 End Sub Is it different for array values? Anyway it works now - Thanks Last edited by colin9876 : 11-17-2007 at 12:40 PM. |
|
|||
|
Sorry guys, mystery solved ... but how weird is this
At first I had these (faulty) lines in the Sub global - x(0)=0 y(0)=0 ..... x(1)=0 y(1)=100 But the error reported at the polygon statement When I moved them to the App sub The error reported at the first x(0)=0 y(0)=0 now I realise there should have been a : between them when setting two variables on the same line. But for some reason the error message came at a different point when my coding error was in the different Subs! i.e. the x(0)=0 y(0)=0 didnt error immediately when its in the Global sub but it did in the App sub Totally my mistake, but thrown by the differnt error reporting??? Last edited by colin9876 : 11-17-2007 at 06:00 PM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| program variables | tremara1 | Questions & Help Needed | 2 | 10-16-2008 08:52 AM |
| Environment Variables | Zenerdiode | Questions & Help Needed | 1 | 05-22-2008 04:36 PM |
| automatic typecasting of variables? | Stellaferox | Questions & Help Needed | 4 | 02-04-2008 01:17 PM |
| Help about variables/objects | skipper | Questions & Help Needed | 6 | 12-19-2007 04:45 PM |
| Structure variables | Erel | Code Samples & Tips | 0 | 05-19-2007 11:36 AM |