Creating an App, and evolution for the extreme beginner (me)



#5

Hello all,

a post for newbies like me that have a million questions so here goes a very Basic (excuse the pun) of App and program installation. You will see two sections near the end of the program that are not finished yet: "WEIGHTED BREAK",WB() and "LONG SHORT BREAK",LS().

i hope this helps people whose Prime has just shown up on their door step.

This example is very crude as I am getting to know my new friend, thanks Cyrille and Tim; or; Tim and Cyrille et al.

This is strictly for you beginners and not the Mandlebrot design team or Table of the Elements group! Just a starters guide as I learn the system. So output is not yet perfected (i want a list for that). Input is awkward as I want a list for that similar to the 48 system were all inputs are menu and complete on one page. I will be getting there but getting the routine running and calling subroutines is the object. The bells and whistles come later!

This is a copy/paste clip of a text file residing in Word. It can be copied directly from here and via the Connectivity kit, copied to your emulator or Prime by creating an App using the Save App command and giving it an appropriate name. Open the new App, click on program and paste. Save to the emulator or Prime, whichever you are using.

Here is the info section which can also be copied and pasted to the info section of your emulator or prime associated with your new APP:

Break schedules: 
-calculates break periods.

*Initialize:
-prompts for "off and on" times.
these are the airborne and landing times.
-break "out and in" times.
these are the delay and early return
times in minutes after takeoff and
before landing.
-number of breaks.

*equal breaks:
-2, 4, 6 typically.

*weighted breaks:
-allows the front half or rear half of the
breaks to be longer by choice.
-4 or 6 typically.

*2 short followed by 3 long and short:
-places the sleep period outside the dinner
service.

End Info notes section and here is the listing. There are a lot of notes, more so for the Word file but still copyable to the calc due to the //

NOTE THE ->HMS COMMAND NEEDS TO BE INPUT VIA THE CALC AS THE TEXT EDITOR FAILS TO INTERPRET IT.

//declare MIDNIGHT a subroutine for use in this App.

MIDNIGHT();

//create variables.

EXPORT OFA,OFB,ONA,ONB,WTD;
EXPORT IN,OUT,NUM,EQL,TIM;
EXPORT TOT,CAL,PER;

//title of App

EXPORT Break_schedules()
BEGIN
END;

//initialize routine setting parameters and declaring local variables.

VIEW "Initialize",IT()

BEGIN
HFormat:=1;
HDigits:=2;
HAngle:=1;
STARTVIEW(6,1);

//local variables, some not used YET but will be.

LOCAL A,B,C,D;
END;

// input times and break number.

VIEW "Input times/# of breaks",OO()

BEGIN

INPUT(OFA,"Wheels off time","off time = ","off time");
INPUT(ONA,"Wheels on time""on time = ","on time");
INPUT(OUT,"Out time","out time = ","out time");
INPUT(IN,"In time","in time = ","in time");
INPUT(NUM,"# of breaks","# of breaks = ","# of breaks");

//convert HMS into HR (decimal time).

OFA:=(FP(OFA)/60)*100+IP(OFA);
ONA:=(FP(ONA)/60)*100+IP(ONA);
OUT:=(FP(OUT)/60)*100+IP(OUT);
IN:=(FP(IN)/60)*100+IP(IN);

//correct for GMT landing time less then GMT takeoff time
//for when flight passes through 24:00 GMT.

IF OFA>ONA
THEN ONB:=ONA+24
ELSE ONB:=ONA;
END;

//calculate actual times for break using delay after takeoff
//and early return before landing.

ONB:=ONB-IN;
OFB:=OFA+OUT;
TOT:=ONB-OFB;
EQL:=->HMS(TOT/NUM);

//display equal breaks and time availble for breaks.

MSGBOX("Equal = "+EQL);
MSGBOX("Total = "+TOT);

END;

//select type of break desired based on EQL and TOT above.

VIEW "EQUAL BREAK",EQ()

//this is a loop using NUM variable to control loop.

BEGIN
FOR N FROM 1 TO NUM DO

TIM:=->HMS(OFB+EQL);
TIM:=MIDNIGHT(TIM);
OFB:=TIM;

//display the consecutive times.

MSGBOX("Time = " +TIM+"");

END;
END;

//end loop

VIEW "WEIGHTED BREAK",WB()

BEGIN

INPUT (WTD,"Weighted time""weighted time = ","weighted time");
INPUT (PER,"Period","Period = ","period");

WTD:=(FP(WTD)/60)*100+IP(WTD);
CAL:=->HMS((TOT-(NUM/2*WTD))/2);

MSGBOX("CALC = " +CAL+"");

END;

VIEW "LONG SHORT BREAK",LS()
BEGIN
END;

Here is the subroutine Midnight which checks to see if the time additives pass through 24:00 hours and then corrects the output for display.

EXPORT MIDNIGHT(TIM)
BEGIN
IF TIM>24 THEN TIM:=TIM-24
ELSE TIM:=TIM;
END;
END;

The point of the above post was just to get you started with an example, believe me, it takes quite a while (for me anyway) to interpret the DICE APP and convert the knowledge in that to my program.

The program is not finished as two sections are WIP's and the input and output displays are not refined.

cheers, Geoff

comments and suggestions welcome, but most of the fun and learning is just trying!


Edited: 20 Oct 2013, 1:14 a.m. after one or more responses were posted


#6

If you are interested in creating a custom app, this video might be of interest:

http://www.youtube.com/watch?v=hv-MMwfzwwA


#7

That is a good video, and indeed it did help.

But, oops, this is an App called Breaks ;-)

i also have an aviation App which contains a series of programs from great circle, intermediate latititude, altitude corrections due to non standard temperature, pressure altitudes greater then 31.00 inches.

Here is the Breaks App at the moment:

and so on...

Cheers

Geoff


Edited: 19 Oct 2013, 11:58 p.m.


#8

This is AWESOME Geoff! I mean, sorry you had to do a lot of work for the rest of us, but great that you're willing to share! I'm thinking about creating an app of my own for some additional statistics functions, and this will help a lot.

Kudos!

bruce


#9

Thanks Bruce.

I will get it to the Wiki soon, also this is a WIP and I will post the complete App with program code, pictures of screens and maybe throw in a video.

Now to finish the last two sections. Yes, in the cockpit in between radio and navigation duties :-)

Geoff


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime: =f(x):=expression in spreadsheet app CR Haeger 1 544 12-05-2013, 07:53 AM
Last Post: cyrille de Brébisson
  HP PRIME: APP program code DISAPPEARS !! Joseph Ec 0 324 11-25-2013, 11:35 AM
Last Post: Joseph Ec
  HP prime: linear solver app Alberto Candel 1 470 11-21-2013, 01:57 AM
Last Post: Michael Carey
  HP Prime: Linear Solver app bug BruceH 0 321 11-15-2013, 06:36 PM
Last Post: BruceH
  HP Prime - CAS functions in Spreadsheet App CR Haeger 6 886 11-11-2013, 12:37 AM
Last Post: Michael de Estrada
  HP Prime - Geometry App inconsistence bluesun08 4 630 11-10-2013, 01:48 PM
Last Post: parisse
  HP Prime - Geometry App Intersection bluesun08 2 462 11-10-2013, 07:52 AM
Last Post: bluesun08
  HP Prime - more than a spreadsheet app so far CR Haeger 0 318 11-08-2013, 03:45 PM
Last Post: CR Haeger
  Equation Library/App for the Prime Harold A Climer 3 583 10-30-2013, 10:14 AM
Last Post: CompSystems
  Example of an App created for Prime, (schedule program from earlier posting). Geoff Quickfall 0 299 10-28-2013, 05:09 PM
Last Post: Geoff Quickfall

Forum Jump: