|
Dave Kreskowiak wrote: One way in, one way out. If the code has to be modified, you don't have to hunt down all the exit points in a function to make sure it's returning a good value.
Excellent point. In this case, it is easiest to have a temporary boolean variable such as result and plug it in with the single return statement...
|
|
|
|
|
Paul Conrad wrote: In this case, it is easiest to have a temporary boolean variable such as result and plug it in with the single return statement...
I use this technique quite regularly.
Kevin
|
|
|
|
|
Kevin McFarlane wrote: I use this technique quite regularly.
And it pretty much works out for the best too
|
|
|
|
|
Many thanks!
By the way - Is it normal to thank someone for their reply on a forum- I feel it's just plain good manners, but on the other hand it clutters the forum...
|
|
|
|
|
RichardBerry wrote: By the way - Is it normal to thank someone for their reply on a forum
Sure it is! It happens so rarely, that it doesn't really clutter up anything.
No problem.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi All,
How to find out a particular Page of a MultipageTiff is
Color or Blak and White ????.
Thanks in advance.
Ram
ram
|
|
|
|
|
what is the shortcut key to disable the code.
I am using mouse to do that it seems a lenghty process
|
|
|
|
|
hi nilish,
this is the shortcut to comment/disable the code
Ctrl + k +c
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
|
hi Nilish,
for enabling use following Key combination
ctrl + k + u
-- modified at 6:06 Saturday 5th May, 2007
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
|
what is the utility of immediate window .i was getting opened in both the compile time as well as the run time
|
|
|
|
|
its to find the value of any int/char/string...
suppose you have a string STR that stores the value 'ABC' at runtime.
debug the project. after you have passed the line where this STR becomes equal to 'ABC', open up the immediate window and type '?STR' and press the enter key. you will see the value 'ABC' returned.
this is the same with any variable or any property of the objects.
try this..
when debugging, take the imm. window and enter '?Me.Name'. you can see the current form's name..
|
|
|
|
|
Then what's the diffeence between add-watch and Immediate window?
|
|
|
|
|
you can see the difference in the 'Watch window' itself..
during debugging, select any variable from the code and right click in the watch window and select the add watch option. you can see many options inside.
morover watch displays the value, type and context of the variable, but imm window shows only the value. also, imm window doesnt have the variety options that is provided by the watch window... got it?
|
|
|
|
|
The immediate window let's you query variables and execute individual statements while in design mode. You can read more here[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hakmeh Mohannad wrote: how can i make this possible
Learn how to write sql statements. Make sure you keep your code safe from injection attacks...
|
|
|
|
|
friend...for this, first learn to write simple queries..
for this case, only a simple select query will be enough, but first u must hav a table to store the uname and passwd... so first try those..
-- modified at 4:45 Saturday 5th May, 2007
|
|
|
|
|
|
I have a compare to sort the order of SubItems in a ListView and it works great, but... If the ListView shows Groups nothing is sorted. Here's the compare function from my class. How can I make it work when Groups are shown?
<br />
Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer _<br />
Implements IComparer.Compare<br />
<br />
Dim ItemA As String<br />
Dim ItemB As String<br />
<br />
Try<br />
ItemA = CType(x, Windows.Forms.ListViewItem).SubItems(_Column).Text<br />
Catch<br />
ItemA = ""<br />
End Try<br />
<br />
Try<br />
ItemB = CType(y, Windows.Forms.ListViewItem).SubItems(_Column).Text<br />
Catch<br />
ItemB = ""<br />
End Try<br />
<br />
If _Ascending Then<br />
Return [String].Compare(ItemA, ItemB)<br />
Else<br />
Return [String].Compare(ItemB, ItemA)<br />
End If<br />
End Function<br />
Cheers
|
|
|
|
|
Hi
I am trying to create BMP file to print on Epson Receipt printers using OPOS. Epson printers only allow - BMP File which are Monochrome, 16 color (4 bit ) or 256 Color (8-bit) and should be uncompressed format.
I tried working 1bppIndexed Bmp. However the printer does not seem to except it. Currently the technique I am using is saving the image first as "GIF" ( 8 bit ) and then again saving it as bmp. However would like to know any techniquie for saving Uncompressed monochrome ( 1 bit ) bmp in Vb.net
Thanks
Satish
|
|
|
|
|
I have two arrays. The first holds titles, the second holds text to see if the titles should be in a different case or bold. These names are then displayed in a Combo Box. Please bear with my simple example but it is about the only way to discribe what I want to do.
vNames = Array("Smith", "Hudson", "Jones")
VString = Array("H","I","h","i")
So I want to search the above vNames array for the vString, and if so I need it to be set to bold
This is what I was thinking:
For i = 0 To 2
For j = 0 To 1
If InStr(vNames(i), vString(j)) <> 0 Then
cmbName.FontBold = True
End If
Next j
Next i
But when I do this all three names are in bold, when my thinking is just the first two names should be bold.
Thanks in advance for any advice,
Dan
|
|
|
|
|
I'm assuming you're using VB6. This won't work because the FontBold property of the ComboBox is for all of the items in the ComboBox, not ones you pick. It's either all of the items are bolded, or none of them.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I am actually using vba for Word 2003, which I believe is much closer to VB6 than to anything else.
And you are right about it doing the whole list. One the name is picked it is added to a Word document text form field, what I believe I will need to do is this: set my txtName.Value, test for the string, then bold if need be.
Thanks for the reply.
Dan
|
|
|
|