redeclaring a structure?

Byak@

Active Member
Licensed User
i have a structure
dim type(s1,s2)var(0) as double
can i redeclare this structure (change size of dimension)?
for example dim type(s1,s2)var(5) as double
when i'm try it i have error 'Syntax error'

i'm say about b4ppc 6.80
 
Last edited:

mjcoon

Well-Known Member
Licensed User
I ran into this problem too.

The solution is to remember that structure arrays are really two-dimension arrays (as the help says). The structure elements are the second dimension, so you can redeclare as a 2-D array. To ensure that I get the size of the second dimension correct (even though I might want to add to the Type) I write:

B4X:
   Dim trksegLimits(newSize, ArrayLen(trksegLimits(), 2)) As Number

This works for me (so far!)...

Mike.
 

Byak@

Active Member
Licensed User
thanks for answer Mike!
it's really work, but only in optimized compiling. but it is good too:icon_clap:

I'm put a sample.it is a test of speed
 

Attachments

  • vartypetest.sbp
    1 KB · Views: 161
Cookies are required to use this site. You must accept them to continue using the site. Learn more…