Still no luck. I'm not very experienced with Delphi. I'm using Delphi 2010. It seems that whenever I try to reference the variable grandTotalTVDifference the line won't be executed. If anyone has any suggestions it would really help.


Hi there,

I am currently struggling through trying to figure out why a statement in my source code isn't being executed when running the program.

The code is as follows:

taxableValueDifference := previousTaxableValue - newTaxableValue;
grandTotalTVDifference := grandTotalTVDifference - taxableValueDifference;
XLWorksheet.Cells[row, 7].Value := XLWorksheet.Cells[row, 7].Value + taxableValueDifference;

The first and last statement execute, but the middle statement is just skipped. Any ideas as to why this is so?

Thanks in advance!!

Okay this may be a silly question but my network / web design knowledge is pretty minimal.

I have a web site where I want to display an image that has a GUID query string attached.

When the page is opened using my internal IP address I can see the image but when I use the IP address for the outside world I get the error that Internet Explorer cannot display the web page. If I remove the query string and view using the external IP the image displays perfectly.

Any ideas?

Thanks in advance!

Also, this is the URL i'm using with all details replace by X for privacy.


Try looking into the action performed when an item is clicked.

See this article on how to fire events from a JComboBox [URL="

Here is your code:

[CODE]map<String, Item> map = new HashMap<String, Item>();
public String selected;
private ItemList categoryList;

// A variable to represent the "current list" being processed
private ItemList currentList;

// A variable to represent the "current item" (in the "current list")
// being processed
private Item currentItem;
private MySystem system;

DefaultListModel CatsModel = new DefaultListModel();
DefaultListModel SubCatModel = new DefaultListModel();
DefaultListModel equipModel = new DefaultListModel();
final JList list = new JList(CatsModel)

addCategory = new JButton("Add Category");
addCategory.setToolTipText("To add a New Category to the list");
addCategory.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
String name = addCategoryText.getText();
ItemList temp = new ItemList(name);
// Add the "category" (with this "title") to the (top-level) list of
// "categories" in the hierarchy
// Set "current item" appropriately, ie as this new "category"
currentItem = temp;
map.put(name, currentItem);


selCategory = new JButton("Select Category");
selCategory.setToolTipText("Select A Category from the list");
selCategory.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
selected = list.getSelectedValue().toString();
My SubCategory Method

final JList sublist = new JList(SubCatModel);

addSubCategory = new JButton("Add A SubCategory");
addSubCategory.setToolTipText("To add a New SubCategory to the list");
addSubCategory.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
// re-populate model sub

map.containsKey(selected); // finding the values for the key.
map.get(selected); // getting the selected variable so that
String name = addSubCategoryText.getText();
map.put(name, currentItem);


Sorry, you must have posted your code whilst I was typing. :)


It seems as if you are using the same object when adding subcategories. Hard to tell without seeing your code. Maybe you need to store the subcategories for each top level category and then when one is clicked, delete all items from the list and load the appropriate sub-categories.

Please post your code so we can help you easier!

Hi there,

Can you post your code so we can see how this is happening?

Thanks and good luck!

Hi there,

Please post your code, screen shots if necessary, and the process you are currently employing that isn't working for you.

We all want to help but we need you to be clearer otherwise we won't be able to/

Good luck!

I was thinking of setting the file with usernames and paths included.

Username Path
bernie d:\somedir\users\bernie\
david d:\somedir\users\david

Just a tab delimited text file

Then read in the file and split the lines into a 2 element array. Do this in the load form section so it's ready to go when someone selects a user from your form.

Then, loop through the array when someone selects a user until you get to that user and use the path for however you want.

I hope I answered your question.

Let me know how it all goes.

Thanks, Bernie.

Also, please post all your code. Where do you have your main method?

I would also like to know. I believe canonical just relates to the simplest form an object can take. I'm confused as how to define the simplest object.

Good luck!

Think of multiple constructors in a class as being different ways to create your object. If, for example, your class involved some sort of form you could construct a blank form or one already filled out. The filled out form would have a constructor that allowed parameters to fill out the form and the other form could have no parameters.

Check here for constructor information: [URL="

Try reading up on common controls in VB .Net here: [URL="

Yes this is absolutely possible. Just set an action to be performed on clicking on the dropdown menu that updates another area in your GUI with the value.

Give it a go and then post back with how you are getting along.


Hi there,

What part of the problem are you having trouble with?

If you need a good starters tutorial check out [URL="

Hi there,

Can you please specify exactly what the issue is, and please post your code that you are having an issue with.


Okay. So the basic changes to your code are as follows:

Kept your first loop going through the entire program until you get just before printing the counts. I removed the second loop as this is where you problems were occurring.
I have changed the switch statement to work on die1 and added the exact same switch statement immediately after to work on die2.

This is a crude way of dealing with the situation. The switch statement could be made into a method and called once passing in die1 and then again passing in die2.

I have also initialised die1 and die2 as 0.

For your print statements you will never roll a 7,8 or 9 on a six sided die :)

Good luck!!!


  • To change this template, choose Tools | Templates
  • and open the template in the editor.
    package howmanydoubles;


  • @author Bernie
    class HowManyDoubles {

    public static void main(String[] args) {

    int die1 = 0, die2 = 0, times = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0, fiveCount = 0, sixCount = 0;
    int sevenCount = 0, eightCount = 0, nineCount = 0;
    int countAmount = 0, diceAmount = 0;
    System.out.println("Start rolling...");
    while (countAmount != 500 && diceAmount != 500) {
        die1 = (int) (Math.random() * 6) + 1;
        System.out.println("First die: " + die1);
        die2 = (int) (Math.random() * 6) + 1;
        System.out.println("Second die: " + die2);

    // for (int count = 0; ...

NormR1 commented: Giving the OP code does not help him learn -3

Your case statement is based on the integer TIMES. This value never changes and is always zero. Try making a method that increments the ncounts and call that passing die1 and die2 and you should be ok.

Can you post the error message?

If you need to register 32-bit DLL's see this article [URL="

Agree with kingsonprisonic. If you want to change details of a record in a table you need to update, not insert. I'm tipping that your error would have been along the lines of cannot insert duplicate entry.

What error exactly are you getting?

Have you tried manually performing the insert statement directly into the database?

What are the values of txtNewUsername.Text and txtNewPassword.Text when the insert fails?

Try making a file with a list of all the usernames and there corresponding directory.
Populate the drop down box with this list of usernames.
When a name is selected then read the corresponding folder and open the file inside this folder.
There are tutorials everywhere for reading and writing from text files in VB .Net such as [URL="

Try the following:

[CODE] private void TestStrings(string p, string p_2)
// Change the case of the two strings to be the same, either upper or lower
p = p.ToLower();
p_2 = p_2.ToLower();

        // Convert string to char array
        char[] charArrayP = p.ToCharArray();
        char[] charArrayP2 = p_2.ToCharArray();

        // Sort the chars in the array

        // Store the char arrays back as strings
        p = new string(charArrayP);
        p_2 = new string(charArrayP2);

        // Test the strings for equality
        if (p.Equals(p_2))


I agree. Forum posting is a great way to promote SNIP

Please don't ban me. I'm making a joke and linking at the same time :)


Constructors are used to create an instance of a class.

[CODE]BaseClass var = new SubClass();[/CODE]

Should be

[CODE]SubClass var = new SubClass()[/CODE]

Your var is still a SubClass which is a sub-class of BaseClass

My first programming job basically consisted of running other peoples code.
Then for a while I learnt what they were doing and eventually started writing my own.

If you can read code and translate to English exactly what is going on and can also translate English into a workable algorithm then you are well on your way.

Be sure to keep reading and practicing. Set yourself some home projects and before you know it you'll get so good you'll be answering this question for others :)

Good luck!

Step 1: Place left hand beside left ear.
Step 2: Place right hand beside right ear.
Step 3: Clap