Qbasicnews.com
February 18, 2020, 01:21:39 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: TYPE command and stuff like that  (Read 7977 times)
NovaProgramming
Been there, done that
*****
Posts: 1025



« on: February 01, 2003, 07:47:08 PM »

Hey guys it's been awhile since I've been on since I have just undergone a move to a different part o' the states, so I need some help because for some reason all the forums got erased or something along with my questions.......

I had a problem with my program running out of string space, and so people told me to use TYPE

TYPE player
playername as string
weaponpower as int



so on


but what do you put here?

Close type
end type
type end

??  I forget, and then also....... how would you set the variables to what you want them to be?  Someone told me - player.weaponpower = 3
or something like that but I don't know, is that right?  Someone could help me out and it would be appreciated.. thanks.
Logged

ovaProgramming.

One night I had a dream where I was breaking balls.  The next morning, BALLSBREAKER was born.

Quote from: "Haye, Phillip J."
 Excellent.  Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
wildcard
*.*
Administrator
__/--\__
*****
Posts: 2369



« Reply #1 on: February 01, 2003, 07:57:08 PM »

You use END TYPE e.g.

TYPE Player
  health as integer
END TYPE

You then need to make a variable/array of it as TYPE makes a data type not a memory place to hold the information.

You do it like this:

DIM Bob as Player

You can then use it like a normal variale via the fullstop. e.g.

Bob.health = 100

I hope that helps.
Logged
toonski84
__/--\__
*****
Posts: 2567



« Reply #2 on: February 01, 2003, 08:13:14 PM »

*sigh* another rtfm moment...:

http://qbasicnews.com/qboho/qcktype.shtml
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Hexadecimal Disaster
Been there, done that
*****
Posts: 1123



« Reply #3 on: February 01, 2003, 10:53:02 PM »

*cries of joy*



[slogan]
...because these moments are really special...
[/slogan]
Logged

img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
ak00ma
Ancient Guru
****
Posts: 669



« Reply #4 on: February 02, 2003, 06:01:52 AM »

Hey Nova,

before postin' in this forum, I would have a look in the QB help. You know, there's a index of all QB commands. There you have to search for the command you want to know more about. On the following page you get info about this command and some examples.
Logged

B 4 EVER
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #5 on: February 02, 2003, 11:16:20 AM »

Y know, what toonski said: R.T.F.M..
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
toonski84
__/--\__
*****
Posts: 2567



« Reply #6 on: February 02, 2003, 11:33:08 AM »

... or what i linked to *hugs my precious qboho*
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
NovaProgramming
Been there, done that
*****
Posts: 1025



« Reply #7 on: February 02, 2003, 01:53:57 PM »

Okay so I admit it, I am lazy and you guys know what you're going, okay?  You don't have to rub it in....  Yeah, so, that helps quite a bit then thanks.  Typing that (dim bob as player) that would make it shared right!?  Just making sure, sorry, it's been awhile since I've been about these forums, so thanks guys.
Logged

ovaProgramming.

One night I had a dream where I was breaking balls.  The next morning, BALLSBREAKER was born.

Quote from: "Haye, Phillip J."
 Excellent.  Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
toonski84
__/--\__
*****
Posts: 2567



« Reply #8 on: February 02, 2003, 02:08:23 PM »

woah, buddy, no need to get angry.  "rtfm" was meant as a tip, not a putdown.  dim SHARED variable(whatever) as x makes it shared.  

http://qbasicnews.com/qboho/qckadvr.dimr.shtml
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #9 on: February 02, 2003, 02:46:25 PM »

Quote from: "toonski84"
woah, buddy, no need to get angry.  "rtfm" was meant as a tip, not a putdown.  dim SHARED variable(whatever) as x makes it shared.  

http://qbasicnews.com/qboho/qckadvr.dimr.shtml


That "f" in there tends to imply anger on the part of whoever's using the "rtfm" acronym.  

(I in fact didn't learn about user-defined types from the "f---- manual."  I learned about them, and QB's ability to handle them, from a book giving an example of how to call interrupts.  Smiley  )
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
NovaProgramming
Been there, done that
*****
Posts: 1025



« Reply #10 on: February 02, 2003, 02:58:17 PM »

I know, I know, not a put down
I was just sayin' that yous guys were so much smareter than a dumb old manual anyway.[/quote]
Logged

ovaProgramming.

One night I had a dream where I was breaking balls.  The next morning, BALLSBREAKER was born.

Quote from: "Haye, Phillip J."
 Excellent.  Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #11 on: February 02, 2003, 03:26:14 PM »

you aren't saying all that much.  Smiley
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
toonski84
__/--\__
*****
Posts: 2567



« Reply #12 on: February 02, 2003, 07:22:05 PM »

i would simply use rtm, but then i would receive back something like "wtf is rtm?", while rtfm is a common phrase.  so, american and therefore lazy, i wanted to use as few keystrokes as possible while staying legible so i went with the acronym, and the well known one.

and could you perhaps tell me about this book?  most books i've read are even dumber than the manual...  but you were around when qb was in its prime so maybe real programmers wrote them then.
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #13 on: February 02, 2003, 07:46:29 PM »

warrented.   I was just trying to explain why he might have gotten the idea that you were a tad annoyed (and I didn't necessarily say that you shouldn't have been).  Smiley
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
NovaProgramming
Been there, done that
*****
Posts: 1025



« Reply #14 on: February 04, 2003, 09:27:12 PM »

I didn't mean an actual manual, I meant the 'help guide' that gives you all the commands and how to use them and nonsense like that.  Otherwise, if you are looking for a book, the book that I've found that is best (well, for me, probably not you guys cause your'e so experienced and stuff......but the book that speaks to newbies best is) is Qbasic By Example (published by QUE)  I think that it has helped we a little, but you's guys here have helped me moreso......
Logged

ovaProgramming.

One night I had a dream where I was breaking balls.  The next morning, BALLSBREAKER was born.

Quote from: "Haye, Phillip J."
 Excellent.  Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!