Main Menu

Dim dy(NUMBEROFBALLS,40) As Float()

Started by RaverDave, November 25, 2009, 05:23:41 PM

Previous topic - Next topic

RaverDave

Dim dy(NUMBEROFBALLS,40) As Float()

Hi,been a while since i was here!
Anyhow that line is from some old code,it works in the old version(1.49)
But errors if i update to 1.6xx saying that As is a reserved word...
So what has changed with this and what is used instead!

kevin

#1
  Well,  you're talking about a revision PlayBasic some 3 to 4 years old.  

Quote
 Dim dy(NUMBEROFBALLS,40) As Float()

 While such an expression might parse in an old edition, this doesn't necessarily mean that syntax or the results it created are actually what you intended.   if you run that line, you won't get a Floating array at all, you'll get an integer array.  The As Float() on the end,  means nothing to it.

 To make a floating point array in PB  you use the # post fix.  

 eg.


 Dim dy#(NUMBEROFBALLS,40)