Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
Q

Qhalis

@Qhalis
About
Posts
11
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • why do the custom written events NEED to have a client??
    Q Qhalis

    From the code, it looks like you should be getting an unhandled null reference exception in FireOffFirstEvent() when you do not register the events. This is correct. When you create the instance of EventsClass, FirstEvent is null. If you do not register the events it is never set. You call FireOffAllEvents() which calls FireOffFirstEvent() which calls FirstEvent() - which is null One way to solve this is place a check around the delegate invocation, e.g. private void FireOffFirstEvent() { if (null != FirstEvent) { FirstEvent(); } } Q.

    C# csharp question

  • Array of an Object
    Q Qhalis

    Just curious: Do you have a hard reason why you need to use an array as opposed to an arraylist? It would handle all the resizing issues for you and, if needed, you can always generate an array from the ArrayList using ToArray(). Q.

    Visual Basic help data-structures business question

  • Debug.Write - no output :/
    Q Qhalis

    Have a look to see if the output is showing in the Immediate window. There is an option in 2005 under Debugging/General for re-directing all output window text to the Immediate window. If this is set then Debug goes to immediate rather than Output. hth, Q.

    C# debugging help csharp visual-studio workspace

  • Application has generated an exception that could not be handled
    Q Qhalis

    Not too familiar with the 1.0 framework so this may not be available but try adding a handler for the AppDomain.CurrentDomain.UnhandledException. This may at least give you some information about where the exception is occuring. hth, Alan.

    .NET (Core and Framework) help csharp dotnet sales

  • Convert String to decimal
    Q Qhalis

    The problem is that there is no single format that will achieve your goal Say you have 88.0 and 88888.888 Console.WriteLine("{0:0##}", num) will give you 88.0 88888.888 the problem is that if you have another number of finer precision, say 99.1234, it will be rounded to 99.124. If you use the general format g Console.WriteLine("{0:g}", num) then you will get 88 88888.888 99.1234 If you have a hard need to display 88 as 88.0 then you will probably need to use two format strings Dim nums() As Double = {88, 88888.888} Dim numFmt As String For Each num As Double In nums Dim tmpNum As Double = System.Math.Abs(num) If (System.Math.Floor(tmpNum) = tmpNum) Then numFmt = "#.0" Else numFmt = "g" End If Dim exprFmt As String = "{0:" & numFmt & "}" Console.WriteLine(exprFmt) Console.WriteLine(String.Format(exprFmt, num)) Next End Sub NOTE: When testing this, it works well for Doubles but not singles. Don't know why hth, Alan. if (

    C#

  • Discussing coding style of non-fixed length Multi-dimension Array
    Q Qhalis

    I'll second the other reply and extend it a bit. 1) Create a Patient Class including all the attributes for the patient (name, gender, age, et al.) 2) Create a PatientCollection class, inheriting from CollectionBase (see Walkthroughs in help for details on how to do this) The Patient class is a gimme. It is pretty much a canonical example of a class/object to be used in a program. The PatientCollection is a bit more work than the ArrayList but is safer and since you have Option Strict turned on (hint, hint) it will save some casting in your code. hth Alan.

    Visual Basic csharp data-structures regex help

  • Question on VB
    Q Qhalis

    There is the String.Split() function that will split a string into an array based upon a separator character.

    Visual Basic c++ question

  • Join Tables
    Q Qhalis

    It looks like a misunderstanding of how the join works. The SQL Engine performs a select on the two tables using the join. The 'left outer' part ensures that if there are entries in the ForeignCurrency table that do not have corresponding entries in the Rates table, then they will still be shown. e.g Add a new entry to the ForeignCurrency table 4 IEP SELECT FC.FC_TYPE ,ISNULL(FCV_RateIN,1) FCV_RateIN ,ISNULL(FCV_RateOut,1) FCV_RateOut FROM ForeignCurrency FC LEFT OUTER JOIN Rates R ON FC.FC_ID=R.FCV_ID will give FC_TYPE FCV_RateIN FCV_RateOut USD 1 1 EUR 1.345 1.345 YTL 1.651 1.654 IEP 1 1 AFTER the join is performed the WHERE criteria are applied. Thus we check through the resultset for the FCV_Date='10/13/2005' (This is all conceptual - in practice the engine may optimize but it ACTS as if the steps happen in this order) For 10/13/2005 all the rows in your test data match, so we are good For 10/14/2005, no rows match so you get an empty set. hth Alan.

    Visual Basic question database

  • how to report the bugs together with program status such as procedure name, call stack, code line and variable contents
    Q Qhalis

    In which language are you working? VB6 - afaik you will need to custom write something, there is no support for this 'straight out of the box' VB.Net Look at the stacktrace and stackframe classes. They provide all the information. NOTE: if using exception handling, the exception object includes a stacktrace. Alan.

    Visual Basic data-structures tutorial

  • Event - After form is displayed for first time
    Q Qhalis

    The Activated event is triggered after the load (and every time the form is activated) One can use a flag (to indicate first activation) and the activated event to solve the problem. class form inherits Windows.System.Forms.Form ... Private _firstActivation as boolean = true Private Sub frmMain_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated If (_firstActivation) Then _firstActivation = False Dim frm As New Login Dim res as DialogResult = frm.ShowDialog(me) ' Login Succeeded / Failed functionality End If End Sub ... end class hth, Q.

    Visual Basic question

  • VB.Net Query
    Q Qhalis

    In a default VB.Net application you shouldn't have to do anything. Microsoft.VisualBasic is one of the default imports in the project template and Right(str,len) works, as is. If it is not working you can 1) Include an Imports Microsoft.VisualBasic statement at the top of the file 2) Add Microsoft.VisualBasic as one of the imports in the project settings. Project Properties/Common Properties/Imports One caveat though, as mentioned, Microsoft.VisualBasic is included by default whenever you create project. If it is no longer there then someone must have explictly removed it and may have a good reason for this. hth, Alan.

    Visual Basic csharp database
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups