|
-
Jun 10th, 2003, 04:06 AM
#1
Thread Starter
Sleep mode
All in one line ??[Resolved]
I can do this in one line in VB.NET , How (if possible) to do this in C# (one line also) ?
VB Code:
Dim a As String
Dim b As String : a = 20
I want to do multiple things in one line
-
Jun 10th, 2003, 04:08 AM
#2
Thread Starter
Sleep mode
Re: All in one line ??
I guess I don't have to use special symbols . Cool .
-
Jun 10th, 2003, 04:10 PM
#3
Lively Member
try:
Is that what you were looking for?
-
Jun 10th, 2003, 06:25 PM
#4
Thread Starter
Sleep mode
Originally posted by toto
try:
Is that what you were looking for?
heh , I know that . that's just an example . I was asking about how to do multiple code lines in one .
-
Jun 10th, 2003, 10:38 PM
#5
Frenzied Member
Well as long as you put the semicolon, you can do it.
-
Jun 11th, 2003, 06:03 AM
#6
Thread Starter
Sleep mode
Originally posted by DevGrp
Well as long as you put the semicolon, you can do it.
Exactly , but I thought that like in VB.NET which needs to add " : " after every line of code .
-
Jun 12th, 2003, 07:36 PM
#7
yay gay
you can put multiple statements in a line like the other guy said (too lazy to look at the nick :| ) because c# compiler only looks for it and not for paragrphs like vb one does..also if you want you can do
string lol = "hi";;;;;;;;;;;;;;;;;;;;
this wont raise any error thu it has no particular meaning!
for the interested ones thu it has nothing to do try putting double opening braces in the IDE and see what happens!
\m/  \m/
-
Jun 13th, 2003, 06:54 AM
#8
Thread Starter
Sleep mode
because c# compiler only looks for it and not for paragrphs like vb one does..also if you want you can do
This is new .
for the interested ones thu it has nothing to do try putting double opening braces in the IDE and see what happens!
I don't get it !
(too lazy to look at the nick :| )
hehe
-
Jun 15th, 2003, 11:57 AM
#9
yay gay
have u ever put a function in a MFC like notation(i think is how they call it) something like this...
put this code into the IDE
Code:
public void myFunction(
int a,
int b,
int c,
int d) { {
}
}
and put this:
Code:
public void myFunction(
int a,
int b,
int c,
int d) {
}
then put some code inside both of them and format it deleting the closing brace of each one so the IDE formats them...you'll notice as the 1st one is a lot easier to read
\m/  \m/
-
Jun 15th, 2003, 12:11 PM
#10
Thread Starter
Sleep mode
Hmm , I think I'm doing it the wrong way ..lol . What do you mean by "and format it deleting ". What does it look like when I'm done ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|