Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what's the point of type definition?
#11
If you're super-smart, you can do everything with arrays........ :o
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#12
Quote:If you're super-smart, you can do everything with arrays........ :o

and want your proggie super-slow. lol.
Reply
#13
Not necessarily, man. Just because you don't see the code for structure X doesn't mean it's not there.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#14
I find TYPES very useful for making record-length files:

Code:
TYPE CharacterType
Strength AS INTEGER
Speed AS INTEGER
Magic AS INTEGER
Health AS INTEGER
Mana AS INTEGER
Experience AS LONG
Picture AS STRING * 8
END TYPE

DIM PC as CharacterType

Location% = 1 'or whatever # your character is in the file...

OPEN "CHAR.DAT" FOR RANDOM AS #1 LEN = LEN(PC)
GET #1, Location%, PC
CLOSE #1
Reply
#15
For an in depth explanation, go to
www.ethanwiner.com
download his book (WINER.ZIP)
unzip it and look in CHAP2.TXT
searching for the section heading called "USER DEFINED TYPE VARIABLES".
*****
Reply
#16
You're really in love with this Winer guy aren't you?

Anyhow it's clear now. TYPEs are useless to me Big Grin
ammit potato!
Reply
#17
Ethan Winer's name appears on over 250 websites for his contributions to the music industry and especially the computer programming industry. Yes, I hold him in high regard for his expert knowledge of QuickBasic, and especially for his personal support and tutoring on this subject which he gave me several years ago.

Don't abandon TYPE variables altogether, just put them aside for possible use later.
*****
Reply
#18
TYPES are not useless. Besides being organizational, they are good for using files and databases. Try and make a proper bitmap loader without using TYPE, and with. You can read headers in one statement. And with the addition of arrays within types it becomes even more useful.

PS. "Joe Antoon", "Toonski" and "Jofers" combine for a total of over 400 hits. Ethan Winer wrote a very good book, but I've never met the guy and there are people actually *in* the community that I hold in much higher regard.
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
Reply
#19
"met"? How many people in the community you speak of have you actually met? If you mean, electronically I've "met" Ethan. He's a very likeable and very helpful guy. Smile Why are you underestimating someone you haven't met? I haven't been active in the community he was active in for a while, but he was quite active in it then. I don't doubt that he still is.
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.
Reply
#20
My community is people I've "met" Smile I underestimate people I havent "met". I guess that clears that up. (Hey, I never said he was a unlikeable or unhelpful)
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)