Page 1 of 1

Easy work with Structures with 'SubStructure' and 'Insert...

Posted: Fri Jun 15, 2007 4:12 pm
by Leonhard
With the command 'InsertStructure' you can insert a structure in a structure:

Code: Select all

Structure Struc1
  bVar1.b
  lVar2.l
  sVar3.s
EndStructure

Structure Struc2
  sName.s
  
  InsertStructure Struc1
EndStructure
the same as

Code: Select all

Structure Struc1
  bVar1.b
  lVar2.l
  sVar3.s
EndStructure

Structure Struc2
  sName.s
  
  bVar1.b
  lVar2.l
  sVar3.s
EndStructure

With 'SubStructure' you can mace a Structure in a Structure:

Code: Select all

Structure Struc
  sValue.s
  
  SubStructure SubName
    lVar.l
  EndSubStructure
EndStructure
the same as

Code: Select all

Structure _Struc_SubName
  lVar.l
EndStructure

Structure Struc
  sValue.s
  
  SubName._Struc_SubName
EndStructure

Posted: Fri Jun 15, 2007 4:25 pm
by freak
Something similar to 'InsertStructure' can be allready done with the 'Extends" keyword.

Posted: Fri Jun 15, 2007 4:38 pm
by Leonhard
freak wrote:Something similar to 'InsertStructure' can be allready done with the 'Extends" keyword.
Yes, but it is only on the front on the Structure.

Posted: Fri Jun 15, 2007 5:19 pm
by Kale
Why would you need these new commands?

Posted: Fri Jun 15, 2007 9:34 pm
by Leonhard
I need this commands why I use this crabwise.

I wrote this in many programms crabwise and I would wrote this faster.

So PureBasic have complex macros, I can wrote this.

comment:
my english is not very good.