Hello!
In 'C' programming the definition of a 'string' goes something like this:
"A string is an array of ASCII characters terminated by a 'NULL'."
The "" delimit the boundaries of the string.
The compiler knows not to count the terminating NULL when you use the 'C'
Library Function "strlen".
If you have a "sting with the '"' character in it" and you don't escape it
...eg "string with a \" in it" guess where the string end's.
Also you may want to use the following format when using the get command.
set tmpString1 [$widget(details) get 1.0 "end -1 chars" ]
That way the newline character will be droped when 'tmpString1' is
populated.
This may make your count of characters .... AH! .... more better.
Ralph McCord
"[EMAIL PROTECTED]" <rjent on 12/27/99 06:59:01 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: (bcc: Ralph McCord/CIMG/CVG)
Subject: [vtcl] Problems working with Strings that contain ""
Greetings,
I have encountered a small problems while trying to handle strings that
contain
"".
Below is how I am getting a string from a text widget then I want to find
the
length of it to do some formating of the string before I pipe it to the
printer:
set tmpString1 [$widget(details) get 1.0 end]
set cr [llength $tmpString1]
This works fine if there are no out of balance "" or there are no "" in the
string. Otherwise it fails:( If the "" are in balance it sort of works
but
the quotes do not appear when you pipe it to the printer:(
I would like to have the quotes remain in the string so they will print
out, but I need help!
Thoughts welcome!
#
--
RJ Ent. -- http://www.rjent.pair.com
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).