15,884,298 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Sumal.V (Top 200 by date)
Sumal.V
10-Oct-12 10:48am
View
No no..U got my question right.It is solved now.
Sumal.V
10-Oct-12 10:45am
View
Exactly! that's the main reason I thought I was wrong! As i was checking in the debug mode and found the pointer going to the rest of the else statements..
But hey thanks.
Sumal.V
10-Oct-12 10:43am
View
Thanks
Sumal.V
10-Oct-12 10:43am
View
Okay, just thought it was a bit dodgy.. But I changed it to this format just now.
Sumal.V
25-Sep-12 8:38am
View
Its ctrl + f in my computer which has find and replace option. But yes problem solved..:)
Sumal.V
25-Sep-12 7:46am
View
I know how to do that in a macro, but its tedious. Moreover the excel file has many sheets and I'm only using this for testing.
Sumal.V
25-Sep-12 7:27am
View
Did you mean manually replacing all the values ?
Sumal.V
25-Sep-12 6:53am
View
Hmmm I must be replacing over 1000 values then :O
I must have mentioned that in the question..
Sumal.V
20-Sep-12 10:43am
View
Cheers, That works.
But it is different. For example, if its an If statement, every line is aligned to the left, spoiling the flow/look , but by explicitly pushing some lines to the right and then realigning to the left keeps the format right.
But thanks :)
P.S. Can you add this as a solution so that I can take this question off the unanswered list.
Thanks
Sumal.V
20-Sep-12 9:28am
View
I'm using Excel VBA, to code the macros.
There aren't any shortcuts available too..
Sumal.V
11-Sep-12 9:10am
View
Save your .exe file in some other directory and check.
Sumal.V
11-Sep-12 9:09am
View
Deleted
Save your .exe file in some other directory other directory and check.
Sumal.V
7-Sep-12 11:36am
View
Thanks a ton! That works :)
Sumal.V
7-Sep-12 11:36am
View
Yeah I use Visual C++. But this didn't work ! But hey Thanks :)
Sumal.V
3-Sep-12 8:57am
View
Hey if you want to learn, then pick up a book and start. Learn the concept and look for examples based on that concept. like examples for threads, functions, arrays and so on. That way you can at least understand what is going on in there, rather than picking up some random code and breaking your head.
Sumal.V
30-Aug-12 6:26am
View
Simple parser like? And would that not do exactly the same thing, but in a different method..
Sumal.V
30-Aug-12 6:22am
View
Wish I could vote this message :)
Sumal.V
29-Aug-12 7:36am
View
Hey there are 5 solutions posted for you. Please accept a solution, so that this question goes off the unanswered list.
Or if you are still having problems, ask!
Sumal.V
29-Aug-12 7:35am
View
Deleted
Hey there are 5 solutions posted for you. Please accept a solution, so that this question goes off the unanswered list.
Or if you are still having problems, ask!
Sumal.V
27-Aug-12 13:46pm
View
Thank You :)
Sumal.V
25-Aug-12 5:04am
View
Hey thanks.. but the problem is just solved. Looks like you work with GPS data as well... ;)
Sumal.V
24-Aug-12 8:56am
View
Yeah that works :)Cheers :)
The only change being the reference type. Here "." is used instead of "->" operator.
Sumal.V
22-Aug-12 11:20am
View
I guess this was like using a calculator to calculate 2 + 2! I was completely blank, but yes I had tried earlier but may be I was doing some silly error somewhere :/
Yes instead of _T("\n"), if I use _T(","), I can add labels in different column :) Thanks a lot. :)
Sumal.V
21-Aug-12 8:19am
View
Reputation Points! Common! :P
Sumal.V
20-Aug-12 10:27am
View
Thank you :)
Sumal.V
20-Aug-12 10:09am
View
Can I have an example please...
Sumal.V
20-Aug-12 9:27am
View
Well the problem is with my SetValues function. I need to use some other way of parsing the string (and its different formats).
But thank you :)
Sumal.V
20-Aug-12 9:03am
View
Yes I understood about the %%d but thinking how that applies to my code. But is that a good way of including a formatted string?
Sumal.V
20-Aug-12 7:46am
View
Crappy? :( I don't know! Updated the question just now.
Sumal.V
20-Aug-12 5:35am
View
I finally got the program working. Took a while for me to understand, I'm a very slow learner. But Thank you :)
Sumal.V
16-Aug-12 9:58am
View
Nope I'm not doing that mistake of asking ;) But thanks so much :)
Sumal.V
16-Aug-12 9:25am
View
I don't understand why you have chosen "CString DataType" variable ; And what is the main function of SetFieldData()?
Can I not just use scanf function to read the file and add the variables into the SurveyTable..
And I want to know why the ParseDateField, setDateRecorded are for?
I'm surely not asking for you to make my project for free. You got my 5 for the answer.
But hey, how much do u charge ? ;)
Sumal.V
16-Aug-12 7:55am
View
Deleted
And I want to know why the ParseDateField, setDateRecorded are for?
Sumal.V
16-Aug-12 7:48am
View
Deleted
I don't understand why you have chosen "CString DataType" variable ;
Can I not just use scanf function to read the file and add the variables into the SurveyTable..
I'm surely not asking for you to make my project for free.
But hey, how much do u charge ? ;)
Sumal.V
15-Aug-12 10:04am
View
Hi that's alright. Just found a beginner level article on Lists :)
Sumal.V
15-Aug-12 6:35am
View
Thanks for that. May be I'm asking for too much,but could you please give me an example code, with some values, for a better understanding. I browsed the internet and found few examples, but they either look complicated or not relevant. Thanks again
I do have a book with a case study on lists but its starts with simple variables and by the time I could get to the middle of the program I had lost track of what I was doing.
Sumal.V
14-Aug-12 11:23am
View
And Can I also know what the SetFieldData () is for..
Sumal.V
14-Aug-12 8:52am
View
Hey Jack, the lines:
virtual bool SetFieldData(LPCSTR szDateRecorded, LPCSTR szDataType, etc...);
virtual bool SetFieldData(LPCSTR szDateRecorded, LPCSTR szDataType, etc...);
Did u mean to override the SetFieldData, for the rest of the variables?
Sumal.V
14-Aug-12 8:28am
View
Yeah I'm trying to work with lists as explained in the solution 2. Thanks :)
Sumal.V
14-Aug-12 4:32am
View
Thanks so much for the wonderful example. It looks like an complicated exam question with lot of clues. Will give this a try :)
Sumal.V
13-Aug-12 11:23am
View
Okay, I've never done anything involving lists and complex functions. WIll give that a try. Thanks
Sumal.V
13-Aug-12 10:28am
View
Do you mean use of Lists?
Sumal.V
13-Aug-12 10:27am
View
This is a sample code:
//1 read
if (csf.Open(fname, CFile::modeRead))
{
while (csf.ReadString(buffer) )
{
out = swscanf_s(buffer, _T("%[^,], %lf, %lf, %[^,], %lf, %[^,], %d, %d, %lf, %lf, %[^,], %lf, %[^,], , %[^,]"),
str1, 2046, &sTime, &db1, str4, 2046, &db2,str5, 2046, &in1, &in2, &db3, &db4, str6, 2046, &db5, str7, 2046,str10,2046);
double templat = int( lat1 / 100 ) + ( (lat1 / 100 - int( lat1 / 100 )) / 0.6 ); // latitude in degrees
double templon = int( lon1 / 100 ) + ( (lon1 / 100 - int( lon1 / 100 )) / 0.6 ); // longitude in degrees
//lat/lon calculations
sumLat = sumLat + templat;
count++; // int count = 0;
}
else
{
//error report
}
}
csf.Close();
}
meanLat = sumLat / count;
//Second Read
if (csf.Open(fname, CFile::modeRead))
{
while (csf.ReadString(buffer) )
{
out = swscanf_s(buffer, _T("%[^,], %lf, %lf, %[^,], %lf, %[^,], %d, %d, %lf, %lf, %[^,], %lf, %[^,], , %[^,]"),
str1, 2046, &sTime, &db1, str4, 2046, &db2,str5, 2046, &in1, &in2, &db3, &db4, str6, 2046, &db5, str7, 2046,str10,2046);
lattemp = db1;
lat = int( lattemp / 100 ) + ( (lattemp / 100 - int( lattemp / 100 )) / 0.6 );
latRad = lat * (ML::pi)/180;
deltaLat = latRad - meanLat ; //MeanLat is used for every single line.
.............
Sumal.V
13-Aug-12 10:04am
View
Deleted
SoapBox effect?? Hehe :)
B/w I check and cannot reduce it to less!!
Sumal.V
13-Aug-12 9:54am
View
Nope sorry, I've updated my question.
B/w I must do that as I apply these calculated values to values in every single line and display them..
Sumal.V
13-Aug-12 9:49am
View
Hey sorry, I've updated my question. That is because after I read the first time, I calculate the average and in the second read I apply this average value to every line in the file n so on ...
Sumal.V
2-Aug-12 8:52am
View
Alright..
Sumal.V
2-Aug-12 6:56am
View
These programs are pre written/defined and I cannot alter anything in there. But yes I did have a look at the link you've sent, but don't quite understand what is wrong.
Sumal.V
2-Aug-12 5:22am
View
In this particular class, there is a settings function, where the object is added:-
obj.Item(_T("Source_Easting"), m_srcENZFx.x, 10);
There is another function in another main class where this function lies-
void CESetObj::Item(const CString& itm, double& val, int dp)
{ CString str, fmt;
fmt.Format(_T("%%.%dlf"), dp);
Add(itm, fmt, val)
}.
Sumal.V
2-Aug-12 4:31am
View
CV3 in my program is a class with one of its method- CV3(double x, double y, double z).This is mainly used in calculations involving latitude, longitude and height.(3 parameters)
Sumal.V
2-Aug-12 4:28am
View
I didn't get you.. it is displayed using :
InsCtrl(80, EC_EDIT,m_userENZ1.x);
where InsCtrl is a method in the class - CECtrl
InsCtrl(int c, int type, double& val, CEFlex* pFlex)
Sumal.V
2-Aug-12 4:21am
View
CV3 in my program is a class with one of its method- CV3(double x, double y, double z).This is mainly used in calculations involving latitude, longitude and height.(3 parameters)
Sumal.V
2-Aug-12 4:08am
View
Alright, thanks :) Indeed have got some answers for my question. Is it because of the editing? I don't know, But I'm glad :)
Sumal.V
2-Aug-12 4:05am
View
Haha, never expected so many supporters for the editor :P
But thanks, I checked that :) There was an extra bracket in the heading itself!
Sumal.V
2-Aug-12 4:01am
View
Oh yeah, must come out of using the SMS language ;) cheers
Sumal.V
2-Aug-12 4:00am
View
Cheers, Thanks for that :)
Sumal.V
1-Aug-12 6:14am
View
Yup thanks, including brackets helped :)
Sumal.V
1-Aug-12 6:07am
View
Cheers Richard, That helped a lot.
Sumal.V
1-Aug-12 6:06am
View
Yippeeee....Thank u soooooooooooooo much. The 90.0/180.0 instead of 90/180 made a big difference :)
Sumal.V
18-Jul-12 8:36am
View
Thanks, was being a lil silly :P
Sumal.V
13-Jul-12 11:46am
View
Oh yeah thank you, I tried the LEFT function, but that could be applied on a single cell
Cheers :)
Sumal.V
6-Jul-12 4:27am
View
Sorry I made some mistake while copying the values. It works. Thank u very much :)
Sumal.V
6-Jul-12 4:13am
View
Thank you very much. But I have another problem. In my previous method, where I specify the path name, I get an Import Wizard, where in I can choose the type of file, file origin, select the delimiters.
Because I select a .csv file I must specify the delimiters like comma.
The above method imports the data and prints them without organising them into columns. But now since it only selects the file name, I have no option to select the delimiters..
Sumal.V
2-Jul-12 5:14am
View
If down voting please give me the reason, so that I will know what is wrong in asking a sensible question! Thanks
Sumal.V
29-Jun-12 6:14am
View
But v can always format the axis. An that is what I'm trying to do..formatting the x-axis containing the time...
Sumal.V
29-Jun-12 6:01am
View
I display the time from my C++ programming into an excel sheet. Now I work with this to produce the excel graph. I do not get much response if its excel. should I take off the c++ tag ?
Sumal.V
27-Jun-12 10:18am
View
:) yeah but what I mean is instead of giving the chart name I want to use the ActiveChart, which means I can use that as a standard macro and use it on any data set.
Sumal.V
27-Jun-12 10:02am
View
ActiveSheet.Shapes("Chart 42").IncrementLeft 400.5
This is the chart number I'm talking about. The chart numbers keep changing every time
Sumal.V
27-Jun-12 9:54am
View
I can see what is happening but the code generated by recording the macro has chart numbers generated and hence not feasible. Every single time I have to change the chart numbers and run
Sumal.V
27-Jun-12 9:50am
View
The problem with recording the macro is that, the chart is generated along with numbers which means chart 1 is generated while recording the macro but next time the chart value changes to 2 and this causes run time error: name not found...
Sumal.V
27-Jun-12 9:40am
View
What do I modify in the same code as shown above such that instead of a range of values being selected, I must select just one column?
Sumal.V
27-Jun-12 9:38am
View
Yeah I understand, just thought there might be a way to do that.
Sumal.V
27-Jun-12 9:32am
View
And if I get rid of that line, no data is selected
Sumal.V
27-Jun-12 9:17am
View
Cheers :) yup I've got 2 monitors and can see what happens exactly. I got rid of the "Selection.CurrentRegion.Select" and changed the Range the Range to D4:D7, but Could not extract the values yet. But thanks :)
Sumal.V
27-Jun-12 8:53am
View
so what should I change that to?
Sumal.V
27-Jun-12 8:50am
View
Sorry, I'm working based on an example from the link: http://support.microsoft.com/kb/213352
it contains cells C, D, E, F . when I say Range(C:C), the macro is applied to C, D, E, F as well not just C
Sumal.V
27-Jun-12 8:42am
View
Yeah, In that above code, if I change the range to A1:A11, it still selects the entire area.
Sumal.V
27-Jun-12 8:30am
View
if i record the macro,
ActiveChart.SeriesCollection(1).Name = "=Sheet1!$A$11"
ActiveChart.SeriesCollection(1).Values = "=Sheet1!$A$1:$A$11"
but again I do not want to specify the sheet name. I have updated my code.
Sumal.V
27-Jun-12 5:54am
View
Well not thought about generating letters in programming yet! ;)
I meant letters in a 'text'. I generate a report into word, say the date, name of the project and the specifications, while outputting in a string, can I apply any formatting ? changing font colour or making it bold..
Sumal.V
21-Jun-12 11:48am
View
Its just a simple Stdio file,
of.WriteString(DispValue(val));
where of is the CStdioFile of;
and DispValue(val)is a function that returns a string of values
Sumal.V
19-Jun-12 9:31am
View
Oh well, yeah. I always to do try things in complicated way and end up in confusion. B/w it is not 21 decimals, its 2l(2 followed my letter "L")
Sumal.V
19-Jun-12 5:18am
View
Exactly! since I work with latitudes and longitude values from csv files, I always encounter such problems!
Sumal.V
18-Jun-12 10:47am
View
yes rounding is the word! I din't quite understand this example(for my level) ..need sometime to go through.. but thanks
Sumal.V
18-Jun-12 10:42am
View
Yeah I have done that, but since I'm converting calculations that were in excel to c++, the calculations are based on the rounded off values and they differ from the dynamic values obtained..
Sumal.V
18-Jun-12 4:56am
View
Yeah this works as well. I now wonder why I used w_char types instead of CString itself.I'm sure I had some problem earlier, I'm just blank now. Must maintain some documentation. But thanks for keeping up with me :)
Sumal.V
18-Jun-12 4:34am
View
Good morning!,I checked the code with a break point but realised that since the variable in both the if and while loops was str1, ie both pinitialTime and pfinalTime were assigned this str1 variable, at the end when the final time was taking the final value, initialtime was assigned the same value. I changed the variable names now as initstr1 and finalstr1 instead of str1 for both and that gives me the right values..
Sumal.V
15-Jun-12 11:51am
View
And If I add the semicolon, I get run time error. when I checked the code in debug, I found that the program does not move after while();
That's the reason I took it off.
Sumal.V
15-Jun-12 11:39am
View
This results in both variables taking the same values as well..
Sumal.V
15-Jun-12 10:34am
View
Cheers, it works when I pull the initial value before the while loop starts. I will work out why both the variables take the same value, when they are printed after teh while loop.
Thank u very much :)
Sumal.V
15-Jun-12 10:22am
View
I updated my code, but bothe the first and last values get the same values ie(last ). I have shown my updated code in the question.
Sumal.V
15-Jun-12 9:33am
View
I cannot extract any values before this statement.
while (csf.ReadString(buffer));
There the variable gets no values/garbage values before that line of code .
Sumal.V
15-Jun-12 9:29am
View
Hi,I have updated my question.
Sumal.V
15-Jun-12 8:48am
View
Ummm.. it doesn't look easy for me :(
if I try extract one value, that will apply for all the values, as it is in a loop. so everything the loop is run, the particular column value will b printed.
And I must go into the while loop to start reading the values .
Sumal.V
15-Jun-12 8:32am
View
Deleted
Ummm.. it doesn't look easy for me :(
if I try extract one value, that will apply for all the values, as it is in a loop. so everything the loop is run, the particular column value will b printed.
And I must go into the while loop to start reading the values .
Sumal.V
14-Jun-12 6:46am
View
Will update my question.
Sumal.V
14-Jun-12 6:46am
View
Oops sorry, yeah. It is a csv file that opens in excel.
Yeah if I change that myself in excel it does change the format and display the desired values. :)
Cheers
Sumal.V
14-Jun-12 6:11am
View
Using swscanf_s function.
Sumal.V
13-Jun-12 11:38am
View
I assigned the dynamic value to a pointer and it works...
wchar_t *pStrId = str1;
//pStrId now takes the correct values.
Sumal.V
13-Jun-12 7:28am
View
cheers :)that worked
Sumal.V
13-Jun-12 7:27am
View
Thank u :)
Sumal.V
13-Jun-12 6:56am
View
And it is the npos value its taking..
Sumal.V
13-Jun-12 6:52am
View
Cheers, but when I used std::wstring strId;
strId = str1;
The format / value is completely different. The value obtained dynamically is "21:00:55" but the strId value holds "4294967295"
Sumal.V
12-Jun-12 6:05am
View
Cheers :)
Sumal.V
31-May-12 6:15am
View
Well just tried using double instead of CV3 but teh str1 and str2 are still gthe same..
Sumal.V
31-May-12 6:03am
View
Yes both take same values and return false.. sorry they are comma separated values.. I doubt if its anything to do with the vector format CV3.
Sumal.V
31-May-12 5:39am
View
OOps sorry took a while..
Sumal.V
31-May-12 5:17am
View
I did use the reply button. If I can ask another doubt, I know it will b downvoted but I believe its always good to ask questions.. I have updated the questions for your reference.. Please help
Sumal.V
31-May-12 5:13am
View
That's a meaningful example, understandable code and gives awareness of drinking :)But I must use sscanf functions, as I'm adding additional functions on a existing program and I'm supposed to follow the uniformity. :(
But thank you :)
Sumal.V
29-May-12 9:33am
View
If I get this working , half of of problem will be solved..
Sumal.V
29-May-12 9:26am
View
Hi! I've just updated the code.
Sumal.V
29-May-12 9:07am
View
Again, as u said, I changed the format to :
lineval : is same
searchStr=_T("%s,%s,%s,%lf,%c,%s,%s,%s,%lf,%c");
swscanf_s (line, searchStr, str1, 50, str2, 50, str3, 50, &doub1, &chart1) ;
//none of the variables get any value...
Sumal.V
29-May-12 9:05am
View
Well its not a simple string . I have open a .csv file containg thousands of lines, each line of the format something like this :-
21:00:55 $GPGGA 210055 6102.00399 N 107.5920998 E 2 9 1.2 23.57 M 47.57 M 10 1011*4E $GPGGA 210054 6102.00388 N 107.62266 E 2 10 1 25.33 M 47.57 M 13 0777*76 $HEHDT 0.4 T*2B 0.67.
so I have to get the first 5 column values say and then perform calculation on 4th column - find sum and average, column wise.
Sumal.V
29-May-12 8:42am
View
Oh sorry, I'm really not getting the hang of sscanf functions :(
Yes if I give buffer values, the code works well..
In the same program, There is an error again:-
CString searchStr, lineval;
lineval = "21:00:55.035,$GPGGA,210055.00,6102.0039902,N,$GPGGA,210054,6102.00388,N";
searchStr.Format(_T("%%s,%%s,%%s,%%lf,%%c,%%s,%%s,%%s,%%lf,%%c"));
CString str1, str2, str3;
double doub1;
char chart1;
swscanf_s (line, searchStr, str1, 50, str2, 50, str3, 50, &doub1, chart1) ;
What is wrong here? It doesn't read the values first... Thanks for ur help
Sumal.V
29-May-12 4:18am
View
Thanks so much.. Have to get some tuitions from you ;)
Sumal.V
29-May-12 4:10am
View
Still have doubts on formatting a string.
char *tokenstring = "first 25.5,second 15";
result = sscanf(tokenstring, "%[^' '] %[^','],%[^' '] %s", string1, flt, string2, int1);
This is the right format for the given string, But don't understand why I must include the %[^' '] plus leave a space in between the next set of values in the string. And the last value in the string as %s! could you please give me few examples?
Sumal.V
29-May-12 3:45am
View
Thanks for the explanation, had many doubts regarding the sscanf, swscanf functions.
Sumal.V
28-May-12 7:59am
View
I know L is for LPCTSTR, unicode conversion. But the whole swscanf function is a bit of confusion for me.. Igoogled it, but did not find good examples that I can understand..
Sumal.V
28-May-12 6:44am
View
That doesn't help too...
Sumal.V
28-May-12 6:28am
View
Nope It still shows the error:
Here's my code:
int main( void )
{
int integ ;
CString st2,st1;
float doub;
CString s =L"first:25.5,second,15";
if ( swscanf_s(s, "%s %f %s %d", &st1, &doub, &st2, &integ )!= 4 )
{
cout<< "right";
}
else
cout <<"wrong";
}
Sumal.V
28-May-12 4:37am
View
Hi sorry, I really did not understand that code above, could you please explain?
Sumal.V
25-May-12 7:48am
View
Haha that's cool... will ignore :P
Sumal.V
25-May-12 7:42am
View
OOps! In my screen there is a number! something is wrong with my screen then!
Sumal.V
25-May-12 6:55am
View
;) Nope in the solution, there is a phone number printed..
Is that yours ?
Sumal.V
25-May-12 6:39am
View
Thanks I will try that!. Is that your phone number printed by mistake ?
Sumal.V
25-May-12 5:30am
View
Exactly, to not read the data from the file I have to set some kind of a condition and that can be either the discarding the column based on a format, but this row has 2 variables of the same format.
And I really don't understand what you mean by delaying ..
Sumal.V
25-May-12 4:33am
View
Yes I managed to open the source file, read the values and print them onto the destination file, with headings. But I have to discard the last set of values and again performing calculation on this is a little confusing..
Sumal.V
25-May-12 4:30am
View
Just managed to print heading in the file, I cannot use tokenise because of the format of the text in the file, as updated in my question. Cant point to a particular column in a row and delete all the values after that row.
Sumal.V
23-May-12 11:49am
View
And to output the file is it better to use .csv file as I have to save them in columns and its rely confusing!
Sumal.V
23-May-12 11:48am
View
Deleted
And to output the file is it better to use .csv file as I have save them in columns and its rely confusing!
Sumal.V
23-May-12 9:46am
View
I used this code to get the value from the 4th column, but I cannot make any calculations on these values. for example :
void main{
str(_T("%21:00:55 $GPGGA 210055 6102.00399 six"));
CAtlString resToken;
int curPos = 24;
double val;
resToken= str.Tokenize(_T(" "),curPos);
_tprintf_s(_T("Resulting token: %s\n"), resToken);
}
thsi prints the 4th column value but I have to do some calculation on that variable, For which I have to convert from string to double and back to string to print the values. Is this feasible?
Sumal.V
23-May-12 6:40am
View
:)
Sumal.V
23-May-12 6:33am
View
Thanks, But by using tokenise function I can use space as delimiter, but there is space after every column in the file and I have to extract a particular column say the 5th one, how can I do that?
Sumal.V
22-May-12 10:56am
View
In one of the code, in order to ignore the comment lines, I can type:
if (line.Find(_T("%")) == 0)
return;
//where the line is a CSring and "%" is used for comment lines in .csv files
But now since I have to find many spaces ie to calculate the 4th column I have to check 3 spaces in a row, so how can I do that?
Sumal.V
22-May-12 10:55am
View
Deleted
In one of the code, in order to ignore the comment lines, I can type:
if (line.Find(_T("%")) == 0)
return;
But now since I have to find many spaces ie to calculate the 4th column I have to check 3 spaces in a row, so how can I do that?
Sumal.V
22-May-12 9:54am
View
But how can I separate the columns? There are no commas, or any other delimiters between each column..
Sumal.V
22-May-12 9:06am
View
NPD: Novell Printer Definition (NPD) files appear in the Printer Type list when you are creating a Printer Agent using the Novell Gateway's Print Device Subsystem (PDS).(Googled it : http://www.novell.com/fr-fr/documentation/nw51/docui/#../ndps_enu/data/hxiyy2w0.html)
Yes I'm working on windows and use visual C++. Yes I have to give a name to each column and display to the user,in a text format.
Sumal.V
8-May-12 10:31am
View
Oh well I get that now.
Thanks :)
Sumal.V
8-May-12 10:21am
View
So why combine int with long double?
Sumal.V
8-May-12 10:09am
View
Oops Sorry yes, I have missed the int variable. Have added that now.
But y not just write :
str1.Format(_T("%%02d°%%02d'%%1.%d\""), 5);
In the seconds part, why is lf required?
Sumal.V
4-May-12 6:32am
View
Okay.. guys. I was glad atleast I got my software display what it has to. I will definitely look into the formula and solve it the proper way, when I find more time. I had some deadline to fix this problem, which explains why I chose the short-cut method. I'm definitely not happy about what I hve done but relieved for now..
Sumal.V
3-May-12 8:54am
View
Oh thank you. So in my program the value nDst is set to -1 which mean the library code has to decide whether daylight saving is in effect or not. So which is that function? I've spent one full day on this n still no clue
:(
Sumal.V
3-May-12 5:48am
View
At last I found the function that displays the time: But I don't know how to change. The time on software is 1 hour slow.
void CPgInd::OnPoll(double time)
{
if (m_hWnd)
{
CTm80 tm;
tm = time;
CString str = tm.Format(_T("%a %d/%m/%Y %H:%M:%S"));
m_timeStr = str;
UpdCtrls();
}
}// the format displayed is Thu 03/05/2012 9:46:23
Sumal.V
2-May-12 11:36am
View
I didn't quite get that! U mean I must display the local time?
Sumal.V
2-May-12 10:02am
View
There are just 3 functions with SetWindowText and not time related!:(
Sumal.V
2-May-12 9:46am
View
Nope I want to know the function that displays the time, so that I can modify to the current GMT....
Sumal.V
1-May-12 11:52am
View
Yeah and so the formula cannot be viewed. :(
But Thanks for your time :)
Sumal.V
1-May-12 11:23am
View
Can U please try that with the link above? because I cannot view :(
Sumal.V
1-May-12 11:20am
View
But I cannot change because it is in compatibility mode. How do I change that?
Sumal.V
1-May-12 11:08am
View
Yeah I tried unprotecting the the sheet, but its just the values but not formula.
Thanks for updating.
Sumal.V
26-Apr-12 8:12am
View
Oh okay, cheers
Sumal.V
26-Apr-12 7:32am
View
But out of the 3 if statements, the 2nd and the third are same.... I don't get the point.
Sumal.V
25-Apr-12 5:34am
View
Thank u very much :)
Sumal.V
24-Apr-12 10:22am
View
Yeah the problem is with CEdit!! Will figure that out.
Thank u :)
Sumal.V
24-Apr-12 10:08am
View
And I'm not sure if I can post the actual code!! That would b wrong isn't it?
Sumal.V
24-Apr-12 10:07am
View
Well edit box must have a different format that takes atleast one letter.If I dont append any letter, I get an error(User defined), that says Incorrect format. The problem is I'm working on somebody else's code.
For now I have appended a letter for that to work.
Thank u
Sumal.V
24-Apr-12 4:19am
View
All I want to know is can I append a blank space using CString.append?
Sumal.V
24-Apr-12 4:12am
View
I have no problem appending character/letter but for one case I want to return the string as it is : The code:
if(condition)
switch (degree)
{
case one:
str.Append(_T("0"));
break;
case two:
str.Append(_T("00"));
break;
}
if (Fmt == Latitude)
(val >= 0) ? str.Append(_T("N")) : str.Append(_T("S"));
else if (m_dirFmt == Longitude)
(val >= 0) ? str.Append(_T("E")) : str.Append(_T("W"));
else if (m_dirFmt == Bearing)
//Here I want to append nothing as bearing is just a degree value
}
return str;
Sumal.V
24-Apr-12 3:55am
View
if (Fmt == Latitude)
(val >= 0) ? str.Append(_T("N")) : str.Append(_T("S"));
else if (m_dirFmt == Longitude)
(val >= 0) ? str.Append(_T("E")) : str.Append(_T("W"));
else if (m_dirFmt == Bearing)
//Here I want to append nothing as bearing is just a degree value
Sumal.V
24-Apr-12 3:55am
View
Exactly! I have no problems appending a character. But for one case I want to append nothing. ie:
if (Fmt == Latitude)
(val >= 0) ? str.Append(_T("N")) : str.Append(_T("S"));
else if (m_dirFmt == Longitude)
(val >= 0) ? str.Append(_T("E")) : str.Append(_T("W"));
else if (m_dirFmt == Bearing)
//Here I want to append nothing as bearing is just a degree value
Sumal.V
23-Apr-12 11:56am
View
Well It is a very complicated code. Before the above shown code : There is :
String1.Format(_T("%%02d°%%02d'%%1.5lf\""), 3);
str.Format( String1, deg, min, sec);
This string is displayed in an edit box in the software. If the format type = style1, Then append '>' or '<'. If the format type = style2, I don't want to append any letter.
Sumal.V
18-Apr-12 10:30am
View
cheers.. thank you
Sumal.V
18-Apr-12 9:18am
View
In order to calculate degrees in the format- 28°36'40.124"
And return this value in an edit box, what is the return type to use?
Sumal.V
17-Apr-12 9:26am
View
Yeah I know what you mean.
As of now I don't have any pressure from senior level to get the job done. But I'm given an opportunity to learn (On my own!).But there were instances where in I was expected to get a function running by the next day n I would just go blank!
As far as the job is concerned, I'm happy as I'm getting some commercial experience. I don't know what I like, Ie: web based or desktop based. I need to figure that out first.
Sumal.V
17-Apr-12 8:34am
View
Nice to hear this from someone as experienced as you. At the end of the day, I know its my decision. Its just that as a graduate when I was offered this position I was excited and never bothered about the platform.
Even now when I find some of my Java books I get all excited and happy to flip through the pages.
Or I guess its just that "The grass is greener on the other side until you get there". Hmmm... I don't know.
Thank you for your time :)
Sumal.V
17-Apr-12 6:25am
View
No the iterLimit is not changed anywhere else.
Thank you very much :)
Sumal.V
17-Apr-12 6:04am
View
Oh! okay. I got it!
Thank u :)
I have another question: Because it is a pre decrement
ie: --iterLimit, this stage is reached no matter what,do u have any idea about that?
Sumal.V
17-Apr-12 5:47am
View
Yeah there is a do while loop, where in the while loop I check the expression.
do
{
}
while (expression > 1e-12 && --iterLimit >0);
if (iterLimit==0) return NaN;
And iterLimit is int not Float.
Sumal.V
17-Apr-12 5:27am
View
* There is a decrement operator for the iterLimit prior to this in a while loop
Sumal.V
17-Apr-12 5:26am
View
Okay. Its a piece of code from the vincenty Inverse Solution. This is in Java script
var iterLimit = 100;
if (iterLimit==0) return NaN // formula failed to converge
Sumal.V
17-Apr-12 5:25am
View
Deleted
Okay. Its a piece of code from the vincenty Inverse Solution. This is in Java script
<pre lang="c++"> var iterLimit = 100;
if (iterLimit==0) return NaN // formula failed to converge </pre>
Sumal.V
17-Apr-12 5:17am
View
@pwasser: Nope! I know it is a simple question.I have tried NULL, 0 But I guess it is always better to ask.
Sumal.V
17-Apr-12 5:16am
View
Deleted
Nope! I know it is a simple question.I have tried NULL, 0 But I guess it is always better to ask.
Sumal.V
17-Apr-12 5:14am
View
Null, nullptr or 0 returns "0". But I have to return NaN! Are they all the same? Just wondering when there is an expression to check Nan ie: _isnan there should be something to return the same.
Sumal.V
16-Apr-12 11:48am
View
Yeah I know what u mean. I mostly use debugger but my problem was to write this code itself.
Didn't know if it was e or 10.
Sumal.V
16-Apr-12 11:16am
View
Do u mean running the program in debugger using breakpoints?????
Sumal.V
12-Apr-12 10:39am
View
Well I don't open from 2 sources. If right click on the #include example.h from my .cpp file, It opens up from the path.
But These files are in one project and declared in a separate project and there are 30 plus projects, each of which are interlinked!
Sumal.V
11-Apr-12 7:53am
View
Well there is no option where I can delete the question.
Sumal.V
11-Apr-12 7:23am
View
Cheers :)
Sumal.V
11-Apr-12 5:14am
View
Hi! Chandrasekharan,
I guess because you edited my question I'm unable to click the "Solved it myself" button
Sumal.V
11-Apr-12 5:09am
View
Cheers n thanks for your time.
Sumal.V
11-Apr-12 5:08am
View
Deleted
Hi! Chandrasekharan,
I guess because you edited my question I'm unable to clicked the "Solved it myself button"
Sumal.V
11-Apr-12 4:59am
View
Ooops Sorry !!! I made a silly mistake of assigning the double values float!!!! Now the obtained values are perfect.
Sumal.V
11-Apr-12 4:44am
View
Well I'm working on previously written code!
Sumal.V
11-Apr-12 4:43am
View
Well I use variable1.GetValue() To get the values from the edit box.
The GetValue() function converts any value from the edit box to a double number.
Sumal.V
11-Apr-12 4:41am
View
Deleted
Well I'm working on previously written code!
Sumal.V
11-Apr-12 4:40am
View
Yes. Run my program in debugger.
Sumal.V
6-Apr-12 9:32am
View
Well thanks,
Had done major blunder by adding _ttoi instead of _ttof and yeah finally managed to get things in place.
cheers :)
Sumal.V
6-Apr-12 9:28am
View
Oh That looks a bit confusing. Will definitely go through the program again.
Sumal.V
6-Apr-12 8:02am
View
Because of incompatibility between char and wchar.
Sumal.V
6-Apr-12 6:41am
View
Yeah I tried converting it back but doesn't display at all.
My function:
int i;
char buffer[20];
CString str;
i= _ttoi(myVal->GetText()); //convert string to int
itoa (i,buffer, 10); //convert int back to string
str.AppendFormat(_T("Value is : %s\n"), buffer);
Sumal.V
6-Apr-12 5:25am
View
Hey Thanks. That works. But I have problems displaying the string using the string.append . But rather than just coying codes and juggling with errors, I will some some reading on strings first.
Sumal.V
6-Apr-12 5:25am
View
Deleted
Hey Thanks. That works. But I have problems displaying the string using the string.append . But rather than just coying codes and juggling with errors, I will some some reading on strings first.
Sumal.V
6-Apr-12 4:56am
View
Oh well I tried the atoi. But it doesn't work .
int i;
i = atoi (myValue->GetText());
Here myValue is a variable and the GetText()function returns its value.
But the error says: No suitable conversion exists between CString to const char
Sumal.V
4-Apr-12 11:29am
View
I'm using Notepad++ . Well its a simple code but embedded within a complex c++ code. The code looks like:
if (SNum1) { obj.Item(_T("Selected_Numeber") , SNum1->GetName()); }
This function prints the selected item's name from the combo box. The Getname() function retrieves the name of the particular variable.
Sumal.V
30-Mar-12 4:06am
View
Well spotted! Sorry, didn't realise in a hurry. I'm glad it is solved now :)
Sumal.V
29-Mar-12 7:49am
View
Thanks, that link is quite helpul
Sumal.V
29-Mar-12 7:09am
View
Oh! yes I have accepted a solution. I hope that is enough.
Sumal.V
29-Mar-12 6:54am
View
Yeah But I ahve to sue double/float in my calculations.
Found the solution! :)
Sumal.V
29-Mar-12 6:53am
View
Hey Thanks Resmi! that works! need learn more about the ceilf function.
Sumal.V
29-Mar-12 6:30am
View
Hi Richard, the question is updated!
Show More