Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Member Since 02 Nov 2012
Offline Last Active Jul 12 2013 05:46 PM

Topics I've Started

[VB] Printing out values onto some kind of template?

11 July 2013 - 04:40 PM

Hey there,


I've recently made an application to calculate quotes for patio doors and windows given its height/size and other variables, everything is working fine and it prints out the costs/profits/VAT etc onto a rich text box on the application. Now I was wondering if it's possible to get this information onto some kind of printable format which would fit onto an A4 piece of paper (This is for a professional company).


My guess was to design a A4 template which would have logos and such and then enters the values onto the template to create some sort of receipt. My guess is to have something which looks like this generated (http://www.starmicronics.com/files/Image/TSP800II_Hotel_Invoice_1.jpg) just pulled it off google.


I was wondering if this at all possible in VB? If so how would I go about doing this?



[VB] Uncertain why this isn't working

10 July 2013 - 05:03 PM



I've just written this code, unfortunately the 'price' & 'price2' variables always returns as 0 when I print it, and I'm really confused why as it should, also instead of it adding the value to price during the if statements, it just goes straight to the last Else which prints out that I should enter a correct numeric value

        Dim theHeight As String = heightEntry.Text
        Dim theWidth As String = widthEntry.Text
        Dim price As Integer
        Dim price2 As Integer

        If IsNumeric(theWidth) >= 1800 Then
            price = 1444

        ElseIf IsNumeric(theWidth) >= 1801 And IsNumeric(theWidth) <= 2000 Then
            price = 1458

        ElseIf IsNumeric(theWidth) >= 2001 And IsNumeric(theWidth) <= 2200 Then
            price = 1479

        ElseIf IsNumeric(theWidth) >= 2201 And IsNumeric(theWidth) <= 2400 Then
            price = 1580

        ElseIf IsNumeric(theWidth) >= 2401 And IsNumeric(theWidth) <= 2600 Then
            price = 1606

        ElseIf IsNumeric(theWidth) >= 2601 And IsNumeric(theWidth) <= 2800 Then
            price = 1630

        ElseIf IsNumeric(theWidth) >= 2801 And IsNumeric(theWidth) <= 3000 Then
            price = 2185

        ElseIf IsNumeric(theWidth) >= 3001 And IsNumeric(theWidth) <= 3200 Then
            price = 2204

        ElseIf IsNumeric(theWidth) >= 3201 And IsNumeric(theWidth) <= 3400 Then
            price = 2259
            Output("Please Enter Numbers Between 1800 to 3400")
        End If

        If IsNumeric(theHeight) > 2100 Then
            price2 = price * 1.05
            price2 = price
        End If

        Output("Value is: " + price2.ToString)

    End Sub

Any help would be greatly appreciated, thanks!

[VB] Greater than or equal to and Less than and equal to if statements

10 July 2013 - 02:39 PM

Hey there,


trying to create a simple application which can calculate quotes based on the size of a variable, but having a bit of trouble as I havnt touched Visual Basic in over 5 years.


So far I have this

        If width >= 1801 And <= 2000 Then
            price = 1458
        End If

is the width is equal to or larger than 1801 and the width is greater than or equal to 2000 then the price is 1458, although this is saying that the 2nd operator is infact an XML element?


Does anyone have an example of a working if statement like this that I can get an idea of?



[XNA] Camera Centralizing around player

02 July 2013 - 05:22 PM

Hey there,


started to create a game in XNA in my spare time, its a 2D platform game. I'm trying to get a similar effect to a game such as Terraria, where the camera is centralized around the player's character/avatar.


Is there any tutorials out there which can explain how this is done in XNA?


Thanks in advanced

3D Collision Detection, is an object inside an object

26 April 2013 - 08:52 PM

Hey there,


I've rendered 4 zones which have an x,y,z coordinate and are all 100.0f by 100.0f and completely flat across the 'z' axis, resulting in this: 



Now, I have a struct which holds the coordinates of a player in 3D space

struct PLAYER
      float x, y, z;


and I want to check if the player's coordinates are inside the more or less 2D grid, it doesn't need to check against the y axis as the player can not move up or down the y axis.


The problem is my CheckZone() function I am trying to create, so far it looks like this, but I'm struggling to work to this as I on a basic level for programming:


void Application::CheckZone()
	Player = {Player.x, Player.y, Player.y};

	float Section1[4][2] =
		{0.0f, 0.0f},
		{0.0f, 80.f},
		{80.0f, 0.0f},
		{80.0f, 0.0f}

	if(Player == Section1[][])
		//Trigger element in Section1


I'm getting "Error: expected an expression" from the 2 array boxes in the if statement, as well as the Player statement, I'm having trouble understanding some basic programming here, any help would be greatly appreciated 



EDIT: On closer inspection the title can be mis-leading, I'm not trying to check an object against an object, instead the coordinates for the grid which are decoupled from these arrays.