Post Reply 
Division by 0 (zero) in an App
04-02-2017, 10:39 PM
Post: #10
RE: Division by 0 (zero) in an App
(04-02-2017 08:06 PM)Bob Frazee Wrote:  Han wrote;
"In other words, how do you normally start your app?"
I typically start it by either tapping on the "HeatIndex" App screen icon or highlighting the App screen icon and hitting the "Enter" key.

This suggests that the START() function is where your app gets run. The code you posted confirms this.

Quote:I presume that HeatIndex() starts the program, and even though it appears to do nothing, the BEGIN END pair has to be there, or the App will not run. If it actually does nothing, then it should execute the next instruction, which is the VIEW command. The order of this App follows the DiceSimulation() App example on p 579 of the manual.

You can simply delete the HeatIndex function (including the BEGIN/END pair) and your app will run just fine. This is just part of the template that gets created when copying an existing app (which you presumably renamed as HeatIndex) or when creating a new program file.

[quote]Cyrille wrote;
"Note that you can test your faulty app program function by exporting it and calling it directly from the command line. At this point, it will behave like a normal program."
So in this case, Han is correct?, I should export START()? How do I do that, since it is part of the View command? Do I need to structure my App differently than the example in the manual in order to use the code troubleshooting method Cyrille suggested?

In this case, where you have the START function defined with the VIEW command, I would simply rename it and create a wrapping START function.

Code:

START()
BEGIN
  ViewStart();
END;

VIEW "Start HeatIndex", ViewStart()
BEGIN
  // your original code here
END;

Now, you can add EXPORT in front of START and debug normally. Or, you can optionally just insert the DEBUG command anywhere in your code where you wish to start the debugging process. I find this second method much easier. By using multiple calls to the DEBUG command, I "skip" unnecessary debugging steps using the "continue" option, which runs the app/program up until the next instance of DEBUG.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Division by 0 (zero) in an App - Han - 03-27-2017, 06:59 AM
RE: Division by 0 (zero) in an App - Han - 03-28-2017, 11:47 PM
RE: Division by 0 (zero) in an App - Han - 03-30-2017, 01:15 AM
RE: Division by 0 (zero) in an App - Han - 04-02-2017 10:39 PM
RE: Division by 0 (zero) in an App - Han - 04-04-2017, 03:52 AM



User(s) browsing this thread: 1 Guest(s)