COULD ANYONE TELL ME ????

 BBS: SPOKANE CENTRAL
Date: 04-08-93 (14:58)             Number: 49
From: TWO BITZ #213 @5930          Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: COULD ANYONE TELL ME ????      Conf: (17) QuickBASIC

Response To: LUCIFER #109 @6189 VIRTUA L#@V> Is there any way to turn on the mouse cursor and access it's position wit L#@V> basic not using a library? Thanxs... The first program does what you ask, the second changes the shape of the cursor. They are BOTH written for QB45 (not Qbasic) and require that you load up the default library with QB /L. 'mouse.bas Start with QB /L 'The values of Button% can be 1 (left button pressed), '2 (right button pressed), 3 (both buttons pressed simultaneously), 'and of course 0 (no button[s] pressed). ' '$INCLUDE: 'QB.BI' ' DIM SHARED InRegs AS RegType, OutRegs AS RegType CLS PRINT "Press a mouse button to quit..." InRegs.ax = &H1 CALL INTERRUPT(&H33, InRegs, OutRegs) 'Show pointer DO InRegs.ax = &H3 'LOOP UNTIL a button CALL INTERRUPT(&H33, InRegs, OutRegs) ' is pressed button% = OutRegs.bx LOOP UNTIL button% <> 0 InRegs.ax = &H2 'Hide pointer CALL INTERRUPT(&H33, InRegs, OutRegs) '-eof(1) ----------------- 'mous-crs.bas '$INCLUDE: 'qb.bi' 'changing the mouse cursor ' DECLARE SUB init () DECLARE SUB defcurs (hotx%, hoty%, shape%()) DECLARE SUB show () DECLARE FUNCTION Bin2Hex% (Binary$) DIM SHARED iregs AS RegTypeX, oregs AS RegTypeX REDIM shape%(1 TO 32) CLS : SCREEN 12 init RESTORE HourGlass FOR x = 1 TO 32 'read 32 words of data READ Dat$ 'read the data shape%(x) = Bin2Hex%(Dat$) 'convert to integer NEXT defcurs 1, 1, shape%() 'use interrupts to define shape show HourGlass: DATA "1100000000000111" DATA "1100000000000111" DATA "1100000000000111" DATA "1110000000001111" DATA "1110000000001111" DATA "1111000000011111" DATA "1111100000111111" DATA "1111110001111111" DATA "1111110001111111" DATA "1111100000111111" DATA "1111000000011111" DATA "1110000000001111" DATA "1110000000001111" DATA "1100000000000111" DATA "1100000000000111" DATA "1100000000000111" DATA "0000000000000000" DATA "0001111111110000" DATA "0000000000000000" DATA "0000111111100000" DATA "0000100110100000" DATA "0000010001000000" DATA "0000001010000000" DATA "0000000100000000" DATA "0000000100000000" DATA "0000001010000000" DATA "0000011111000000" DATA "0000110001100000" DATA "0000100000100000" DATA "0000000000000000" DATA "0001111111110000" DATA "0000000000000000" DEFINT A-Z FUNCTION Bin2Hex% (Binary$) STATIC 'binary to integer temp& = 0 Count = 0 FOR x = LEN(Binary$) TO 1 STEP -1 IF MID$(Binary$, x, 1) = "1" THEN temp& = temp& + 2 ^ Count END IF Count = Count + 1 NEXT IF temp& > 32767 THEN temp& = temp& - 65536 Bin2Hex% = temp& END FUNCTION SUB defcurs (hotx%, hoty%, shape()) iregs.ax = &H9 iregs.bx = hoty iregs.cx = hotx iregs.dx = VARPTR(shape(1)) iregs.es = VARSEG(shape(1)) INTERRUPTX &H33, iregs, oregs END SUB DEFSNG A-Z SUB init iregs.ax = &H0 INTERRUPTX &H33, iregs, oregs END SUB SUB show iregs.ax = &H1 INTERRUPTX &H33, iregs, oregs END SUB '-eof(2)- ---A woman who tries to equal a man has little ambition. * SLMR 2.1a * WWIVMail/QWK 4.3 [EVALUATION COPY]: SPOKANE CENTRAL - @5930 ON WWIVnet
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET