Converting Number Type EOCustomObjects
Converting Number Type EOCustomObjects
- Subject: Converting Number Type EOCustomObjects
- From: "Jonathan Fleming" <email@hidden>
- Date: Fri, 21 Feb 2003 15:34:15 +0000
I'm having a real nightmere just trying to convert two Number object types
in my EOCustom code so that I can do a simple addition on their values.
I've given up trying to tidy the code up so you have to forgive the mess you
witness here, this is as far as I have got with it:
I don't understand why I am not allowed to use operator to read if a value
is > 0 or == 0 and so forth? Nor can I use (+) symbol says the
projectBuilder compiler to add the two values together even if the code was
right, and converting the EO's is just winding me up... 8 hours I've been at
this nonesense (UK time), it should have been real easy.
Can someone please help before I go out of my tiny mind...
All I want to do is add one EOCustomObject that is a Number type to another
EOCustomObject that is a Number type, how hard can that be?
public WOComponent dbSaveChanges(){
try {
// get editing context
EOEditingContext ec = session().defaultEditingContext();
// this checks if a number was entered into the
countOfImagesToUpload variable
if (getSCountOfImagesToUpload().equals("0"))
{
Number sum;
Number nCountOfImagesUploaded = (Number)
tbClient.valueForKey("countOfImagesUploaded");
Number nCountOfUploadMatch = (Number)
tbClient.valueForKey("countOfUploadMatch");
// Something was uploaded, update the EO
tbClient.setCountOfImagesUploaded(
getSCountOfImagesToUpload().intValue() );
if (nCountOfUploadMatch > 0) {
sum = nCountOfImagesUploaded + nCountOfUploadMatch;
tbClient.setCountOfUploadMatch(sum);
} else {
tbClient.setCountOfUploadMatch(getSCountOfImagesToUpload());
}
}
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://messenger.msn.co.uk
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.