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
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
RE: How can I get mu qbasic script to acceps a external value
LET VLAN$ = COMMAND$
(remaining code)
...
miguel
migoul@hotmail.com
http://www.geocities.com/siliconvalley/network/817...
RE: How can I get mu qbasic script to acceps a external value
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
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
SkyFighter
skyfighta@hotmail.com
Get the fun out of life!