|
WScript.Echo WScript.ScriptName
RageInTheMachine9532
|
|
|
|
|
|
Adding a related question to this thread:
Assuming you don't know it (all or at all) after importing VBScript code, or instantiating a COM object, is there any way to get a list of methods (and perhaps properties) of a VBScript class and/or COM object (built from C/C++ or Visual Basic)?
Basically something like .NET reflection for VBScript/COM.
"A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible." - Freeman Dyson
|
|
|
|
|
Hi everybody.. how can I search a string without caring about the case\
eg..
<br />
Dim str as String = "he HE hE He" <br />
Dim r as Integer<br />
Dim c as Integer<br />
while(r<>-1)<br />
r=str.IndexOf("he",r)<br />
If (r<>-1) Then<br />
r+=2 'adding 2 (he has two letters) so it will start looking at position it first found +2<br />
c+=1<br />
End If<br />
End While<br />
Instead of c=4, I'm only getting c=1
How to search a string in case insensitive?
|
|
|
|
|
r = str.ToLower().IndexOf("he", r)
Charlie
if(!curlies){ return; }
|
|
|
|
|
I'm having issues writing text to a tiff file. However I have no problems saving text to a Bitmap.
Here is an example of the code that works with Bitmap:
Dim objBitmap As New Bitmap(600, 600)<br />
Dim objTextBrush As New TextureBrush(objBitmap)<br />
Dim objFont As New Font("Verdana", 20, FontStyle.Bold, GraphicsUnit.Pixel, 0)<br />
Dim objGraphics As Graphics = Graphics.FromImage(objBitmap)<br />
<br />
objGraphics.DrawString("Test Text", objFont, Brushes.Black, 0, 0)<br />
objBitmap.Save("test.bmp")
This code works great! But I need to a way to write to tiff.
The code below should work but fails. It returns a black tiff image:
Dim objBitmap As New Bitmap(600, 600)<br />
Dim objTextBrush As New TextureBrush(objBitmap)<br />
Dim objFont As New Font("Verdana", 20, FontStyle.Bold, GraphicsUnit.Pixel, 0)<br />
Dim objGraphics As Graphics = Graphics.FromImage(objBitmap)<br />
<br />
objGraphics.DrawString("Test Text", objFont, Brushes.Black, 0, 0)<br />
objBitmap.Save("test.tiff", ImageFormat.Tiff)
Any help would be greatly appreciated. In return what I would like to do is build a C# class that will save text to an image in different formats and make it available for free. I have tried tools like CoolWatermark, but it has the same issue.
Ryan
ryan@edevers.com
|
|
|
|
|
hello,
this link - there is a nice example of line charting , but the code is in c#. I attempted to convert it to vb.net but have some issues.
does anyone have vb.net code sample of line charting - specifically, plotting multiple lines?
http://www.codeproject.com/aspnet/LineGraph.asp
or ifyou email me directly I can share what I have so far, maybe someone can get this to work for me. thanks
(bsharris@optonline.net)
bev
|
|
|
|
|
I know this is a toughie, but I figured I'd ask...
I am writing an internal application for my company. We have thousands of Articles on our web server in HTML (actually ASP) format. These articles are technical in nature, and support the various software programs we write. This tool is meant to scan the text of those articles, and convert the information into a new format that we'll be storing in a database.
Part of that conversion process will include identifying the product and version that each article is associated with. This is really easy when the product name is spelled correctly and formatted the same as what I'd expect it to be. Unfortunately, people make mistakes (lots and lots of mistakes) and what I expect is rarely what is there. For a silly example, let's say that I'm scanning the text for the word "Microsoft" to see if this article is associated with a Microsoft product. Easy enough, right?
But as I start looking at articles, I see:
Micro Soft
Microssoft
Microsoff
MS
Microsucks
MSoft
..
..
Well, you get the idea. Doing a simple InStr(Article, "Microsoft") doesn't always find what I want. What I need is a more "fuzzy" compare method. Microsoft SQL Server has a function called LIKE that is kind of close to this - better yet, I can use the FreeText or Contains methods to provide a fuzzy search.
Is there a similar function or technique in VB that would allow me to do a compare like this?
-Todd Davis (toddhd@hotmail.com)
|
|
|
|
|
Not unless you write it.
I found a couple of resources on the 'Net about the subject just by searching for 'fuzzy string compare'.
You might want to try converting this[^] Delphi source. You also might want to try working something up using Regular Expressions. I don't have any code, but it's an idea I would look into.
RageInTheMachine9532
|
|
|
|
|
|
Try doing a SOUNDEX search - when people spell incorrectly, the word usually sounds the same - SOUNDEX creates a numeric value for a string based in its phonetics, so Smithe and Smythe would result in the same SOUNDEX value - believe SQL Server (and definately Oracle - ner!) support it straight out of the box...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hello,
Does any one know how to make or where to get information on a menu like the properties menu in VS.net. I want to add the functionally to my program, on how it hides in tell you hover your mouse over the icon that is off to the right side and then it shows it self.
I hope that made sense
Dale Burmeister
|
|
|
|
|
Does clicking on the close button in the control box on a form raise an event? I would like the code I have for exiting using a menu to be executed if the close on the control box is clicked. Any ideas?
|
|
|
|
|
well you can handle this in queryunload event. It gives you an idea from where the unload event has been called.
I think rest is upto your logic. You can call the menu's click function. Or the better way is to create a common function and call it from different events.
Hope that is what you are looking for.
Ritesh.
|
|
|
|
|
I came across the following bit of code and was wondering why VB does not generate an error. strHTML is dimmed inside a loop that will execute multiple times.
I realise this pretty avaerage coding but wondered why/how VB allowed something like this.
For nCounter = 0 To objCodesLU.Count - 1
...
Dim strHTML As String
If blnSelected Then
strHTML = strHTML + "" + strValue
Else
strHTML = strHTML + "" + strValue
End If
blnSelected = False
Next
William
|
|
|
|
|
As per my understanding,
VB does not generate any error because every time it creates a separate reference to an string object and assign its address to strHTML.
Something like, initially one object is created having address 100 and assigned to strHTML. Next time when new object is created, it may have address 110 and it will be assigned to strHTML.
Hence there is no error. You can use messagebox and print the address of the variable.
I have not seen this practically. This is what I think.
Just trying to help you.
Ritesh.
|
|
|
|
|
Why would VB or VB.NET generate an error?
The only stipulation to using a variable is that it must be defined in the current scope or a parent scope. There are very few rules on WHERE you can use a Dim.
Dim used inside a loop just means that the variable that is defined can only be used inside that loop. Outside that loop, the variable doesn't exist. In your example, then code before the For statment and after the Next statement doesn't know anything about strHTML.
RageInTheMachine9532
|
|
|
|
|
How to apply the style sheet for crystal report in .net version for windows application.?Actually my need is to have multi lingual support for crystal report.But i cann't do it as like the window's forms.SO i decide to have style sheet so that the labels in crystal report can be generated with the style sheet value.Can i do like this or anybody have some other idea to get multilingual support in the crystal report.
Sriram
|
|
|
|
|
Hi friends,
In visual basic when a structure is declared, it does a padding between members so as to meet the memory boundry condition.
Now I would like to remove the padding by setting some complier option.
In VC++ this can be done by using
#pragma pack(1)
Is there any similar option in Visual Basic
Amar.
|
|
|
|
|
Your looking for the StructLayoutAttribute class. It has the Pack member that your looking for.
Something like this:
<StructLayout(LayoutKind.Sequential,Pack=1)> _
Public Structure EXAMPLE
Public dwWhoCares As Integer
Public ptMinSize As Point
Public ptMaxSize As Point
End Structure
RageInTheMachine9532
|
|
|
|
|
Hi Dave,
Thanks for the answer.
I guess the above code works for vb.net. I am working on VB 6.0, so please give me equivalent in VB 6.0.
Amar.
|
|
|
|
|
There is no equivalent in VB6...
RageInTheMachine9532
|
|
|
|
|
Am having a bit of a problem trying to retieve a DataRow from a DataGrid . The problem is that the DataGrid only exposes a CurrentRowIndex property for the selected row. The hassle with this is if the data is sorted at runtime by the grid, then the CurrentRowIndex does not correspond to the row in the grids DataSource (in this case a DataTable).
I could add a psudo column to the DataRow indicating its index in the DataTable . But then maintaining the index will be a nightmare, so I want to try avoid that approach.
I really cant believe they made a grid that cant retirieve a row!
Thnx
|
|
|
|
|
Hi! Greg Eales,
I think curent row in datasource (i.e. datatable or dataset) is the same as what you have selected in datagrid. So, do not have to look for any index or something like that.
Although, I am also a learner. So, I might be wrong. But, this is what I have experienced when I have bind datagrid with DataSet.
Ritesh.
|
|
|
|
|
Hi,
I am using VS.net and have a custom validator that shows an error if both text boxes are filled in. This is done server side but i now want it to also work client side. How would i do this, does anyone know?
I presume i use some sort of JS function, where does this go in the VS layout. Or is there another better way to do this altogether?
<br />
Protected Sub CustomValidator1_ServerValidate(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate<br />
<br />
<br />
Dim Count As Integer<br />
<br />
If Len(txtName.Text) > 0 Then Count += 1<br />
<br />
If Len(txtName2.Text) > 0 Then Count += 1<br />
<br />
If Count <> 1 Then<br />
<br />
args.IsValid = False<br />
<br />
End If<br />
<br />
<br />
End Sub<br />
All help appreciated.
|
|
|
|