473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

passed data being corrupted

When I pass a float value '10f' to the following:

public void getForm( float item_NO_ )

{

Console.WriteLine( item_NO_ );

}

I get item_NO_ == 2.382193E-37;

This happens at the very fist of my program.

Am I corruping the heap some how?

What is going on?

Thanks,

Jerry
Apr 3 '07 #1
4 1214
Jerry,

It prints out "10" for me. Can you show a more complete example which
reproduces the results consistently?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jerry" <jp******@general-steel.comwrote in message
news:13*************@corp.supernews.com...
When I pass a float value '10f' to the following:

public void getForm( float item_NO_ )

{

Console.WriteLine( item_NO_ );

}

I get item_NO_ == 2.382193E-37;

This happens at the very fist of my program.

Am I corruping the heap some how?

What is going on?

Thanks,

Jerry


Apr 3 '07 #2
On Apr 3, 3:35 pm, "Jerry" <jpres...@general-steel.comwrote:
When I pass a float value '10f' to the following:

public void getForm( float item_NO_ )
{
Console.WriteLine( item_NO_ );
}

I get item_NO_ == 2.382193E-37;

This happens at the very fist of my program.

Am I corruping the heap some how?

What is going on?
We can't tell without reproducing it.
Please post a short but complete program that demonstrates the problem
- see http://pobox.com/~skeet/csharp/complete.html for what I mean by
that.

Jon

Apr 3 '07 #3
using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace Procs

{

public partial class Procs : Form

{

public Procs()

{

InitializeComponent();

eMail theMail = new eMail();

// theMail.sendIt( 2, "Tesing New VF SQL error Mangement", "This is a ONLY A
TEST", "" );

}

private void btnCheckSQL_Click( object sender, EventArgs e )

{

// System.NullReferenceException.Equals();

DataVars.PCS a = new DataVars.PCS();

ProcsPCS PCS = new ProcsPCS();

// PCS.start();

// a = PCS.clearForm( a );

//a = PCS.getForm( 0.00f );

//a = PCS.getForm( 0.01f );

a = PCS.getForm( 10f );

//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

//a = PCS.nextForm( ( int ) a.recordNO );

//a = PCS.getForm( 10f );

//PCS.saveForm( a );

//PCS.calcA( a, 'I', true, 0, true );

// a = PCS.getForm( 10f );

//PCS.calcK( a, 0 );

//PCS.calcAA( a, 0, 0 );

//PCS.calcAA( a, 1, 10 );

//PCS.calcBB( a, 0, 0 );

//PCS.calcBB( a, 1, 10 );

//PCS.Procedure1();

//PCS.Procedure2();

//PCS.Procedure3();

//PCS.Procedure4( a );

//PCS.Procedure5( a ); // requires SubPCS data to exist!!! is there sich a
thing??

//PCS.collectingData(); // requires SubPCS data to exist!!! is there sich a
thing??

//PCS.collectingPasqtr( a, 1 );

//PCS.collectingData(); // requires SubPCS data to exist!!! is there sich a
thing??

PCS.collectPurchasesData( a, 1 );

PCS.stop();

this.lblDone.Text = "DONE!!";

Application.DoEvents();

}

private void btnExit_Click( object sender, EventArgs e )

{

this.Close();

}

}

}

============

using System;

using System.Collections;

using System.Collections.Generic;

using System.Text.RegularExpressions;

using System.Text;

using System.Data.Sql;

using System.Data.SqlClient;

using System.Data.SqlTypes;

using System.Data;

namespace Procs

{

class ProcsPCS

{

public int lastLine = 0; // the total number of column records / lines /
rows

public int lastForm = 0; // record number of the last form / record in the
table

public DataVars.PCS getForm( float item_NO_ )

{

Console.WriteLine( item_NO_ );

}

}

The code is getting massive. All worked fine yesterday until my system
locked up running this program. After bebooting my system, the bad data
issue started.. I went into the project for this program and deleted all the
exe files and support files. Still the same bad data being passed.

In the c/c++ days it looks like something is getting stepped on!!

Thanks,

Jerry

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:ON**************@TK2MSFTNGP05.phx.gbl...
Jerry,

It prints out "10" for me. Can you show a more complete example which
reproduces the results consistently?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jerry" <jp******@general-steel.comwrote in message
news:13*************@corp.supernews.com...
>When I pass a float value '10f' to the following:

public void getForm( float item_NO_ )

{

Console.WriteLine( item_NO_ );

}

I get item_NO_ == 2.382193E-37;

This happens at the very fist of my program.

Am I corruping the heap some how?

What is going on?

Thanks,

Jerry



Apr 3 '07 #4
Jerry <jp******@general-steel.comwrote:

<snip>
public partial class Procs : Form
That's not a complete example. See
http://pobox.com/~skeet/csharp/complete.html

We want to be able to cut/paste/compile/run and see the problem.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 3 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bill | last post by:
I have a DataSet that is serialized to a local disk. One of the testers recently experienced a problem where data was saved and the Tablet PC she was testing later went offline. When she restarted...
9
by: Matthew T. O'Connor | last post by:
Hello, pg_dump started failing for one of my databases, so I looked in to it and it appears that I have some corrupted data or something. I assume this is related to a failed hard disk that was...
5
by: ruben20 | last post by:
Hi: Is there any way to recover data from a corrupted table? I can only run SELECTs on certain WHERE conditions. I cannot vacuum, pg_dump, I've deleted the indexes and try to reindex, always...
2
by: nepdae | last post by:
Please forgive me, this is a long one. My 11-user Access 2000 database is having recurring corruption problems. The symptoms include the following: 1) corrupted fields in recently created or...
2
by: Susanne | last post by:
HI I built a website (for someone else) that sends several data fields to an aol e-mail account. I have noticed on several occasions that the data fields are passed blank to the e-mail. When I...
1
by: phillip.s.powell | last post by:
I'm having the most bizarre problem with PHP/MySQL that I've ever faced and it's an urgent matter (of course) to try to fix it ASAP. We have one record inserted into a table with 75 columns,...
8
by: Lykins | last post by:
We currently use Access 2003 in our company and have had this issues from every version from Access 97 to 2003. We deal with large databases and run a lot of queries over tables with millions of...
16
by: Wayne | last post by:
I have an Access 2003 data file that has now corrupted twice in a week. The database is extremely simple with one main data table and a few lookup tables. The lookup tables are linked to the main...
0
by: Zogo | last post by:
Hi, I read a chinese character from the notepad using c++ in OMVS to pass it to the stored procedure in DB2. In the process, the three bytes chinese character is read byte by byte and so I get...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.