Page 3 of 3

Posted: Wed Feb 15, 2006 12:26 am
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.

Posted: Wed Feb 15, 2006 12:48 am
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
---------------------------

Posted: Wed Feb 15, 2006 1:04 am
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.

Posted: Wed Feb 15, 2006 2:21 am
by Hroudtwolf
But it worked already with pb 3.93.
Why does it work not longer with PB 4.00?

Posted: Wed Feb 15, 2006 12:00 pm
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: