PureBasic v4.00 - Beta 2

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Hello PureBasic-Team,

I found a little BUG with Stringvariables.
Better I show what I mean, 'cause my english is not the best.


In this code, I get a "Invalid memory access" on the line with "Debug DuTmp.s".

Code: Select all

; Just a testcode without other usability.
Procedure TestProc()
  testing.l=#True
  If testing.l=#True
    test.s="This is a little test"
    For x=0 To 10
      UnTmp.s=PeekS (@test+x,1)
      If Asc(UnTmp.s) <65
        DuTmp.s = PeekS(@test+x,1)
      EndIf
      Debug DuTmp.s
      Debug UnTmp.s
    Next x
  EndIf
EndProcedure

TestProc() 


Thank you.
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Post by Falko »

With option ASM this message.
---------------------------
PureBasic - Assembler error
---------------------------
PureBasic.asm [330]:

MP0

PureBasic.asm [118] MP0 [24]:

TEST.s ="This is a little test"

error: value out of range.


---------------------------
OK
---------------------------
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

The first code should be:

Code: Select all

; Just a testcode without other usability.
Procedure TestProc()
  testing.l=#True
  If testing.l=#True
    test.s="This is a little test"
    For x=0 To 10
      UnTmp.s=PeekS (@test+x,1)
      If Asc(UnTmp.s) <65
        DuTmp.s = PeekS(@test+x,1)
      EndIf
      If DuTmp
        Debug DuTmp.s
      EndIf
      Debug UnTmp.s
    Next x
  EndIf
EndProcedure

TestProc() 
Otherwise, i think you would be trying to debug an uninitialized variable.
El_Choni
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

But it worked already with pb 3.93.
Why does it work not longer with PB 4.00?
Mowen
User
User
Posts: 48
Joined: Tue Oct 07, 2003 1:04 pm
Location: Belgium

Post by Mowen »

I do not understand the added parameter for the command DisableMenuItem. How to adapt the previous version of it ?

[edit] Ok found it in the Menu.pb sample file ! Just specify the main menu id as first parameter. :roll:
PureBasic: one of the best programming tools ever ! PB is light, easy, crossplatform, powerfull, fast, extendable, enjoyable and... tasty ;-)
Post Reply