|
Is there any way to reduce the code?
|
|
|
|
|
Probably, but unless you are willing to pay me I'm not going to do that for you.
|
|
|
|
|
wow - no-one is going to read all that.
1 - yes, you can do that
2 - well, create a wav, encode it to mp3, and see which is smaller... MP3 is obviously smaller. I believe WMA is smaller still, but they are probably quite similar.
Yes, this code is very brute force, there's no doubt you could make it a lot smaller and more elegant.
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 )
|
|
|
|
|
Sir, Please Provide me some tips how can i reduce the code.
Along with the code i am going to create audio file - for each words
0,1,2,3,4,5,6,7,8,9,10,12,11,13,14,15,16,17,18,19,20,30,40,50,60,70,80,90,
hundred , thousand, ten thousand, lakh, core,ten crore.
Another question is that Is there any way out to reduce the audio files .i thought to create as many audio files as i said above.
Am i thinking right?
Please provide some suggestions.
|
|
|
|
|
Build a dictionary that you can use to look up file names based on numbers instead of all those switch statements, for a start.
Nilish wrote: Another question is that Is there any way out to reduce the audio files
Not really, I don't think.
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 )
|
|
|
|
|
How should I built the dictionary?
|
|
|
|
|
Why not just use the SAPI 5.1[^] API library??
|
|
|
|
|
hi,
i have two buttons in my form - named button1 and button2.now in the following handler , can i add the two button click events?
like
private sub button_click(byval sender as system.objects , byval e as system.eventargs)handles button1.click , button2.click
end sub
|
|
|
|
|
If clicking the two buttons causes the same code to execute, why do you need two buttons?
-------------------------------------------
Damian - Man of changing signature.
|
|
|
|
|
No, further i want to do code to distinguish between two button , whether i have clicked button1 or button2 .Is it possible???????
|
|
|
|
|
|
I did not get the meaning of
DirectCast(sender, Button)
Private Sub LotsOfButtons( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click, Button2.Click, _
Button3.Click, Button4.Click, _
Button5.Click, Button6.Click, _
Button7.Click, Button8.Click, _
Button9.Click, Button10.Click
Dim clickedBtn As Button
If TypeOf sender Is Button Then
clickedBtn = DirectCast(sender, Button)
MsgBox(clickedBtn.Text)
End If
End Sub
Should i imports any framework class to use this function?
|
|
|
|
|
is DirectCast(sender, Button) some sort of CTYpe(sender,button) ?
If yes then DirectCast is any predefined function??????
|
|
|
|
|
|
Making the two function either it is user define e.g
private sub button1_click(byval sender as system.objects , byval e as system.eventargs)handles button1.click
and Change the Name Of Second Function and replace the Handeler name Button2
Please try it
|
|
|
|
|
by using the following code you can distinguish between the two buttons
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click, Button5.Click
Dim btn As Button = CType(sender, Button)
If btn.Text = "ASDFS" Then
Else
End If
End Sub
shally
|
|
|
|
|
I would like to be able to modify data a program uses for calculations and have it remain as default for the next time the program runs. I can't think of a way to do this with out using a seperate ini or cfg file. If someone could give me a clue I would appreciate it.
thanks
bill a.
|
|
|
|
|
You can use a config file, XML file, Registry, or Isolated Storage. You have to put it somewhere. it's up to you where that somewhere is and the format of the file you write.
|
|
|
|
|
|
I suspected that was the only way. I can remember vaguely using a "poke" command to push data back into a compiled executable from the executing program, but that was using assembly language on a very old machine. I was kind of hoping that VB had an easy way of defining a storage structure within the program that could be modified on the fly.
thanks
bill a.
|
|
|
|
|
I want to give my user the ability to copy a list of Orders (based on MR # and PreviousVisitDate) to a new VisitDate when they are creating one. So this is what I have to do..
1. Select all Orders with the specified MR and PreviousVisitDate
2. Copy all of the returned records (to a new temp table??)
3. Change the Date in the returned records to the New Date they entered.
So now I will have the original list and the new list that looks just like it but with a different Date.
I am sure this is simple for most of you but I am struggling with it. Can anyone show me an example of how this would be done or point me to one that I can read through? Thanks for any help you can give me with this.
|
|
|
|
|
How this is done depends on your existing implementation. How are the records being selected? In what control are they displayed? Is this control bound to a DataSet?
If the displaying control is bound to a dataset, then the items returned by its SelectedItems property should be DataRow objects. All you would have to do is change the date in each DataRow, then possibly write the in that DataSet back to the database.
If not bound, then you would have to get the record ID numbers from the SelectedItems of your control and make the changes to the database using Sql statements, or whatever else you're storing this data in.
I can't give you a more consise answer, because we know nothing of your existing implementation.
|
|
|
|
|
Hello Dave, thanks for your reply.
When the user goes to enter a new VisitDate (text box) I have a checkbox below it for Copy Orders from existing Visit Date, when they check it They see a combo box with a list of previous Dates for this MR #. Once they select a previous Date and hit OK I need to run this behind the scenes. I need to find all of the orders from the selected Previous VisitDate and copy all of them and then change the date on those new records to the NewVisitDate that they entered in the text box. I know that the New Date and the Previous date are both coming over fine right now. I just need to start putting the SQL into place now. And that is where I got stuck.
The form I am working with is connected to my Access 2003 database via a DataSet.
If you need more information then just let me know.
-- modified at 16:12 Wednesday 23rd May, 2007
|
|
|
|
|
OK. I still know nothing of your implementation in code, so I'll just describe the generic versions.
Retrieve the records for that MR and previous date putting them into a DataTable using a DataAdapter. Change the date field in each row in the table, then call Update on the DataAdpater to write the changes back to the database. Refresh your bound controls and you should be all set.
Or, write an SQL UPDATE statement that selects all of the records that make the MR/PreviousDate restrictions and changes only those records to the new date. This would use an OldDbCommand and its ExecuteNonQuery method to launch the command. Again, refresh the bound controls.
UPDATE mytable SET mydatefield = ?newdate WHERE mydatefield = ?somedate AND MKID = ?selectedMKID
|
|
|
|
|
Ok this is what I have so far I am trying to create a temp table and pull data into it....
Dim NewVisitDate As Date
Dim PriorVisitDate As Date
Dim SQL As String = String.Empty
Dim DT As New DataTable("TempVisitTable")
'set Variables
NewVisitDate = txtVisitDate.Text
PriorVisitDate = Me.cbobxPriorDates.Text.ToString
MR = frmQuestionnaire.txtMRNo.Text
'
SQL = "SELECT OrderMR, OrderDate, [Order] FROM (Orders) WHERE (OrderMR='" & MR & "') and (OrderDate= #" & PriorVisitDate & "#)"
Try
Connection.Open()
Dim Command As New OleDbCommand(SQL, Connection)
Command.ExecuteReader()
DT.Load(SQL)
Catch ex As Exception
End Try
When I do this I get a message on the DT.Load(SQL) that says...Unable to cast object of type 'System.String' to type 'System.Data.IDataReader'.
I am sure this is a syntax problem. Can someone tell me what I am doing wrong here?
|
|
|
|