Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MarkSkits

Pages: [1]
1
QB64 Discussion / Returning from CHAIN Statement
« on: August 12, 2018, 02:23:54 pm »
I'm making another sort of interface in QBASIC, and it keeps running out of memory because it's in DOS. To fix this, I figured I'd separate the SUBs into different BAS/EXE files and just use a CHAIN statement, however, I cannot figure out how to have the secondary program return to the main program without restarting said main program. For example:

Main:
Code: QB64: [Select]
  1. CHAIN "calc.bas"
  2. lastRan = "Calculator"
  3. ...
  4.  

Calc.bas:
Code: QB64: [Select]
  1. TRUE = 1
  2. DO UNTIL exitProgram = TRUE
  3.     'Calculator Stuff
  4.     ...
  5. [return to main]
  6.  

Is it possible to have it return to where it was on the main program, and if so, how can I do so?

2
Programs / Re: "Brightness Slider" for QBASIC and QB64.
« on: June 12, 2018, 09:16:03 am »
I made it so it would work with QB64 AND QBasic.

3
Programs / "Brightness Slider" for QBASIC and QB64.
« on: June 11, 2018, 10:15:43 pm »
Note: Uses QBMOUSE Sub

Code: QB64: [Select]
  1. startPos = 50
  2. endPos = 590
  3. currentPos = startPos
  4. colorValue = 9
  5. COLOR colorValue
  6. LINE (50, 239)-(590, 241), colorValue, BF
  7. LINE (startPos - 1, 230)-(startPos + 1, 250), colorValue, BF
  8. MOUSE 1
  9. Text$ = "Current Background Brightness:" + STR$(FIX(Brightness)) + "."
  10. LOCATE 13, 40 - (LEN(Text$) / 2)
  11. PRINT Text$
  12. LOCATE 13, (40 + (LEN(Text$) / 2)) - 3
  13. PRINT RTRIM$(STR$(FIX(Brightness))); ". "
  14.     MOUSE 3
  15.     SELECT CASE B
  16.         CASE 1
  17.             IF H >= startPos AND H <= endPos AND V >= 230 AND V <= 250 THEN
  18.                 DO WHILE B = 1
  19.                     MOUSE 3
  20.                     IF H >= startPos AND H <= endPos THEN
  21.                         LINE (currentPos - 1, 230)-(currentPos + 1, 238), 0, BF
  22.                         LINE (currentPos - 1, 242)-(currentPos + 1, 250), 0, BF
  23.                         currentPos = H
  24.                         Brightness = (currentPos - 50) / (540 / 63)
  25.                         OUT &H3C8, 0
  26.                         OUT &H3C9, Brightness
  27.                         OUT &H3C9, Brightness
  28.                         OUT &H3C9, Brightness
  29.                         LINE (currentPos - 1, 230)-(currentPos + 1, 250), colorValue, BF
  30.                         LOCATE 13, (40 + (LEN(Text$) / 2)) - 3
  31.                         PRINT RTRIM$(STR$(FIX(Brightness))); ". "
  32.                     END IF
  33.                 LOOP
  34.             END IF
  35.     END SELECT
  36. SUB MOUSE (Funk)
  37.     SHARED B, H, V
  38.     STATIC Crsr
  39.     IF Funk = 1 THEN Crsr = 1
  40.     IF Funk = 2 AND Crsr = 0 THEN EXIT SUB
  41.     IF Funk = 2 AND Crsr = 1 THEN: Crsr = 0
  42.     POKE 100, 184: POKE 101, Funk: POKE 102, 0
  43.     POKE 103, 205: POKE 104, 51: POKE 105, 137
  44.     POKE 106, 30: POKE 107, 170: POKE 108, 10
  45.     POKE 109, 137: POKE 110, 14: POKE 111, 187
  46.     POKE 112, 11: POKE 113, 137: POKE 114, 22
  47.     POKE 115, 204: POKE 116, 12: POKE 117, 203
  48.     CALL ABSOLUTE(100)
  49.     B = PEEK(&HAAA)
  50.     H2 = PEEK(&HBBC)
  51.     H2 = H2 * 256
  52.     H = PEEK(&HBBB) + H2
  53.     V = PEEK(&HCCC) + PEEK(&HCCD) * 256
  54.  

Pages: [1]