Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 system
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
BryX




PostPosted: Mon Sep 29, 2003 4:37 pm   Post subject: system

is there any way to have a combination of both string and variables in the system command? cause when i try it i can't get it to work with either + or commas, is there any other operators that would work?
eg

code:

system ("blablaba" variable "blabalbla", a")
%or
system ("blabalba"+variable+"blablabla",a)
%or
system ("blablabla", variable,"blablabla",a)




ps. ne reason why sigs don't work on this forum?
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Mon Sep 29, 2003 5:23 pm   Post subject: (No subject)

jeez man why do you guys even think a comma is used to mix variables and strings.

use the + operator. Which stands for concatenation. so use + only.
BryX




PostPosted: Mon Sep 29, 2003 5:26 pm   Post subject: (No subject)

cuase our teacher told us to use it when using put statement so i just assumed to use it everywhere else Embarassed
rizzix




PostPosted: Mon Sep 29, 2003 5:28 pm   Post subject: (No subject)

yea it is a turing language syntax problem. turing is not a perfect language.

the comma in turing is used only for system functions and it stands for seperating arguments (thus not necessarly strings).

don't use it anywhere except for system functions
BryX




PostPosted: Mon Sep 29, 2003 6:55 pm   Post subject: (No subject)

The command doesn't work properly now, ne idea why?

code:

var localip:string:=Net.LocalAddress
var scrname,sendtxt,ip, command1:string
var sent,error,w1,w2:int
var FontID:int := Font.New ("Arial:30:italic")
var FontID1:int :=Font.New ("Arial:75:italic")
w1:= Window.Open ("title: Bryan's Chat Program, graphics: max,max, position: 0,0")
put "Please Enter a screen name..."
    get scrname
    loop
        put "Enter a message to send.."
        get sendtxt
        put"enter an ip"
        get ip
        command1:="net send "+ip+" "+sendtxt+localip
        put command1 delay (3000)
        system (command1, sent)
        error := Error.Last
        if error =0 then cls
        elsif error not=0 then w2:= Window.Open ("title: Clssroom Map, graphics: 240,120, position: 120,500")put Error.Last
        end if
    end loop
Blade




PostPosted: Mon Sep 29, 2003 9:54 pm   Post subject: (No subject)

well i tried it but i dont have messenger running on any of my computers because of the stupid popups that dumb people send over the internet, however i didnt get any errors or anything

and as for the sig you need an http:// in there
rizzix




PostPosted: Tue Sep 30, 2003 9:06 am   Post subject: (No subject)

DO NOT USE a COMMA!!!! Use a PLUS OPERATOR insted.

jeez.... infact never use a comman. Hate the comma else it will bring you bad luck.
octopi




PostPosted: Tue Sep 30, 2003 11:55 am   Post subject: (No subject)

Need a space between sendtxt and localip?
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Tue Sep 30, 2003 12:04 pm   Post subject: (No subject)

no eh.. no way. as i said it's the comma.

this:
code:
system (command1, sent)

should be changed to this:
code:
system (command1 + sent)
BryX




PostPosted: Tue Sep 30, 2003 3:41 pm   Post subject: (No subject)

no man i need the comma there....it works fine with it,and actually i tried the program at school and it worked fine jus couldn't test it properly over a network at home cause i only have one comp
rizzix




PostPosted: Tue Sep 30, 2003 3:51 pm   Post subject: (No subject)

oh. then whats wrong?
BryX




PostPosted: Tue Sep 30, 2003 3:53 pm   Post subject: (No subject)

thats what i emant, nothing is wrong, i just tried to get it to message myself at home and i didn't work so i assumed it didn't work but when i tried it at school i moded the code a bit to create messages on random computers throughout the school lol Laughing
14fenix




PostPosted: Tue Sep 30, 2003 7:46 pm   Post subject: (No subject)

Heheh, so that was you... I didn't get one but a lot of kids were being pissed off lol.
thoughtful




PostPosted: Sat Oct 11, 2003 11:42 pm   Post subject: (No subject)

Hey thats a pretty neat program. Put the command in a loop and you got ur self a floder...hehe gonna flood my school computers
Tony




PostPosted: Sun Oct 12, 2003 4:00 pm   Post subject: (No subject)

heh, last year me and my friend wrote couple of those flooder programs in VB and we sending those messages in packs of 10,000 Laughing

Funny thing was - cmd was disabled, but it still worked though VB.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 15 Posts ]
Jump to:   


Style:  
Search: