PDA

View Full Version : Spaces and Enter


rexzooly
02-06-2009, 09:30 PM
'
, ip_address:


ok as you see there is a enter here how would i make this work in the code
cos i keep getting a line error when i do


Endstring = "
'
, ip_address:";

i have tryed " and '

thanks all

Centauri Soldier
02-06-2009, 10:21 PM
Are you referring to a carriage return? If so that is "\r\n".

Also, you can set up strings using a multi-line technique.

Endstring = [[
'
, ip_address:]];

--that method will include any spaces you enter in the code; therefore, if you write...

sMyFirstString = [[This is my first string]];

--you will see that it is different than...

sMySecondString = [[...

This is my second string

see...]];


Dialog.Message("First", sMyFirstString);

Dialog.Message("Second", sMySecondString);

Bags
02-06-2009, 10:28 PM
'
, ip_address:


ok as you see there is a enter here how would i make this work in the code
cos i keep getting a line error when i do


Endstring = "
'
, ip_address:";

i have tryed " and '

thanks all

There are a few ways.

#1)
Endstring = [[
'
, ip_address:]];

If you use the double square brackets ALL text you type (including returns) remain.
#2)
Endstring = "'\r\n\t, ip_address:";

'\r\n\t' - represent carriage return, line feed, and tab

Hope that was helpful

rexzooly
02-07-2009, 09:14 AM
Are you referring to a carriage return? If so that is "\r\n".

Also, you can set up strings using a multi-line technique.

Endstring = [[
'
, ip_address:]];

--that method will include any spaces you enter in the code; therefore, if you write...

sMyFirstString = [[This is my first string]];

--you will see that it is different than...

sMySecondString = [[...

This is my second string

see...]];


Dialog.Message("First", sMyFirstString);

Dialog.Message("Second", sMySecondString);

[[ thanks i will try this one out as i am not sure in the spaces neede i just i did a straght copy from the code needed
:yes

thanks guys