Nested With

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Franky
Enthusiast
Enthusiast
Posts: 213
Joined: Sat Apr 26, 2003 2:58 pm

Nested With

Post by Franky »

Hi there,
hope, I am not bombing you too much with feature requests, but I'm working with PB all day,
so I find some more things that could be optimized than I did as a hobbyist

This one's a minor one and it's just for comfort, so priority is below "MultiDimensional Array in Structures" for me.
Nested With
First the definitions:

Code: Select all

Structure MyInnerStruct
   value1.l
  value2.l
EndStructure

Structure MainStruct
   name.s
  values.MyInnerStruct
EndStructure

Global Main.MainStruct
Now, currently I would fill that like this:

Code: Select all

With Main 
  \name=test
  \values\value1=5
  \values\value2=7
EndWith
or like this

Code: Select all

With Main 
  \name=test
EndWith
With Main\values
  \value1=5
  \value2=7
EndWith

So, what would work against Nested With:

Code: Select all

With Main 
  \name=test
  With \values
        \value1=5
        \value2=7
  EndWith
EndWith
To be true, it doesn't look that comfortable by now, but it's just a short example, so just imagin this with 5 or 6 SubStructures and some more Structure Members.

Additional to the intern "This is to replace the '\' with: 'Main\'"-Variable, the compiler would just need some kind of Stack to know, what part of the replacetext should be removed from this variable, when EndWith is called.

So far

Franky
Give Up everything but trying!