Bug with copying map structure

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

PrincieD
Enthusiast
Enthusiast
Posts: 642
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Bug with copying map structure

Post by PrincieD »

Hi,

It appears theres problems with TailBite and copying maps, the following code causes TailBite to fail:

CopySkin.asm
line: 31
error code: -108
error string: Illegal Instruction

Code: Select all

Structure skinProperties
  value.s
  resType.i
  resData.i
  resDataSize.i
EndStructure

Structure skinStates
  Map property.skinProperties()
EndStructure

Structure skinComponents
  Map state.skinStates()
EndStructure

Structure skins
  name.s
  author.s
  date.s
  version.s
  url.s
  Map component.skinComponents()
EndStructure

Global NewList skin.skins()

ProcedureDLL CopySkin(Skin.i) ; Returns a copy of the specified skin
  
  ForEach skin()
    If @skin() = Skin
      
      tskin.skins
      tskin = skin()
      
      LastElement(skin())
      If AddElement(skin()) <> 0
        skin() = tskin
        ProcedureReturn @skin()
      EndIf
      
      ProcedureReturn 0
      
    EndIf
  Next
  
  ProcedureReturn 0
  
EndProcedure
Thanks!

Chris.
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Bug with copying map structure

Post by ABBKlaus »

its a missing macro. Will be hard to implement in TB but i will try it when it find some time ;-)

Code: Select all

macro MP0_Setup{
  LEA    eax,[esp]
  PUSH   s_skins
  PUSH   eax
  CALL  _SYS_InitDynamicStructure@8
}
BTW : your Linked List has to be initialised in the init-function, something like this :

Code: Select all

ProcedureDLL CopySkin_Init()
  Global NewList skin.skins()
EndProcedure
PrincieD
Enthusiast
Enthusiast
Posts: 642
Joined: Wed Aug 10, 2005 2:08 pm
Location: Yorkshire, England
Contact:

Re: Bug with copying map structure

Post by PrincieD »

ABBKlaus wrote:its a missing macro. Will be hard to implement in TB but i will try it when it find some time
Thanks ABBKlaus :)
ABBKlaus wrote:BTW : your Linked List has to be initialised in the init-function, something like this :
Yes I know (all lists are defined in ProGUI_Init), just wanted to show you the copy map error but thanks anyway.

Chris.
ProGUI - Professional Graphical User Interface Library - http://www.progui.co.uk
Post Reply