Sponsored Content
Top Forums Programming How to trim the white space around a string in C program Post 302244887 by rmh on Thursday 9th of October 2008 12:23:23 AM
Old 10-09-2008
You do realize that the register class hints that the declared objects will be accessed frequently, right.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to trim space in output variable ?

Hi , I have a code like this: uid=scott password=tiger database=db01 cat >runid_val.sql<<-EOA SET ECHO OFF SET FEEDBACK OFF SET HEADING OFF SELECT trim(runid_seq.nextval) FROM dual; EXIT EOA echo `cat runid_val.sql` V_RUNID=`sqlplus -s $uid/$password@$database @runid_val.sql`... (5 Replies)
Discussion started by: vj_76
5 Replies

2. Shell Programming and Scripting

Trim white spaces using awk

Hi, I have a CSV file with footer information as below. The third value is the number of records in the file. Sometimes it contains both leading and trailing white spaces which i want to trim using awk. C,FOOTER , 00000642 C,FOOTER , 00000707 C, FOOTER,... (2 Replies)
Discussion started by: mona
2 Replies

3. Shell Programming and Scripting

stripping white space...

Hi All; Having a problem with a file.. the file contains the following data... (a snapshot) 1331F9E9DB7C2BB80EAEDE3A8F043B94,AL7 1DZ,M,50 186FDF93E1303DBA217279EC3671EA91,NG5 1JU,M,24 3783FFAF602015056A8CD21104B1AAAF,CH42 4NQ,M,17 It has 3 columns sepreated by a , the second column... (7 Replies)
Discussion started by: Zak
7 Replies

4. UNIX for Dummies Questions & Answers

SED with White Space

Dear Members, Suppose i have a variable test which stores a string as below: test='John drives+++++++++a+++++car' now i want to use sed on the above variable and replace + with a white space, so that i get echo $test should give me 'john drives a car' Between... (1 Reply)
Discussion started by: sandeep_1105
1 Replies

5. Shell Programming and Scripting

sed + white space

Hi, What sed command (if sed is the right command) can remove ALL white space from my file. I have a csv, except I want to remove all white space between commas and characters. My idea (without testing) sed 's/ //g' Is there a better way? (18 Replies)
Discussion started by: mcclunyboy
18 Replies

6. UNIX for Dummies Questions & Answers

filename with white space

our user creates a text file with a white space on the filename. this same file is transfered to unix via automation tool. i have a korn shell script that reads these files on a input directory and connects to oracle database to run the oracle procedures which will load the data from each of the... (2 Replies)
Discussion started by: wtolentino
2 Replies

7. Shell Programming and Scripting

awk - trim white space from a field / variable

Hi, Consider the data (FS = |): 1| England |end 2| New Zealand |end 3|Australia|end 4| Some Made Up Country |end 5| West Indies|end I want the output to be (i.e. without the leading and trailing white space from $2) England New Zealand Australia Some Made Up Country West... (4 Replies)
Discussion started by: Storms
4 Replies

8. Shell Programming and Scripting

Add white space

hi guys how can i add spacein file name with sed if strings have no space around dash input 19-20 ( 18-19 ) ABC-EFG output after add white space 19 - 20 (18 - 19 ) ABC - EFG thx in advance (2 Replies)
Discussion started by: mhs
2 Replies

9. Shell Programming and Scripting

Putting white Space at the end of the string

Hi Guys, Hope, you all are doing good out there. I am writing a shell script and currrint in need of your help. This is what I need to do; I have position based plain file. One of the fields is 15 character long. I need to fill that field. The problem is that the value is dynamic, it could... (4 Replies)
Discussion started by: singh.chandan18
4 Replies

10. Shell Programming and Scripting

Trim Space

In Shell, I have output of a unix command as test1 test2015 but I want it as test1 test2015 can anyone help me out. Use code tags, thanks. (3 Replies)
Discussion started by: OscarS
3 Replies
itcl(n) 							    [incr Tcl]								   itcl(n)

__________________________________________________________________________________________________________________________________________________

NAME
itcl - object-oriented extensions to Tcl _________________________________________________________________ DESCRIPTION
[incr Tcl] provides object-oriented extensions to Tcl, much as C++ provides object-oriented extensions to C. The emphasis of this work, however, is not to create a whiz-bang object-oriented programming environment. Rather, it is to support more structured programming prac- tices in Tcl without changing the flavor of the language. More than anything else, [incr Tcl] provides a means of encapsulating related procedures together with their shared data in a namespace that is hidden from the outside world. It encourages better programming by pro- moting the object-oriented "library" mindset. It also allows for code re-use through inheritance. CLASSES
The fundamental construct in [incr Tcl] is the class definition. Each class acts as a template for actual objects that can be created. Each object has its own unique bundle of data, which contains instances of the "variables" defined in the class. Special procedures called "methods" are used to manipulate individual objects. Methods are just like the operations that are used to manipulate Tk widgets. The "button" widget, for example, has methods such as "flash" and "invoke" that cause a particular button to blink and invoke its command. Within the body of a method, the "variables" defined in the class are automatically available. They need not be declared with anything like the global command. Within another class method, a method can be invoked like any other command-simply by using its name. From any other context, the method name must be prefaced by an object name, which provides a context for the data that the method can access. Each class has its own namespace containing things that are common to all objects which belong to the class. For example, "common" data members are shared by all objects in the class. They are global variables that exist in the class namespace, but since they are included in the class definition, they need not be declared using the global command; they are automatically available to any code executing in the class context. A class can also create ordinary global variables, but these must be declared using the global command each time they are used. Classes can also have ordinary procedures declared as "procs". Within another class method or proc, a proc can be invoked like any other command-simply by using its name. From any other context, the procedure name should be qualified with the class namespace like "class- Name::proc". Class procs execute in the class context, and therefore have automatic access to all "common" data members. However, they cannot access object-specific "variables", since they are invoked without reference to any specific object. They are usually used to per- form generic operations which affect all objects belonging to the class. Each of the elements in a class can be declared "public", "protected" or "private". Public elements can be accessed by the class, by derived classes (other classes that inherit this class), and by external clients that use the class. Protected elements can be accessed by the class, and by derived classes. Private elements are only accessible in the class where they are defined. The "public" elements within a class define its interface to the external world. Public methods define the operations that can be used to manipulate an object. Public variables are recognized as configuration options by the "configure" and "cget" methods that are built into each class. The public interface says what an object will do but not how it will do it. Protected and private members, along with the bodies of class methods and procs, provide the implementation details. Insulating the application developer from these details leaves the class designer free to change them at any time, without warning, and without affecting programs that rely on the class. It is precisely this encapsulation that makes object-oriented programs easier to understand and maintain. The fact that [incr Tcl] objects look like Tk widgets is no accident. [incr Tcl] was designed this way, to blend naturally into a Tcl/Tk application. But [incr Tcl] extends the Tk paradigm from being merely object-based to being fully object-oriented. An object-oriented system supports inheritance, allowing classes to share common behaviors by inheriting them from an ancestor or base class. Having a base class as a common abstraction allows a programmer to treat related classes in a similar manner. For example, a toaster and a blender per- form different (specialized) functions, but both share the abstraction of being appliances. By abstracting common behaviors into a base class, code can be shared rather than copied. The resulting application is easier to understand and maintain, and derived classes (e.g., specialized appliances) can be added or removed more easily. This description was merely a brief overview of object-oriented programming and [incr Tcl]. A more tutorial introduction is presented in the paper included with this distribution. See the class command for more details on creating and using classes. NAMESPACES
[incr Tcl] now includes a complete namespace facility. A namespace is a collection of commands and global variables that is kept apart from the usual global scope. This allows Tcl code libraries to be packaged in a well-defined manner, and prevents unwanted interactions with other libraries. A namespace can also have child namespaces within it, so one library can contain its own private copy of many other libraries. A namespace can also be used to wrap up a group of related classes. The global scope (named "::") is the root namespace for an interpreter; all other namespaces are contained within it. See the namespace command for details on creating and using namespaces. MEGA-WIDGETS Mega-widgets are high-level widgets that are constructed using Tk widgets as component parts, usually without any C code. A fileselection- box, for example, may have a few listboxes, some entry widgets and some control buttons. These individual widgets are put together in a way that makes them act like one big widget. [incr Tk] is a framework for building mega-widgets. It uses [incr Tcl] to support the object paradigm, and adds base classes which provide default widget behaviors. See the itk man page for more details. [incr Widgets] is a library of mega-widgets built using [incr Tk]. It contains more than 30 different widget classes that can be used right out of the box to build Tcl/Tk applications. Each widget class has its own man page describing the features available. KEYWORDS
class, object, object-oriented, namespace, mega-widget itcl 3.0 itcl(n)
All times are GMT -4. The time now is 07:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy