PureBasic Forum
https://www.purebasic.fr/english/

Bug with copying map structure
https://www.purebasic.fr/english/viewtopic.php?f=26&t=46944
Page 1 of 1

Author:  PrincieD [ Tue Jul 19, 2011 5:46 pm ]
Post subject:  Bug with copying map structure

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:
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.

Author:  ABBKlaus [ Tue Jul 19, 2011 6:13 pm ]
Post subject:  Re: Bug with copying map structure

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

Code:
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:
ProcedureDLL CopySkin_Init()
  Global NewList skin.skins()
EndProcedure

Author:  PrincieD [ Tue Jul 19, 2011 6:54 pm ]
Post subject:  Re: Bug with copying map structure

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.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/