Goravani Jyotish How to use the Formula/Calculator Window ---------------------------------------- This document was last updated on 3/1/98 for release with Version 2.13 of the software. Written by Das Goravani. This document covers a technically advanced and very exciting feature of Goravani Jyotish version 2.13. Namely, the Formula/Calculator window. This new feature is basically one single window. What it does is allow you to enter programming code calculations which are executed for the current chart in memory. This feature allows you to calculate whatever you want. You can work with all the thousands of fields of information which already make up the chart. They are provided in a handy list. You can combine them and use math operators as well as text operators upon them. The medium you work with on this window is the "single Omnis calculation" medium. In other words, this window allows the entry and execution of only a single complex statement. You cannot enter steps or loops or any such construct. Only a single complex calculation can be entered. For example, you could enter: con(First,' ',Last,' ',BIRTHCITY,', ',BIRTHCOUNTRY) and get out Das Goravani Oakland, USA That is an example of a character based operation. Here's an example of a mathematical formula: lst(PLANET_LIST,1,PLAN_MIN)/60 to get: 7.51735698127 Now, the above phrase "lst(PLANET_LIST,1,PLAN_MIN)" was typed for me when I double clicked on "Ascendent Minute in Degrees" in the fields list, which is thousands of items long. The code "lst(PLANET_LIST,1,PLAN_MIN)" is the internal pointer or reference to where this data is held. The actual data it references is the minutes of arc for the ascendent of the current chart. In this case, which is my chart, it returns the number shown, which is 7.51735698127. This is 7 degrees Aries, plus the exact decimal thereof. There is another field which holds a formatted version of this same value. If you click on the line in the fields list labeled "Ascendent Display" you get this field in the formula box: ASCEND_DISP If you then hit the "Calculate Now" button, you get this is the results box: 7­ 31' 2" Aries So, this number, 7.51735698127, when broken down properly into more human-readable figures, becomes 7­ 31' 2" Aries. One of those fields is numeric, and the other text-based. The one which is a pure number with a long decimal portion, is numeric. The one containing the word "Aries" is obviously textual. You CANNOT do calculations properly on textual references. You must use only numeric fields if doing numeric calculations. You can tell which fields are which by looking in the "Current Value" column in the fields list. Fields whose current value is numeric and whose current value is textual is generally obvious. To cover the window briefly before we go on with calculations examples: You click in the upper list to load field references into the formula box. They are always pasted at the end. You can then copy and paste them around as you wish. Generally the idea is to put in fields with operators between them- like: MIDHEAVEN-(ASCEND_MINUTES/60) Here the field "MIDHEAVEN" which is in degrees, and "ASCEND_MINUTES" which is in minutes, are both being used. To equalize them, we divide the "minutes based" figure by 60 to reduce it to degrees, and then we subtract it from the midheaven. (This formula will not always work as is if the ascendent happens to be later in the zodiac than the midheaven). It works in my case. So anyway, the point is, we're using two fields here- which I loaded from the list of fields, but I TYPED IN THE OPERATORS AND PARENTHASIS- it does NOT do that for you. Then in the bottom half of the window is three white areas- the formula box, results box, and name. The formula box is where you type the formulas- with a little help from the field list. The Results box is where the results appear AFTER YOU CLICK the Calculate Now button. The Name Box is where you optionally type a name if you are going to save the formula- it's a good idea to give it an English Readable name like "Part of Fortune" or "Avayogi Point", or whatever it might be. The buttons on the right side are as follows: Calculate Now: This is the button that execuates your formula and puts results for it in the results box. So, click this button when you think you are done with your formula- to try it out. If you get a blank result, then there's an error in the formula. Add New: This clears the boxes for entering formulas and allows you to start a new one. Once you type in your new formula, you can either save it, or execute it and then save it, that's up to you. You can also never save them. You can just play and then exit whenever you like. Retrieve Saved: This opens a list of formulas you've saved. You can then load one to use it again. Note that editing or changing a formula you loaded, and then resaving it, overwrites the saved formula. If you want to use a saved formula as a "blueprint" for a new one, then do the following: 1. Load the formula from before that you want to start with, 2. Then hilite the formula and copy it to the clipboard, 3. then click New, 4. then do a paste in the formula box. Then when you save the new one it will be a fresh save, not overwriting the old one. Basically what I just advised was a simple "borrow-copy-paste" routine commonly done in many programs by experienced users. Save Formula: This button saves the formula you're working on. If you clicked "Add New" then it saves a the new formula. If you were working on an old one that you loaded, then it overwrites the old one with the new changes you just made on it, if any. Help-Examples: This pops up this document that you're reading right now. OK, so now back to examples: First of all, lets cover the operators: * multiply - subtract + addition / division = equals ( ) parenthasis (or however you spell that) > greater than < less than & and >= greater than or equal to <= less than or equal to There's also a whole bunch of functions you can use. For examples, the pick() function picks the result from a lineup of possibilities based on the input of one field. Like this: pick(FINALASCSIGN,'','Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces') In this example, the field FINALASCSIGN which is a number from 1 to 12, is used to "pick" the result from a lineup. Note that position zero is skipped by the placeholder '' which means "no text" basically. So, we start with "Aries" as the "result" if "FINALASCSIGN" is equal to 1, and Taurus, if it's equal to 2, and so on... Lets talk through and then code an example whereby we find the numer of the nakshatra a planet is in. Lets take my Moon. I already know it's in Satabish, Star #24 that is, so lets see how to code that: It's pretty easy- take the planets degrees and minutes in the zodiac, divide that by 13 deg 20 min, that will tell you a number plus a decimal degree amount, and then you have to realize that it's "in" the nakshatra represented by the whole integer plus one. So it's coded like this in steps Moon position divided by 13.33333333333333 degrees (since 20 minutes of arc is one third of a degree) take the integer of the remainder and add one to that Here's the actual code: int((lst(PLANET_LIST,3,PLAN_MIN)/800))+1 Lets talk about why this is the code. First of all, I started by finding in the list a field called "Moon Minutes in Zodiac". I decided to use this as minutes are more accurate than degrees, and I couldn't find the degrees field and I'm basically lazy. Then also I realized, that if I worked on the level of minutes, then I could use 800 to represent the nakshatras, because 13 deg. and 20 minutes is 800 minutes. To understand the above formula you need to grasp parenthasis real well. There is a function being used called "int()". It stands for "integer", and basically means "drop the decimal part of the result of the equation inside it's parenthasis". So, I'm saying "integer result please" to this enclosed sub-formula: (lst(PLANET_LIST,3,PLAN_MIN)/800) This in turn is actually two parts. The first part is just our Moon Minutes reference which was typed for us when I double clicked on it's line in the list: lst(PLANET_LIST,3,PLAN_MIN) This was typed for me. It's a pointer to a value stored in a list in memory. It gives us the Moon's position in the zodiac in my chart expressed in minutes. It actually gives this value if typed alone and executed: 18749.842967 We are then adding /800 onto the end of that- no, it's not a toll free number, rather, it's the "divide by the nakshatras" part of the equation since 800 is how many minuts there are in a nakshatra. So all this (lst(PLANET_LIST,3,PLAN_MIN)/800) is saying is "give peace a chance", no, actually it's simply saying "moon divided by 13 deg 20 minutes" to find out how many nakshatras are past. Then we're adding the int() function AROUND that statement to remove the decimal part of the result, then we add 1 with +1 on the end. So here's the formula again in code and then English underneath it: int((lst(PLANET_LIST,3,PLAN_MIN)/800))+1 (iteger of (moons position div. by the nakshatras)) plus one Things buried in parenthasis are execuated first. So in this case the middle part is done first, then the integer part, then lastly the +1 part which is not inside parens at all. You can use "Boolean Algebra" in these formulas also. Boolean algebra is that type of mathematical expression which evaluates to true or false, or to a language like this one, that's one or zero. For example: pick(MOON_H<8,'The Moon is in the Bright Half','The moon is set, not risen.') In this formula, we are using a boolean expression MOON_H<8 to trigger a selection of either one of two possible text strings. Moon_H contains a number from one to twelve representing the HOUSE in the chart that the Moon is inside. We are saying simple "Is the Moon's House Less than 8". That's a Yes or No question- hence it's "Boolean" math. Boolean, although originally the name of a person, has become synonomous in computer programming with the concept of true or false, zero or one. The pick statement used in the above example takes any expression as it's argument following the opening paren., and based on the result of that argument, it the "picks" the result from the possibilities given- the first one will be chosen on a ZERO result from the argument, the next one will be chosen if the answer is ONE, and so on it goes. I've run pick statements with around 30 or so options trailing off to the right- I'm not sure what the Max is. There are literally hundreds of functions. I've only touched on Pick and Integer. There are tons of other ones. I'll see if anybody uses this feature, and if anybody reads this far, and lets me know they want more. The immediate possible expansions to this feature are making it so that you can apply your formula to all the charts you have in the list, or hilited in the list, and output the results to spreadsheet compatible text file, or into the word processor, or as a list we save and display in the program. Also, I could also document it more fully. I could also make it possible to write step code- but actually I've opened that up already under More ->Utilities->Code Access. At a certain point, one will have to learn Omnis. But shy of that, those who are adventurous, curious, or already knowledgeable in programming fundamentals, may get some use out of these kind of advanced features. More is definately possible. I'll wait and see if there's any need before I spend more time on this. To write this feature and this supporting document took a total of only about 4 solid hours due to the existence of most of it's chunks already in my lineup of code-tool-toys built over the years towards the service of their Lordships Sri Sri Radha Krishna. Om Tat Sat