×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How can I get mu qbasic script to acceps a external value

How can I get mu qbasic script to acceps a external value

How can I get mu qbasic script to acceps a external value

(OP)
I have written a qbasic script that will edit an ip address within a file depending on what value the script is run with.  I can't get my script to accept an external value - ie c:\vlan.exe 10.  sample of script below.  (In example I want 10 to be passed to my script as the value for vlan$).

LET vlan1$ = "10 10 " + vlan$ + " 1"
LET vlan2$ = "10 10 " + vlan$ + " 8"
'OPEN "c:\SCRIPTS\PROTOCOL.UPD" FOR INPUT AS #2
OPEN "i", 2, "c:\SCRIPTS\PROTOCOL.UPD"
OPEN "o", 3, "c:\SCRIPTS\PROTOCOL.CHG"
WHILE NOT EOF(2)
LINE INPUT #2, a$
IF a$ <> "DefaultGateway0=changeme" THEN PRINT #3, a$
IF a$ = "DefaultGateway0=changeme" THEN PRINT #3, "DefaultGateway0="; vlan1$
WEND

RE: How can I get mu qbasic script to acceps a external value

(OP)
Done this by getting my script to read an unput file.

RE: How can I get mu qbasic script to acceps a external value

Note to all:

Noone uses Let anymore. It's only included to be backward
compatible.

Let A=1
is exactly the same as
A=1
and 4 less bytes when saved in ascii file format

RE: How can I get mu qbasic script to acceps a external value

LOL...

I was about to say...

Do you REALLY still use LET ???

That was only carried over for compatability reasons from gwbasic...
(That's like using line numbers... Please say you don't do that )

Have Fun, Be Young... Code BASIC
-Josh


http://cubee.topcities.com

PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.

RE: How can I get mu qbasic script to acceps a external value

It's easier for a beginner to understant what "LET" let you do, and it can be useful when you want to search your code for variable change and not for comparison, but you're right it takes too much place for something not necessary at all. I used to take "LET" on the TRS80, and it's a good things it is not necessary anymore!

SkyFighter
skyfighta@hotmail.com
Get the fun out of life!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close