|
In vb6 all the variables passed to a function are by default by ref so when you have to pass some variable by value you have to give byval explicitly
In vb.net all variables are by default by val, so remove byval it may work
For the variable declaration
Where are u declaring these variables
You can use global for modules then the variable will be accessible in whole of the application
For a form file you can declare at the top in the class to be accessible by all function
Good luck
|
|
|
|
|
I have a bit problem here in ReportViewer.. I have this project where I should translate or convert the MONEY in number(in a textbox) into words(in another textbox) (e.g. 1234--> one thousand two hundred thirty four).
Is it possible to do this in a report document(.rdlc file)?
|
|
|
|
|
You could write a custom function with your report definition to do this.
Do a Google search for code to convert a value into words if you are unsure how to do this.
Paul Marfleet
|
|
|
|
|
In crystal report try to use ToWords(number) with a little customization
Salman Sheikh
|
|
|
|
|
The question refers to SSRS, not Crystal Reports. There is no built-in function to convert a number to words in SSRS. The poster will have to write a custom function within their report as I have suggested.
Paul Marfleet
|
|
|
|
|
Ok thanks Mr.Marfleet..
I'll try to search for it.. I really just don't have any ideas to it yet eh.
|
|
|
|
|
Which bit are you struggling with? The logic for converting a number to words? This is a common requirement and a Google search should yield plenty of results, although you may have to translate to VB.
To add an implementation of this function to your report definiton, bring up the Property dialog for your report and select the 'Code' tab. Add the code for your function in the box. You can now call your function from an expression using the syntax Code.<myfunction> .
Paul Marfleet
|
|
|
|
|
I got a code here for converting numeric value into words..
Public Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click<br />
txtResult.Text = NumberToString(CDbl(txtNumber.Text))<br />
End Sub<br />
<br />
' Return a word representation of the whole number value.<br />
Private Function NumberToString(ByVal num As Double) As String<br />
' Remove any fractional part.<br />
num = Int(num)<br />
<br />
' If the number is 0, return zero.<br />
If num = 0 Then Return "zero"<br />
<br />
Static groups() As String = {"", "thousand", "million", "billion", "trillion", "quadrillion", "?", "??", "???", "????"}<br />
Dim result As String = ""<br />
<br />
' Process the groups, smallest first.<br />
Dim quotient As Double<br />
Dim remainder As Integer<br />
Dim group_num As Integer = 0<br />
Do While num > 0<br />
' Get the next group of three digits.<br />
quotient = Int(num / 1000)<br />
remainder = CInt(num - quotient * 1000)<br />
num = quotient<br />
<br />
' Convert the group into words.<br />
result = GroupToWords(remainder) & _<br />
" " & groups(group_num) & ", " & _<br />
result<br />
<br />
' Get ready for the next group.<br />
group_num += 1<br />
Loop<br />
<br />
' Remove the trailing ", ".<br />
If result.EndsWith(", ") Then<br />
result = result.Substring(0, result.Length - 2)<br />
End If<br />
<br />
Return result.Trim()<br />
End Function<br />
<br />
' Convert a number between 0 and 999 into words.<br />
Private Function GroupToWords(ByVal num As Integer) As String<br />
Static one_to_nineteen() As String = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eightteen", "nineteen"}<br />
Static multiples_of_ten() As String = {"twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}<br />
<br />
' If the number is 0, return an empty string.<br />
If num = 0 Then Return ""<br />
<br />
' Handle the hundreds digit.<br />
Dim digit As Integer<br />
Dim result As String = ""<br />
If num > 99 Then<br />
digit = num \ 100<br />
num = num Mod 100<br />
result = one_to_nineteen(digit) & " hundred"<br />
End If<br />
<br />
' If num = 0, we have hundreds only.<br />
If num = 0 Then Return result.Trim()<br />
<br />
' See if the rest is less than 20.<br />
If num < 20 Then<br />
' Look up the correct name.<br />
result &= " " & one_to_nineteen(num)<br />
Else<br />
' Handle the tens digit.<br />
digit = num \ 10<br />
num = num Mod 10<br />
result &= " " & multiples_of_ten(digit - 2)<br />
<br />
' Handle the final digit.<br />
If num > 0 Then<br />
result &= " " & one_to_nineteen(num)<br />
End If<br />
End If<br />
<br />
Return result.Trim()<br />
End Function<br />
<br />
End Class<br />
---the code works but not on with decimals.. and i hope i can also put currencies such as dollars and cents..
I had a hard time on the logic here..
|
|
|
|
|
I have a window service and i have a Web Service reference in it.
The web service is on a local machine which is in my network.
The app.config file of the window service is containing the key for the web service.
When i make setup of the window service the its not dynamically changing the machine name even when i change the key in the config. During the run of the service it says cant find the machine "acb" which is name of the machine which is in my local network from where i was referring the web service.
When i try to find out what is wrong i find that in the Project there is a Folder My Project Which is Containing a file Settings.settings Which is containing a key for that web servce. any Idea How That can be made dynamic
Regards
Regards
|
|
|
|
|
I can't figure out what you're talking about.
Are you saying that you have two versions of this web service?? One for test and another for production?? The windows service you wrote is supposed to use the production web service, but you developed against the test service?
|
|
|
|
|
I have an application that was developed in vb6 i have packaged it using The Vb package and deployment wizard. The problem is that when i try to install it on some machines it brings an error during installation that some system files are old.................
My question is is there any tool that i can use to package the application for it to be able to instal on XP, 2000 and 2003 without bringing problems?
briogene
|
|
|
|
|
|
Try and using INO setup it is a GNU application for creation of setup
|
|
|
|
|
how can i send sms thru my mobile using USB port. can any body help me
thanks and regards
kishore
|
|
|
|
|
How you do that depends entirely on how the phone shows up when connected to the machine. Does it show up as a COM port? What commands does it understand?? What is it with newbies and cell phone projects??
|
|
|
|
|
You can send SMS through your mobile phone's built in GSM modem but you have to connect it to your computer through an infrared connection, I'm not sure whether a modem can be connected to a computer through a USB cable you can see your phone's reference manual for this purpose. You can easily send SMS by using AT commands or you can also use the .NET Phone Communication Library for this purpose.
AliAmjad(MCP)
|
|
|
|
|
i want to connect with usb port. can any body help me
thanks and regards
kishore
|
|
|
|
|
The question isn't valid. You don't connect to the bus, you have to talk to a device connected to it using the devices SDK, or some other "generic" method, depending on the device you want.
|
|
|
|
|
Dear all
I want to save a image available im Image comtrol in VB6, I used the Savepicture method but it save the image in his orignal size which is 3000*1500 but i want to save this image into 100*100 means i want to save images with my required height & width, So plz help me to solve this problem
With regards
yogesh agarwal
|
|
|
|
|
|
setup: I have an midparent with on it an ribbon (custom control) and space for the mdichildren
normally I can access the ribbonbuttons from the forms but I have one form that's not in the project (and can't be included there) so it can not access the ribbonbuttons. But I have to disable them.
So I figured I'll do it in the mdichildactivate of the mdiparent.
But when I compare the types of forms the code in the if (or select case) always gets run. Nomather what I compare.
Private Sub frmMain_MdiChildActivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MdiChildActivate
Dim frm As Form = Me.ActiveMdiChild
Dim s As String = "jorosoft.frmagenda" 'frm.GetType.ToString.ToLower
Dim ss As String = "joro.reports.showreport" 'GetType(joro.reports.Showreport).ToString.ToLower
If s.Equals(ss) = True Then
clsGlobals.MDIParent.rbSearch.Enabled = False
End If
End Sub
when I debug the programme it tells me that 's.Equals(ss)' = false but still the code within the if gets run.
Anybody has encounterd the same??
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Do't use strings to compare types. Compare the object against a type
If TypeOf Me.ActiveMdiChild Is frmAgenda Then
' I'm assuming that this code is on the MdiParent form...
Me.rdSearch.Enabled = False
End If
|
|
|
|
|
I did that first but because the code always got run I tryed it with string as I posted.
I tryed you'r code and still get the same result.
The strange thing about it is even if you invert the condition the code also get's run. So nomatter what the outcome of my condition is the code inside the if gets run
If TypeOf Me.ActiveMdiChild Is frmAgenda Then
' I'm assuming that this code is on the MdiParent form...
Me.rdSearch.Enabled = False
End If
and
If not TypeOf Me.ActiveMdiChild Is frmAgenda Then
' I'm assuming that this code is on the MdiParent form...
Me.rdSearch.Enabled = False
End If
both result in me.rdsearch.enabled = false
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Do the child forms in question derive from frmAgenda at all??
Did you trace through the code step-by-step and watch these sections execute??
Are there any other places where the status of the rbsearch can be set/reset??
|
|
|
|
|
I'v found a way to do it with an custom event but still I'm puzzeld because when I step through the code
it tells me that 'me.mdiactivechild is frmagenda' equals 'false' (checked it with quick watch) but still the code inside the if gets run
setup of the forms:
each mdichild has an ancester and that ancester has another ancester but the form that I need to check frmagenda doesn't have any ancesters so normally I should be able to check against that (I think)
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|