Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: NovaProgramming on February 01, 2003, 07:47:08 PM



Title: TYPE command and stuff like that
Post by: NovaProgramming 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.


Title: TYPE command and stuff like that
Post by: wildcard 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.


Title: TYPE command and stuff like that
Post by: toonski84 on February 01, 2003, 08:13:14 PM
*sigh* another rtfm moment...:

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


Title: TYPE command and stuff like that
Post by: Hexadecimal Disaster on February 01, 2003, 10:53:02 PM
*cries of joy*

(http://www.handykult.de/plaudersmilies.de/bawling.gif)

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


Title: TYPE command and stuff like that
Post by: ak00ma 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.


Title: TYPE command and stuff like that
Post by: na_th_an on February 02, 2003, 11:16:20 AM
Y know, what toonski said: R.T.F.M..


Title: TYPE command and stuff like that
Post by: toonski84 on February 02, 2003, 11:33:08 AM
... or what i linked to *hugs my precious qboho*


Title: TYPE command and stuff like that
Post by: NovaProgramming 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.


Title: TYPE command and stuff like that
Post by: toonski84 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


Title: Woah yourself, toonski. :)
Post by: Glenn 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.  :)  )


Title: TYPE command and stuff like that
Post by: NovaProgramming 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]


Title: But considering that manual,...
Post by: Glenn on February 02, 2003, 03:26:14 PM
you aren't saying all that much.  :)


Title: TYPE command and stuff like that
Post by: toonski84 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.


Title: I didn't say that I thought the "rtfm" wasn't ...
Post by: Glenn 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).  :)


Title: TYPE command and stuff like that
Post by: NovaProgramming 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......


Title: TYPE command and stuff like that
Post by: Neo on February 05, 2003, 07:32:54 AM
:D That RTFM remembers me of my early days, and the Linux contest LoL