Actually ...wt. I had to check was that if the char pointer has a string initialized or it is not yet initialized.
To check if a string is zero length is easy even without a function call.
But uninitialized doesn't mean zero length, uninitialized means undefined. That means empty only if you're lucky. If you're unlucky it could be full of garbage. Don't check if a string is uninitialized -- don't leave around uninitialized strings, period.
I've got a very peculiar situation. I'm trying to find out if we can compare null fields with non-null. I've output csv files from SQL and Oracle. I need to compare each field from the files, and then find out any differences. The files usualy have over 500 fields, and send the resule to DBA.... (8 Replies)
Dear All,
I'm glad that I've also joined in this forum. Good work fellas... :b:
Keep going...! :)
I am having a .csv file where I am reading the values with comma(,) as delimiter. After reading each and every values, I would like to check whether it is empty (say null or blank spaces). How... (4 Replies)
Hi all
I have a file that i'm running and exec(cat ./dat) against..and putting its contents into any array, then doing an exploding the array into a multi-dimension array...
The 15 multi-dimensional arrays have elements that are null/empty, I would like to remove/unset these elements and then... (2 Replies)
void disptree(node *ptr)
{
if ((ptr->left) !=NULL)
disptree(ptr->left);
cout<<"Position:"<<ptr->pos<<" Data:"<<ptr->data<<endl;
if ((ptr->right)!=NULL;
disptree(ptr->right);
}
i'm getting a segmentation fault at the red line. i cannot understand what's the problem.... (3 Replies)
I have an input file having 7 fields delimited by ,
eg :
1,ABC,hg,1,2,34,3
2,hj,YU,2,3,4,
3,JU,kl,4,5,7,
4,JK,KJ,3,56,4,5
The seventh field here in some lines is empty, whereas the other lines there is a value.
How do I insert string NULL at this location (7th loc) for these lines where... (8 Replies)
Hi I need to check the output of a string to null. For eg the output I get for $KIT is empty. So want to echo something when the output is empty.
How can I do that?
Thanks in advance (6 Replies)
i have an array (with each element length "n") which is dynamic and has alphanumeric characters.
i want to check if any of the elements of the array are null and replace it with a string of "n" zeros for that element.
can you suggest me a code for the same. (1 Reply)
i have this code
for i in `cat sql_output.txt`
do
-- some script commands
done
sql_output.txt has 1 column with employee_ids
If the sql_output.txt is null then the do loop should not execute.
How can i implement this.
for i in `cat sql_output.txt`
If i is null or empty
then ... (5 Replies)
hi,
Am trying to find a solution for finding a null column value inside a loop using array.
for eg:
two
three
five
From the above array myarray,myarray and myarray having null values. But when am trying to check that space using some condition its not working.
for (( i=0;... (4 Replies)
I am getting some values from a file and putting them in an array..but the null strings are not getting passed to the array. So during printing the elements ,the null string is not showing in the output. during array size calculation it is also excluding null.Please let me know how to do it.
# cat... (2 Replies)
Discussion started by: millan
2 Replies
LEARN ABOUT OPENDARWIN
tcl_discardresult
Tcl_SaveResult(3) Tcl Library Procedures Tcl_SaveResult(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult - save and restore an interpreter's result
SYNOPSIS
#include <tcl.h>
Tcl_SaveResult(interp, statePtr)
Tcl_RestoreResult(interp, statePtr)
Tcl_DiscardResult(statePtr)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter for which state should be saved.
Tcl_SavedResult *statePtr (in) Pointer to location where interpreter result should be saved or restored.
_________________________________________________________________DESCRIPTION
These routines allows a C procedure to take a snapshot of the current interpreter result so that it can be restored after a call to
Tcl_Eval or some other routine that modifies the interpreter result. These routines are passed a pointer to a structure that is used to
store enough information to restore the interpreter result state. This structure can be allocated on the stack of the calling procedure.
These routines do not save the state of any error information in the interpreter (e.g. the errorCode or errorInfo variables).
Tcl_SaveResult moves the string and object results of interp into the location specified by statePtr. Tcl_SaveResult clears the result for
interp and leaves the result in its normal empty initialized state.
Tcl_RestoreResult moves the string and object results from statePtr back into interp. Any result or error that was already in the inter-
preter will be cleared. The statePtr is left in an uninitialized state and cannot be used until another call to Tcl_SaveResult.
Tcl_DiscardResult releases the saved interpreter state stored at statePtr. The state structure is left in an uninitialized state and can-
not be used until another call to Tcl_SaveResult.
Once Tcl_SaveResult is called to save the interpreter result, either Tcl_RestoreResult or Tcl_DiscardResult must be called to properly
clean up the memory associated with the saved state.
KEYWORDS
result, state, interp
Tcl 8.1 Tcl_SaveResult(3)