Posts: 3,368
Threads: 195
Joined: Jan 2003
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.
Posts: 720
Threads: 46
Joined: Oct 2001
Quote:If you're super-smart, you can do everything with arrays........ :o
and want your proggie super-slow. lol.
Posts: 3,368
Threads: 195
Joined: Jan 2003
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.
Posts: 480
Threads: 24
Joined: Mar 2003
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
Posts: 1,956
Threads: 65
Joined: Jun 2003
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".
*****
Posts: 394
Threads: 16
Joined: Jun 2003
You're really in love with this Winer guy aren't you?
Anyhow it's clear now. TYPEs are useless to me
ammit potato!
Posts: 1,956
Threads: 65
Joined: Jun 2003
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.
*****
Posts: 2,020
Threads: 24
Joined: Jun 2002
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
Posts: 704
Threads: 0
Joined: Dec 2002
"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.
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.
Posts: 2,020
Threads: 24
Joined: Jun 2002
My community is people I've "met"
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