Author Topic: X-GUI 5 (attempt to port a qbasic gui to qb64  (Read 10285 times)

0 Members and 1 Guest are viewing this topic.

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
X-GUI 5 (attempt to port a qbasic gui to qb64
« on: August 10, 2018, 12:37:49 pm »
Hey everyone,

A long time ago a dude started some little "company" on the internet...
It was called KG Software, coincidentally those are also my initials (I am not the original author).

They created a GUI for DOS that was scriptable and stable but very slow and required a lot of memory (real mode standards).
It was called X-GUI. There were versions 1, 2, 3, and 4. Version 3 was very nice, but version 4 was a little more advanced and had more accessory applications.

As many of you probably know, I've been relentlessly trying to create a gui for the past few years (like a broken record).

Well lately in my gui attempts I ran into a little trouble with tcp/ip and it seems like the previous way I was creating the gui will not work with intermachine networking... So I came up with a plan to build a scripting language that could be sent from node to node and recreate images sent across the connection at each machine. Last night I thought, if im going to build something like that, why not just port a really good one for DOS/qbasic to Windows/Linux/Mac qb64? So I chose one: X-GUI 4. It is great, works great, uses outdated DOS stuff that I will strip out and replace, and it's totally abandoned to the point that if the author saw me bringing it back to life they would probably be happy :D.

Here is a link to a screenshot, a download of DOS binaries, source code, and script files: http://qbasicgui.datacomponents.net/203_xgui4.html

There is a lot of work involved which is why I admit this may become vaporware but right now im going to give it a try and see what happens:

If I succeed at making it work it will be called X-GUI 5 and it will hopefully be awesome.
I am from a Kazakhstan, we follow the hawk.

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #1 on: August 10, 2018, 12:51:30 pm »
I actually already did some significant work trying to figure out how it works...
Also, I tediously converted all the old outdated DOS PCX images to PNG. :)
I am from a Kazakhstan, we follow the hawk.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #2 on: August 10, 2018, 01:03:59 pm »
Hi keybone,

I am interested to know if it has a decent text editor control, ie select text for cut, copy, and paste.

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #3 on: August 10, 2018, 02:27:25 pm »
Hi keybone,

I am interested to know if it has a decent text editor control, ie select text for cut, copy, and paste.

It's been forever since I ran this program... I don't have a dos computer to use the executable on.
I haven't been able to get it to compile on qb64, I have to get rid of any use of rhe SVGAPV (Zephyr) library.
So I really couldn't tell you. I believe so... it will be easy to integrate the qb64 clipboard commands into it though.


I'm reading up on the library as I come to places in the code where its used.
My plan is to use QB64 graphics commands to replace it, it will be a lot better that way.
Version 5 is going to be way different than version 4 anyways, as I've developed so much GUI related stuff that I will use to enhance this project. For example it will use PNG graphics throughout (instead of PCX) and will be able to use them as icons, buttons, desktop wallpaper etc. And all the background routines i wrote: the stretched background, the tiling, the dither patterns, diagonal gradients, etc. will be used. Also I have to come up with a better alternative to all the XMS stuff, probably my normal route of a dynamic array or something.
« Last Edit: August 10, 2018, 02:28:41 pm by keybone »
I am from a Kazakhstan, we follow the hawk.

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #4 on: August 11, 2018, 02:48:37 am »
This appears to be quite an undertaking. but... It might not be.
I was thinking about it, all I may really have to do is use qb64 functionality to clone the library.

If I design all the subs/functions to work the same as all the zephyr library ones, they should drop right in and it should work.
There is probably other stuff to be done too, but that's the direction i'm going... I have a lot of time to work on it... :D

Also, the zephyr library had some pretty decent documentation so that's helping a lot too. :)
« Last Edit: August 11, 2018, 03:12:14 am by keybone »
I am from a Kazakhstan, we follow the hawk.

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #5 on: August 11, 2018, 03:55:56 am »
This appears to be quite an undertaking. but... It might not be.
I was thinking about it, all I may really have to do is use qb64 functionality to clone the library.

If I design all the subs/functions to work the same as all the zephyr library ones, they should drop right in and it should work.
There is probably other stuff to be done too, but that's the direction i'm going... I have a lot of time to work on it... :D

Also, the zephyr library had some pretty decent documentation so that's helping a lot too. :)

So far what I got done of trying to port the needed parts of the Zephyr library (untested):

Code: QB64: [Select]
  1.  
  2. FUNCTION initDisplay%
  3.     initDisplay% = RESTEXT~&&(-1, 0, -1)
  4.  
  5. FUNCTION RESTEXT~&& (inFullscreen AS _BYTE, inScaled AS _BYTE, inSmoothed AS _BYTE)
  6.     theDisplay.sizeX = _DESKTOPWIDTH
  7.     theDisplay.sizeY = _DESKTOPHEIGHT
  8.     theDisplay.Options.isFullscreen = inFullscreen
  9.     theDisplay.Options.isScaled = inScaled
  10.     theDisplay.Options.isSmoothed = inSmoothed
  11.     theDisplay.Handle = _NEWIMAGE(theDisplay.sizeX, theDisplay.sizeY, 32)
  12.     RESTEXT~&& = 1
  13.  
  14. SUB FONTSYSTEM (inFilename AS STRING, inSize AS _UNSIGNED INTEGER)
  15.     SHARED systemFont AS LONG
  16.     systemFont = _LOADFONT(inFilename, inSize)
  17.     _FONT systemFont
  18.  
  19. SUB DRWFILLBOX (inColour AS _UNSIGNED LONG, inX1 AS INTEGER, inY1 AS INTEGER, inX2 AS INTEGER, inY2 AS INTEGER)
  20.     LINE (inX1, inY1)-(inX1 + inX2, inY1 + inY2), inColour, BF
  21.  
  22. SUB DRWBOX (inColour AS _UNSIGNED LONG, inX1%, inY1%, inX2%, inY2%)
  23.     LINE (inX1, inY1)-(inX1 + inX2, inY1 + inY2), inColour, B
  24.  
  25. SUB DRWSTRING (inForegroundColor AS _UNSIGNED LONG, inBackgroundColor AS _UNSIGNED LONG, inString AS STRING, inX AS INTEGER, inY AS INTEGER)
  26.     COLOR inForegroundColor, inBackgroundColor
  27.     _PRINTSTRING (inX, inY), inString
  28.  

the original library had an additional first parameter, some kind of mode integer, would have served no purpose in qb64 so its gone everywhere it was used.
« Last Edit: August 11, 2018, 03:57:54 am by keybone »
I am from a Kazakhstan, we follow the hawk.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #6 on: August 11, 2018, 08:58:16 am »
Hi keybone,

When I was imagining the project, I also imagined a humongous undertaking but the crucial areas that decide if it is possible or not are the ones translating interactions with DOS OS: converting those to Windows OS or Linux OS. I myself would check out the feasibility of those areas before undertaking the translating process.

Eh, maybe you have all your file management tools ready to go?

Quote
Last night I thought, if im going to build something like that, why not just port a really good one for DOS/qbasic to Windows/Linux/Mac qb64?

"Why not just port..."  OK, if you have those file management tools ready...   
« Last Edit: August 11, 2018, 09:02:45 am by bplus »

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #7 on: August 11, 2018, 10:30:10 am »
Hi keybone,

When I was imagining the project, I also imagined a humongous undertaking but the crucial areas that decide if it is possible or not are the ones translating interactions with DOS OS: converting those to Windows OS or Linux OS. I myself would check out the feasibility of those areas before undertaking the translating process.

Eh, maybe you have all your file management tools ready to go?

Quote
Last night I thought, if im going to build something like that, why not just port a really good one for DOS/qbasic to Windows/Linux/Mac qb64?

"Why not just port..."  OK, if you have those file management tools ready...

Don't really care too much about feasibility... Not really on my list of important things :D
no need for file management tools either, kinda missing your point.

First pass done. Not running yet,  but I managed to get the ide to OK... Nothing shows on the screen yet, but that's to be expected I didn't even replace XMS yet.

Code: QB64: [Select]
  1. DECLARE FUNCTION getvar$ (varname$, pid!)
  2. DECLARE FUNCTION readline$ (linenumber%, pid!)
  3. DECLARE FUNCTION window.create! (X1!, Y1!, X2!, Y2!, closebtn!, resizebtn!, movebtn!, title$)
  4. DECLARE SUB setuppointers (mousefile$, mousefile2$)
  5. DECLARE SUB PANIC (message$)
  6. DECLARE SUB background (wallpaper$)
  7. DECLARE SUB fontnormal ()
  8. DECLARE SUB fontload (FileName$)
  9. DECLARE SUB startscript (FileName$, cmd$)
  10. DECLARE SUB putvar (varname$, contents$, pid!)
  11. DECLARE SUB drw3Dbox (X1%, Y1%, X2%, Y2%, col1%, col2%)
  12. DECLARE SUB hidegraph (truth%)
  13. DECLARE SUB screen.setup ()
  14. DECLARE SUB window.manager ()
  15. DECLARE SUB window.paint (X1%, Y1%, X2%, Y2%, closebtn%, resizebtn%, movebtn%, title$, active%)
  16. DECLARE SUB winvput (id!)
  17. DECLARE SUB winvsave (id!)
  18. DECLARE SUB setpoi (FileName$, v$)
  19. DECLARE SUB timerset (truth%)
  20. DECLARE SUB startup ()
  21. DECLARE SUB scrshot ()
  22. DECLARE SUB chactcol (newcol!)
  23. DECLARE SUB chnonactcol (newcol!)
  24. DECLARE SUB chbcolor (newcol!)
  25. DECLARE SUB chwallpaper (newfile$)
  26.  
  27. CONST true = 1, false = 0 ' real logic
  28. CONST maxwins = 30 ' always +2 more then actual value
  29. CONST stfile$ = "SHELL.XSF" ' first ran script file
  30.  
  31. DIM SHARED pcxpal AS STRING * 768, refreshwindows
  32. DIM SHARED maxx, maxy
  33. DIM SHARED mx%, my%, mb%, bgcolor, openwins
  34. DIM SHARED actcolor, nonactcolor, titlecolor
  35. DIM SHARED bghandle%, crhandle%
  36. DIM SHARED mainmem$(1 TO maxwins), IP(1 TO maxwins) AS INTEGER
  37. DIM SHARED vtx%(1 TO maxwins), vty%(1 TO maxwins)
  38. DIM SHARED flags1%(1 TO maxwins), flags2%(1 TO maxwins), flags3%(1 TO maxwins)
  39. DIM SHARED co1%(1 TO maxwins), co2%(1 TO maxwins)
  40. DIM SHARED pstack$(1 TO maxwins)
  41. DIM SHARED pcommand$(1 TO maxwins), pfiles$(1 TO maxwins)
  42. DIM SHARED homedir$, derror(1 TO maxwins)
  43. DIM SHARED sfonx%, sfony%, sfon$, fon AS STRING * 4098
  44. DIM SHARED repair, switch
  45.  
  46. TYPE windows
  47.     objectID AS INTEGER ' ID of window environment
  48.     X1 AS INTEGER ' windows x1
  49.     Y1 AS INTEGER ' windows y1
  50.     X2 AS INTEGER ' windows x2
  51.     Y2 AS INTEGER ' windows y2
  52.     closebtn AS INTEGER ' window close button truth
  53.     resizebtn AS INTEGER ' window resize button truth
  54.     movebtn AS INTEGER ' window titlebar show truth
  55.     title AS STRING * 60 ' window title
  56.     virtual AS INTEGER ' window virtual screen pointer to XMS
  57.  
  58. DIM SHARED win(1 TO maxwins) AS windows
  59.  
  60. DIM SHARED mousepointer$, mousetimer$
  61.  
  62. startup
  63. START: CLEAR
  64.  
  65. homedir$ = CURDIR$
  66. switch = true
  67.  
  68. ON ERROR GOTO errhandler
  69.  
  70. screen.setup
  71.  
  72. IF DIR$(stfile$) <> "" THEN
  73.     startscript stfile$, ""
  74.     PANIC stfile$ + " main script not found."
  75.  
  76.     MOUSESTATUS x%, y%, b%
  77.     scrshot
  78.     window.manager
  79.     IF refreshwindows = false AND openwins <> false THEN
  80.         activewin = win(openwins).objectID
  81.         X1 = win(openwins).X1 + 2: Y1 = win(openwins).Y1 + 2
  82.         X2 = win(openwins).X2 - 2: Y2 = win(openwins).Y2 - 2
  83.         IF win(openwins).movebtn THEN Y1 = Y1 + 18
  84.         IF win(openwins).resizebtn THEN X2 = X2 - 19: Y2 = Y2 - 19
  85.         a$ = readline$(IP(activewin), activewin)
  86.         derror = false
  87.         IF a$ = "R" THEN
  88.             p$ = pstack$(activewin)
  89.             DO
  90.                 IF INSTR(p$, ".") = false THEN EXIT DO
  91.                 p$ = MID$(p$, INSTR(p$, ".") + 1)
  92.             LOOP
  93.             pstack$(activewin) = LEFT$(pstack$(activewin), LEN(pstack$(activewin)) - LEN(p$) - 1)
  94.             IP(activewin) = VAL(p$)
  95.         END IF
  96.         IF LEFT$(a$, 1) = CHR$(1) THEN
  97.             p$ = LTRIM$(MID$(a$, 2))
  98.             pstack$(activewin) = pstack$(activewin) + "." + LTRIM$(STR$(IP(activewin)))
  99.             label$ = UCASE$(p$): GOTO jump
  100.         END IF
  101.         IF LEFT$(a$, 1) = ">" THEN
  102.             p$ = LTRIM$(MID$(a$, 2))
  103.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  104.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  105.             _MOUSEHIDE
  106.             h% = XMSSCREENGET%
  107.             OUT 968, 66
  108.             SHELL p$
  109.             OUT 968, 0
  110.             e% = XMSSCREENPUT%(h%)
  111.             e% = XMSFREE%(h%)
  112.             _MOUSESHOW
  113.         END IF
  114.         IF LEFT$(a$, 1) = "!" THEN
  115.             p$ = LTRIM$(MID$(a$, 2))
  116.             IF RIGHT$(p$, 1) = "$" OR RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  117.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  118.             PANIC p$
  119.         END IF
  120.         IF LEFT$(a$, 1) = "@" THEN
  121.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  122.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  123.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  124.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  125.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  126.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  127.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  128.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  129.             _MOUSEHIDE
  130.             'SETVIEW X1, Y1, X2, Y2
  131.             winvsave openwins
  132.             'SETVIEW 0, 0, maxx, maxy
  133.             dummy% = XMSBLKPUT%(1, 0, 0, crhandle%)
  134.             _MOUSESHOW
  135.             win(openwins).X1 = VAL(a1$): win(openwins).Y1 = VAL(a2$)
  136.             win(openwins).X2 = VAL(a3$): win(openwins).Y2 = VAL(a4$)
  137.             IF win(openwins).X2 > maxx THEN win(openwins).X2 = maxx
  138.             IF win(openwins).Y2 > maxy THEN win(openwins).Y2 = maxy
  139.             refreshwindows = true
  140.             repair = true
  141.         END IF
  142.         IF a$ = "S-" THEN switch = false
  143.         IF a$ = "S+" THEN switch = true
  144.         IF LEFT$(a$, 1) = "`" THEN
  145.             p$ = LTRIM$(MID$(a$, 2))
  146.             putvar p$, STR$(repair), activewin
  147.             repair = false
  148.         END IF
  149.         IF LEFT$(a$, 1) = "c" THEN
  150.             p$ = LTRIM$(MID$(a$, 2))
  151.             IF RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  152.             bgcolor = VAL(p$)
  153.             chbcolor bgcolor
  154.             refreshwindows = true
  155.             repair = true
  156.         END IF
  157.         IF LEFT$(a$, 1) = "n" THEN
  158.             p$ = LTRIM$(MID$(a$, 2))
  159.             IF RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  160.             nonactcolor = VAL(p$)
  161.             chnonactcol nonactcolor
  162.             refreshwindows = true
  163.             repair = true
  164.         END IF
  165.         IF LEFT$(a$, 1) = "a" THEN
  166.             p$ = LTRIM$(MID$(a$, 2))
  167.             IF RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  168.             actcolor = VAL(p$)
  169.             chactcol actcolor
  170.             refreshwindows = true
  171.             repair = true
  172.         END IF
  173.         IF LEFT$(a$, 1) = "\" THEN
  174.             p$ = LTRIM$(MID$(a$, 2))
  175.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  176.             fontload p$
  177.             sfon$ = p$
  178.             FK = FREEFILE: KL = false
  179.             OPEN "SETTINGS.INI" FOR INPUT AS FK
  180.             FL = FREEFILE
  181.             OPEN "SETTINGS.TMP" FOR OUTPUT AS FL
  182.             DO UNTIL EOF(FK)
  183.                 LINE INPUT #FK, h$
  184.                 h$ = UCASE$(LTRIM$(h$))
  185.                 IF LEFT$(h$, 12) = "SYSTEM FONT " THEN
  186.                     PRINT #FL, "SYSTEM FONT " + p$: KL = true
  187.                 ELSE
  188.                     PRINT #FL, h$
  189.                 END IF
  190.             LOOP
  191.             IF KL = false THEN PRINT #FL, "SYSTEM FONT " + p$
  192.             CLOSE FK, FL
  193.             OPEN "SETTINGS.INI" FOR OUTPUT AS FK
  194.             OPEN "SETTINGS.TMP" FOR INPUT AS FL
  195.             DO UNTIL EOF(FL)
  196.                 LINE INPUT #FL, h$: PRINT #FK, h$
  197.             LOOP
  198.             CLOSE FK, FL
  199.             KILL "SETTINGS.TMP"
  200.             refreshwindows = true
  201.             repair = true
  202.         END IF
  203.         IF LEFT$(a$, 1) = "t" THEN
  204.             p$ = LTRIM$(MID$(a$, 2))
  205.             IF RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  206.             titlecolor = VAL(p$)
  207.             FK = FREEFILE: KL = false
  208.             OPEN "SETTINGS.INI" FOR INPUT AS FK
  209.             FL = FREEFILE
  210.             OPEN "SETTINGS.TMP" FOR OUTPUT AS FL
  211.             DO UNTIL EOF(FK)
  212.                 LINE INPUT #FK, h$
  213.                 h$ = UCASE$(LTRIM$(h$))
  214.                 IF LEFT$(h$, 12) = "TITLE COLOR " THEN
  215.                     PRINT #FL, "TITLE COLOR " + p$: KL = true
  216.                 ELSE
  217.                     PRINT #FL, h$
  218.                 END IF
  219.             LOOP
  220.             IF KL = false THEN PRINT #FL, "TITLE COLOR " + p$
  221.             CLOSE FK, FL
  222.             OPEN "SETTINGS.INI" FOR OUTPUT AS FK
  223.             OPEN "SETTINGS.TMP" FOR INPUT AS FL
  224.             DO UNTIL EOF(FL)
  225.                 LINE INPUT #FL, h$: PRINT #FK, h$
  226.             LOOP
  227.             CLOSE FK, FL
  228.             KILL "SETTINGS.TMP"
  229.             refreshwindows = true
  230.             repair = true
  231.         END IF
  232.         IF LEFT$(a$, 1) = "b" THEN
  233.             p$ = LTRIM$(MID$(a$, 2))
  234.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  235.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  236.             background p$ + "~"
  237.             chwallpaper p$
  238.         END IF
  239.         IF LEFT$(a$, 1) = "#" THEN
  240.             p$ = LTRIM$(MID$(a$, 2))
  241.             IF RIGHT$(p$, 1) = "$" OR RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  242.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  243.             win(openwins).title = p$
  244.             _MOUSEHIDE
  245.             window.paint win(openwins).X1, win(openwins).Y1, win(openwins).X2, win(openwins).Y2, win(openwins).closebtn, win(openwins).resizebtn, win(openwins).movebtn, CHR$(3) + p$, true
  246.             _MOUSESHOW
  247.         END IF
  248.         IF LEFT$(a$, 3) = "GP " THEN
  249.             p$ = LTRIM$(MID$(a$, 4)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  250.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  251.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  252.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  253.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  254.             putvar a1$, STR$(GETPOINT%(VAL(a2$) + X1, VAL(a3$) + Y1)), activewin
  255.         END IF
  256.         IF LEFT$(a$, 3) = "FA " THEN
  257.             p$ = LTRIM$(MID$(a$, 4)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  258.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  259.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  260.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  261.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  262.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  263.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  264.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  265.             'SETVIEW X1, Y1, X2, Y2
  266.             FILLAREA VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a3$), VAL(a4$)
  267.             'SETVIEW 0, 0, maxx, maxy
  268.         END IF
  269.         IF LEFT$(a$, 3) = "HD " THEN putvar LTRIM$(MID$(a$, 4)), homedir$, activewin
  270.         IF LEFT$(a$, 3) = "OP " THEN
  271.             p$ = LTRIM$(MID$(a$, 4))
  272.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  273.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  274.             FF = FREEFILE
  275.             OPEN p$ FOR OUTPUT AS FF
  276.             FOR R = 1 TO maxwins - 1
  277.                 IF win(R).objectID <> false THEN PRINT #FF, RTRIM$(win(R).title) + " " + STR$(win(R).objectID) + CHR$(13)
  278.             NEXT
  279.             CLOSE FF
  280.         END IF
  281.         IF LEFT$(a$, 3) = "XF " THEN
  282.             p$ = LTRIM$(MID$(a$, 4))
  283.             IF RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  284.             dummy% = XMSFREE%(VAL(p$))
  285.         END IF
  286.         IF LEFT$(a$, 3) = "XP " THEN
  287.             p$ = LTRIM$(MID$(a$, 4)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  288.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  289.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  290.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  291.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  292.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  293.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  294.             a4$ = getvar$(a4$, activewin)
  295.             'SETVIEW X1, Y1, X2, Y2
  296.             dummy% = XMSBLKPUT%(VAL(a3$), VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a4$))
  297.             'SETVIEW 0, 0, maxx, maxy
  298.         END IF
  299.         IF LEFT$(a$, 3) = "XG " THEN
  300.             p$ = LTRIM$(MID$(a$, 4)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  301.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  302.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  303.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  304.             a5$ = MID$(p$, INSTR(p$, ",") + 1)
  305.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  306.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  307.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  308.             IF RIGHT$(a5$, 1) = "%" THEN a5$ = getvar$(a5$, activewin)
  309.             putvar a1$, STR$(XMSBLKGET%(VAL(a2$) + X1, VAL(a3$) + Y1, VAL(a4$) + X1, VAL(a5$) + Y1)), activewin
  310.         END IF
  311.         IF LEFT$(a$, 4) = "_GC " THEN
  312.             p$ = LTRIM$(MID$(a$, 5))
  313.             putvar p$, pcommand$(activewin), activewin
  314.         END IF
  315.         IF LEFT$(a$, 1) = CHR$(43) THEN
  316.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  317.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  318.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  319.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  320.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  321.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  322.             DEF SEG = VAL(a1$)
  323.             POKE VAL(a2$), VAL(a3$)
  324.             DEF SEG
  325.         END IF
  326.         IF LEFT$(a$, 1) = CHR$(45) THEN
  327.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  328.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  329.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  330.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  331.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  332.             DEF SEG = VAL(a2$)
  333.             putvar a1$, STR$(PEEK(VAL(a3$))), activewin
  334.             DEF SEG
  335.         END IF
  336.         IF LEFT$(a$, 1) = CHR$(202) THEN
  337.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  338.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  339.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  340.             IF RIGHT$(a2$, 1) = "$" THEN a2$ = getvar$(a2$, activewin)
  341.             IF RIGHT$(a3$, 1) = "$" THEN a3$ = getvar$(a3$, activewin)
  342.             IF LEFT$(a3$, 1) = CHR$(34) THEN a3$ = MID$(a3$, 2): a3$ = LEFT$(a3$, LEN(a3$) - 1)
  343.             putvar a1$, STR$(INSTR(a2$, a3$)), activewin
  344.         END IF
  345.         IF LEFT$(a$, 4) = "POI " THEN
  346.             p$ = LTRIM$(MID$(a$, 5))
  347.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  348.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  349.             setpoi p$, mousepointer$
  350.         END IF
  351.         IF LEFT$(a$, 4) = "DIR " THEN
  352.             p$ = LTRIM$(MID$(a$, 5))
  353.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  354.             IF RIGHT$(d$, 1) = "$" THEN d$ = getvar$(d$, activewin)
  355.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  356.             IF LEFT$(d$, 1) = CHR$(34) THEN d$ = MID$(d$, 2): d$ = LEFT$(d$, LEN(d$) - 1)
  357.             IF LEFT$(s$, 1) = CHR$(34) THEN s$ = MID$(s$, 2): s$ = LEFT$(s$, LEN(s$) - 1)
  358.             FF = FREEFILE
  359.             OPEN d$ FOR OUTPUT AS FF
  360.             f$ = DIR$(s$)
  361.             PRINT #FF, f$
  362.             DO UNTIL f$ = ""
  363.                 'f$ = DIR$
  364.                 PRINT #FF, f$
  365.             LOOP
  366.             CLOSE FF
  367.         END IF
  368.         IF LEFT$(a$, 4) = "PID " THEN
  369.             p$ = LTRIM$(MID$(a$, 5))
  370.             putvar p$, STR$(activewin), activewin
  371.         END IF
  372.         IF LEFT$(a$, 1) = CHR$(201) THEN
  373.             p$ = LTRIM$(MID$(a$, 2))
  374.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  375.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  376.             putvar d$, STR$(VAL(s$)), activewin
  377.         END IF
  378.         IF LEFT$(a$, 1) = CHR$(253) THEN
  379.             p$ = LTRIM$(MID$(a$, 2))
  380.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  381.             putvar d$, STR$(sfonx%), activewin
  382.             putvar s$, STR$(sfony%), activewin
  383.         END IF
  384.         IF LEFT$(a$, 1) = "{" THEN
  385.             p$ = LTRIM$(MID$(a$, 2))
  386.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  387.             putvar d$, STR$(maxx), activewin
  388.             putvar s$, STR$(maxy), activewin
  389.         END IF
  390.         IF LEFT$(a$, 4) = "EOF " THEN
  391.             p$ = LTRIM$(MID$(a$, 5))
  392.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  393.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  394.             putvar d$, STR$(EOF(VAL(s$))), activewin
  395.         END IF
  396.         IF LEFT$(a$, 4) = "LOF " THEN
  397.             p$ = LTRIM$(MID$(a$, 5))
  398.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  399.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  400.             putvar d$, STR$(LOF(VAL(s$))), activewin
  401.         END IF
  402.         IF LEFT$(a$, 3) = "FP " THEN
  403.             p$ = LTRIM$(MID$(a$, 4))
  404.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  405.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin)
  406.             IF LEFT$(s$, 1) = CHR$(34) THEN s$ = MID$(s$, 2): s$ = LEFT$(s$, LEN(s$) - 1)
  407.             PUT #VAL(d$), , s$
  408.         END IF
  409.         IF LEFT$(a$, 3) = "FG " THEN
  410.             p$ = LTRIM$(MID$(a$, 4))
  411.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  412.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  413.             GET #VAL(s$), , f$
  414.             putvar d$, f$, activewin
  415.         END IF
  416.         IF LEFT$(a$, 3) = "FW " THEN
  417.             p$ = LTRIM$(MID$(a$, 4))
  418.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  419.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin)
  420.             IF RIGHT$(s$, 1) = "$" OR RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  421.             IF LEFT$(s$, 1) = CHR$(34) THEN s$ = MID$(s$, 2): s$ = LEFT$(s$, LEN(s$) - 1)
  422.             PRINT #VAL(d$), s$
  423.         END IF
  424.         IF LEFT$(a$, 3) = "FI " THEN
  425.             p$ = LTRIM$(MID$(a$, 4))
  426.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  427.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  428.             LINE INPUT #VAL(s$), f$
  429.             putvar d$, f$, activewin
  430.         END IF
  431.         IF LEFT$(a$, 1) = "Z" THEN
  432.             p$ = LTRIM$(MID$(a$, 2))
  433.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  434.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  435.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin)
  436.             IF VAL(d$) > 0 THEN
  437.                 FOR dummy = 1 TO VAL(d$)
  438.                     LINE INPUT #VAL(s$), dummy$
  439.                     IF EOF(VAL(s$)) THEN EXIT FOR
  440.                 NEXT
  441.             END IF
  442.         END IF
  443.         IF LEFT$(a$, 3) = "FH " THEN putvar LTRIM$(MID$(a$, 4)), STR$(FREEFILE), activewin
  444.         IF LEFT$(a$, 3) = "CL " THEN
  445.             p$ = LTRIM$(MID$(a$, 4))
  446.             IF RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  447.             f = VAL(p$)
  448.             FOR FF = 1 TO LEN(pfiles$(activewin))
  449.                 m$ = MID$(pfiles$(activewin), FF)
  450.                 IF pfiles$(activewin) <> "" THEN
  451.                     IF ASC(m$) = f THEN pfiles$(activewin) = LEFT$(pfiles$(activewin), FF - 1) + MID$(pfiles$(activewin), FF + 1)
  452.                 END IF
  453.             NEXT
  454.             CLOSE f
  455.         END IF
  456.         IF LEFT$(a$, 1) = "J" THEN
  457.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  458.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  459.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  460.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  461.             p$ = MID$(p$, INSTR(p$, ",") + 1): a5$ = LEFT$(p$, INSTR(p$, ",") - 1)
  462.             a6$ = MID$(p$, INSTR(p$, ",") + 1)
  463.             'JOYSTICKINFO jax%, jay%, jab%, jbx%, jby%, jbb%
  464.             putvar a1$, STR$(jax%), activewin
  465.             putvar a2$, STR$(jay%), activewin
  466.             putvar a3$, STR$(jab%), activewin
  467.             putvar a4$, STR$(jbx%), activewin
  468.             putvar a5$, STR$(jby%), activewin
  469.             putvar a6$, STR$(jbb%), activewin
  470.         END IF
  471.         IF LEFT$(a$, 2) = "O " THEN
  472.             p$ = LTRIM$(MID$(a$, 3)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  473.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  474.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  475.             IF RIGHT$(a1$, 1) = "$" THEN a1$ = getvar$(a1$, activewin)
  476.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  477.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  478.             IF LEFT$(a1$, 1) = CHR$(34) THEN a1$ = MID$(a1$, 2): a1$ = LEFT$(a1$, LEN(a1$) - 1)
  479.             SELECT CASE VAL(a2$)
  480.                 CASE 1: OPEN a1$ FOR INPUT AS VAL(a3$)
  481.                 CASE 2: OPEN a1$ FOR APPEND AS VAL(a3$)
  482.                 CASE 3: OPEN a1$ FOR OUTPUT AS VAL(a3$)
  483.                 CASE 4: OPEN a1$ FOR BINARY AS VAL(a3$)
  484.                 CASE 5: OPEN a1$ FOR RANDOM AS VAL(a3$)
  485.             END SELECT
  486.             pfiles$(activewin) = CHR$(VAL(a3$))
  487.         END IF
  488.         IF LEFT$(a$, 4) = "TMR " THEN putvar LTRIM$(MID$(a$, 5)), STR$(TIMER), activewin
  489.         IF LEFT$(a$, 4) = "RAN " THEN
  490.             p$ = LTRIM$(MID$(a$, 5))
  491.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  492.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  493.             RANDOMIZE TIMER
  494.             putvar d$, STR$(INT(RND * VAL(s$))), activewin
  495.         END IF
  496.         IF LEFT$(a$, 4) = "MOD " THEN
  497.             p$ = LTRIM$(MID$(a$, 5)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  498.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  499.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  500.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  501.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  502.             putvar a1$, STR$(VAL(a2$) MOD VAL(a3$)), activewin
  503.         END IF
  504.         IF LEFT$(a$, 4) = "OCT " THEN
  505.             p$ = LTRIM$(MID$(a$, 5))
  506.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  507.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  508.             putvar d$, OCT$(VAL(s$)), activewin
  509.         END IF
  510.         IF LEFT$(a$, 4) = "HEX " THEN
  511.             p$ = LTRIM$(MID$(a$, 5))
  512.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  513.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  514.             putvar d$, HEX$(VAL(s$)), activewin
  515.         END IF
  516.         IF LEFT$(a$, 4) = "ATN " THEN
  517.             p$ = LTRIM$(MID$(a$, 5))
  518.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  519.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  520.             putvar d$, STR$(ATN(VAL(s$))), activewin
  521.         END IF
  522.         IF LEFT$(a$, 4) = "TAN " THEN
  523.             p$ = LTRIM$(MID$(a$, 5))
  524.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  525.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  526.             putvar d$, STR$(TAN(VAL(s$))), activewin
  527.         END IF
  528.         IF LEFT$(a$, 4) = "SIN " THEN
  529.             p$ = LTRIM$(MID$(a$, 5))
  530.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  531.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  532.             putvar d$, STR$(SIN(VAL(s$))), activewin
  533.         END IF
  534.         IF LEFT$(a$, 4) = "COS " THEN
  535.             p$ = LTRIM$(MID$(a$, 5))
  536.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  537.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  538.             putvar d$, STR$(COS(VAL(s$))), activewin
  539.         END IF
  540.         IF LEFT$(a$, 4) = "ABS " THEN
  541.             p$ = LTRIM$(MID$(a$, 5))
  542.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  543.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  544.             putvar d$, STR$(ABS(VAL(s$))), activewin
  545.         END IF
  546.         IF LEFT$(a$, 1) = CHR$(204) THEN
  547.             p$ = LTRIM$(MID$(a$, 2))
  548.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  549.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin)
  550.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  551.             SOUND VAL(d$), VAL(s$)
  552.         END IF
  553.         IF LEFT$(a$, 1) = CHR$(203) THEN
  554.             p$ = LTRIM$(MID$(a$, 2))
  555.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  556.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  557.             putvar d$, STR$(LEN(s$)), activewin
  558.         END IF
  559.         IF LEFT$(a$, 1) = CHR$(200) THEN
  560.             p$ = LTRIM$(MID$(a$, 2))
  561.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  562.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  563.             putvar d$, LCASE$(s$), activewin
  564.         END IF
  565.         IF LEFT$(a$, 1) = CHR$(199) THEN
  566.             p$ = LTRIM$(MID$(a$, 2))
  567.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  568.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  569.             putvar d$, UCASE$(s$), activewin
  570.         END IF
  571.         IF LEFT$(a$, 1) = CHR$(198) THEN
  572.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  573.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  574.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  575.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  576.             IF RIGHT$(a2$, 1) = "$" THEN a2$ = getvar$(a2$, activewin)
  577.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  578.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  579.             IF VAL(a4$) <> false THEN g$ = MID$(a2$, VAL(a3$), VAL(a4$)) ELSE g$ = MID$(a2$, VAL(a3$))
  580.             putvar a1$, g$, activewin
  581.         END IF
  582.         IF LEFT$(a$, 1) = CHR$(197) THEN
  583.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  584.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  585.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  586.             IF RIGHT$(a2$, 1) = "$" THEN a2$ = getvar$(a2$, activewin)
  587.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  588.             putvar a1$, RIGHT$(a2$, VAL(a3$)), activewin
  589.         END IF
  590.         IF LEFT$(a$, 1) = CHR$(196) THEN
  591.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  592.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  593.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  594.             IF RIGHT$(a2$, 1) = "$" THEN a2$ = getvar$(a2$, activewin)
  595.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  596.             putvar a1$, LEFT$(a2$, VAL(a3$)), activewin
  597.         END IF
  598.         IF LEFT$(a$, 1) = CHR$(195) THEN putvar LTRIM$(MID$(a$, 2)), STR$(derror(activewin)), activewin: derror(activewin) = false
  599.         IF LEFT$(a$, 1) = CHR$(194) THEN
  600.             p$ = LTRIM$(MID$(a$, 2))
  601.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  602.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  603.             putvar d$, RTRIM$(LTRIM$(s$)), activewin
  604.         END IF
  605.         IF LEFT$(a$, 1) = CHR$(193) THEN
  606.             p$ = LTRIM$(MID$(a$, 2))
  607.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  608.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  609.             putvar d$, RTRIM$(s$), activewin
  610.         END IF
  611.         IF LEFT$(a$, 1) = CHR$(192) THEN
  612.             p$ = LTRIM$(MID$(a$, 2))
  613.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  614.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  615.             putvar d$, LTRIM$(s$), activewin
  616.         END IF
  617.         IF LEFT$(a$, 1) = CHR$(191) THEN
  618.             p$ = LTRIM$(MID$(a$, 2))
  619.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  620.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  621.             putvar d$, CHR$(VAL(s$)), activewin
  622.         END IF
  623.         IF LEFT$(a$, 1) = CHR$(190) THEN
  624.             p$ = LTRIM$(MID$(a$, 2))
  625.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  626.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  627.             IF s$ <> "" THEN putvar d$, STR$(ASC(s$)), activewin
  628.         END IF
  629.         IF LEFT$(a$, 1) = CHR$(137) THEN
  630.             p$ = LTRIM$(MID$(a$, 2))
  631.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  632.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin)
  633.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  634.             OUT VAL(d$), VAL(s$)
  635.         END IF
  636.         IF LEFT$(a$, 1) = CHR$(138) THEN
  637.             p$ = LTRIM$(MID$(a$, 2))
  638.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  639.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin)
  640.             putvar s$, STR$(INP(VAL(d$))), activewin
  641.         END IF
  642.         IF a$ = "RES" THEN RES = true: EXIT DO
  643.         IF a$ = "SYS" THEN EXIT DO
  644.         IF LEFT$(a$, 1) = CHR$(136) THEN
  645.             p$ = LTRIM$(MID$(a$, 2))
  646.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  647.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  648.             DATE$ = p$
  649.         END IF
  650.         IF LEFT$(a$, 1) = CHR$(135) THEN
  651.             p$ = LTRIM$(MID$(a$, 2))
  652.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  653.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  654.             TIME$ = p$
  655.         END IF
  656.         IF LEFT$(a$, 1) = CHR$(134) THEN putvar LTRIM$(MID$(a$, 2)), DATE$, activewin
  657.         IF LEFT$(a$, 1) = CHR$(133) THEN putvar LTRIM$(MID$(a$, 2)), TIME$, activewin
  658.         IF LEFT$(a$, 1) = CHR$(182) THEN
  659.             p$ = LTRIM$(MID$(a$, 2))
  660.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  661.             IF RIGHT$(d$, 1) = "$" THEN d$ = getvar$(d$, activewin)
  662.             IF LEFT$(d$, 1) = CHR$(34) THEN d$ = MID$(d$, 2): d$ = LEFT$(d$, LEN(d$) - 1)
  663.             IF DIR$(d$) <> "" THEN putvar s$, STR$(true), activewin ELSE putvar s$, STR$(false), activewin
  664.         END IF
  665.         IF LEFT$(a$, 1) = CHR$(181) THEN
  666.             p$ = LTRIM$(MID$(a$, 2))
  667.             putvar p$, CURDIR$, activewin
  668.         END IF
  669.         IF LEFT$(a$, 1) = CHR$(180) THEN
  670.             p$ = LTRIM$(MID$(a$, 2))
  671.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar$(p$, activewin)
  672.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  673.             'CHDRIVE p$
  674.             CHDIR p$
  675.         END IF
  676.         IF LEFT$(a$, 1) = CHR$(170) THEN
  677.             p$ = LTRIM$(MID$(a$, 2))
  678.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  679.             IF RIGHT$(d$, 1) = "$" THEN d$ = getvar$(d$, activewin)
  680.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  681.             IF LEFT$(d$, 1) = CHR$(34) THEN d$ = MID$(d$, 2): d$ = LEFT$(d$, LEN(d$) - 1)
  682.             IF LEFT$(s$, 1) = CHR$(34) THEN s$ = MID$(s$, 2): s$ = LEFT$(s$, LEN(s$) - 1)
  683.             IF INSTR(d$, ".") = false THEN d$ = d$ + ".XSF"
  684.             IF d$ <> "" AND LEFT$(d$, 1) <> "." THEN
  685.                 IF DIR$(d$) <> "" THEN
  686.                     _MOUSEHIDE
  687.                     winvsave openwins
  688.                     _MOUSESHOW
  689.                     startscript d$, s$
  690.                 ELSE
  691.                     derror(activewin) = 53
  692.                 END IF
  693.             END IF
  694.         END IF
  695.         IF LEFT$(a$, 1) = CHR$(171) THEN
  696.             p$ = LTRIM$(MID$(a$, 2))
  697.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  698.             IF RIGHT$(d$, 1) = "$" THEN d$ = getvar$(d$, activewin)
  699.             IF LEFT$(d$, 1) = CHR$(34) THEN d$ = MID$(d$, 2): d$ = LEFT$(d$, LEN(d$) - 1)
  700.             RMDIR d$
  701.             putvar s$, STR$(derror(activewin)), activewin
  702.         END IF
  703.         IF LEFT$(a$, 1) = CHR$(172) THEN
  704.             p$ = LTRIM$(MID$(a$, 2))
  705.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  706.             IF RIGHT$(d$, 1) = "$" THEN d$ = getvar$(d$, activewin)
  707.             IF LEFT$(d$, 1) = CHR$(34) THEN d$ = MID$(d$, 2): d$ = LEFT$(d$, LEN(d$) - 1)
  708.             MKDIR d$
  709.             putvar s$, STR$(derror(activewin)), activewin
  710.         END IF
  711.         IF LEFT$(a$, 1) = CHR$(165) THEN
  712.             p$ = LTRIM$(MID$(a$, 2))
  713.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  714.             IF RIGHT$(d$, 1) = "$" THEN d$ = getvar$(d$, activewin)
  715.             IF LEFT$(d$, 1) = CHR$(34) THEN d$ = MID$(d$, 2): d$ = LEFT$(d$, LEN(d$) - 1)
  716.             KILL d$
  717.             putvar s$, STR$(derror(activewin)), activewin
  718.         END IF
  719.         IF LEFT$(a$, 1) = CHR$(164) THEN
  720.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  721.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  722.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  723.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  724.             IF RIGHT$(a4$, 1) = "$" THEN a4$ = getvar$(a4$, activewin)
  725.             IF LEFT$(a4$, 1) = CHR$(34) THEN a4$ = MID$(a4$, 2): a4$ = LEFT$(a4$, LEN(a4$) - 1)
  726.             dummy% = PNGGETINFO%(a4$, x%, y%)
  727.             putvar a1$, STR$(x%), activewin: putvar a2$, STR$(y%), activewin
  728.             putvar a3$, STR$(cols%), activewin
  729.         END IF
  730.         IF LEFT$(a$, 1) = CHR$(163) THEN
  731.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  732.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  733.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  734.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  735.             a5$ = MID$(p$, INSTR(p$, ",") + 1)
  736.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  737.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  738.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  739.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  740.             IF RIGHT$(a5$, 1) = "$" THEN a5$ = getvar$(a5$, activewin)
  741.             IF LEFT$(a5$, 1) = CHR$(34) THEN a5$ = MID$(a5$, 2): a5$ = LEFT$(a5$, LEN(a5$) - 1)
  742.             _MOUSEHIDE
  743.             'SETVIEW X1, Y1, X2, Y2
  744.             dummy% = PNGMAKE%(VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a3$) + X1, VAL(a4$) + Y1, a5$)
  745.             'SETVIEW 0, 0, maxx, maxy
  746.             _MOUSESHOW
  747.         END IF
  748.         IF LEFT$(a$, 1) = CHR$(162) THEN
  749.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  750.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  751.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  752.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  753.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  754.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  755.             IF RIGHT$(a3$, 1) = "$" THEN a3$ = getvar$(a3$, activewin)
  756.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  757.             IF LEFT$(a3$, 1) = CHR$(34) THEN a3$ = MID$(a3$, 2): a3$ = LEFT$(a3$, LEN(a3$) - 1)
  758.             _MOUSEHIDE
  759.             'SETVIEW X1, Y1, X2, Y2
  760.             dummy% = PNGPUT%(VAL(a1$) + X1, VAL(a2$) + Y1, a3$)
  761.             'SETVIEW 0, 0, maxx, maxy
  762.             _MOUSESHOW
  763.         END IF
  764.         IF LEFT$(a$, 1) = CHR$(161) THEN
  765.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  766.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  767.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  768.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  769.             a5$ = MID$(p$, INSTR(p$, ",") + 1)
  770.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  771.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  772.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  773.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  774.             IF RIGHT$(a5$, 1) = "%" THEN a5$ = getvar$(a5$, activewin)
  775.             'SETVIEW X1, Y1, X2, Y2
  776.             DRWCIRCLE VAL(a5$), VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a3$)
  777.             'SETVIEW 0, 0, maxx, maxy
  778.         END IF
  779.         IF LEFT$(a$, 1) = ")" THEN
  780.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  781.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  782.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  783.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  784.             a5$ = MID$(p$, INSTR(p$, ",") + 1)
  785.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  786.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  787.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  788.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  789.             IF RIGHT$(a5$, 1) = "%" THEN a5$ = getvar$(a5$, activewin)
  790.             'SETVIEW X1, Y1, X2, Y2
  791.             DRWFILLCIRCLE VAL(a5$), VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a3$)
  792.             'SETVIEW 0, 0, maxx, maxy
  793.         END IF
  794.         IF a$ = CHR$(155) THEN _MOUSEHIDE
  795.         IF a$ = CHR$(156) THEN _MOUSESHOW
  796.         IF LEFT$(a$, 1) = CHR$(160) THEN
  797.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  798.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  799.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  800.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  801.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  802.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  803.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  804.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  805.             'SETVIEW X1, Y1, X2, Y2
  806.             DRWPOINT VAL(a4$), VAL(a1$) + X1, VAL(a2$) + Y1
  807.             'SETVIEW 0, 0, maxx, maxy
  808.         END IF
  809.         IF LEFT$(a$, 1) = CHR$(159) THEN
  810.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  811.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  812.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  813.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  814.             p$ = MID$(p$, INSTR(p$, ",") + 1): a5$ = LEFT$(p$, INSTR(p$, ",") - 1)
  815.             a6$ = MID$(p$, INSTR(p$, ",") + 1)
  816.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  817.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  818.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  819.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  820.             IF RIGHT$(a5$, 1) = "%" THEN a5$ = getvar$(a5$, activewin)
  821.             IF RIGHT$(a6$, 1) = "%" THEN a6$ = getvar$(a6$, activewin)
  822.             'SETVIEW X1, Y1, X2, Y2
  823.             DRWFILLBOX VAL(a6$), VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a3$) + X1, VAL(a4$) + Y1
  824.             'SETVIEW 0, 0, maxx, maxy
  825.         END IF
  826.         IF LEFT$(a$, 1) = CHR$(158) THEN
  827.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  828.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  829.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  830.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  831.             p$ = MID$(p$, INSTR(p$, ",") + 1): a5$ = LEFT$(p$, INSTR(p$, ",") - 1)
  832.             a6$ = MID$(p$, INSTR(p$, ",") + 1)
  833.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  834.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  835.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  836.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  837.             IF RIGHT$(a5$, 1) = "%" THEN a5$ = getvar$(a5$, activewin)
  838.             IF RIGHT$(a6$, 1) = "%" THEN a6$ = getvar$(a6$, activewin)
  839.             'SETVIEW X1, Y1, X2, Y2
  840.             DRWBOX VAL(a6$), VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a3$) + X1, VAL(a4$) + Y1
  841.             'SETVIEW 0, 0, maxx, maxy
  842.         END IF
  843.         IF LEFT$(a$, 1) = CHR$(157) THEN
  844.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  845.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  846.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  847.             p$ = MID$(p$, INSTR(p$, ",") + 1): a4$ = LEFT$(p$, INSTR(p$, ",") - 1)
  848.             p$ = MID$(p$, INSTR(p$, ",") + 1): a5$ = LEFT$(p$, INSTR(p$, ",") - 1)
  849.             a6$ = MID$(p$, INSTR(p$, ",") + 1)
  850.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = getvar$(a1$, activewin)
  851.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  852.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  853.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar$(a4$, activewin)
  854.             IF RIGHT$(a5$, 1) = "%" THEN a5$ = getvar$(a5$, activewin)
  855.             IF RIGHT$(a6$, 1) = "%" THEN a6$ = getvar$(a6$, activewin)
  856.             'SETVIEW X1, Y1, X2, Y2
  857.             DRWLINE VAL(a6$), VAL(a1$) + X1, VAL(a2$) + Y1, VAL(a3$) + X1, VAL(a4$) + Y1
  858.             'SETVIEW 0, 0, maxx, maxy
  859.         END IF
  860.         IF LEFT$(a$, 3) = "WS " THEN
  861.             p$ = LTRIM$(MID$(a$, 4))
  862.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  863.             putvar d$, STR$(X2 - X1), activewin: putvar s$, STR$(Y2 - Y1), activewin
  864.         END IF
  865.         IF LEFT$(a$, 1) = CHR$(154) THEN
  866.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  867.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  868.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  869.             MOUSESTATUS x%, y%, b%: putvar a1$, STR$(x%), activewin
  870.             putvar a2$, STR$(y%), activewin: putvar a3$, STR$(b%), activewin
  871.         END IF
  872.         IF LEFT$(a$, 1) = CHR$(153) THEN
  873.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  874.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  875.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  876.             MOUSESTATUS x%, y%, b%: putvar a1$, STR$(x% - X1), activewin
  877.             putvar a2$, STR$(y% - Y1), activewin: putvar a3$, STR$(b%), activewin
  878.         END IF
  879.         IF LEFT$(a$, 1) = CHR$(20) THEN
  880.             p$ = LTRIM$(MID$(a$, 2))
  881.             putvar p$, s$, activewin
  882.         END IF
  883.         IF LEFT$(a$, 1) = CHR$(152) THEN
  884.             p$ = LTRIM$(MID$(a$, 2))
  885.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  886.             putvar d$, STR$(vtx%(activewin)), activewin: putvar s$, STR$(vty%(activewin)), activewin
  887.         END IF
  888.         IF LEFT$(a$, 1) = CHR$(151) THEN
  889.             p$ = LTRIM$(MID$(a$, 2))
  890.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  891.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin)
  892.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  893.             vtx%(activewin) = VAL(d$): vty%(activewin) = VAL(s$)
  894.         END IF
  895.         IF LEFT$(a$, 1) = CHR$(132) THEN
  896.             p$ = LTRIM$(MID$(a$, 2)): putvar p$, STR$(VAL(getvar$(p$, activewin)) - 1), activewin
  897.         END IF
  898.         IF LEFT$(a$, 1) = CHR$(131) THEN
  899.             p$ = LTRIM$(MID$(a$, 2)): putvar p$, STR$(VAL(getvar$(p$, activewin)) + 1), activewin
  900.         END IF
  901.         IF LEFT$(a$, 1) = CHR$(17) THEN
  902.             p$ = LTRIM$(MID$(a$, 2))
  903.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  904.             putvar d$, STR$(FIX(VAL(getvar$(s$, activewin)))), activewin
  905.         END IF
  906.         IF LEFT$(a$, 1) = CHR$(143) THEN
  907.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  908.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  909.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  910.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  911.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  912.             putvar a1$, STR$(VAL(a2$) / VAL(a3$)), activewin
  913.         END IF
  914.         IF LEFT$(a$, 1) = CHR$(142) THEN
  915.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  916.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  917.             a3$ = MID$(p$, INSTR(p$, ",") + 1)
  918.             IF RIGHT$(a2$, 1) = "%" THEN a2$ = getvar$(a2$, activewin)
  919.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar$(a3$, activewin)
  920.             putvar a1$, STR$(VAL(a2$) * VAL(a3$)), activewin
  921.         END IF
  922.         IF LEFT$(a$, 1) = CHR$(141) THEN
  923.             p$ = LTRIM$(MID$(a$, 2))
  924.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  925.             IF RIGHT$(d$, 1) = "%" THEN
  926.                 IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  927.                 putvar d$, STR$(VAL(getvar$(d$, activewin)) - VAL(s$)), activewin
  928.             END IF
  929.         END IF
  930.         IF LEFT$(a$, 1) = CHR$(140) THEN
  931.             p$ = LTRIM$(MID$(a$, 2))
  932.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  933.             IF RIGHT$(d$, 1) = "%" THEN
  934.                 IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  935.                 putvar d$, STR$(VAL(getvar$(d$, activewin)) + VAL(s$)), activewin
  936.             END IF
  937.             IF RIGHT$(d$, 1) = "$" THEN
  938.                 IF RIGHT$(s$, 1) = "$" THEN
  939.                     s$ = getvar$(s$, activewin)
  940.                     putvar d$, getvar$(d$, activewin) + s$, activewin
  941.                 ELSE
  942.                     IF LEFT$(s$, 1) = CHR$(34) THEN s$ = MID$(s$, 2): s$ = LEFT$(s$, LEN(s$) - 1)
  943.                     putvar d$, getvar$(d$, activewin) + s$, activewin
  944.                 END IF
  945.             END IF
  946.         END IF
  947.         IF LEFT$(a$, 1) = CHR$(130) THEN
  948.             p$ = LTRIM$(MID$(a$, 2)): a1$ = LEFT$(p$, INSTR(p$, ",") - 1)
  949.             p$ = MID$(p$, INSTR(p$, ",") + 1): a2$ = LEFT$(p$, INSTR(p$, ",") - 1)
  950.             p$ = MID$(p$, INSTR(p$, ",") + 1): a3$ = LEFT$(p$, INSTR(p$, ",") - 1)
  951.             a4$ = MID$(p$, INSTR(p$, ",") + 1)
  952.             IF RIGHT$(a1$, 1) = "$" THEN a1$ = getvar(a1$, activewin)
  953.             IF RIGHT$(a1$, 1) = "%" THEN a1$ = LTRIM$(STR$(VAL(getvar(a1$, activewin))))
  954.             IF LEFT$(a1$, 1) = CHR$(34) THEN a1$ = MID$(a1$, 2): a1$ = LEFT$(a1$, LEN(a1$) - 1)
  955.             IF RIGHT$(a2$, 1) = "$" THEN a2$ = getvar(a2$, activewin)
  956.             IF LEFT$(a2$, 1) = CHR$(34) THEN a2$ = MID$(a2$, 2): a2$ = LEFT$(a2$, LEN(a2$) - 1)
  957.             IF RIGHT$(a3$, 1) = "%" THEN a3$ = getvar(a3$, activewin)
  958.             IF RIGHT$(a4$, 1) = "%" THEN a4$ = getvar(a4$, activewin)
  959.             t$ = UCASE$(LTRIM$(RTRIM$(a2$)))
  960.             IF t$ <> "SYSTEM" THEN
  961.                 IF t$ <> "" THEN fontload a2$ ELSE FONTSYSTEM
  962.             END IF
  963.             _MOUSEHIDE
  964.             'SETVIEW X1, Y1, X2, Y2
  965.             DRWSTRING co1%(activewin), co2%(activewin), a1$, X1 + VAL(a3$), Y1 + VAL(a4$)
  966.             'SETVIEW 0, 0, maxx, maxy
  967.             _MOUSESHOW
  968.             IF t$ <> "SYSTEM" THEN
  969.                 fontnormal
  970.             END IF
  971.         END IF
  972.         IF LEFT$(a$, 1) = CHR$(5) THEN
  973.             p$ = LTRIM$(MID$(a$, 2))
  974.             IF flags2%(activewin) = 1 THEN label$ = UCASE$(p$): GOTO jump
  975.         END IF
  976.         IF LEFT$(a$, 1) = CHR$(6) THEN
  977.             p$ = LTRIM$(MID$(a$, 2))
  978.             IF flags3%(activewin) = 1 THEN label$ = UCASE$(p$): GOTO jump
  979.         END IF
  980.         IF LEFT$(a$, 1) = CHR$(7) THEN
  981.             p$ = LTRIM$(MID$(a$, 2))
  982.             IF flags2%(activewin) = 2 THEN label$ = UCASE$(p$): GOTO jump
  983.         END IF
  984.         IF LEFT$(a$, 1) = CHR$(11) THEN
  985.             p$ = LTRIM$(MID$(a$, 2))
  986.             IF flags3%(activewin) = 2 THEN label$ = UCASE$(p$): GOTO jump
  987.         END IF
  988.         IF LEFT$(a$, 1) = CHR$(4) THEN
  989.             p$ = LTRIM$(MID$(a$, 2))
  990.             IF flags1%(activewin) = 0 THEN label$ = UCASE$(p$): GOTO jump
  991.         END IF
  992.         IF LEFT$(a$, 1) = CHR$(3) THEN
  993.             p$ = LTRIM$(MID$(a$, 2))
  994.             IF flags1%(activewin) = 1 OR flags1%(activewin) = 2 THEN label$ = UCASE$(p$): GOTO jump
  995.         END IF
  996.         IF LEFT$(a$, 1) = CHR$(144) THEN
  997.             p$ = LTRIM$(MID$(a$, 2))
  998.             d$ = LEFT$(p$, INSTR(p$, ",") - 1)
  999.             s$ = MID$(p$, INSTR(p$, ",") + 1)
  1000.             IF LEFT$(d$, 1) = CHR$(34) THEN d$ = MID$(d$, 2): d$ = LEFT$(d$, LEN(d$) - 1)
  1001.             IF LEFT$(s$, 1) = CHR$(34) THEN s$ = MID$(s$, 2): s$ = LEFT$(s$, LEN(s$) - 1)
  1002.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar$(d$, activewin): s = false
  1003.             IF RIGHT$(d$, 1) = "$" THEN d$ = getvar$(d$, activewin): s = true
  1004.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar$(s$, activewin)
  1005.             IF RIGHT$(s$, 1) = "$" THEN s$ = getvar$(s$, activewin)
  1006.             flags1%(activewin) = false
  1007.             IF s = true THEN
  1008.                 IF s$ = d$ THEN flags1%(activewin) = 1
  1009.             ELSE
  1010.                 IF VAL(s$) = VAL(d$) THEN flags1%(activewin) = 2
  1011.             END IF
  1012.             flags2%(activewin) = false
  1013.             IF VAL(d$) > VAL(s$) THEN flags2%(activewin) = 1
  1014.             IF VAL(d$) < VAL(s$) THEN flags2%(activewin) = 2
  1015.             flags3%(activewin) = false
  1016.             IF VAL(d$) >= VAL(s$) THEN flags3%(activewin) = 1
  1017.             IF VAL(d$) <= VAL(s$) THEN flags3%(activewin) = 2
  1018.         END IF
  1019.         IF LEFT$(a$, 1) = CHR$(150) THEN
  1020.             p$ = LTRIM$(MID$(a$, 2))
  1021.             putvar p$, INKEY$, activewin
  1022.         END IF
  1023.         IF LEFT$(a$, 1) = CHR$(14) THEN
  1024.             p$ = LTRIM$(MID$(a$, 2))
  1025.             IF RIGHT$(p$, 1) = "%" THEN p$ = getvar$(p$, activewin)
  1026.             IF RIGHT$(p$, 1) = "$" THEN p$ = STR$(ASC(getvar$(p$, activewin)))
  1027.             p$ = CHR$(VAL(p$))
  1028.             GOSUB printf
  1029.         END IF
  1030.         IF LEFT$(a$, 1) = CHR$(12) THEN
  1031.             p$ = LTRIM$(MID$(a$, 2))
  1032.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = MID$(p$, INSTR(p$, ",") + 1)
  1033.             IF RIGHT$(s$, 1) = "%" THEN s$ = getvar(s$, activewin)
  1034.             IF RIGHT$(d$, 1) = "%" THEN d$ = getvar(d$, activewin)
  1035.             co1%(activewin) = VAL(d$): co2%(activewin) = VAL(s$)
  1036.         END IF
  1037.         IF LEFT$(a$, 1) = CHR$(128) THEN
  1038.             p$ = LTRIM$(MID$(a$, 2))
  1039.             d$ = LEFT$(p$, INSTR(p$, ",") - 1): s$ = RTRIM$(MID$(p$, INSTR(p$, ",") + 1))
  1040.             IF RIGHT$(s$, 1) = "$" OR RIGHT$(s$, 1) = "%" THEN s$ = getvar(s$, activewin)
  1041.             putvar d$, s$, activewin
  1042.         END IF
  1043.         IF LEFT$(a$, 1) = "L" THEN
  1044.             p$ = LTRIM$(MID$(a$, 2))
  1045.             k = false
  1046.             IF RIGHT$(p$, 1) = ";" THEN
  1047.                 k = true
  1048.                 p$ = RTRIM$(LEFT$(p$, LEN(p$) - 1))
  1049.             END IF
  1050.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar(p$, activewin)
  1051.             IF RIGHT$(p$, 1) = "%" THEN p$ = LTRIM$(STR$(VAL(getvar(p$, activewin))))
  1052.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  1053.             IF p$ <> "" THEN
  1054.                 IF k = true THEN LPRINT p$; ELSE LPRINT p$
  1055.             END IF
  1056.         END IF
  1057.         IF LEFT$(a$, 1) = CHR$(129) THEN
  1058.             p$ = LTRIM$(MID$(a$, 2))
  1059.             k = false
  1060.             IF RIGHT$(p$, 1) = ";" THEN
  1061.                 k = true
  1062.                 p$ = RTRIM$(LEFT$(p$, LEN(p$) - 1))
  1063.             END IF
  1064.             IF RIGHT$(p$, 1) = "$" THEN p$ = getvar(p$, activewin)
  1065.             IF RIGHT$(p$, 1) = "%" THEN p$ = LTRIM$(STR$(VAL(getvar(p$, activewin))))
  1066.             IF LEFT$(p$, 1) = CHR$(34) THEN p$ = MID$(p$, 2): p$ = LEFT$(p$, LEN(p$) - 1)
  1067.             IF p$ <> "" THEN
  1068.                 GOSUB printf
  1069.                 IF k = false THEN p$ = CHR$(13): GOSUB printf
  1070.             END IF
  1071.         END IF
  1072.         IF LEFT$(a$, 1) = CHR$(2) THEN
  1073.             label$ = UCASE$(MID$(a$, 2))
  1074.             jump:
  1075.             IP(activewin) = VAL(label$) - 2
  1076.         END IF
  1077.         done:
  1078.         IF a$ <> "E" THEN
  1079.             IP(activewin) = IP(activewin) + 1
  1080.         ELSE
  1081.             window.close openwins + 0
  1082.         END IF
  1083.     END IF
  1084. IF RES = true THEN GOTO START
  1085.  
  1086. printf: ' print text into window as if it was a text mode screen
  1087. FOR Z = 1 TO LEN(p$)
  1088.     q$ = MID$(p$, Z, 1)
  1089.     IF q$ = CHR$(7) THEN
  1090.         SOUND 500, 1
  1091.     ELSE
  1092.         IF q$ = CHR$(13) THEN
  1093.             vty%(activewin) = vty%(activewin) + 1
  1094.             vtx%(activewin) = 0
  1095.             IF sfony% + 1 + vty%(activewin) * sfony% > Y2 - Y1 THEN GOSUB scrollf: vty%(activewin) = vty%(activewin) - 1
  1096.         ELSE
  1097.             IF q$ = CHR$(8) THEN
  1098.                 IF vtx%(activewin) THEN
  1099.                     vtx%(activewin) = vtx%(activewin) - 1
  1100.                     x% = X1 + vtx%(activewin) * sfonx%: y% = Y1 + vty%(activewin) * sfony%
  1101.                     DRWSTRING co1%(activewin), co2%(activewin), " ", x%, y%
  1102.                 END IF
  1103.             ELSE
  1104.                 IF sfonx% + vtx%(activewin) * sfonx% > X2 - X1 THEN
  1105.                     vty%(activewin) = vty%(activewin) + 1
  1106.                     vtx%(activewin) = 0
  1107.                     IF sfony% + 1 + vty%(activewin) * sfony% > Y2 - Y1 THEN GOSUB scrollf: vty%(activewin) = vty%(activewin) - 1
  1108.                 END IF
  1109.                 IF sfonx% + vtx%(activewin) * sfonx% > X2 - X1 THEN vtx%(activewin) = 0
  1110.                 IF sfony% + 1 + vty%(activewin) * sfony% > Y2 - Y1 THEN vty%(activewin) = 0
  1111.                 x% = X1 + vtx%(activewin) * sfonx%: y% = Y1 + vty%(activewin) * sfony%
  1112.                 DRWSTRING co1%(activewin), co2%(activewin), q$, x%, y%
  1113.                 vtx%(activewin) = vtx%(activewin) + 1
  1114.             END IF
  1115.         END IF
  1116.     END IF
  1117.  
  1118. scrollf: ' scroll text in window
  1119. scroll% = XMSBLKGET%(X1, Y1 + sfony%, X2, Y2)
  1120. dummy% = XMSBLKPUT%(1, X1, Y1, scroll%)
  1121. DRWFILLBOX co2%(activewin), X1, Y2 - sfony%, X2, Y2
  1122. dummy% = XMSFREE%(scroll%)
  1123.  
  1124. errhandler:
  1125. derror(activewin) = ERR
  1126.  
  1127. REM I had way too much caffeine while programming this, hahahaha!!!
  1128.  
  1129. SUB background (wallpaper$)
  1130.     IF RIGHT$(wallpaper$, 1) = "~" THEN
  1131.         wallpaper$ = LEFT$(wallpaper$, LEN(wallpaper$) - 1)
  1132.         mm = true
  1133.     END IF
  1134.     IF mm = true THEN timerset true
  1135.     refreshwindows = true
  1136.     IF mm = true THEN _MOUSEHIDE
  1137.     IF openwins THEN winvsave openwins
  1138.     FILLSCREEN bgcolor
  1139.     IF mm = true THEN _MOUSESHOW
  1140.     IF wallpaper$ <> "" THEN
  1141.         IF DIR$(wallpaper$) <> "" THEN
  1142.             redo3:
  1143.             IF mm = true THEN _MOUSEHIDE
  1144.             a% = PNGPUT%(xx%, yy%, wallpaper$)
  1145.             IF mm = true THEN _MOUSESHOW
  1146.             a% = PNGGETINFO%(wallpaper$, x%, y%)
  1147.             IF x% + xx% < maxx THEN xx% = xx% + x%: GOTO redo3 ELSE xx% = 0
  1148.             IF y% + yy% < maxy THEN yy% = yy% + y%: GOTO redo3 ELSE yy% = 0
  1149.         END IF
  1150.     END IF
  1151.     IF bghandle% <> false THEN dummy% = XMSFREE%(bghandle%)
  1152.     IF mm = true THEN _MOUSEHIDE
  1153.     bghandle% = XMSBLKGET%(0, 0, maxx, maxy)
  1154.     IF mm = true THEN
  1155.         _MOUSESHOW
  1156.         timerset false
  1157.     END IF
  1158.  
  1159. SUB fontload (FileName$)
  1160.     IF DIR$(FileName$) = "" THEN EXIT SUB
  1161.     FF = FREEFILE: OPEN FileName$ FOR BINARY AS FF
  1162.     GET #FF, , fon
  1163.     CLOSE FF
  1164.     'FONTSET fon
  1165.  
  1166. SUB fontnormal
  1167.     IF sfon$ <> "" THEN fontload sfon$ ELSE FONTSYSTEM
  1168.  
  1169. FUNCTION getvar$ (varname$, pid)
  1170.     a$ = mainmem$(pid)
  1171.     a = INSTR(UCASE$(a$), CHR$(127) + UCASE$(varname$))
  1172.     IF a > false THEN
  1173.         b$ = MID$(a$, a)
  1174.         b$ = MID$(b$, INSTR(b$, ",") + 1)
  1175.         b$ = LTRIM$(RTRIM$(LEFT$(b$, INSTR(b$, CHR$(255)) - 1)))
  1176.         IF LEFT$(b$, 1) = CHR$(34) THEN b$ = MID$(b$, 2): b$ = LEFT$(b$, LEN(b$) - 1)
  1177.         getvar$ = b$
  1178.     END IF
  1179.  
  1180. SUB putvar (varname$, contents$, pid)
  1181.     varname$ = CHR$(127) + LTRIM$(RTRIM$(UCASE$(varname$)))
  1182.     a$ = mainmem$(pid)
  1183.     IF RIGHT$(varname$, 1) = "$" AND LEFT$(contents$, 1) <> CHR$(34) THEN contents$ = CHR$(34) + contents$ + CHR$(34)
  1184.     a = INSTR(UCASE$(a$), varname$)
  1185.     IF a > false THEN
  1186.         b$ = LEFT$(a$, a - 1) + varname$ + "," + contents$
  1187.         b$ = b$ + MID$(a$, INSTR(a, a$, CHR$(255)))
  1188.         mainmem$(pid) = b$
  1189.     END IF
  1190.  
  1191. FUNCTION readline$ (linenumber%, pid)
  1192.     a$ = mainmem$(pid)
  1193.     b$ = MID$(a$, INSTR(a$, CHR$(255) + LTRIM$(STR$(linenumber%)) + CHR$(252)))
  1194.     b$ = MID$(b$, INSTR(b$, CHR$(252)) + 1)
  1195.     readline$ = LEFT$(b$, INSTR(b$, CHR$(255)) - 1)
  1196.  
  1197.     FOR i% = 1 TO maxwins
  1198.         window.close i%
  1199.     NEXT
  1200.     dummy% = XMSFREE%(bghandle%)
  1201.     tmp% = RESTEXT%: CLS
  1202.  
  1203. SUB screen.setup
  1204.     freehandle = FREEFILE
  1205.  
  1206.     bgcolor = 25
  1207.  
  1208.     IF WHICHXMS(MEM%, handles%) = true THEN
  1209.         IF MEM% < 1 OR handles% < 1 THEN
  1210.             PANIC "no free XMS memory"
  1211.         END IF
  1212.     ELSE
  1213.         PANIC "HIMEM.SYS must be loaded first"
  1214.     END IF
  1215.  
  1216.     IF DIR$("SETTINGS.INI") <> "" THEN
  1217.         OPEN "SETTINGS.INI" FOR INPUT AS freehandle
  1218.         DO UNTIL EOF(freehandle)
  1219.             LINE INPUT #freehandle, settings$
  1220.             settings$ = LTRIM$(RTRIM$(UCASE$(settings$)))
  1221.             IF LEFT$(settings$, 4) = "MODE" THEN Mode$ = LTRIM$(MID$(settings$, 5))
  1222.             IF LEFT$(settings$, 14) = "MOUSE POINTER " THEN
  1223.                 mousefile$ = MID$(settings$, 15)
  1224.             END IF
  1225.             IF LEFT$(settings$, 12) = "MOUSE TIMER " THEN
  1226.                 mousefile2$ = MID$(settings$, 13)
  1227.             END IF
  1228.             IF LEFT$(settings$, 17) = "BACKGROUND COLOR " THEN bgcolor = VAL(MID$(settings$, 18))
  1229.             IF LEFT$(settings$, 13) = "ACTIVE COLOR " THEN actcolor = VAL(MID$(settings$, 14))
  1230.             IF LEFT$(settings$, 13) = "NONACT COLOR " THEN nonactcolor = VAL(MID$(settings$, 14))
  1231.             IF LEFT$(settings$, 12) = "TITLE COLOR " THEN titlecolor = VAL(MID$(settings$, 13))
  1232.             IF LEFT$(settings$, 10) = "WALLPAPER " THEN wallpaper$ = MID$(settings$, 11)
  1233.             IF LEFT$(settings$, 12) = "SYSTEM FONT " THEN sfon$ = MID$(settings$, 13)
  1234.         LOOP
  1235.         CLOSE freehandle
  1236.     ELSE
  1237.         Mode$ = "640X480"
  1238.         mousefile$ = "mouse.poi"
  1239.     END IF
  1240.  
  1241.     setuppointers mousefile$, mousefile2$
  1242.  
  1243.     cardtype = WHICHVGA
  1244.     IF WHICHMOUSE = false THEN
  1245.         PANIC "No mouse driver found"
  1246.     END IF
  1247.  
  1248.     SELECT CASE Mode$
  1249.         CASE "640X400": errorcheck = RES640L: maxx = 639: maxy = 399
  1250.         CASE "640X480": errorcheck = RES640: maxx = 639: maxy = 479
  1251.         CASE "800X600": errorcheck = RES800: maxx = 799: maxy = 599
  1252.         CASE "1024X768": errorcheck = RES1024: maxx = 1023: maxy = 767
  1253.         CASE "1280X1024": errorcheck = RES1280: maxx = 1279: maxy = 1023
  1254.     END SELECT
  1255.     IF errorcheck = false THEN
  1256.         PANIC "Video card can't use this screen mode in SETTINGS.INI"
  1257.     END IF
  1258.  
  1259.     dummy% = PAGEACTIVE%(1)
  1260.     FILLPAGE 24
  1261.     f$ = "XGUI4.INI"
  1262.     a% = PNGGETINFO%(f$, xe%, ye%)
  1263.     xe% = xe% / 2: ye% = ye% / 2
  1264.     a% = PNGPUT%(-xe% + maxx / 2, -ye% + maxy / 2, f$)
  1265.     t$ = RIGHT$(TIME$, 2)
  1266.     dummy% = PAGEACTIVE%(0)
  1267.     dummy% = PAGEDISPLAY%(0, 0, 1)
  1268.  
  1269.     background wallpaper$
  1270.  
  1271.     FONTSYSTEM
  1272.  
  1273.     IF sfon$ <> "" THEN
  1274.         IF DIR$(sfon$) <> "" THEN
  1275.             fontload sfon$
  1276.         END IF
  1277.     END IF
  1278.     FONTGETINFO sfonx%, sfony%
  1279.  
  1280.     IF VAL(RIGHT$(TIME$, 2)) < VAL(t$) + 3 THEN SLEEP 2
  1281.     dummy% = PAGEDISPLAY%(0, 0, 0)
  1282.  
  1283.     'MOUSEENTER
  1284.     MOUSELOCSET 16, 16
  1285.     timerset true
  1286.  
  1287.  
  1288. SUB startscript (FileName$, cmd$)
  1289.     'ON LOCAL ERROR GOTO sse
  1290.     timerset true
  1291.     FF = FREEFILE: OPEN FileName$ FOR INPUT AS FF
  1292.     INPUT #FF, X1, Y1, X2, Y2, closebtn, resizebtn, movebtn, title$
  1293.     process = window.create(X1, Y1, X2, Y2, closebtn, resizebtn, movebtn, title$)
  1294.     DO UNTIL EOF(FF)
  1295.         LINE INPUT #FF, a$
  1296.         a$ = LTRIM$(RTRIM$(a$))
  1297.         l = l + 1
  1298.         mainmem$(process) = mainmem$(process) + CHR$(255) + LTRIM$(STR$(l)) + CHR$(252) + a$
  1299.     LOOP
  1300.     mainmem$(process) = mainmem$(process) + CHR$(255)
  1301.     CLOSE FF
  1302.     IP(process) = 1 'set instruction pointer to first line...
  1303.     vtx%(process) = 0 'set virtual text cursor x
  1304.     vty%(process) = 0 'set virtual text cursor y
  1305.     co1%(process) = 0 'set color x, to 0
  1306.     co2%(process) = 7 'set color ,x to 7
  1307.     pcommand$(process) = cmd$
  1308.     timerset false
  1309.     EXIT SUB
  1310.     sse:
  1311.     RESUME ssee
  1312.     ssee:
  1313.     timerset false
  1314.  
  1315.     IF win(id%).objectID = false THEN EXIT SUB
  1316.     mainmem$(win(id%).objectID) = ""
  1317.     a$ = pfiles$(win(id%).objectID)
  1318.     IF a$ <> "" THEN
  1319.         FOR i = 1 TO LEN(a$)
  1320.             m$ = MID$(a$, i, 1)
  1321.             IF m$ <> "" THEN CLOSE ASC(m$)
  1322.         NEXT
  1323.     END IF
  1324.     pfiles$(win(id%).objectID) = ""
  1325.     'SETVIEW win(id%).X1, win(id%).Y1, win(id%).X2, win(id%).Y2
  1326.     dummy% = XMSBLKPUT%(1, 0, 0, bghandle%)
  1327.     'SETVIEW 0, 0, maxx, maxy
  1328.     dummy% = XMSFREE%(win(id%).virtual)
  1329.     FOR c = id% TO maxwins - 1 '*rollback* function #2
  1330.         win(c).X1 = win(c + 1).X1: win(c).Y1 = win(c + 1).Y1
  1331.         win(c).X2 = win(c + 1).X2: win(c).Y2 = win(c + 1).Y2
  1332.         win(c).closebtn = win(c + 1).closebtn: win(c).resizebtn = win(c + 1).resizebtn
  1333.         win(c).movebtn = win(c + 1).movebtn: win(c).title$ = win(c + 1).title$
  1334.         win(c).virtual = win(c + 1).virtual: win(c).objectID = win(c + 1).objectID
  1335.     NEXT
  1336.     openwins = openwins - 1
  1337.     refreshwindows = true
  1338.     switch = true
  1339.  
  1340. FUNCTION window.create (X1, Y1, X2, Y2, closebtn, resizebtn, movebtn, title$)
  1341.     IF Y2 = 5000 THEN Y1 = maxy / 2: Y2 = maxy '*little internal hack 4 shell :)
  1342.     IF X2 > maxx THEN X2 = maxx
  1343.     IF Y2 > maxy THEN Y2 = maxy
  1344.     IF openwins = maxwins - 2 THEN SOUND 700, 1: SOUND 500, 1: EXIT FUNCTION
  1345.     FOR i = 1 TO maxwins
  1346.         IF win(i).objectID = false THEN
  1347.             win(i).X1 = X1: win(i).X2 = X2
  1348.             win(i).Y1 = Y1: win(i).Y2 = Y2
  1349.             win(i).closebtn = closebtn
  1350.             win(i).resizebtn = resizebtn
  1351.             win(i).movebtn = movebtn
  1352.             win(i).title$ = title$
  1353.             FOR Z = 1 TO maxwins
  1354.                 FOR x = 1 TO maxwins
  1355.                     IF win(x).objectID = Z THEN GOTO n
  1356.                 NEXT
  1357.                 win(i).objectID = Z: EXIT FOR
  1358.                 n:
  1359.             NEXT
  1360.             openwins = openwins + 1
  1361.             refreshwindows = true
  1362.             repair = true
  1363.             window.create = Z: EXIT FUNCTION
  1364.         END IF
  1365.     NEXT
  1366.     window.create = false
  1367.  
  1368. SUB window.manager
  1369.     MOUSESTATUS x%, y%, b%
  1370.  
  1371.     IF b% <> false AND refreshwindows = false THEN
  1372.         'if mouse is in another window and pressed, set active
  1373.         FOR i = 1 TO maxwins
  1374.             IF win(i).objectID = false THEN i = i - 1: EXIT FOR
  1375.         NEXT
  1376.         IF x% >= win(i).X1 AND y% >= win(i).Y1 AND x% <= win(i).X2 AND y% <= win(i).Y2 THEN
  1377.         ELSE
  1378.             FOR Z = 1 TO openwins - 1
  1379.                 IF x% >= win(Z).X1 AND y% >= win(Z).Y1 AND x% <= win(Z).X2 AND y% <= win(Z).Y2 THEN
  1380.                     newactwin = Z ' sets this for next routines below
  1381.                 END IF
  1382.             NEXT
  1383.         END IF
  1384.     END IF
  1385.  
  1386.     IF newactwin <> false AND refreshwindows = false THEN
  1387.         ' set to new active window
  1388.         IF switch = true THEN
  1389.             _MOUSEHIDE
  1390.             winvsave openwins
  1391.             _MOUSESHOW
  1392.             FOR i = 1 TO maxwins
  1393.                 IF win(i).objectID = false THEN EXIT FOR
  1394.             NEXT
  1395.             win(i).X1 = win(newactwin).X1: win(i).X2 = win(newactwin).X2
  1396.             win(i).Y1 = win(newactwin).Y1: win(i).Y2 = win(newactwin).Y2
  1397.             win(i).closebtn = win(newactwin).closebtn
  1398.             win(i).resizebtn = win(newactwin).resizebtn
  1399.             win(i).movebtn = win(newactwin).movebtn
  1400.             win(i).title$ = win(newactwin).title$
  1401.             win(i).virtual = win(newactwin).virtual
  1402.             win(i).objectID = win(newactwin).objectID
  1403.             FOR c = newactwin TO maxwins - 1 '*rollback routine*
  1404.                 win(c).X1 = win(c + 1).X1: win(c).Y1 = win(c + 1).Y1
  1405.                 win(c).X2 = win(c + 1).X2: win(c).Y2 = win(c + 1).Y2
  1406.                 win(c).closebtn = win(c + 1).closebtn: win(c).resizebtn = win(c + 1).resizebtn
  1407.                 win(c).movebtn = win(c + 1).movebtn: win(c).title$ = win(c + 1).title$
  1408.                 win(c).virtual = win(c + 1).virtual: win(c).objectID = win(c + 1).objectID
  1409.             NEXT
  1410.             refreshwindows = true
  1411.         ELSE
  1412.             SOUND 700, .6 ' window switch = false so just beep..
  1413.             DO UNTIL b% = false
  1414.                 MOUSESTATUS x%, y%, b%
  1415.             LOOP
  1416.         END IF
  1417.     END IF
  1418.  
  1419.     IF refreshwindows = true THEN 'refresh windows (duh)
  1420.         refreshwindows = false
  1421.         _MOUSEHIDE
  1422.         hidegraph true
  1423.         dummy% = XMSBLKPUT%(1, 0, 0, bghandle%)
  1424.         FOR i = 1 TO maxwins
  1425.             IF win(i).objectID <> false THEN
  1426.                 IF i = openwins THEN a% = true ELSE a% = false
  1427.                 IF a% = true THEN
  1428.                     IF crhandle% <> false THEN dummy% = XMSFREE%(crhandle%)
  1429.                     crhandle% = XMSBLKGET%(0, 0, maxx, maxy)
  1430.                 END IF
  1431.                 window.paint win(i).X1, win(i).Y1, win(i).X2, win(i).Y2, win(i).closebtn, win(i).resizebtn, win(i).movebtn, win(i).title$, a%
  1432.                 IF win(i).virtual <> false THEN
  1433.                     Y1 = win(i).Y1: X1 = win(i).X1: Y2 = win(i).Y2: X2 = win(i).X2
  1434.                     IF win(i).movebtn THEN Y1 = Y1 + 18
  1435.                     IF win(i).resizebtn THEN X2 = X2 - 19: Y2 = Y2 - 19
  1436.                     'SETVIEW X1, Y1, X2 - 2, Y2 - 2
  1437.                     winvput i 'put windows contents back into the window :)
  1438.                     'SETVIEW 0, 0, maxx, maxy
  1439.                 END IF
  1440.             END IF
  1441.         NEXT
  1442.         hidegraph false
  1443.         _MOUSESHOW
  1444.     END IF
  1445.  
  1446.     i = openwins
  1447.     IF b% <> false AND refreshwindows = false THEN
  1448.         IF win(i).resizebtn <> false AND x% >= win(i).X2 - 19 AND y% >= win(i).Y2 - 19 AND x% <= win(i).X2 AND y% <= win(i).Y2 THEN
  1449.             xl = x% - win(i).X1: yl = y% - win(i).Y1
  1450.             'SETVIEW win(i).X1, win(i).Y1, win(i).X2, win(i).Y2
  1451.             _MOUSEHIDE
  1452.             winvsave i
  1453.             hidegraph true
  1454.             dummy% = XMSBLKPUT%(1, 0, 0, crhandle%)
  1455.             'SETVIEW 0, 0, maxx, maxy
  1456.             DO
  1457.                 MOUSESTATUS x%, y%, b%
  1458.                 x3 = win(i).X1: y3 = win(i).Y1
  1459.                 x4 = x% + (win(i).X2 - win(i).X1) - xl: y4 = y% + (win(i).Y2 - win(i).Y1) - yl
  1460.                 IF x4 <= x3 + 70 THEN x4 = x3 + 70
  1461.                 IF y4 <= y3 + 70 THEN y4 = y3 + 70
  1462.                 IF x4 > maxx THEN x4 = maxx
  1463.                 IF y4 > maxy THEN y4 = maxy
  1464.                 handle2% = XMSBLKGET%(x3, y3, x4, y4)
  1465.                 window.paint x3 + 0, y3 + 0, x4 + 0, y4 + 0, win(i).closebtn, true, win(i).movebtn, win(i).title, true
  1466.                 drw3Dbox x4 - 19, y4 - 19, x4 - 2, y4 - 2, 0, actcolor + 0
  1467.                 'SETVIEW x3, y3, x4 - 21, y4 - 21
  1468.                 winvput i
  1469.                 'SETVIEW 0, 0, maxx, maxy
  1470.                 MOUSESTATUS xx%, yy%, bb%
  1471.                 hidegraph false
  1472.                 _MOUSESHOW
  1473.                 DO UNTIL x% <> xx% OR y% <> yy%
  1474.                     MOUSESTATUS x%, y%, b%
  1475.                     IF b% = false THEN s = true: GOTO e
  1476.                 LOOP
  1477.                 _MOUSEHIDE
  1478.                 hidegraph true
  1479.                 dummy% = XMSBLKPUT%(1, x3, y3, handle2%)
  1480.                 e: 'Hidden deep inside your code you may find yourself
  1481.                 dummy% = XMSFREE%(handle2%)
  1482.                 IF s = true THEN EXIT DO
  1483.             LOOP
  1484.             _MOUSESHOW
  1485.             refreshwindows = true
  1486.             win(i).X2 = x4: win(i).Y2 = y4
  1487.             repair = true
  1488.             _MOUSEHIDE
  1489.             winvsave i
  1490.             _MOUSESHOW
  1491.         END IF
  1492.         IF win(i).closebtn <> false THEN f = 20
  1493.         IF win(i).movebtn <> false AND x% >= win(i).X1 AND y% >= win(i).Y1 AND x% <= win(i).X2 - f AND y% <= win(i).Y1 + 18 THEN
  1494.             xl = x% - win(i).X1: yl = y% - win(i).Y1
  1495.             handle% = XMSBLKGET%(win(i).X1, win(i).Y1, win(i).X2, win(i).Y2)
  1496.             'SETVIEW win(i).X1, win(i).Y1, win(i).X2, win(i).Y2
  1497.             _MOUSEHIDE
  1498.             winvsave i
  1499.             hidegraph true
  1500.             dummy% = XMSBLKPUT%(1, 0, 0, crhandle%)
  1501.             'SETVIEW 0, 0, maxx, maxy
  1502.             DO
  1503.                 MOUSESTATUS x%, y%, b%
  1504.                 x3 = x% - xl: y3 = y% - yl
  1505.                 x4 = x% + (win(i).X2 - win(i).X1) - xl: y4 = y% + (win(i).Y2 - win(i).Y1) - yl
  1506.                 IF x3 < 0 THEN x3 = 0: x4 = win(i).X2 - win(i).X1
  1507.                 IF y3 < 0 THEN y3 = 0: y4 = win(i).Y2 - win(i).Y1
  1508.                 IF x4 > maxx THEN x4 = maxx: x3 = x4 - (win(i).X2 - win(i).X1)
  1509.                 IF y4 > maxy THEN y4 = maxy: y3 = y4 - (win(i).Y2 - win(i).Y1)
  1510.                 handle2% = XMSBLKGET%(x3, y3, x4, y4)
  1511.                 dummy% = XMSBLKPUT%(1, x3, y3, handle%)
  1512.                 hidegraph false
  1513.                 MOUSESTATUS xx%, yy%, bb%
  1514.                 DO UNTIL x% <> xx% OR y% <> yy%
  1515.                     MOUSESTATUS x%, y%, b%
  1516.                     IF b% = false THEN s = true: GOTO E2
  1517.                 LOOP
  1518.                 E2:
  1519.                 hidegraph true
  1520.                 dummy% = XMSBLKPUT%(1, x3, y3, handle2%)
  1521.                 dummy% = XMSFREE%(handle2%)
  1522.                 IF s = true THEN EXIT DO
  1523.             LOOP
  1524.             dummy% = XMSBLKPUT%(1, x3, y3, handle%)
  1525.             hidegraph false
  1526.             _MOUSESHOW
  1527.             dummy% = XMSFREE%(handle%)
  1528.             win(i).X1 = x3: win(i).Y1 = y3: win(i).X2 = x4: win(i).Y2 = y4
  1529.             refreshwindows = true
  1530.         END IF
  1531.         IF win(i).closebtn <> false AND win(i).movebtn <> false AND x% >= win(i).X2 - 19 AND x% <= win(i).X2 - 2 AND y% >= win(i).Y1 + 2 AND y% <= win(i).Y1 + 18 THEN
  1532.             _MOUSEHIDE
  1533.             DRWBOX 0, win(i).X2 - 19, win(i).Y1 + 1, win(i).X2 - 1, win(i).Y1 + 18
  1534.             _MOUSESHOW
  1535.             DO UNTIL b% = false
  1536.                 MOUSESTATUS x%, y%, b%
  1537.             LOOP
  1538.             FOR R = 0 TO 1: t# = TIMER: DO UNTIL t# <> TIMER: LOOP: NEXT
  1539.             _MOUSEHIDE
  1540.             DRWLINE 15, win(i).X2 - 19, win(i).Y1 + 1, win(i).X2 - 19, win(i).Y1 + 17
  1541.             DRWLINE 15, win(i).X2 - 19, win(i).Y1 + 1, win(i).X2 - 2, win(i).Y1 + 1
  1542.             _MOUSESHOW
  1543.             IF x% >= win(i).X2 - 19 AND x% <= win(i).X2 - 2 AND y% >= win(i).Y1 + 2 AND y% <= win(i).Y1 + 18 THEN
  1544.                 window.close i + 0
  1545.             END IF
  1546.         END IF
  1547.     END IF
  1548.  
  1549. SUB window.paint (X1%, Y1%, X2%, Y2%, closebtn%, resizebtn%, movebtn%, title$, active%)
  1550.     'kenneths ripoff of the Amiga look >:)
  1551.     DRWBOX 0, X1%, Y1%, X2%, Y2%
  1552.     DRWBOX 0, X1%, Y1%, X2% - 1, Y2% - 1
  1553.     DRWBOX 15, X1% + 1, Y1% + 1, X2% - 2, Y2% - 2
  1554.     IF LEFT$(title$, 1) <> CHR$(3) THEN
  1555.         DRWFILLBOX 7, X1% + 2, Y1% + 2, X2% - 2, Y2% - 2
  1556.     ELSE
  1557.         title$ = MID$(title$, 2)
  1558.     END IF
  1559.     IF movebtn% THEN
  1560.         DRWLINE 0, X1% + 1, Y1% + 18, X2% - 2, Y1% + 18
  1561.         DRWLINE 15, X1% + 1, Y1% + 19, X2% - 2, Y1% + 19
  1562.     END IF
  1563.     IF active% THEN
  1564.         a = actcolor
  1565.     ELSE
  1566.         a = nonactcolor
  1567.     END IF
  1568.     IF movebtn% THEN
  1569.         DRWFILLBOX a, X1% + 2, Y1% + 2, X2% - 2, Y1% + 17
  1570.         IF closebtn% THEN
  1571.             DRWLINE 15, X2% - 19, Y1% + 2, X2% - 19, Y1% + 17
  1572.             DRWLINE 0, X2% - 20, Y1% + 2, X2% - 20, Y1% + 17
  1573.             DRWBOX 0, X2% - 13, Y1% + 7, X2% - 8, Y1% + 12
  1574.             DRWLINE 15, X2% - 12, Y1% + 12, X2% - 8, Y1% + 12
  1575.             DRWLINE 15, X2% - 8, Y1% + 8, X2% - 8, Y1% + 12
  1576.             b = 19
  1577.         END IF
  1578.         t$ = RTRIM$(title$)
  1579.         l% = ((X2% - X1%) / 2) - LEN(t$) * 4
  1580.         'SETVIEW X1% + 2, Y1% + 3, X2% - 3 - b, Y1% + 17
  1581.         DRWSTRING titlecolor, a, t$, X1% + 2 + l%, Y1% + 3
  1582.         'SETVIEW 0, 0, maxx, maxy
  1583.     END IF
  1584.     IF resizebtn% THEN
  1585.         DRWFILLBOX a, X2% - 18, Y2% - 18, X2% - 2, Y2% - 2
  1586.         DRWBOX 0, X2% - 16, Y2% - 15, X2% - 12, Y2% - 11
  1587.         DRWBOX 15, X2% - 16, Y2% - 15, X2% - 11, Y2% - 10
  1588.         DRWBOX 0, X2% - 17, Y2% - 16, X2% - 5, Y2% - 5
  1589.         DRWBOX 15, X2% - 16, Y2% - 15, X2% - 4, Y2% - 4
  1590.         DRWLINE 15, X2% - 19, Y2% - 19, X2% - 19, Y2% - 2
  1591.         DRWLINE 15, X2% - 19, Y2% - 19, X2% - 2, Y2% - 19
  1592.         DRWBOX 0, X2% - 20, Y2% - 20, X2% - 1, Y2% - 1
  1593.         DRWLINE 0, X2% - 20, Y1% + 20, X2% - 20, Y2% - 21
  1594.         DRWLINE 0, X1% + 2, Y2% - 20, X2% - 21, Y2% - 20
  1595.         DRWFILLBOX a, X2% - 19, Y1% + 20, X2% - 2, Y2% - 21
  1596.         DRWFILLBOX a, X1% + 2, Y2% - 19, X2% - 21, Y2% - 2
  1597.     END IF
  1598.  
  1599. SUB winvput (id)
  1600.     X1% = win(id).X1 + 2: Y1% = win(id).Y1% + 2
  1601.     IF win(id).movebtn THEN
  1602.         Y1% = Y1% + 18
  1603.     END IF
  1604.     dummy% = XMSBLKPUT%(1, X1%, Y1%, win(id).virtual)
  1605.  
  1606. SUB winvsave (id)
  1607.     IF win(id).virtual <> false THEN dummy% = XMSFREE%(win(id).virtual)
  1608.     X1% = win(id).X1 + 2: Y1% = win(id).Y1% + 2
  1609.     X2% = win(id).X2 - 2: Y2% = win(id).Y2% - 2
  1610.     IF win(id).movebtn THEN
  1611.         Y1% = Y1% + 18
  1612.     END IF
  1613.     IF win(id).resizebtn THEN
  1614.         X2% = X2% - 19
  1615.         Y2% = Y2% - 19
  1616.     END IF
  1617.     win(id).virtual = XMSBLKGET%(X1%, Y1%, X2%, Y2%)
  1618.  
  1619. SUB chactcol (newcol)
  1620.     FK = FREEFILE: KL = false
  1621.     OPEN "SETTINGS.INI" FOR INPUT AS FK
  1622.     FL = FREEFILE
  1623.     OPEN "SETTINGS.TMP" FOR OUTPUT AS FL
  1624.     DO UNTIL EOF(FK)
  1625.         LINE INPUT #FK, h$
  1626.         h$ = UCASE$(LTRIM$(h$))
  1627.         IF LEFT$(h$, 13) = "ACTIVE COLOR " THEN
  1628.             PRINT #FL, "ACTIVE COLOR" + STR$(newcol): KL = true
  1629.         ELSE
  1630.             PRINT #FL, h$
  1631.         END IF
  1632.     LOOP
  1633.     IF KL = false THEN PRINT #FL, "ACTIVE COLOR" + STR$(newcol)
  1634.     CLOSE FK, FL
  1635.     OPEN "SETTINGS.INI" FOR OUTPUT AS FK
  1636.     OPEN "SETTINGS.TMP" FOR INPUT AS FL
  1637.     DO UNTIL EOF(FL)
  1638.         LINE INPUT #FL, h$: PRINT #FK, h$
  1639.     LOOP
  1640.     CLOSE FK, FL
  1641.     KILL "SETTINGS.TMP"
  1642.  
  1643. SUB chbcolor (newcol)
  1644.     FK = FREEFILE: KL = false
  1645.     OPEN "SETTINGS.INI" FOR INPUT AS FK
  1646.     FL = FREEFILE
  1647.     OPEN "SETTINGS.TMP" FOR OUTPUT AS FL
  1648.     DO UNTIL EOF(FK)
  1649.         LINE INPUT #FK, h$
  1650.         h$ = UCASE$(LTRIM$(h$))
  1651.         IF LEFT$(h$, 17) = "BACKGROUND COLOR " THEN
  1652.             PRINT #FL, "BACKGROUND COLOR" + STR$(newcol): KL = true
  1653.         ELSE
  1654.             PRINT #FL, h$
  1655.         END IF
  1656.     LOOP
  1657.     IF KL = false THEN PRINT #FL, "BACKGROUND COLOR" + STR$(newcol)
  1658.     CLOSE FK, FL
  1659.     OPEN "SETTINGS.INI" FOR OUTPUT AS FK
  1660.     OPEN "SETTINGS.TMP" FOR INPUT AS FL
  1661.     DO UNTIL EOF(FL)
  1662.         LINE INPUT #FL, h$: PRINT #FK, h$
  1663.     LOOP
  1664.     CLOSE FK, FL
  1665.     KILL "SETTINGS.TMP"
  1666.  
  1667. SUB chnonactcol (newcol)
  1668.     FK = FREEFILE: KL = false
  1669.     OPEN "SETTINGS.INI" FOR INPUT AS FK
  1670.     FL = FREEFILE
  1671.     OPEN "SETTINGS.TMP" FOR OUTPUT AS FL
  1672.     DO UNTIL EOF(FK)
  1673.         LINE INPUT #FK, h$
  1674.         h$ = UCASE$(LTRIM$(h$))
  1675.         IF LEFT$(h$, 13) = "NONACT COLOR " THEN
  1676.             PRINT #FL, "NONACT COLOR" + STR$(newcol): KL = true
  1677.         ELSE
  1678.             PRINT #FL, h$
  1679.         END IF
  1680.     LOOP
  1681.     IF KL = false THEN PRINT #FL, "NONACT COLOR" + STR$(newcol)
  1682.     CLOSE FK, FL
  1683.     OPEN "SETTINGS.INI" FOR OUTPUT AS FK
  1684.     OPEN "SETTINGS.TMP" FOR INPUT AS FL
  1685.     DO UNTIL EOF(FL)
  1686.         LINE INPUT #FL, h$: PRINT #FK, h$
  1687.     LOOP
  1688.     CLOSE FK, FL
  1689.     KILL "SETTINGS.TMP"
  1690.  
  1691. SUB chwallpaper (newfile$)
  1692.     FK = FREEFILE: KL = false
  1693.     OPEN "SETTINGS.INI" FOR INPUT AS FK
  1694.     FL = FREEFILE
  1695.     OPEN "SETTINGS.TMP" FOR OUTPUT AS FL
  1696.     DO UNTIL EOF(FK)
  1697.         LINE INPUT #FK, h$
  1698.         h$ = UCASE$(LTRIM$(h$))
  1699.         IF LEFT$(h$, 10) = "WALLPAPER " THEN
  1700.             PRINT #FL, "WALLPAPER " + newfile$: KL = true
  1701.         ELSE
  1702.             PRINT #FL, h$
  1703.         END IF
  1704.     LOOP
  1705.     IF KL = false THEN PRINT #FL, "WALLPAPER " + newfile$
  1706.     CLOSE FK, FL
  1707.     OPEN "SETTINGS.INI" FOR OUTPUT AS FK
  1708.     OPEN "SETTINGS.TMP" FOR INPUT AS FL
  1709.     DO UNTIL EOF(FL)
  1710.         LINE INPUT #FL, h$: PRINT #FK, h$
  1711.     LOOP
  1712.     CLOSE FK, FL
  1713.     KILL "SETTINGS.TMP"
  1714.  
  1715. SUB drw3Dbox (X1%, Y1%, X2%, Y2%, col1%, col2%)
  1716.     DRWLINE col1%, X1%, Y1%, X2%, Y1%
  1717.     DRWLINE col1%, X1%, Y1%, X1%, Y2%
  1718.     DRWLINE col2%, X1% + 1, Y2%, X2%, Y2%
  1719.     DRWLINE col2%, X2%, Y1% + 1, X2%, Y2%
  1720.  
  1721. SUB hidegraph (truth%)
  1722.     IF truth% = false THEN
  1723.         a% = PAGEDISPLAY(0, 0, 0)
  1724.     ELSE
  1725.         h% = XMSSCREENGET%
  1726.         a% = PAGEACTIVE%(1)
  1727.         e% = XMSSCREENPUT%(h%)
  1728.         e% = XMSFREE%(h%)
  1729.         a% = PAGEACTIVE%(0)
  1730.         a% = PAGEDISPLAY%(0, 0, 1)
  1731.     END IF
  1732.  
  1733. SUB PANIC (message$)
  1734.     tmp% = RESTEXT%: CLS
  1735.     COLOR 12
  1736.     PRINT "PANIC: ";
  1737.     PRINT message$
  1738.     COLOR 7
  1739.     SYSTEM
  1740.  
  1741. SUB scrshot
  1742.     MOUSESTATUS x%, y%, b%
  1743.     IF b% = 3 THEN
  1744.         MOUSERANGESET x%, y%, x% + 1, y% + 1
  1745.         dummy% = PNGMAKE%(0, 0, GETMAXX%, GETMAXY%, "SCRSHOT.PCX")
  1746.         MOUSERANGESET 0, 0, GETMAXX%, GETMAXY%
  1747.         startscript "MSGBOX.L", "System Message...:Screen shot was saved as SCRSHOT.PCX"
  1748.     END IF
  1749.  
  1750. SUB setpoi (FileName$, v$)
  1751.     freehandle = FREEFILE
  1752.     OPEN FileName$ FOR INPUT AS freehandle
  1753.     DO UNTIL EOF(freehandle)
  1754.         LINE INPUT #freehandle, tempstr$
  1755.         FOR i = 1 TO LEN(tempstr$)
  1756.             char$ = MID$(tempstr$, i, 1)
  1757.             IF char$ <> "," THEN
  1758.                 newchar$ = newchar$ + char$
  1759.             ELSE
  1760.                 vv$ = vv$ + CHR$(VAL(newchar$)): newchar$ = ""
  1761.             END IF
  1762.         NEXT
  1763.     LOOP
  1764.     CLOSE #freehandle
  1765.     v$ = vv$
  1766.  
  1767. SUB setuppointers (mousefile$, mousefile2$)
  1768.     IF mousefile$ <> "" THEN
  1769.         IF DIR$(mousefile$) <> "" THEN
  1770.             setpoi mousefile$, mousepointer$
  1771.         END IF
  1772.     END IF
  1773.  
  1774.     IF mousefile2$ <> "" THEN
  1775.         IF DIR$(mousefile2$) <> "" THEN
  1776.             setpoi mousefile2$, mousetimer$
  1777.         END IF
  1778.     END IF
  1779.  
  1780. SUB startup
  1781.     IF DIR$("SETTINGS.INI") = "" THEN
  1782.         tmp% = RESTEXT%: CLS
  1783.         PRINT "Please run SETUP program first"
  1784.         SYSTEM
  1785.     END IF
  1786.     IF COMMAND$ <> "~+][[]+~" THEN
  1787.         PANIC "Don't directly start X-GUI, please use START"
  1788.     END IF
  1789.  
  1790. SUB timerset (truth%)
  1791.     IF truth% = true THEN
  1792.         IF mousetimer$ <> "" THEN MOUSECURSORSET mousetimer$
  1793.     ELSE
  1794.         IF mousepointer$ <> "" THEN MOUSECURSORSET mousepointer$
  1795.     END IF
  1796.  
  1797. FUNCTION DIR$ (spec$)
  1798.     CONST TmpFile$ = "DIR$INF0.INF", ListMAX% = 500 'change maximum to suit your needs
  1799.     SHARED DIRCount% 'returns file count if desired
  1800.     STATIC Ready%, Index%, DirList$()
  1801.     IF NOT Ready% THEN REDIM DirList$(ListMAX%): Ready% = -1 'DIM array first use
  1802.     IF spec$ > "" THEN 'get file names when a spec is given
  1803.         SHELL _HIDE "DIR " + spec$ + " /b > " + TmpFile$
  1804.         Index% = 0: DirList$(Index%) = "": ff% = FREEFILE
  1805.         OPEN TmpFile$ FOR APPEND AS #ff%
  1806.         size& = LOF(ff%)
  1807.         CLOSE #ff%
  1808.         IF size& = 0 THEN KILL TmpFile$: EXIT FUNCTION
  1809.         OPEN TmpFile$ FOR INPUT AS #ff%
  1810.         DO WHILE NOT EOF(ff%) AND Index% < ListMAX%
  1811.             Index% = Index% + 1
  1812.             LINE INPUT #ff%, DirList$(Index%)
  1813.         LOOP
  1814.         DIRCount% = Index% 'SHARED variable can return the file count
  1815.         CLOSE #ff%
  1816.         KILL TmpFile$
  1817.     ELSE IF Index% > 0 THEN Index% = Index% - 1 'no spec sends next file name
  1818.     END IF
  1819.     DIR$ = DirList$(Index%)
  1820.  
  1821. FUNCTION RESGRAPHIC~&& (inFullscreen AS _BYTE, inScaled AS _BYTE, inSmoothed AS _BYTE)
  1822.     theDisplay.sizeX = _DESKTOPWIDTH
  1823.     theDisplay.sizeY = _DESKTOPHEIGHT
  1824.     theDisplay.Options.isFullscreen = inFullscreen
  1825.     theDisplay.Options.isScaled = inScaled
  1826.     theDisplay.Options.isSmoothed = inSmoothed
  1827.     theDisplay.Handle = _NEWIMAGE(theDisplay.sizeX, theDisplay.sizeY, 32)
  1828.     SCREEN theDisplay.Handle
  1829.     IF inScaled THEN
  1830.         IF inSmoothed THEN
  1831.             theDisplay.Options.isScaled = -1
  1832.             theDisplay.Options.isSmoothed = -1
  1833.             IF theDisplay.Options.isScaled = -1 AND theDisplay.Options.isSmoothed = -1 THEN
  1834.                 _FULLSCREEN _STRETCH , _SMOOTH
  1835.             END IF
  1836.         ELSE
  1837.             theDisplay.Options.isScaled = -1
  1838.             theDisplay.Options.isSmoothed = 0
  1839.             IF theDisplay.Options.isScaled = -1 AND theDisplay.Options.isSmoothed = 0 THEN
  1840.                 _FULLSCREEN _STRETCH
  1841.             END IF
  1842.         END IF
  1843.     ELSE
  1844.         IF inSmoothed THEN
  1845.             theDisplay.Options.isScaled = 0
  1846.             theDisplay.Options.isSmoothed = -1
  1847.             IF theDisplay.Options.isScaled = 0 AND theDisplay.Options.isSmoothed = -1 THEN
  1848.                 _FULLSCREEN _SQUAREPIXELS , _SMOOTH
  1849.             END IF
  1850.         ELSE
  1851.             theDisplay.Options.isScaled = 0
  1852.             theDisplay.Options.isSmoothed = 0
  1853.             IF theDisplay.Options.isScaled = 0 AND theDisplay.Options.isSmoothed = 0 THEN
  1854.                 _FULLSCREEN _SQUAREPIXELS
  1855.             END IF
  1856.         END IF
  1857.     END IF
  1858.     RESGRAPHIC~&& = 1
  1859.  
  1860. SUB FONTSYSTEM
  1861.     systemFont = _LOADFONT("SYSTEMRG.TTF", 12)
  1862.     _FONT systemFont
  1863.  
  1864. SUB DRWFILLBOX (inColour AS _UNSIGNED LONG, inX1 AS INTEGER, inY1 AS INTEGER, inX2 AS INTEGER, inY2 AS INTEGER)
  1865.     LINE (inX1, inY1)-(inX1 + inX2, inY1 + inY2), inColour, BF
  1866.  
  1867. SUB DRWBOX (inColour AS _UNSIGNED LONG, inX1%, inY1%, inX2%, inY2%)
  1868.     LINE (inX1, inY1)-(inX1 + inX2, inY1 + inY2), inColour, B
  1869.  
  1870. SUB DRWSTRING (inForegroundColor AS _UNSIGNED LONG, inBackgroundColor AS _UNSIGNED LONG, inString AS STRING, inX AS INTEGER, inY AS INTEGER)
  1871.     COLOR inForegroundColor, inBackgroundColor
  1872.     _PRINTSTRING (inX, inY), inString
  1873.  
  1874. SUB MOUSESTATUS (x AS INTEGER, y AS INTEGER, b AS INTEGER)
  1875.         x = _MOUSEX
  1876.         y = _MOUSEY
  1877.         IF _MOUSEBUTTON(1) THEN
  1878.             b = b AND 1
  1879.         END IF
  1880.         IF _MOUSEBUTTON(2) THEN
  1881.             b = b AND 2
  1882.         END IF
  1883.         IF _MOUSEBUTTON(3) THEN
  1884.             b = b AND 4
  1885.         END IF
  1886.     LOOP
  1887.  
  1888. SUB FILLAREA (inXSeed AS INTEGER, inYSeed AS INTEGER, inBorderColor AS _UNSIGNED LONG, inFillColor AS _UNSIGNED LONG)
  1889.     PAINT (inXSeed, inYSeed), inFillColor, inBorderColor
  1890.  
  1891. FUNCTION PNGGETINFO% (inFilename AS STRING, inWidth AS INTEGER, inHeight AS INTEGER)
  1892.     inFilename = LTRIM$(RTRIM$(UCASE$(inFilename)))
  1893.     DIM Temporary AS _UNSIGNED LONG: Temporary = _LOADIMAGE(inFilename)
  1894.     inWidth = _WIDTH: inHeight = _HEIGHT
  1895.     PNGGETINFO = 1
  1896.  
  1897. FUNCTION PNGMAKE% (inX1 AS INTEGER, inY1 AS INTEGER, inX2 AS INTEGER, inY2 AS INTEGER, inFilename AS STRING)
  1898.     inFilename = LTRIM$(RTRIM$(UCASE$(inFilename)))
  1899.     DIM Temporary AS _UNSIGNED LONG: Temporary = _NEWIMAGE(x2 - x1, y2 - y1, 32)
  1900.     _PUTIMAGE , theDisplay.Handle, Temporary, (inX1, inY1)-(inX2, inY2)
  1901.     PNGMAKE = 1
  1902.  
  1903. FUNCTION PNGPUT% (inX AS INTEGER, inY AS INTEGER, inFilename AS STRING)
  1904.     inFilename = LTRIM$(RTRIM$(UCASE$(inFilename)))
  1905.     DIM Temporary AS _UNSIGNED LONG: Temporary = _LOADIMAGE(inFilename)
  1906.     PNGPUT = 1
  1907.  
  1908. SUB DRWCIRCLE (inColor AS _UNSIGNED LONG, inXCenter AS INTEGER, inYCenter AS INTEGER, inRadius AS INTEGER)
  1909.     CIRCLE (inXCenter, inYCenter), inRadius, inColor
  1910.  
  1911. SUB DRWFILLCIRCLE (inColor AS _UNSIGNED LONG, inXCenter AS INTEGER, inYCenter AS INTEGER, inRadius AS INTEGER)
  1912.     DRWCIRCLE inColor, inXCenter, inYCenter, inRadius
  1913.     FILLAREA inXCenter, inYCenter, inColor, inColor
  1914.  
  1915. SUB DRWPOINT (inColour AS _UNSIGNED LONG, inX AS INTEGER, inY AS INTEGER)
  1916.     PSET (inX, inY), inColour
  1917.  
  1918. SUB DRWLINE (inColour AS _UNSIGNED LONG, inX1 AS INTEGER, inY1 AS INTEGER, inX2 AS INTEGER, inY2 AS INTEGER)
  1919.     LINE (inX1, inY1)-(inX2, inY2), inColour
  1920.  
  1921. SUB FILLSCREEN (inColour AS _UNSIGNED LONG)
  1922.     CLS 1, inColour
  1923.  
  1924. SUB FILLPAGE (inColour AS _UNSIGNED LONG)
  1925.     CLS 1, inColour
  1926.  
  1927. FUNCTION RESTEXT% ()
  1928.     'SCREEN 3
  1929.     RESTEXT = 1
  1930.  
  1931. SUB FONTGETINFO (inWidth, inHeight)
  1932.     inWidth = _FONTWIDTH(fonthandle)
  1933.     height = _FONTHEIGHT(fonthandle)
  1934.  
  1935. SUB MOUSELOCSET (inX AS INTEGER, inY AS INTEGER)
  1936.     _MOUSEMOVE inX, inY
  1937.  
  1938. SUB MOUSERANGESET (X1 AS INTEGER, Y1 AS INTEGER, X2 AS INTEGER, Y2 AS INTEGER)
  1939.     WHILE _MOUSEX < X1
  1940.         _MOUSEMOVE X1 + 1, _MOUSEY
  1941.     WEND
  1942.     WHILE _MOUSEY < Y1
  1943.         _MOUSEMOVE _MOUSEX, Y1 + 1
  1944.     WEND
  1945.     WHILE _MOUSEX > X2
  1946.         _MOUSEMOVE X2 - 1, _MOUSEY
  1947.     WEND
  1948.     WHILE _MOUSEY > Y2
  1949.         _MOUSEMOVE _MOUSEX, Y2 - 1
  1950.     WEND
  1951.  
  1952. SUB MOUSECURSORSET (MouseCursor AS STRING)
  1953.     DIM Temporary AS INTEGER: Temporary = VAL(MouseCursor$)
  1954.     MOUSE.Icon = Temporary
  1955.  

Btw, it is definately possible to port this to qb64... Qb64 has way better graphics functionality than QB 7.1 + SVGAPV anyday.
« Last Edit: August 11, 2018, 10:37:14 am by keybone »
I am from a Kazakhstan, we follow the hawk.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #8 on: August 11, 2018, 11:33:26 am »
Code: QB64: [Select]
  1. Don't really care too much about feasibility... Not really on my list of important things :D
  2. no need for file management tools either, kinda missing your point.
  3.  

My point was that the biggest difference with code written for DOS and code now being written for Windows or porting to other OS is obviously the OS interface.

But now it is dawning on me you don't care about translating this, say for a Windows version, but are just in it for the GUI tools. OK :)

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #9 on: August 11, 2018, 04:27:56 pm »
Code: QB64: [Select]
  1. Don't really care too much about feasibility... Not really on my list of important things :D
  2. no need for file management tools either, kinda missing your point.
  3.  

My point was that the biggest difference with code written for DOS and code now being written for Windows or porting to other OS is obviously the OS interface.

But now it is dawning on me you don't care about translating this, say for a Windows version, but are just in it for the GUI tools. OK :)

Oh, okay... I get ya. Well as far as accessing the file system, that *could* be a little different depending on which OS you are compiling for and which features you are using etc. For windows specifically, it uses the same filesystem superficially... Underneath one is still NTFS the other one FAT.... but how do you get a directory listing in both NTFS and FAT? DIR... change directory CD/CHDIR, remove directory, RD/RMDIR... etc. same for both, and Linux is usually not difficult to get basic stuff like that either.

As far as all the other stuff goes, u gotta remember i have a lot of little pieces already written, I've literally rewrote my own GUI 3-4 times, didnt finish every single one though... I have enough gui pieces basically that if part of this becomes impossible or too difficult i can just drop in one of those pieces replacing the old piece.

Also, the goal is to get it running... Once it runs, its not gonna stay the same, then im really gonna start tweaking and replacing stuff.
X-GUI 5 will eventually end up being very different from now.
I am from a Kazakhstan, we follow the hawk.

Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #10 on: August 12, 2018, 02:15:11 am »
I'm starting to think this code is sloppily written... I might give up and look at something else on the datacomponents gui website and try to port that. I'm starting to think that in order to make X-GUI the way I want I would have to replace like 80% of it (at least)… :-/

Maybe I can add all the widgets from this one into my gui:

http://qbasicgui.datacomponents.net/240_tguiv311.html

Well at the very least messing with all these other people's guis might teach me something.


And it works already as-is qb64. awesome... gonna hack on it a little bit, bored, this may be interesting.
still want some kind of script system though :-/ ill figure something out, i have like couple hundred more guis on that page to experiment with :D

might just work on mine instead... so bored. im working on something :D
« Last Edit: August 12, 2018, 02:55:18 am by keybone »
I am from a Kazakhstan, we follow the hawk.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #11 on: August 12, 2018, 09:47:15 am »
A GUI Control type is interesting idea, then possibly script to that... hmm...

I might be just catching up with the main ideas.  :)




Offline keybone

  • Forum Regular
  • Posts: 116
  • My name a Nursultan Tulyakbay.
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #12 on: August 15, 2018, 01:52:13 am »
A GUI Control type is interesting idea, then possibly script to that... hmm...

I might be just catching up with the main ideas.  :)

Yeah I gave up on the whole porting effort.. after spending hours getting it to say 'OK' in the ide it *still* was nowhere near even about to run... But the script idea is nice, thats the main reason I wasted my time with it.

I am from a Kazakhstan, we follow the hawk.

Offline Rudy

  • Newbie
  • Posts: 1
    • View Profile
Re: X-GUI 5 (attempt to port a qbasic gui to qb64
« Reply #13 on: February 01, 2019, 02:24:48 am »
Hello,
I'm new on this forum and fully testing qb64 in Linux Mint 19.1 Xfce on a 64bit pc.
I did a lot of tests to implemant the inform software but it seems for me impossible to get it working.

In Freebasic I used FLTK GUI    https://www.fltk.org/doc-1.3/index.html
As you can read on this link " it is a cross-platform C++ GUI toolkit for UNIX®/Linux® (X11), Microsoft® Windows®, and Apple® OS X® "

I understand it is a lot of work to port old librarys to QB64 (or to make a new one).
 
Therefore: Is it not possible to use this kind of library's (as FLTK) in QB64?