Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | MsgBox is not about retrieving data from the environment ... it's for reporting information to the user about the process being calculated, such as errors, warnings, or information. The error and warning capabilities have two main uses: 1. Error if it's impossible to do the task with the current inputs (usually related to #bars loaded) ... ideally, the message tells the user how many additional bars are needed, so it's easy to fix. 2. Warning if the task will work, but is either limited in usefulness, or combo of inputs goes outside "reasonable" bounds so the results have questionable value. ... I didn't show this in the demo - maybe I should add something ... these messages would usually be generated within the "bar=0" initialization section. The information capabilities are effectively limitless. The demo shows two types: 1. "As you go" pauses the "loop" execution midway, to highlight cases of interest. I set up Y/N/cancel to control whether this continues or morphs to just a summary or dies completely ... but a more useful implementation might have used Yes to MARK the point (paint a hashmark on the screen), No to continue without marking, and Cancel to deactivate the As You Go checking. 2. "At the end" is set up to appear only when the processing hits the HRE bar (ie bar=numrec-1). It reports either a final state at the HRE, or statistical summary of the history, or both. Since you can format the message with as much detail as you want, MUCH info can be provided here ... it's sort of like a turbo combination of a FL column plus the VoteLine advisor. Normally it would just have an OK button ... but if you have a LOT of info potentially to present, then Y/N/Cancel or just Y/N could be used to continue through several "panels" of detail. The important thing to remember as a programmer, in order not to annoy the user with many unwanted popups (esp when indic is applied to FL or used in a live Strat), is to ALWAYS provide an input to "toggle" the MsgBox popup feature off/on (or on in more than one state, such as Errors only or Errs + Warnings or Err+Warn+Info). (Message has 3 revisions) |