INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Creating an Array that is reset per change of group

Creating an Array that is reset per change of group

(OP)
Ladies, Gents

I have been working on this problem for awhile now and cannot seem to crack it (I am a self-taught novice at this). I am trying to find the earliest start date that is classified as a labor step(L) within each group

I have set up my code to build the array in the details, evaluate to find the minimum value in the footer and reset in the header. Can any of you here point out my idiocies?
Here is my code:

//////header\\\\\\\\
WHILEPRINTINGRECORDS;
SHARED DATEVAR ARRAY STARTDATE;
REDIM STARTDATE[1];


/////details\\\\\\\
WHILEPRINTINGRECORDS;
SHARED DATEVAR ARRAY STARTDATE;


SELECT {JOB_OPERATIONS_WC.LMO}
CASE "L":
(
STARTDATE[UBOUND(STARTDATE)]:=(date(left({JOB_OPERATIONS_WC.DATE_START},2)+'/'+mid({JOB_OPERATIONS_WC.DATE_START},3,2)+'/'+right({JOB_OPERATIONS_WC.DATE_START},2)));
REDIM PRESERVE STARTDATE[UBOUND(STARTDATE)+1];
)

DEFAULT:
(
STARTDATE[UBOUND(STARTDATE)]:=date("12/01/2016");
REDIM PRESERVE STARTDATE[UBOUND(STARTDATE)+1];
)


/////////footer\\\\\\\\\\
SHARED DATEVAR ARRAY STARTDATE;
Minimum(STARTDATE)

RE: Creating an Array that is reset per change of group

Can you post some sample data you are working on?

RE: Creating an Array that is reset per change of group

(OP)
I think I was able to break through and finally fix the code this morning. Thank you for your willingness to help!

below is the code just for reference.
//////header\\\\\\\\
WHILEPRINTINGRECORDS;
SHARED NUMBERVAR I:=1;


/////details\\\\\\\
WHILEPRINTINGRECORDS;
GLOBAL DATEVAR ARRAY STARTDATE;
SHARED NUMBERVAR I;

IF {JOB_OPERATIONS_WC.LMO}= "L" THEN
(
REDIM PRESERVE STARTDATE[I];
STARTDATE[I]:=(date(left({JOB_OPERATIONS_WC.DATE_START},2)+'/'+mid({JOB_OPERATIONS_WC.DATE_START},3,2)+'/'+right({JOB_OPERATIONS_WC.DATE_START},2)));
I:=I+1;
(date(left({JOB_OPERATIONS_WC.DATE_START},2)+'/'+mid({JOB_OPERATIONS_WC.DATE_START},3,2)+'/'+right({JOB_OPERATIONS_WC.DATE_START},2)));
)
ELSE
(
REDIM PRESERVE STARTDATE[I];
STARTDATE[I]:=DATE("12/01/2016");
DATE("12/01/2016");
)

/////////footer\\\\\\\\\\
WHILEPRINTINGRECORDS;
GLOBAL DATEVAR ARRAY STARTDATE;
(
MINIMUM(STARTDATE);
)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close