Structures & Uppercase

skipper

Member
Licensed User
Hello Erel,

perhaps is something already know, but I noticed this behaviour in B4PPC.
if you declare in Sub Global

Dim Type(a,b,c,d) pippo

the right panel displays under Global Variables
pippo: Structure

if you declare instead in Sub Global

Dim Type(a,b,c,d) Pippo '(uppercase)

the right panel displays under Global Variables
pippo: Array

Is any reason for that?

May I use the declared structure (eg: pippo) as a standard Data Type to dim/redim other arrays?

Many thanks
Mimmo
 

skipper

Member
Licensed User
I forgot one question:

The help says (under DIM): "The same array can be declared many times and its size can be changed"

I tried with an array of structure

Sub Globals
Dim Type(a,b,c,d) pippo(0) 'empty array
End Sub

then in AppStart I tried to redim the array

Sub AppStart
'--- Dim Type(a,b,c,d) pippo(50) '----> Syntax error
Dim pippo(50) '----> works

but when I assign a value

pippo(10).a="xxxxx"

i got an error message "Indices lenght does not match the array rank".

Many thanks for your help

Mimmo
 

skipper

Member
Licensed User
Many thanks Erel!

I did'nt tested it, but I hope the bug is only cosmetic and the defined structure will be treated as a structure along the source code.

Your tip about redim is welcome. Just as a little remind for future B4P versions, I would suggest the possibility to define a structure of structures as in VB

Dim Type (a,b,c) MyStruct
Dim Type (c,d,e,MyStruct) NewStruct

NewStruct.c=123
.....
NewStruct.MyStruct.a="xxxxxxxx"
NewStruct.MyStruct.b="zzzzzzzz"
NewStruct.MyStruct.c="yyyyyyy"

Thanks again for your help.

Mimmo
 
Top