Jump to content

BASIC question


Zaaps1

Recommended Posts

Hey so I'm taking a programming class and for whatever reason he's teaching us BASIC. I was wondering if anyone could explain to me exactly how the RUN command works.

 

So I have a

 

OPEN "c:\qb64\vars.cfg" FOR INPUT AS #1

INPUT #1, x

INPUT #1, y

INPUT #1, z

[many more vars]

CLOSE #1

 

code that I'm using to load a lot of variables I have saved elsewhere. I don't want this to make my main script huge, so I was thinking of using the RUN command to run it separately. Would all the variables be there and would be program treat them the same as when the code is directly in the script?

 

Also is there a way I can use functions stored elsewhere or that is above BASIC

Link to comment
Share on other sites

nvm, solved, new question

Link to comment
Share on other sites

Odd. Looks okay to me. (not really knowing BASIC though)

 

Can you verify that the right input is being accepted?

 

EDIT: Oh okay. What was the solution?

polvCwJ.gif
"It's not a rest for me, it's a rest for the weights." - Dom Mazzetti

Link to comment
Share on other sites

I brought the

 

OPEN...

INPUT #1, ..

CLOSE ...

 

lines for each CASE outside of the SELECT CASE and it just worked. I still don't understand why it was broken in the first place, or why the solution solved it, but hey the more you know.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.