Eagletalon 34 Junior Poster in Training

When you pass by value, you "create" a second instance of the variable, local only to the function receiving it...

When you pass by pointer/reference you can see it as passing a big neon arrow pointing to the original variable...

thus you can imagine, as no additional memory is allocated or the value is not duplicated, it is much more efficient to pass a pointer/reference rather than by value, however this would mean that the function called would be able to change the value of the variable and have that change reflected back to the original...

To avoid this you could create a new variable in the function containing the value of the pointer passed, but then you are doing exactly the same as passing by value

alternatively... passing

"const int* MyInt"

would pass a pointer and make it constant (not changable)

Eagletalon 34 Junior Poster in Training

"add 1/3 to itself a large number of times and to compare the result to multiplying 1/3 by the number of times 1/3 was added to itself" & "Your program will do these additions 109 (1 billion) times." (perhaps they meant to say 10 x 9?)

so what I understand is this:

double Start = (1/3);
double Addition = (1/3);

double Multiplication = Start * (10 * 9);

for (long i = 0; i < (10 * 9); i++){

    Start = Start + Addition;
}

//compare Start to Multiplication
Eagletalon 34 Junior Poster in Training

well I dont know much of this kind of coding... but I guess the best trick would be to first get the positions of each node? have that saved and be able to calculate the distance between each node?

then you can start with the current node... the node you want to go to... and compare the combinations of lengths applicable until you get the shortest one...

but without more info I wont be able to say...

Eagletalon 34 Junior Poster in Training

CASE (ISNULL([QtyOnHand],0)) WHEN < 0 THEN 0 ELSE ISNULL([QtyOnHand],0) END

Eagletalon 34 Junior Poster in Training

For those interested I found a complete work around for my problem... I found that the library I was attempting to import was just a way to access the methods of the COM objects installed with the ERP... and that using the QAxBase class native to QT I would be able to access these COM objects without the library alltogether...

Found everything I needed in the OLE/COM viewer of windows 7 and http://qt-project.org/doc/qt-4.8/qaxbase.html

Thankyou for all the assistance everyone :)

thines01 commented: Persistence! +0
Eagletalon 34 Junior Poster in Training

@MrNo - What the h... dude? Walt is actually giving you assistance with your code, NOT writing it for you, and encouraging you to develop your understanding and knowledge your damn self

Stop being a complete ass and learn a thing or 2, your comment you state you've only been learning this on the side for a while? so LEARN!!! dont mope and insult people encouraging that...

This forum is actually a set of decent people helping each other and you attitude is simply going to make LOADS of people ignore you and not offer any assistance any more...

WaltP commented: Thanks.... +17
Eagletalon 34 Junior Poster in Training

Put a timestamp in the table that you update and select based on that?

Eagletalon 34 Junior Poster in Training

Uhm... I dont want to sound like an ass but that is not really helping... we told him to at least try... everyone on this forum will help some-one if they at least try themselves... be it error handling or code correction... but giving them results is just strengthening their lack of knowledge

Fbody commented: Well said. +13
Eagletalon 34 Junior Poster in Training

Get a input of each 1... and calculate the values and total? Come on mate give it a try at least... don't ask people to do your project for you?

Eagletalon 34 Junior Poster in Training

Try the following?:

SELECT ItemNumber,	
             PurchasePrice,
             ReceivingPO,
             DATENAME(MONTH,CONVERT(DATETIME, ReceivedDate)) AS ReceivedMonth
FROM #VPTable as vp
WHERE vp.ReceivingPO IS NOT NULL
adam_k commented: I stand corrected +7