Qbasicnews.com

Full Version: XMS in Qbasic using Future.Library
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a question: How to use XMS memory in Qbasic using Future.Library. I know that Ordinary way:

Code:
'$INCLUDE: 'Future.bi'
TYPE DataBase
   Xpos AS INTEGER
   Ypos AS INTEGER
END TYPE

'Define Two Arrays
DIM Object1 AS DataBase
DIM Object2 AS DataBase

'Create XMS Handle
XMS = AllocateXMS(LEN(Object1))

'Give to Object1 Array some values
Object1.Xpos = 100
Object1.Ypos = 200

'Move Object1 into XMS
Segment = VARSEG(Object1)
Offset = VARPTR(Object1)
Size = LEN(Object1)
MoveToXMS XMS, Segment, Offset, Size, 0

'Move data from Xms into Object2 array.
Segment = VARSEG(Object2)
Offset = VARPTR(Object2)
Size = LEN(Object2)
MoveFromXMS XMS, Segment, Offset, Size, 0

CLS
PRINT Object2.Xpos
PRINT Object2.Ypos

DeAllocateXMS XMS

Well but it's quite slow. I'm making a Gui(WizGUI) and there I need speed. I don't want to use convertional memory.
So is there any faster way to do this?
Yes. Switch to UGL.