Welcome to Dream.In.Code
Become a VB Expert!

Join 137,390 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,138 people online right now. Registration is fast and FREE... Join Now!




Qb Problem, Data And Subs

 
Reply to this topicStart new topic

Qb Problem, Data And Subs

The one
21 May, 2004 - 06:23 AM
Post #1

New D.I.C Head
*

Joined: 21 May, 2004
Posts: 1

My question is why doesn't the data statement work in subs? When it try putting data in Subs I get an error that says "illegal procedure or Def Fn" I says that while highlighting the first data thingy. Heres a program to show you what I mean.

Thanks in advance,
Razor



,************************************************************

DECLARE SUB Fire ()
DECLARE SUB Ro ()
SCREEN 7

Fire
Ro

PUT (50, 50), Fire
PUT (70, 50), Ro

SUB Fire
xlenght = 10
ylenght = 10
FOR y = 1 TO ylenght
FOR x = 1 TO xlenght
READ z
PSET (x, y), z
NEXT
NEXT
Fire:
DATA 00,00,00,04,00,00,04,00,00,00
DATA 00,00,04,04,00,04,04,00,00,00
DATA 00,00,04,04,04,04,04,00,00,00
DATA 00,04,04,12,12,04,04,00,00,00
DATA 00,04,04,12,12,04,04,00,00,00
DATA 00,04,04,12,12,04,04,00,00,00
DATA 00,04,12,12,12,04,04,04,00,00
DATA 00,04,12,14,14,12,04,04,00,00
DATA 04,04,12,14,14,14,12,04,00,00
DATA 04,04,12,14,14,14,12,04,00,00
DIM Fire(xlenght * ylenght)
GET (0, 0)-(xlenght, ylenght), Fire
CLS
xlenght = 10
ylenght = 10
FOR y = 1 TO ylenght
FOR x = 1 TO xlenght
READ z
PSET (x, y), z
NEXT
NEXT
END SUB

SUB Ro
Ro:
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,02,02,00,00,00,00,00,00
DATA 00,02,00,00,02,00,00,00,00,00
DATA 02,00,00,00,00,02,00,00,00,00
DATA 02,00,00,00,00,02,00,00,00,00
DATA 00,02,00,00,02,00,00,00,00,00
DATA 00,00,02,02,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DATA 00,00,00,00,00,00,00,00,00,00
DIM Ro(xlenght * ylenght)
GET (0, 0)-(xlenght, ylenght), Ro
CLS
END SUB

,************************************************************
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/5/08 02:27AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month