Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simulated Dancing Tesla Coil
#4
(08-17-2024, 04:56 PM)SierraKen Wrote: Thanks Petr! I'm glad you saw this! 

I tried your code with Steve's Function and got an error message in the Function. I also don't know how to use the Function with the variables it uses, so I'm just going to drop the 32 bit version (I use the 64 bit QB64), unless anyone wishes to tackle it. But thanks again!

This function?

Code: (Select All)
FUNCTION ConvertOffset&& (value AS _OFFSET)
$CHECKING:OFF
DIM m AS _MEM 'Define a memblock
m = _MEM(value) 'Point it to use value
$IF 64BIT THEN
   'On 64 bit OSes, an OFFSET is 8 bytes in size.  We can put it directly into an Integer64
   _MEMGET m, m.OFFSET,temp&&
    ConvertOffset&& = temp&& 'Get the contents of the memblock and put the values there directly into ConvertOffset&&
$ELSE
   'However, on 32 bit OSes, an OFFSET is only 4 bytes.  We need to put it into a LONG variable first
   _MEMGET m, m.OFFSET, temp& 'Like this
   ConvertOffset&& = temp& 'And then assign that long value to ConvertOffset&&
$END IF
_MEMFREE m 'Free the memblock
$CHECKING:ON
END FUNCTION

Just plug it in, and on lin 67, make it:
Code: (Select All)
sz = ConvertOffset(SampleData.ELEMENTSIZE)
Reply


Messages In This Thread
Simulated Dancing Tesla Coil - by SierraKen - 08-17-2024, 04:44 AM
RE: Simulated Dancing Tesla Coil - by Petr - 08-17-2024, 08:06 AM
RE: Simulated Dancing Tesla Coil - by SierraKen - 08-17-2024, 04:56 PM
RE: Simulated Dancing Tesla Coil - by SMcNeill - 08-18-2024, 05:49 AM
RE: Simulated Dancing Tesla Coil - by SierraKen - 08-18-2024, 04:04 PM
RE: Simulated Dancing Tesla Coil - by a740g - 08-18-2024, 06:22 PM
RE: Simulated Dancing Tesla Coil - by a740g - 08-18-2024, 06:04 PM
RE: Simulated Dancing Tesla Coil - by SierraKen - 08-18-2024, 07:35 PM



Users browsing this thread: 3 Guest(s)