• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Converting Number Type EOCustomObjects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Dynamically setting item appearances
  • Next by Date: Re: ADC-TV
  • Previous by thread: Re: PK Generation in PostgreSQL 7.3 with WO 5.1
  • Next by thread: RE: Converting Number Type EOCustomObjects
  • Index(es):
    • Date
    • Thread