Had a quick look, couldn't find it.
I'd like #PB_Integer added to FillMemory, if possible, I use this quite alot, but I've had to make my own routine for X64.
[Implemented] #PB_Integer with FillMemory
[Implemented] #PB_Integer with FillMemory
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
Re: #PB_Integer with FillMemory
i found #PB_Integer with the tool "structure viewer" which is showing every predefined constants (alt+S)
#PB_Byte = 0
#PB_Word = 1
#PB_Integer = 2
#PB_Long = 2
#PB_Float = 3
#PB_Quad = 4
#PB_Double = 6
#PB_Character = 7
#PB_Ascii = 8
#PB_Unicode = 9
#PB_Byte = 0
#PB_Word = 1
#PB_Integer = 2
#PB_Long = 2
#PB_Float = 3
#PB_Quad = 4
#PB_Double = 6
#PB_Character = 7
#PB_Ascii = 8
#PB_Unicode = 9
Re: #PB_Integer with FillMemory
It way well be defined for other functions, but according to the documentation it isn't available for the Fillmemory function. Which is what I would like. At the moment you can only fill bytes, words or longs.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
Re: #PB_Integer with FillMemory
Code: Select all
#intsize = 4
Define *my_memory = AllocateMemory(100*#intsize)
FillMemory( *my_memory, 100*#intsize, 8, #PB_Integer)
Define counter.i
For counter=0 To 100*#intsize
Debug Hex( PeekB(*my_memory+counter) )
Next counter
edit : nevermind, i tried on 32 bits and as you can see integer and long have the same value so this code is not thrue

#PB_Integer = 2
#PB_Long = 2
edit 2: tried with quad and got the error
"[20:32:47] [ERROR] Invalid type for FillMemory(), should be either #PB_Byte, #PB_Word or #PB_Long."
so you definitively right
Last edited by xorc1zt on Wed Dec 21, 2011 8:35 pm, edited 2 times in total.
Re: #PB_Integer with FillMemory
not on x64!, there i get an error!
under x64 ist #PB_Integer = 4 (Quad) and not 2
Only Byte, Word and Long can be used!
under x64 ist #PB_Integer = 4 (Quad) and not 2
Only Byte, Word and Long can be used!
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: #PB_Integer with FillMemory
they should add #PB_Quad too for 32 bits users
Re: #PB_Integer with FillMemory
I just think it would make porting code to and from 64 bit mode easier, since the #PB_Integer would always reflect the correct size.
You can make your own routine, like I had to, using SizeOf(Integer) to get the size of a pointer, which works on either OS.
I just think it would be nice to have this included in the FillMemory function.
You can make your own routine, like I had to, using SizeOf(Integer) to get the size of a pointer, which works on either OS.
I just think it would be nice to have this included in the FillMemory function.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: #PB_Integer with FillMemory
I like!Psych wrote:Commenting your own code is admitting you don't understand it.

Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!