[JS] CS3 Help with groups needed

Hi.
I am formatting a page of text frames, and images, and trying to group the selected objects together.
While formatting the pageI am gathering an array of variables:
myGroupArray = new Array();
myGroupCounter = 0;
myGroupArray[myGroupCounter]="myTextFrame";
myGroupCounter++;
etc...
when I am finished a section, I want to group the contents of the vaiable 'myGroupArray'
I am using this line:
myGroup = myDoc.groups.add(myGroupArray);
but getting an error 'Invalid value for parameter 'groupitems' of event 'add'. Expected Array o...t received("myTextFrame","myCorrectPic","myPriceFrame","mtQtyFrame").
Can someone help me on this?
Cheers
Roy

(Without actually trying it in ID)
myGroupArray[myGroupCounter]="myTextFrame";
That adds a string to the array, not the frame. If "myTextFrame" is a variable pointing to a text frame, simply use
myGroupArray[myGroupCounter]=myTextFrame;
By the way, have you been programming in other languages in the past? I have, and used
myGroupCounter++;
as well until finding out that for arrays, this built-in array function works equally well:
myGroupArray.push(myTextFrame);
Types much faster, and if you need the number of elements, you can always use myGroupArray.length.

Similar Messages

  • Please Help with group chat probs

    I don't get any sound or vibe notification for my group chats also In my group chats if a pic is posted and then comments made on that pic I can't scroll up or down to see all comments. This is something I need to fix as we use pic with chats at work.  I can't get the info I need.  If any one could help with this problem please do. This problem has only been since I upgraded to the newest bbm messenger last week. I have the Q10. I pulled the battery and sims card but this did nothing to fix the problem. Please if anyone can help!
    Thank you all  

    Please make sure you are using TRUCN() in your GROUP BY expression. This function will truncate the date by removing time content.
    Best of luck!

  • Need help with iPhoto, Need help with iPhoto

    Hey there!!!
    When I plug in my iPhone I go to iPhoto and can choose to import the pictures. I also tried Image Capture as it seemed easier to organise my pictures, making folders, sub-folders, etc. The problem with this is everytime I plug my iPhone into the computer click on Import the system automatically makes second, third, fourth, etc copies of each picture. This also means that there is a copy of my pictures on iPhoto and on Image Capture - which I do not really need.
    I have tried to make Albums and Folders on iPhoto. Sometimes when I delete a picture as it has been saved in two albums it gets deleted from both albums. Why is this? How can I make Albums or Folders to organise my pictures. If my pictures are transferred directly onto iPhoto, can I find them anywhere else in my computer? If I wanted to burn pictures from various albums on a disc how could I do that on iPhoto? Also I dont want events to create themselves. How can I avoid this?
    I would like help with either using iPhoto or know how the stop the duplicating of pictures on Image Capture.
    Maybe there is a better way I can transfer the pictures onto my MacBook??
    Thanks a mil!!!

    Are you running a "referenced" or "managed' library?
    Image Capture does not store phortos in it. It's an application for uploading photos to wherever you tell it to, either a folder on the hard drive or into iPhoto. If you want to use only Image Capture to upload your photos to iPhoto then set iPhoto's General preferences to the following:
    Deleting Photos from an iPhoto Library:
    1 - from an Event or the Photos mode: select the photo(s) and use the Delete key to move the photos to the trash bin. Then empty the iPhoto Trash bin as follows:
    2 - from an album, smart album, book, slideshow, card, etc.: select the photo(s) and use the key combination of Command+Option+Delete to move the photos to the trash bin.  Then empty the trash bin as above.
    NOTE: deleting a photo from an album, slideshow, book, etc., with only the Delete key only deletes that photo from that item. Deleting a photo from an Event deletes ALL occurances of that photo in the library.
    OT

  • Alright I give! I need some help with groups/busses and more please..

    Hi all,
    Well, its now been a few weeks of my off and on testing with my new Logic Rig, I have every plug I can transfer over to UB that I can and now am trying to get deeper into things.
    First I struggled with learning the environment (I still dont get it fully) but now I am really confused about group and fx tracks.
    - Am I missing something or is everything just a buss turned into a group? This also included creating an FX track?
    If this is the case then its not nearly as complex as I think it is but I cant figure certain things out with the way logic handles naming in regards to its busses.
    Lets say I want to create a sidechain group. I take an audio track change it to represent buss (1), I then rename buss 1 to SC-GROUP, now any window that I drop down to find the newly names SC-GROUP always remains named as buss (1). This even happens when I rename the buss direct from the audio environment.
    I must be missing something, whats been confusing the heck out of me is that no matter how I try and name things they always remain their original names in any menues as the example of the buss (1), so how do I rename these channels so I can clearly know exactly where I am routing audio?
    So lets summarise where I am lost so far hehe.
    1. Are groups really just empty busses renamed to act as a group?
    2. How can I rename a buss/group and be able to see the renamed channel in the menues.
    and for the 3rd new question of sorts...
    3. FX Sends, again is this just a buss that has an AU inserted into its channel and then rout the insert of an additional audio channel to the buss with the FX inserted?
    and now my last uestion of the day if I have not confused you to death so far
    Why is it that when I add a AU lets say battery as instrument 1, when I add another in the window and I rerout an instrum,ent track the next AU shows up at the bottom of the list instead of inst. 2?
    If I am not explaining myself clearly enough for any of my examples let me know so I can try to better represent my questions. I am still so new to Logic and still have yet to get the bulk of the simple operations down just yet..
    Thanks again for all your asistance!

    Thank you guys,
    So if I understand right, a sub buss is nothing more than a routing the output of a few channels to a buss to control a few aspects like I had mentioned compressing an entire group of tracks EG: a drum buss (in this situation a drum sub buss?).
    So I will have to reffer to the manual again to read the details on an actual group since it does seem there is a difference EG: the group can actually manipulate the faders of channels routed to the group?
    FX busses seem to be just that, slap an FX info either and AUX channel or a buss and then set the insert of that AUX or buss desired.
    The reason I asked about naming is that lets say I have 6 effects tracks I wish to use lets say as an example AUX1=Short Delay, AUX2=Long Filter Delay, AUX3=Slap Verb, AUX4=Long Verb and so forth.
    When I go to actually use these inserts I need to assume I know exactly what AUX I assigned each effect to, if I could simply rename this AUX track to refference the effect it would make so much more sense then trying to remember what AUX5 was.
    In regards to my last question here is a bit more of a detailed explanation, please bare with me as I am not in front of my computer.
    1. I add battery into Audio Instrument-1
    2. I then configure my environemt to use my AUXs I already have inplace for audio routing.
    3. I then edit the Audio window create the midi for a new multi-instrument.
    4. I come back to the main arrange window and hold-click on the next available audio-instrument and in the instrument window battery will be instrument 1 out of how ever many blanks apear EG:25+
    5. Now I go to add lets say Stylus RMX into the next available mutli audio instrument. I then repeat steps 2,3,4.
    Now when I get to step 4 this time instead of audio instrument 2 from the lint being Stylus it shows up as the last possible instrument in the drop list that appears under audio instrument from hold-click on the audio-instrument track.
    Its just odd, it should be instrument 2, but instead it shows up as the last possible choice.
    Maybe I am doing something wrong, even sometimes when I grab on of batteries midi tracks and create next object I will get a random audio track in there out of no where, or maybe its just a bug with battery.
    Any ideas? If I still am not describing this right, I will post a step by step this eve of exactly the steps I am taking.
    Thanks again, this forum has been very helpful in getting me going with the questions I just cant seem to get around from my Nuendo work flow.
    Cheers!

  • Need Help with Group Message Glitch

    I am in a group message with about 15 people. Every text comes in as if only one person was sending me a text. Although I can see every person's text, I can not respond. Also, when I press "details" only one person's information and name shows up. Please Help.

    I am in a group message with about 15 people. Every text comes in as if only one person was sending me a text. Although I can see every person's text, I can not respond. Also, when I press "details" only one person's information and name shows up. Please Help.

  • Need help with Group Headings and showing them on drill down.

    Hi all:
    I think this is a simple question and feel that I should already know the answer but for some reason it eludes me.  What I would like to know is the proper way to hide/display group headings and have them show up on drill down BUT not repeat on each group header.
    What I have for grouping is as follows:
    Group Header #1 u2013 Sales Rep
      Group Header #2 u2013 Customer
        Group Header #3 u2013 Product Class
          Group Header #4 u2013 Stock Code
            Details
          Group Footer #4 u2013 summary calculated on this line
        Group Footer #3  u2013 summary calculated on this line
      Group Footer #2 u2013 summary calculated on this line
    Group Footer #1 u2013 summary calculated on this line
    My goal is to have my report show only the lines listed below by default and allow the user to drill down group by group to the details section:
    Group Header #1 u2013 Sales Rep
      Group Footer #2 u2013 summary calculated on this line
    Group Footer #1 u2013 summary calculated on this line
    If anyone could offer any help it would be greatly appreciated!
    Thanks,
    FatMan

    click section expert, then for example of GH3, highlight it, then click on the formula box for suppression, and put in the code....
    Drilldowngrouplevel < 3
    The result will be that this GH3 is suppressed whenever the report is showing GH1 and 2 but not 3.
    In addition to this, you must Hide(Drill-down ok) GH3. This is also done in the section expert.
    Then just do the same for GF3, and for GH4/GF4 make sure you use...
    Drilldowngrouplevel < 4

  • Need help with group by query with condition

    Name
    ID
    A1
    1
    A2
    1
    A3
    1
    A1
    1
    A2
    2
    A2
    3
    A3
    3
    A1
    4
    A2
    4
    A3
    5
    I want to get result of total count  where ID is less than 4
    A1 - 2
    A2 - 3
    A3 -  2

    Hi,
    If you want to get 0 counts for names that don't have any low ids, then use a CASE expression instead of a WHERE clause.
    You didn't post CREATE TABLE and INSERT statements for your sample data, so I'll use scott.emp to illustrate.
    Say you want to see how many sals in each job are under 3000, like this:
    JOB       UNDER_3_CNT
    CLERK               4
    SALESMAN            4
    PRESIDENT           0
    MANAGER             3
    ANALYST             0
    Here's one way to do that:
    SELECT    job
    ,         COUNT (CASE WHEN sal < 3000 THEN 1 END)  AS under_3_cnt
    FROM      scott.emp
    GROUP BY  job
    This shows that there are ANALYSTs and PRESIDENTs in the scott.emp table; there just don't happen to be any with sals under 3000.

  • Help with scripting: need to import Excel files into PS type layers

    Howdy all,
    I have a series of TV commercials provided to me as layered PS files.  I work in CS3 and export to Avid for editing.
    For customization, I need to import their Excel list of phone numbers and duplicate each one into a type layer with existing efx and placement.
    There are 30-60 #s, which appear in 2 locations, so automation is key (just finished a 45 # series, and they have more!)
    I dont know how to script this, and would appreciate any guidance. I am not asking for someone to do it for me, just help me learn what I have to do.
    Dave Koslow

    From Excel save your file out as either CSV or TDT from the drop down 'save as' options. Once you have a plain text file script will be able to read the text file using which ever delimiter best suits you and create an array of string variables that you can use within photoshop to assign to the contents of a text layer…

  • Help with group by

    Can anyone tell why this query isn't working? It returns NOT a group by expression error. It has something to do with the subquery but I know I can't group by the alias of that statement. Any help would be appreciated.
    SELECT acc.uprn,
    NVL (SUM (lth.balance), 0) balance,
    (SELECT SUM (balance)
    FROM lsc_transaction_history lth
    WHERE acc.account_no = lth.account_no
    AND SUBSTR (lth.account_no,10,3) = 450) repair_balance
    FROM lsc_occupants occ,
    lsc_account acc,
    lsc_area lmc,
    hpm_view_property p,
    lsc_account_parties_view accn,
    lsc_transaction_history lth
    WHERE occ.seq_no = acc.seq_no
    AND acc.uprn = occ.uprn
    AND occ.account_type = acc.account_type
    AND lmc.code = acc.area_code
    AND p.uprn = occ.uprn
    AND accn.account_no = acc.account_no
    AND lth.account_no = acc.account_no
    GROUP BY acc.uprn

    Well, the hints were already given, but maybe an example make it clearer.
    SQL> create table lsc_account
      2  as
      3  select 1 uprn, '100000000000' account_no from dual union all
      4  select 1, '100000000450' from dual union all
      5  select 2, '100000000450' from dual
      6  /
    Tabel is aangemaakt.
    SQL> create table lsc_transaction_history
      2  as
      3  select '100000000000' account_no, 100 balance from dual union all
      4  select '100000000000', 200 from dual union all
      5  select '100000000000', 300 from dual union all
      6  select '100000000450', 400 from dual union all
      7  select '100000000450', 500 from dual
      8  /
    Tabel is aangemaakt.
    SQL> SELECT acc.uprn
      2       , NVL (SUM (lth.balance), 0) balance
      3       , ( SELECT SUM (balance)
      4             FROM lsc_transaction_history lth
      5            WHERE acc.account_no = lth.account_no
      6              AND SUBSTR (lth.account_no,10,3) = 450
      7         ) repair_balance
      8    FROM lsc_account acc
      9       , lsc_transaction_history lth
    10   WHERE lth.account_no = acc.account_no
    11   GROUP BY acc.uprn
    12  /
              WHERE acc.account_no = lth.account_no
    FOUT in regel 5:
    .ORA-00979: Geen GROUP BY-uitdrukking.
    SQL> select acc.uprn
      2       , nvl(sum(lth.balance),0) balance
      3       , nvl(sum(case substr(lth.account_no,10,3) when '450' then balance end),0) repair_balance
      4    from lsc_account acc
      5       , lsc_transaction_history lth
      6   where lth.account_no = acc.account_no
      7   group by acc.uprn
      8  /
    UPRN      BALANCE REPAIR_BALANCE
       1         1500            900
       2          900            900You only need to access the lsc_transaction_history table once this way.
    Regards,
    Rob.

  • Help with grouping similar lines

    Hi,
    could you help me with one sql query in Oracle 11g.
    I have data with two columns - timestamp, counter
    4.7.2012 10:01, 13
    4.7.2012 10:03, 0
    4.7.2012 10:04, 0
    4.7.2012 10:05, 0
    4.7.2012 10:21, 3
    4.7.2012 10:33, 0
    4.7.2012 10:51, 6
    What I need to get is to group lines with counter = 0 which are next to each other and keep the info about start and end of the timestamp.
    so first I need to use rank
    line_number, timestamp, counter, rank
    1, 4.7.2012 10:01, 13, 0
    2, 4.7.2012 10:03, 0, 1
    3, 4.7.2012 10:04, 0, 2
    4, 4.7.2012 10:05, 0, 3
    5, 4.7.2012 10:21, 3, 0
    6, 4.7.2012 10:33, 0, 0
    7, 4.7.2012 10:51, 6, 0
    and then group lines 2, 3, 4 into one line, because line's counter=0 and there is more then one line in the group.
    so the result would be
    4.7.2012 10:01, 13
    4.7.2012 10:03 - 4.7.2012 10:05, 0
    4.7.2012 10:21, 3
    4.7.2012 10:33, 0
    4.7.2012 10:51, 6
    Thanks a lot for any ideas,
    D.
    Edited by: dusoo on Jul 11, 2012 6:37 AM

    Hi,
    You can do something like this:
    WITH     got_grp     AS
         SELECT     tmstmp, counter
         ,     ROW_NUMBER () OVER ( ORDER BY      tmstmp)
              -  ROW_NUMBER () OVER ( PARTITION BY  counter
                                        ORDER BY          tmstmp
                           )     AS grp
         FROM    table_x
    --     WHERE     ...     -- If you need any filtering, do it here
    SELECT       MIN (tmstmp) || CASE        -- You'll probably want to use TO_CHAR here, and 2 lines below
                                  WHEN  COUNT (*) > 1
                         THEN '-' || MAX (tmstmp)
                              END
    ,         counter
    FROM       got_grp
    GROUP BY  counter, grp
    ORDER BY  MIN (tmstmp)
    ;TIMESTAMP is a keyword in Oracle 9 (and up), so it's not a good column name. I used TMSTMP instead.
    This assumes that tmstmp is unique. If not, you'll have to add something to the analytic ORDER BY clauses.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data. For example, what defines a "group" in this problem? It seems to be consectuive rows (in order by tmstmp), but what else? Will all members of a gropup have the same value for counter, regardless of the difference in tmstmp? (That's what I assumed above.) Will all members of a group have tmstmp within 1 minute of another, regardless of counter?
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • Help with Group Left Report

    Hi everyone,
    I created a Group left report with 4 grouping columns.Everthing is working fine but i am getting some problem with the order of the 3rd column(varchar).It is doing ascending order(As the Break order Propoerty of that column is ascending).
    But i am trying to do is the 3 rd column needs to be displayed by a specific (order by clause)
    But in group left report it is not considering the (order by clause of the query).It is doing sort by the grouping columns.Is there any way that i can sort a grouping column(other than asc and dsc).It needs to be displayed in the order of another column.
    Thanks
    phani

    Create another column (either in the query, or in the data model as formula) that would indicated the rank according to the desired sort order. You don't need to place the column into the layout, but use it to set the break order in the data model.

  • Help with Groups and Effects

    I'm still fairly new to Illustrator so even when I tried to Google for my solution I didn't know how to word it properly so I though you guys would be able to help me.
    So, basicaly I'n trying to keep my "Flag" effect applied to the ribbon/banner but i want only the top of it to be above the circle. However, if try to take the top selected layers out of the group to place on top of the circle, the "Flag" effect
    resets or if I try putting the cicle in the group it gets the effect applied on to it, which I don't want. Only way I can think of doing it is with a clipping mask but it doesnt look so great :/

    Both Groups and Layers are nothing but sets of objects which are contiguous (next to each other) in the object stacking order. Just think of them as "brackets" around a portion of a list for organizational and selection convenience.
    All objects reside on a Layer. Layers contain Groups and objects, because a Group is a kind of object in the same sense that a set of objects in set theory is itself treated as an object. Layers are not contained in Groups. In Illustrator, all objects are listed in the Layers palette; that does not make them Layers. Layers can exist and be completely empty. Groups can't.
    Objects all exist in a stack. A path is an object. You cannot have one portion of object A in front of object B and another portion of object A behind object B. All such appearances of objects intertwining that way are "faked" by using multiple objects which merely appear to be one object.
    It's not clear from your description what exactly you are trying to accomplish. But basically, you will most easily accomplish it by cutting either the ribbon or the ellipse at places where they don't overlap. Others often trot out recommendations involving clipping masks. In the vast majority of cases, tedious masking is not necessary, and simply cutting a path into two or more objects and restacking them is both easier and simpler in terms of the resulting constructs.
    JET

  • Help with Group Policy

    Hello all,
    I am new to Group Policy. Server is running Windows 2008 R2. All client on Win 7. I have made a folder redirect by creating it on Default Domain Policy instead of creating gpo. Is there a downfall and if so, how do i redo and have it fix ? 

    What if i just let stay without doing or creating the new gpo? let it be on the DDP. any issue will arise or possibilities that might will mess with the system or client pc connected to domain ? 
    You can let it be, it will not cause harm with anything at all.
    It is fine, in a small and simple network, which does not change often, for these things to remain.
    If you have a complex network, with many different GP configurations required, having such settings in your DDP can then be a problem, to achieve your desired different/granular settings, e.g. different settings for different departments.
    If the DDP (which applies to all departments) contains this setting, then, how do you set it differently for two departments?
    But if your network is small and simple, it's fine to do this.
    If you have no expectation that in the future it will cause constraint for you, it's fine like this.
    You can always change it later, but, it might be more effort then, compared to now?
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Help with constuctor, need to rewrite program with this constructor

    i need to use this constructor for my Scholar class:
    public Scholar(String fullName, double gradePointAverage, int essayScore, boolean scienceMajor){here is the project that i'm doing:
    http://www.cs.utsa.edu/~javalab/cs17.../project1.html
    here's my code for the Scholar class:package project1;
    import java.util.*;
    public class Scholar implements Comparable {
        private static Random rand;
        private String fullName;
        private double gradePointAverage;
        private int essayScore;
        private int creditHours;
        private boolean scienceMajor;
        private String lastName;
        private String firstName;
        private double totalScore;
        /** Creates a new instance of Scholar */
            public Scholar(String lastName, String firstName){
                    this.fullName = lastName + ", " + firstName;
                    this.gradePointAverage = gradePointAverage;
                    this.essayScore = essayScore;
                    this.creditHours = creditHours;
                    this.scienceMajor = scienceMajor;
                    this.rand = new Random();
            public String getFullName(){
                return fullName;
            public double getGradePointAverage(){
                return gradePointAverage;
            public int getEssayScore(){
                return essayScore;
            public int getCreditHours(){
                return creditHours;
            public boolean getScienceMajor(){
                return scienceMajor;
            public String setFullName(String lastName, String firstName){
               fullName = lastName + ", " + firstName;
               return fullName;
            public double setGradePointAverage(double a){
                gradePointAverage = a;
                return gradePointAverage;
            public int setEssayScore(int a){
                essayScore = a;
                return essayScore;
            public int setCreditHours(int a){
                creditHours = a;
                return creditHours;
            public boolean setScienceMajor(boolean a){
                scienceMajor = a;
                return scienceMajor;
            public void scholarship(){
                Random doubleGrade = new Random ();
                Random intGrade = new Random ();
                gradePointAverage = doubleGrade.nextDouble() + intGrade.nextInt(4);
                Random score = new Random();
                essayScore = score.nextInt(6);
                Random hours = new Random();
                creditHours = hours.nextInt(137);
                Random major = new Random();
                int num1 = major.nextInt(3);
                if (num1 == 0)
                    scienceMajor = true;
                else
                    scienceMajor = false;
            public double getScore(){
                totalScore = (gradePointAverage*5) + essayScore;
                if (scienceMajor == true)
                    totalScore += .5;
                if (creditHours >= 60 && creditHours <90)
                    totalScore += .5;
                else if (creditHours >= 90)
                    totalScore += .75;
                return totalScore;
            public int compareTo(Object obj){
                Scholar otherObj = (Scholar)obj;
                double result = getScore() - otherObj.getScore();
                if (result > 0)
                    return 1;
                else if (result < 0)
                    return -1;
                return 0;
            public static Scholar max(Scholar s1, Scholar s2){
                if (s1.getScore() > s2.getScore())
                    System.out.println(s1.getFullName() + " scored higher than " +
                            s2.getFullName() + ".\n");
                else
                    System.out.println(s2.getFullName() + " scored higher than " +
                            s1.getFullName() + ".\n");
                return null;
            public static Scholar max(Scholar s1, Scholar s2, Scholar s3){
                if (s1.getScore() > s2.getScore() && s1.getScore() > s3.getScore())
                    System.out.println(s1.getFullName() + " scored the highest" +
                            " out of all three students.");
                else if (s2.getScore() > s1.getScore() && s2.getScore() > s3.getScore())
                    System.out.println(s2.getFullName() + " scored the highest" +
                            " out of all three students.");
                else if (s3.getScore() > s2.getScore() && s3.getScore() > s1.getScore())
                    System.out.println(s3.getFullName() + " scored the highest" +
                            " out of all three students.");
                return null;
            public String toString(){
                return  "Student name: " + fullName + " -" + " Grade Point Average: "
                        + gradePointAverage  + ". " + "Essay Score: " + essayScore + "."
                        + " Credit Hours: " + creditHours + ". "  +  " Science major: "
                        + scienceMajor + ".";
    }here's my code for the ScholarTester class:package project1;
    import java.util.*;
    public class ScholarTester {
    public static void main(String [] args){
    System.out.println("This program was written by Kevin Brown. \n");
    System.out.println("--------Part 1--------\n");
    Scholar abraham = new Scholar("Lincoln", "Abraham");
    abraham.scholarship();
    System.out.println(abraham);
    /*kevin.setEssayScore(5);
    kevin.setGradePointAverage(4.0);
    kevin.setCreditHours(100);
    kevin.setFullName("Brown", "Kevin J");
    kevin.setScienceMajor(true);
    System.out.println(kevin);*/
    Scholar george = new Scholar("Bush", "George");
    george.scholarship();
    System.out.println(george + "\n");
    System.out.println("--------Part 2--------\n");
    System.out.println(abraham.getFullName() + abraham.getScore() + ".");
    System.out.println(george.getFullName() + george.getScore() + ".\n");
    System.out.println("--------Part 3--------\n");
    if(abraham.compareTo(george) == 1)
        System.out.println(abraham.getFullName() + " scored higher than " +
                abraham.getFullName() + ".\n");
    else
        System.out.println(abraham.getFullName() + " scored higher than " +
                abraham.getFullName() + ".\n");
    System.out.println("--------Part 4--------\n");
        Scholar.max(abraham, george);
        Scholar thomas = new Scholar("Jefferson", "Thomas");
        thomas.scholarship();
            System.out.println("New student added - " + thomas + "\n");
            System.out.println(abraham.getFullName() + " scored " +
                    abraham.getScore() + ".");
            System.out.println(george.getFullName() + " scored " +
                    george.getScore() + ".");
            System.out.println(thomas.getFullName() + " scored " +
                    thomas.getScore() + ".\n");
        Scholar.max(abraham, george, thomas);
    }everything runs like it should and the program is doing fine, i just need to change the format of the Scholar constructor and probably other things. Can someone please give me an idea how to fix this.
    Thanks for taking your time reading this.

    then don't reply if you're not going to read it, i
    just gave the url, Don't get snitty. I'm just informing you that most people here don't want to click a link and read your whole bloody assignment. If you want help, the burden is on you to make it as easy as possible for people to help you. I was only trying to inform you about what's more likely to get you help. If doing things your way is more important to you than increasing your chances of being helped, that's your prerogative.
    so you can get an idea on what
    it's about, and yeah i know how to add a constructor,
    that's very obvious, That's what I thought, but you seemed to be saying, "How do I add this c'tor?" That's why I was asking for clarification about what specific trouble you're having.
    i just want to know how to
    implement everything correctly, so don't start
    flaming people. I wasn't flaming you in the least. I was informing you of how to improve your chances of getting helped, and asking for clarification about what you're having trouble with.

  • Help with GROUP BY with SUM

    Hello all:
    I have always struggled with getting this right, so hopefully someone can assist with this. 
    Basically I have two tables:
    CREATE TABLE [dbo].[Placement](
    [PlacementID] [int] IDENTITY(1,1) NOT NULL,
    [TravelerID] [int] NOT NULL,
    [ActivityTypeID] [int] NULL,
    [ActivityStatusID] [int] NULL,
    [StartDate] [datetime] NULL,
    [EndDate] [datetime] NULL,
    [NumberOfWeeks] [int] NULL,
    [BookingCompanyID] [int] NOT NULL
    CREATE TABLE [dbo].[TravelerCompanyData](
    [TravelerID] [int] NOT NULL,
    [CompanyID] [int] NOT NULL,
    [StatusID] [int] NOT NULL
    I am trying to join the placement table to the TravelerCompanyData table so that I only get one row per TravelerID. The point of this query is to sum up the number of weeks. So I want to sum the number of weeks of Placements that have been completed (if
    any), and add them to however many week the person has been currently on assignment. I cannot use the NumberOfWeeks column if a placement is currently "On Assignment" because it counts the number of weeks from the start date to the end date, and
    the Traveler will not be all the way to the end date yet.
    However, I think with my SUMs in there and all the columns I am referencing in the CASE statement, I am not getting the grouping right. 
    The query below will yield four columns, one for each sum because there are four separate rows in the placement table that fit the criteria of the JOIN/WHERE
    Some notes:
    ActivityStatusID = 23 means the placement status is "on assignment"
    = 24 means the placement in "complete"
    CompanyID 10 and 12 are the only companies that I want to fit this summing criteria. 
    I am using only one travelerID to simplify the result set. 
    SELECT
    trav.TravelerID
    ,CASE
    WHEN p2.EndDate IS NULL -- Not on assignment, can sum number of weeks
    THEN SUM(p.NumberOfWeeks)
    ELSE -- multiple assignments, count weeks
    CASE
    WHEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) % 7 < 3
    THEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) / 7
    +
    ISNULL(p.NumberOfWeeks,0)
    WHEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) % 7 >= 3
    THEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) / 7 + 1
    +
    ISNULL(p.NumberOfWeeks,0)
    END
    END AS WksOnAssignment
    FROM TravelerCompanyData trav
    -- Completed placements ------------------
    LEFT JOIN dbo.Placement p ON p.TravelerID = trav.TravelerID
    AND p.ActivityStatusID IN (24)
    AND trav.CompanyID = p.BookingCompanyID
    -- Placement if on assignment ------------
    LEFT JOIN dbo.Placement p2 ON p2.TravelerID = trav.TravelerID
    AND p2.ActivityStatusID IN (23)
    AND trav.CompanyID = p2.BookingCompanyID
    WHERE ( trav.CompanyID IN (10,12))
    AND
    ( p.PlacementID IS NOT NULL
    OR
    p2.PlacementID IS NOT NULL )
    AND trav.TravelerID = 31788
    GROUP BY trav.TravelerID
    ,p.NumberOfWeeks
    ,p2.StartDate
    ,p2.EndDate
    If I add the NumberOfWeeks column in, it is adding that number to the number of weeks the current On Assignment placement currently has for each row (56 weeks), but I need to add that 56 weeks to the sum of the NumberOfWeeks column. Here is the result set:
    TravelerID NumberOfWeeks WksOnAssignment
    31788 8 64
    31788 12 68
    31788 25 81
    31788 33 89
    So am I joining wrong, grouping wrong, or summing wrong? 
    Thanks so much for any pointers!!!

    Thanks for the reply. I did some more experimenting and I discovered I don't need the SUM in this case at all. I get the same results when remove the SUM completely, but still GROUP BY the same columns. 
    Alternatively, if I SUM and the only GROUP BY tcd.TravelerID, I will get one row, but it is summing each NumberOfWeeks value by the result of the expression. 
    Query where I have included the NumberOfWeeks from the p Placement join, and the StartDate and EndDate of p2 Placement table (on assignment match) - NOTE: I have noticed that with this query, the SUM makes no difference:
    SELECT
    trav.TravelerID
    ,p.NumberOfWeeks
    ,p2.StartDate
    ,p2.EndDate
    ,CASE
    WHEN p2.EndDate IS NULL -- Not on assignment, can sum number of weeks
    THEN p.NumberOfWeeks
    ELSE -- multiple assignments, count weeks
    CASE
    WHEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) % 7 < 3
    THEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) / 7
    +
    ISNULL(p.NumberOfWeeks,0)
    WHEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) % 7 >= 3
    THEN (DATEDIFF(day, p2.StartDate, GETDATE()) + 1) / 7 + 1
    +
    ISNULL(p.NumberOfWeeks,0)
    END
    END AS WksOnAssignment
    FROM TravelerCompanyData trav
    -- Completed placements ------------------
    LEFT JOIN dbo.Placement p ON p.TravelerID = trav.TravelerID
    AND p.ActivityStatusID IN (24)
    AND trav.CompanyID = p.BookingCompanyID
    -- Placement if on assignment ------------
    LEFT JOIN dbo.Placement p2 ON p2.TravelerID = trav.TravelerID
    AND p2.ActivityStatusID IN (23)
    AND trav.CompanyID = p2.BookingCompanyID
    WHERE ( trav.CompanyID IN (10,12))
    AND
    ( p.PlacementID IS NOT NULL
    OR
    p2.PlacementID IS NOT NULL )
    AND trav.TravelerID = 31788
    GROUP BY trav.TravelerID
    ,p.NumberOfWeeks
    ,p2.StartDate
    ,p2.EndDate
    Gives:
    TravelerID NumberOfWeeks StartDate EndDate WksOnAssignment
    31788 8 2013-04-01 2014-10-04 64
    31788 12 2013-04-01 2014-10-04 68
    31788 25 2013-04-01 2014-10-04 81
    31788 33 2013-04-01 2014-10-04 89
    See it is summing correctly on the row, but how can I get it to sum the NumberOfWeeks column and add it to 56, which is what the calculation yields from the StartDate of the "On Assignment" placement from p2 until today's date?
    Hope that makes sense! 

Maybe you are looking for

  • I am having a problem syncing my ipod touch my laptop, can someone help me?

    I don't want to lose all of my information again because this time it contains important information. Also another issue I am having is that on my ipod touch I can not access my App Store and download apps because it keeps closing me out & saying tha

  • How to migrate sql server 2000 user defined function returns table

    Hi, How do I capture the SQL Server 200 user defined function that returns table? Is this supported in the current version of Oracle Migration Workbench? I am using the latest version - Release 9.2.0.1.0 with SQL SERVER 2000 plug-in. I was able to ca

  • Sr. Engineer - DFW, TX

    Good Automation is now accepting resumes for a Senior Engineer position. www.goodautomation.com Must be willing to live in the Dallas/Ft. Worth area. Job Description In this role you will consult with cutting edge companies across many different indu

  • How to make a bapi as test run if there is no testrun parameter?

    Hi, I am using BAPI fm 'BAPI_BCA_INDCOND_CHANGE' to update the financial conditions of a loan in banking. This fm doesn't have testrun parameter. I am trying to make it testrun (simulation) but not suceeded. I stopped teh execution of the BAPI_COMMIT

  • Technical specification format for webi report

    Hello expert,        I was asked to design a webi report, will you please tell me how to write a technical specification format? appreciate very much.   zhang-boling at hotmail.com