View Ports (no, not that question down at the bottom)
View Ports (no, not that question down at the bottom)
Okay, my question is what is the point of using the Viewport commands in QBASIC like "VIEW" and "WINDOW"? Why would I want to use those? Is there a good example?
Daniel "Theophage" Clark
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
Hi Theopage,
One of the more spreadout reasons to use a viewport or window and such is in GUI Development among other things.
but in a game, nothing's stoping you from having, for example, the main game area, and other sub windows to display player and game status for example. .
One of the more spreadout reasons to use a viewport or window and such is in GUI Development among other things.
but in a game, nothing's stoping you from having, for example, the main game area, and other sub windows to display player and game status for example. .
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
And that is exactly what I mean. If I'm making a program with QB, and I want a message area here, a creature graphic area there, a map graphic area there, and a comman area there, I'm going to do all those things separately myself.
In fact, (if I understand correctly) I would have to do those things myself because the viewport commands only let me mark off one text area and one graphics area.
So if I'm going to have to delineate these areas myself and treat them separately anyway (use LOCATE to print things here, input things there, put graphics here and here) then why would I ever want to use the veiwport commands? It's like somebody just stuck these commands in there without even really thinking about it.
Imagine if there was a DRAWPACMAN command. That might be mighty useful if I were making a pacman game, but if I wasn't, and I had to make my character sprites separately 99% of the time anyway, then that would be really useless and a waste of a command.
Am I missing something? Are these commands really as useless as that?
In fact, (if I understand correctly) I would have to do those things myself because the viewport commands only let me mark off one text area and one graphics area.
So if I'm going to have to delineate these areas myself and treat them separately anyway (use LOCATE to print things here, input things there, put graphics here and here) then why would I ever want to use the veiwport commands? It's like somebody just stuck these commands in there without even really thinking about it.
Imagine if there was a DRAWPACMAN command. That might be mighty useful if I were making a pacman game, but if I wasn't, and I had to make my character sprites separately 99% of the time anyway, then that would be really useless and a waste of a command.
Am I missing something? Are these commands really as useless as that?
Daniel "Theophage" Clark
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
- The Walrus
- Veteran
- Posts: 87
- Joined: Fri Apr 01, 2005 7:19 am
- Location: Denmark
- Contact:
But isn't it good for only one window, or am I reading it wrong? Can you give me a little more of a detailed example? (I'm still just not picturing it)
Daniel "Theophage" Clark
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
- The Walrus
- Veteran
- Posts: 87
- Joined: Fri Apr 01, 2005 7:19 am
- Location: Denmark
- Contact:
- The Walrus
- Veteran
- Posts: 87
- Joined: Fri Apr 01, 2005 7:19 am
- Location: Denmark
- Contact:
Only one, that's what I thought. It still sounds pretty much like a one-trick pony. I'm going to check out your gui, though, and see how it looks.
EDITED TO ADD:
Well I tried to check it out, I created the cpath.ini file just like it said to do, and I still get an error when trying to run it (Path not found in module RUNNER at address 056D:0125)
My cpath.ini file contains this:
C:\Documents and Settings\Owner\Desktop\Costa080\
which is the correct path to the COSTA.EXE file.
I would just like to see an example of the viewport commands in use that at least attempts to justify their existance. (The example given in the QB help file certainly doesn't) I still just don't see the point for a couple of dedicated commands for this which would seem to be more likley a user-written routine.
QB has this but won't spare two more commands to use the mouse! I know, that's a whole 'nother kettle of fish...
EDITED TO ADD:
Well I tried to check it out, I created the cpath.ini file just like it said to do, and I still get an error when trying to run it (Path not found in module RUNNER at address 056D:0125)
My cpath.ini file contains this:
C:\Documents and Settings\Owner\Desktop\Costa080\
which is the correct path to the COSTA.EXE file.
I would just like to see an example of the viewport commands in use that at least attempts to justify their existance. (The example given in the QB help file certainly doesn't) I still just don't see the point for a couple of dedicated commands for this which would seem to be more likley a user-written routine.
QB has this but won't spare two more commands to use the mouse! I know, that's a whole 'nother kettle of fish...
Daniel "Theophage" Clark
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
BUGGER!
Ok, I figured out the problem with the path files, I should have realized that a QB based program would not like paths with folders like "Documents and Settings" in them, so I changed that part to "docume~1" and the program started up fine.
Until I tried to read the text. I have one of those machines that apparently doesn't like it when QB programmers read the font bitmaps from the bios and try to display them cleverly; all I get is garbage. So now I can see your nifty login screen, but can't figure out what to do since I can't read it, and I still haven't seen any useful example of the VIEW or WINDOW commands.
I sense a conspiracy...
Ok, I figured out the problem with the path files, I should have realized that a QB based program would not like paths with folders like "Documents and Settings" in them, so I changed that part to "docume~1" and the program started up fine.
Until I tried to read the text. I have one of those machines that apparently doesn't like it when QB programmers read the font bitmaps from the bios and try to display them cleverly; all I get is garbage. So now I can see your nifty login screen, but can't figure out what to do since I can't read it, and I still haven't seen any useful example of the VIEW or WINDOW commands.
I sense a conspiracy...
Daniel "Theophage" Clark
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
theophage (at) geocities (dot) com
"God used to be my co-pilot, but our plane crashed in the mountains and I had to eat Him..."
- The Walrus
- Veteran
- Posts: 87
- Joined: Fri Apr 01, 2005 7:19 am
- Location: Denmark
- Contact:
The version of my GUI you tried out is outdated, it was released about half a year ago and doesn't have a windowing engine (it just draws windows so it looks like it does). It doesn't use VIEW and WINDOW, and it doesn't do much.
The reason nothing has been released for such a long time is that I've been working on a complete rewrite with moveable windows, plus I've been extremely busy. I don't have anything to show you at the moment, but I'm planning on releasing the next beta in a month or so.
The reason nothing has been released for such a long time is that I've been working on a complete rewrite with moveable windows, plus I've been extremely busy. I don't have anything to show you at the moment, but I'm planning on releasing the next beta in a month or so.
If swimming is so good for your figure, how do you explain walruses?
Theophage, the Window and View facilitates QB's custom coordinate system, which is in effect whether you use it not, which means that QB's graphics routine perform the same calculations to effect coordinate translation all the time. You could implement such translation on your own, and the end result is that your final program will contain redundant code.
Also, by your line of reasoning, LINE and CIRCLE are useless because you could always implement lines and circle using pset.
Consider this:
Also, by your line of reasoning, LINE and CIRCLE are useless because you could always implement lines and circle using pset.
Consider this:
Code: Select all
SCREEN 13
'a sine wave with WINDOW
WINDOW (0, -1)-(6.28318, 1)
FOR x = 0 TO 6.28318 STEP 6.28318 / 320
PSET (x, SIN(x)) 'no calculations inside the loop
NEXT x
DO
k$ = INKEY$
LOOP WHILE k$ = ""
WINDOW
CLS
'a sine wave without WINDOW
FOR x = 0 TO 319
'four calculations inside the loop
theta = x * 6.28318 / 320
PSET (x, 100 - 100 * (SIN(theta)))
NEXT x