|
How to implement
string Str( float number, ushort width, ushort presicion)
should return string whose size if width characters, left padded by spaces and having presicion characters after decimal point using current culture decimal separator?
Andrus
|
|
|
|
|
The string.Format method will do this for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you.
Do you have any sample how to pass width and presicion variables to Format() and return padded string ?
Andrus
|
|
|
|
|
This[^] section of MSDN doc covers string formatting in detail. There are some examples for you to examine. You should be able to find what you need in there.
Good luck! 
|
|
|
|
|
I have long single line string literals containing " characters in code like
switch (expr) {
case @"IR(""xxx"")+sql('sele tasudok from dok x where doktyyp+str(dokumnr,7)= ""G""+str(dok.krdokumnr,7) ','')":
For code readability I need to split them to multiple lines so that vlaue remains same. I tried
switch (expr) {
case "IR(\"xxx\")+\
sql('sele tasudok from dok x \
where doktyyp+str(dokumnr,7)= \"G\"+\
str(dok.krdokumnr,7) ','')":
But got compile error. Any idea ?
Andrus
|
|
|
|
|
What made you think that would work ? Does it work in VB ?
string s = "switch(expr){" +
" case IR" +
" whatever"
You can also use @ in C#. when you do, there are no escaped characters and double quote is a quote.
"to do a quote, you do \", and it escapes to a quote"
becomes
@"to do a quote, you do "", and it becomes a quote"
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
this complier error is becoz of the \ that u added in the end of each line,
use following syntax
switch (expr)
{
case "IR(\"xxx\")+
sql('sele tasudok from dok x +
where doktyyp+str(dokumnr,7)= \"G\"+
str(dok.krdokumnr,7) ','')":
|
|
|
|
|
A small question:
How to explicitly invoke parent's constructor in child class 's constructor?
Thanks!
|
|
|
|
|
Hope this helps U.
I think we cannot call the base class constructor in the derived class constructor.
But we can do like this.
class derivedClass:baseClass
{
public derivedClass():base(arguments)
{
}
}
Regards,
Arun Kumar.A
|
|
|
|
|
oh, yes. It's useful.
Thanks.
|
|
|
|
|
public class Derived : BaseClass
{
Derived(int a,int b) : base(b)
{
//Code Block
}
}
Best Regards,
Chetan Patel
|
|
|
|
|
First, i am so sorry,i can't explain the problem very clearly. Let me descript it by an example.
eg, if you click msn shortcut, the processes is liks this: double click MSN's Shortcut - start MSN application. Now there is an application coding by me, in it i new a process, the process.startinfo = "MSN.exe",...then process.start(). That means that, i want to make the doule click the MSN Shortcut's processes become this: double click MSN Shortcut - start my application - start MSN application by the process.start() which Statemented in my application. And there are an other problem, if the user chanage the shortcut "MSN" to other name, like "MyMSN", is there any side affect? if yes ,how can i get the correct information?
If any one have the solution, please give me more info. Thank you very much! 
|
|
|
|
|
I have no idea what you're saying. If you want to start your own app instead of MSN, you need to change the shortcut to point to your app.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am very sorry to my poor English.
But how to change the shortcut to point to my app?
Thx 
|
|
|
|
|
Just right click on it and select Properties.
---
single minded; short sighted; long gone;
|
|
|
|
|
yes,it is very smart, but i can not belive that the cooperater can accept this way. And there still have some problems,first if the user not use the shortcut,she or he clicks the exe direcly, what should i do? second, if the user doesn't want to use my app one day, she or he may delete my app or uninstall it, in those case, i must reset the right path for the user.
Thanks for your Support. Hope you give me more good idea~ 
|
|
|
|
|
Why does the user have to start the MSN shortcuts? Why not just supply the shortcut to your app, if the user want to use it!, and then your app launches and starts MSN? That way, the user has a choice whether or not to have your app in the way of using MSN.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I believe the core point is that he wants to hijack MSN, no matter what you click. Sounds malicious to me ( at a guess, he wants to intercept what is typed and log it )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I figured the same thing. That's why my answer kind of stears clear of modifying the exsting shortcuts.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
:->
First, I must declare one thing, MSN is just a example for describing the case, not really.
Maybe Graus have got my meaning. About your suggestion, supply the shortcut to my app, then the user has a choice,it is a good way, but i don't think the collaborator can accept this concept. He is stronger than me, so i am afraid ... , just a joke.
Maybe there is a mistake, Can not start my app first ,then capture the message. It is should be this, No MSN start, No my app,but MSN's application start by my app.
|
|
|
|
|
huheng_0_0 wrote: It is should be this, No MSN start, No my app,but MSN's application start by my app.
That's not going to happen. Period.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi Dave,
Thanks very much Dave!
Maybe i will find anther way to solve this problem.
In the last message,you mentioned that you figured this problem, could you please give me more solutions or valued experience?
Best Regards
Jimmy
|
|
|
|
|
Dear All,
I want to read pdf file (paragraph wise).
I have downloaded Sharppdf library but do know the methods(code) for reading pdf file. Please help me for it.
Thanks u lot in advance
Manoj
|
|
|
|
|
Hi
We have implemented a web service that prints a document using a printer (that its ip address is defined in Web.config file)
When we use it from a desktop computer in the network to print , it works fine but when we want to use it from a pocket pc program ,it throws an exception and says that the specifeid path is not valid.
What should we do?
Thanks a lot
Nima
|
|
|
|
|
create a student class Fname-string
Lname_string
studentId-Integer
GPA-Float
create a grad student class derived from student class and thesis as string
shanti
|
|
|
|