What is a URL?



URL stands for "Uniform Resource Locator". It is a draft standard for
specifying an object on the Internet, such as a file or newsgroup.

URLs look like this: (file: and ftp: URLs are synonymous.)
* file://wuarchive.wustl.edu/mirrors/msdos/graphics/gifkit.zip
* ftp://wuarchive.wustl.edu/mirrors
* http://info.cern.ch:80/default.html
* news:alt.hypertext
* telnet://dra.com



The first part of the URL, before the colon, specifies the access
method. The part of the URL after the colon is interpreted specific to
the access method. In general, two slashes after the colon indicate a
machine name (machine:port is also valid).

When you are told to "check out this URL", what to do next depends on
your browser; please check the help for your particular browser. For
the line-mode browser at CERN, which you will quite possibly use first
via telnet, the command to try a URL is "GO URL" (substitute the
actual URL of course). In Lynx you just select the "GO" link on the
first page you see; in graphical browsers, there's usually an "Open
URL" option in the menus.

What are WWW, hypertext and hypermedia?



WWW stands for "World Wide Web". The WWW project, started by CERN (the
European Laboratory for Particle Physics), seeks to build a
distributed hypermedia system.



The advantage of hypertext is that in a hypertext document, if you
want more information about a particular subject mentioned, you can
usually "just click on it" to read further detail. In fact, documents
can be and often are linked to other documents by completely different
authors -- much like footnoting, but you can get the referenced
document instantly!

To access the web, you run a browser program. The browser reads
documents, and can fetch documents from other sources. Information
providers set up hypermedia servers which browsers can get documents
from.

The browsers can, in addition, access files by FTP, NNTP (the Internet
news protocol), gopher and an ever-increasing range of other methods.
On top of these, if the server has search capabilities, the browsers
will permit searches of documents and databases.

The documents that the browsers display are hypertext documents.
Hypertext is text with pointers to other text. The browsers let you
deal with the pointers in a transparent way -- select the pointer, and
you are presented with the text that is pointed to.

Hypermedia is a superset of hypertext -- it is any medium with
pointers to other media. This means that browsers might not display a
text file, but might display images or sound or animations.

PASCAL FAQ's

1.1: HOW DO I READ COMMAND LINE PARAMETERS?

The standard function ParamCount: word will return the number of
command line parameters, while function ParamStr(N: word): string will
return the N-th parameter. (Under DOS 3.0 or greater, the 0-th
parameter (ie, ParamStr(0)) is the path and file name of the current
program.) Thus,

function CommandLine: string;
var
Idx: word;
Result: string;
begin
Result := '';
for Idx := 1 to ParamCount do
begin
if Idx > 1 then Result := Result + ' ';
Result := Result + ParamStr(Idx);
end;
CommandLine := Result;
end;

will return the whole command line, with any embedded whitespace
(spaces or tabs) converted to single spaces. If you care about the
amount or type of whitespace, or you want commas, semicolons, and
equal signs to count as parameter separators (as per ancient versions
of DOS manuals), see the next question:

1.2: HOW DO I READ THE WHOLE COMMAND LINE?

ParamCount and ParamStr are for parsed parts of the command line and
cannot be used to get the command line exactly as it was. If you try
to capture

"Hello. I'm here"

you'll end up with a false number of blanks. For obtaining the command
line unaltered use

type CommandLines = string[127];

function CommandLine: CommandLines;
type
CommandLinePtr = ^CommandLines;
begin
CommandLine := CommandLinePtr( Ptr(PrefixSeg, $80) )^;
end;

A warning. If you want to get this correct (the same goes for TP's own
ParamStr and ParamCount) apply them early in your program, before any
disk I/O takes place.

For the contents of the Program Segment Prefix (PSP) see a DOS
Technical Reference Manual (available on the Microsoft DevNet CD) or
Tischer, Michael (1992), PC Intern System Programming, p. 753.

- Based on [ts]'s Turbo Pascal FAQ
_________________________________________________________________

Logarithms, Trigonometry, and Other Numerical Calculations

I often find it convenient to define floating-point functions in terms
of a type float = {$ifopt N+} double {$else} real {$endif}, rather
than either explicitly using real or double. This way, the same
function will automatically use the 'best' argument and result type
for either the N+ (80x87) or N- state, without any changes and without
obscuring its logic with lots of {$ifdef}s.

2.1: HOW DO I CALCULATE X^Y (X**Y)?

Pascals do not have an inbuilt power function. You have to write one
yourself. The common, but non-general method is defining

function POWERFN(number, exponent: float): float;
begin
PowerFn := Exp(Exponent*Ln(Number));
end;

To make it general use:

(* Generalized power function by [ts] *)
{ Some modifications by jds }
function GenPowFn(Number, Exponent: float): float;
begin
if (Exponent = 0.0)
then GenPowFn := 1.0
else if Number = 0.0
then GenPowFn := 0.0
else if Abs(Exponent*Ln(Abs(Number))) > 87.498
then RunError(205) {Floating point overflow}
else if Number > 0.0
then GenPowFn := Exp(Exponent*Ln(Number))
else if (Number < 0.0) and (Frac(Exponent) = 0.0)
then if Odd(Round(Exponent))
then GenPowFn := -GenPowFn(-Number, Exponent)
else GenPowFn := GenPowFn(-Number, Exponent)
else RunError(207); {Invalid float-op}
end; (* genpowfn *)



On the lighter side of things, here's an extract from an answer of
mine [TS] in the comp.lang.pascal UseNet newsgroup:

> anyone point out why X**Y is not allowed in Turbo Pascal?
The situation in TP is a left-over from standard Pascal. You'll
recall that Pascal was originally devised for teaching
programming, not for something as silly and frivolous as
actually writing programs. :-)



The above is a lightly-edited version of the answer from [ts]'s Turbo
Pascal FAQ. For the common special-case where you're raising a
floating point number to an integral power (eg, X^7 or Y^3), you can
use this fast code:

function RealPower(Base: Float; Power: word): Float;
begin
if Odd(Power)
then if Power = 1
then RealPower := Base
else RealPower := Base * RealPower(Base, Power - 1)
else if Power = 0
then RealPower := 1
else RealPower := Sqr(RealPower(Base, Power shr 1));
end;



2.2: HOW DO I TAKE 'UN-NATURAL' LOGARITHMS?

Just define

function Log(X, Base: float): float;
begin
Log := Ln(X) / Ln(Base);
end;

This result is based on some elementary math. By definition y = log(x)
in base B is equivalent to x = B^y (where the ^ indicates an
exponent). Thus ln(x) = y ln(B) and hence y = ln(x) / ln(B).

- A lightly-edited version of the answer from [ts]'s Turbo Pascal FAQ

2.3: WHY DO THE TRIG FUNCTIONS LIKE SIN() AND COS() GIVE THE WRONG ANSWERS?

While most people express angles in degrees, the trig functions expect
their arguments to be in radians. For historical reasons, a complete
rotation is 360 degrees; for more cosmological reasons, the same
complete rotation is 2 * Pi radians (the circumference of a circle
with a radius of 1). Thus, to convert degrees to radians, just divide
by 180 / Pi.

2.4: HOW DO I CALCULATE ARCSIN() OR ARCCOS()?

Borland Pascal does not have ArcSin or ArcCos functions. It does have
an ArcTan function, and the online help for that function gives the
following conversion formulae:

ArcSin(x) = ArcTan (x/sqrt (1-sqr (x)))
ArcCos(x) = ArcTan (sqrt (1-sqr (x)) /x)



Dr. John Stockton, jrs@merlin.dclf.npl.co.uk, points out that ArcTan
will always return a value between -Pi / 2 and Pi / 2. Also, there are
two angles in the range from 0 to 2 pi for any given sine or cosine
value, even though the formulae above will only give you one of them.

2.5: CAN I TRAP (AND RECOVER FROM) FLOATING POINT OVERFLOW ERRORS?

Duncan Murdoch [dm] writes:

Because the floating point processor operates in parallel to the
integer processor, this is generally quite tricky. The best approach
is not to trap the errors, but just to mask them, and at the end of
a calculation check whether they have occurred by examining the
coprocessor status word.

Be aware that Borland's string-conversion routines (used in Str,
Write and Writeln) clear the FPU's status word. If you do any I/O of
floating point values in between status checks, you may miss seeing
signs of errors.

I would add that it's probably best to leave the floating point
overflow exception on (unmasked) in the vast majority of your code,
and that you should only mask it off around the few calculations where
you expect and can handle a possible overflow. That is, a runtime
error is probably better than allowing the program to continue with
unnoticed math errors!

The following demo code may be helpful:

function Get87CtrlWord: word; assembler;
var
CtrlWord: word;
asm
fstcw [CtrlWord]
mov ax,[CtrlWord]
end;

procedure Set87CtrlWord(NewCtrlWord: word); assembler;
asm
fldcw [NewCtrlWord]
end;

function Get87StatusWord: word; assembler;
var
StatusWord: word;
asm
fstsw [StatusWord]
mov ax,[StatusWord]
end;

const
InvalidOp = $01;
DenormalOp = $02;
ZeroDivide = $04;
Overflow = $08;
Underflow = $10;
Precision = $20;

var
Ctrl, Status: word;
X, Y: double;

begin
Ctrl := Get87CtrlWord;
Set87CtrlWord(Ctrl or Overflow); {Setting a bit masks the exception}
X := 1e308; Y := X * X;
Status := Get87StatusWord;
Set87CtrlWord(Ctrl);
if (Status and Overflow) 0 {A set bit indicates an exception}
then WriteLn('Overflow flag set')
else WriteLn('Overflow flag clear');
end.

[dm] adds

const
StackFault = $40;
StackOverflow = $200;

These bits are supported in the 387 and up; together they indicate a
stack overflow (both set) or stack underflow (just StackFault).

2.6: WHY DO I ALWAYS GET THE SAME RANDOM NUMBERS EVERY TIME I RUN MY PROGRAM?

Software random number generators apply a function to a RandSeed which
cycles the seed through its possible values in a quasi-random way.
Each call to the random number generator does one iteration of the
function, and returns a result based on the new seed value.

When your program loads, this seed will have some default value
(probably 0). If you do not change the seed, a series of calls to the
random number generator will yield the same series of "random" numbers
every time your program is run. (Obviously, this will make it easier
to track down the bugs!) Typically, the system clock is used to
provide a value for the random number seed: Even if a given task is
always run at the same time of day, a difference of a few milliseconds
is enough to put a good random number generator in an entirely
different part of its sequence.

In Borland Pascal, the command to randomize the seed is (surprise!)
Randomize; in Think Pascal for the Mac, the equivalent command is
QwertyUiop. Note that you should only call this routine once per
program, when it first loads, or at the very least at times separated
by minutes or hours - calling it on every timer tick (say) will just
reset the 'random' sequence several times a second!
_________________________________________________________________

Strings and Numbers

3.1: HOW DO I CONVERT A STRING TO A NUMBER?

In Turbo/Borland Pascal, you can use the standard Val() procedure. The
first argument is a string, and the second argument is a numeric
variable which will be set to the numeric value represented by the
string. The result variable can be any of the numeric types - from
byte or ShortInt to comp or extended - the compiler will automagically
pass the variable's type to the Val() procedure.

Val() is a procedure, not a function, which means that it does not
return any sort of error code to indicate that it couldn't set the
result variable because eg the string was 'Four score and seven' not
'87', or because the string was '3.14159' and the result variable was
a word, or even because '12261958' is too big for a word variable.
Obviously, you do want to be able to find out whether Val() was able
to decode the string. This is where the third parameter - an integer
(or word) variable which will receive a result code - comes in. If the
result code is 0, then the string represents a number which could be
(and was) placed in the result variable; a nonzero result code means
that the string does not represent a compatible number: the result
variable has not been changed, and the error code is the index of the
first illegal character in the string.

Note that Val() and ReadLn() can handle hexadecimal numbers, using the
$1234 format.

3.2: HOW DO I CONVERT A NUMBER TO A STRING?

In Turbo/Borland Pascal, you can use the standard Str() procedure. The
first argument is a number, and the second is a string variable which
will be set to the formatted value. Just as with Write() and
WriteLn(), the number may (but does not have to) be followed by a
colon and a width specifier and (for float point numbers) a second
colon and a number of digits after the decimal point.

Str() is a procedure, not a function, which makes it a lot harder to
use than, say, WriteLn(). Obviously, it's pretty trivial to put a
'wrapper' around it so that you can write string expressions like
Fmt(Month,2) + DateSep + Fmt(Day,2) + DateSep + Fmt(Year,2):

type NString = string[20];

function Fmt(N: LongInt; Width: word): NString;
var Result: NString;
begin
Str(N: Width, Result); {A width of 0 is the same as no width at all}
Fmt := Result;
end;



While Val() can read hex strings, there's no way to force Str() to
produce a hex string. For that, you can use

type HexString = string[8];

function HexFmt(Int: LongInt; Width: integer): _HexFmtResult_;
const Hex: array[0..$000F] of char = '0123456789ABCDEF';
begin
if (Width <= 1) and (Int and $FFFFFFF0 = 0)
then HexFmt := Hex[Int]
else HexFmt := HexFmt(Int shr 4, Width-1) + Hex[Int and $000F];
end;


_________________________________________________________________

Breaking The 64K Limit



4.1: I HAVE 64K OF GLOBAL DATA AND CAN'T ADD ANYMORE - WHAT DO I DO?

What you have to do is to find the largest data structures. A good
way to do this is to look at a .map file with the addresses of
"public" names, and look for large jumps between names. Often, a big
jump flags a big variable. However, the .map file will not show any
variables that are private to a unit, so a big jump may just indicate
a lot of private variables within a unit. In that case, you'll have to
look at the unit's source code to see what's taking up so much space.

When you find your largest data structures, look at how they're used.
(The cross-reference tool in the BP7 IDE is an excellent way to do
this.) If they're only used in a single function or procedure, you can
move them into that procedure's local variables section, which will
get them out of the global data segment and onto the stack.

Of course, this may now cause the stack to be too big. If so, or if
the data are used in more than one place, you'll have to move the data
structure onto the heap. To do this, you'll have to do three things:
1. Replace a declaration like
var BigVar: BigType;
with
var SmallVar: ^BigType;
2. Change all references to BigVar to SmallVar^. Because BP is so
fast, it's usually quite practical to just keep compiling until
you get no more 'BigVar unknown' or 'need a ^' errors.
3. Somewhere in your program initialization, before you ever execute
any code that refers to SmallVar^, do a New(SmallVar); to allocate
space on the heap.

It's a good idea to get in the habit of using Dispose() whenever
you no longer need the space you've allocated, but it's not
strictly necessary, here: neither DOS nor Windows will 'lose' any
memory that you allocate but don't free when your program
terminates.



One thing to keep in mind is that reading or writing (dereferencing) a
pointer is slower than reading or writing a global or local variable,
especially in protected mode. Generally, you shouldn't worry about
this sort of thing except in bottleneck code but, where efficiency
does matter, you should definitely replace a series of dereferences
of the same pointer with a single with statement. (BP7 is
significantly better at "peephole" optimization than its predecessors,
but even in BP7 there are cases where a with PtrVar^ statement
produces better code than the equivalent series of 'raw' pointer
statements. Certainly replacing multiple instances of Row[Idx]^ or
even RecordPtr^.RecordField with a single with will result in smaller
and faster code.)

Finally, a word of admonition: You should use global data very
sparingly. If you are pushing the 64K limit, and it's not all in a
handful of large buffers, you're almost certainly using too many
global variables. Obviously, global variables that are only used in
one place waste space; less obviously, using global variables tends to
produce bugs. A seemingly innocuous change to a variable here can have
effects way over there. You can fight this sort of potentially
crippling interdepence by explicitly passing parameters to a function,
and explicitly returning results. It can be impossible to totally
avoid writing code that has side-effects, but such code should be
avoided as much as possible -- and always documented.

4.2: CAN I HAVE MORE THAN 64K OF GLOBAL DATA IN MY WINDOWS PROGRAM?

Yes and no. Your .exe module can only have a single 64K
data-and-stack segment, but each .dll has its own, up-to-64K data
segment. Thus, if you run out of room in your global data segment, you
can move some units and their global data into a DLL.

There are two things to keep in mind if you do this:
1. A call to a DLL is more expensive than a call within an EXE. Each
call into a DLL swaps data segments on the way in and on the way
out.
2. If a user is running two or more copies of your program at the
same time, each copy shares the code, but has its own copy of the
.exe's global data. However, there will only be one copy of the
.dll's global data, no matter how many copies of your application
(or how many different applications) are using it.

That is, any global variables in your .exe are a task resource;
any global variables in a .dll are a system resource.



4.3: HOW CAN I BUILD AN ARRAY BIGGER THAN 64K?

Break the array into two (types of) pieces: an array of row ptrs, and
a set of rows on the heap. That is, replace

type BigArrayType = array[0..Rows, 0..Cols] of DataType;
var BigArray: BigArrayType;

with

type BigArrayRow = array[0..Cols] of DataType;
BigArrayType = array[0..Rows] of ^ BigArrayRow;

var BigArray: BigArrayType

and replace any references to BigArray[Row, Col] with references to
BigArray[Row]^[Col]. (As per the answer to 4.1, don't forget to
allocate memory for each row!)

If performance isn't a major issue, you might well want to
encapsulate the array behavior in an object. That is, instead
of replacing BigArray[Row, Col] with BigArray[Row]^[Col], you
would replace it with calls to BigArray.Get(Row, Col) or
BigArray.Set(Row, Col, NewVal). While this is a bit slower than
direct array references, the object (compiled) code is smaller
and the source code is both easier to read and easier to
change. If you need to add virtual memory (swapping to and from
disk, EMS, or XMS) or to move your code to a 32-bit compiler,
you would only have to change the object definitions, not every
reference to your big array.

(One way to maintain both modifiability and good performance is
to replace the array of row pointers with a function that
returns a row pointer. Since you only need to call this once,
no matter how many operations you're doing on the row, using
your huge array might not be much slower than a normal array.
Since the function can do anything from simply looking up a
pointer in an array to swapping out the Least Recently Used row
and swapping in the one you need, you maintain flexibility.)



If the array has a lot of rows, and the rows are not some multiple of
8 (or 16 bytes) long, you might end up wasting a lot of space at the
end of each row. If so, and if you're just barely running out of room,
you might want to New() a "multi-row" type, that consists of an array
of 8 (or 16) individual rows. This will eliminate the wasted pad
bytes, and will only complicate your setup and teardown code: since
the row pointer array will still point to the start of each individual
row, access to any individual array element will be no different than
if each row is its own heap block.

Of course, decomposing an array in this way only works if the array
has two (or more) dimensions. See the next question if you have to
deal with a one-dimensional data stream that's larger than 64K.

4.4: HOW DO I HANDLE .BMP AND/OR .WAV FILES WITH MORE THAN 64K OF DATA?

There are two issues here: allocating a single heap block that's
bigger than 64K, and accessing it. Both are significantly different in
real mode than in protected mode.

Real mode:
In real mode, the primary issue is allocating the space: BP's
heap manager won't let you allocate blocks bigger than 63 and a
bit K-bytes. One approach is to simply rely on the current
implementation's behavior and break your large heap request
into multiple subrequests. If previous allocation and
deallocation hasn't left the heap fragmented, back-to-back
allocations will all be contiguous: The last byte of one will
be just below the first byte of the next. This behavior is not
guaranteed by Borland, though, and may change in future
releases; similarly, if the heap is fragmented, back-to-back
allocations will probably not be contiguous. A better approach
is to restrict the size of the heap, and to use DOS services to
allocate memory outside of your .exe's memory map.

However you allocate it, you will still have to access it. In
real mode, this is simply a matter of understanding that the
segment part of a pointer is multiplied by 16 and added to the
offset part to obtain a linear address within the first meg of
memory. You can thus use a function like


function RealPtrTo(Base: pointer; Offset: LongInt): pointer;
{Note: This function has NOT been pulled from existing code
and has NOT been tested. JDS, 30 September 1994}
var Normal: record Segment, Offset: word; end;
begin
Normal.Segment := Seg(Base^) + Ofs(Base^) shr 4;
Normal.Offset := Ofs(Base^) and $000F;
{Normalise the Base pointer}
Inc(Offset, Normal.Offset); {# bytes from start of Base seg}
RealPtrTo := Ptr(Normal.Segment + Offset shr 4,
Normal.Offset + Offset and $0000000F);
end;

to generate a pointer to any byte within your huge data structure.
This pointer can then be used just as you use any other 16-bit
pointer, to address an up-to-64K window within your huge data.

Protected mode:
In protected mode, allocation is easy, and access is hard. Just
use GlobalAlloc() or GlobalAllocPtr() to allocate however much
space you need. (Well, if your program is running in Windows
standard mode, this had better be less than or equal to one
meg.)

Once you've allocated it, life continues to be easy - if you're
using 386 Enhanced Mode and a 32-bit compiler or assembler. The
selector you get from GlobalAllocPtr can be used with any
32-bit offset within the declared size of the heap block. If
you're using Standard Mode, or 16-bit compilers like TPW or
BP7, though, you'll have to work a bit.

To start with, you can't do segment arithmetic: segments have
been replaced with selectors, which are essentially indices
into a system-global table of allocated segments. Doing
arithmetic with selectors will either result in value that
points to the wrong selector or (more likely) produce an
invalid selector. In either case, using the resulting pointer
will probably produce a General Protection Fault.

This is a complicated subject that I've already covered
elsewhere (see http://www.armory.com/~jon/pubs/huge-model.html
for my PC Techniques article on huge model programming): All
I'll say here is that

1. You have to use SelectorInc to 'step' the selector from one
64K window to the next, and
2. You can't make a single reference that starts in one 64K
window and ends in the next.


_________________________________________________________________

Procedural Types

5.1: CAN I MAKE AN INDIRECT CALL TO AN OBJECT'S METHOD, USING A POINTER OR A
PROCEDURAL TYPE?

Yes, but you'll need to make aggressive use of casting, and to have
a bit of background on just what a method call is. While method
calls look and act very differently than normal calls -- the call
looks like a reference to one of the object's fields, and there's
the implicit with Self do that lets us refer to the object's fields
as if they were global variables -- at the level of words on the
stack they're not all that different from a normal procedure or
function call. All methods have an `invisible', or implicit,
parameter, var Self, after any regular, or explicit, parameters;
constructors and destructors also add an implicit word parameter
(the 16-bit VMT pointer) between the explicit parameters and Self.
Also, while constructors act as if they return a boolean, they
actually return a pointer which contains @ Self if Fail was not
called, and Nil if it was.

The implicit parameters and the special handling of constructor
results are the only differences between method calls and normal
calls: there's no magic involved. If we simply define a procedural
type, ProcType, that explicitly declares the method's implicit
parameters after any normal parameters, we can then use ProcType to
cast any pointer variable to a procedural variable. Once it's cast,
the pointer acts just like a normal procedural variable; we can
assign it to another procedural variable or use it to call a
procedure. Just as with a normal procedural type, the only
difference between a direct and indirect call lies in the way we
make the call: The parameters are pushed and popped in the same way;
the called code operates just the same; and indirectly called
methods have the same full access to their object's fields (through
the Self pointer) as directly called methods do.

Thus, if we have a method with no arguments and no results, we would
simply make the declaration type Niladic = procedure (var Self);. To
use it, we remember that we can only cast pointer variables, not
pointer expressions, and so do something like PtrVar := @
ObjectType.Method; Niladic(PtrVar)(Self); Now, while there is
something strange looking about a cast (in parentheses) followed by
an argument list (in parentheses), indirect method calls are
typically rare and concentrated in a few key routines, even in
programs that rely heavily on them. (My typical uses for indirect
method calls involve things like executing a list of object/method
pairs on every timer tick, or calling a window object's message
handler after DMT lookup reveals that it does have a handler.)
What's more, the strange look of an indirect method call does not
translate into strange object code: Using a cast to a procedural
type generates the exact same code as using an normal procedural
type, and that's both a little smaller and only slightly slower than
a normal, direct procedure or function call.

Methods that require parameters or that return results are only
slightly different than our Niladic example above. We simply have to
remember to put any explicit parameters before the implicit
parameter(s). Thus, we might use type SimplePredicate = function
(var Self): boolean; for a method that takes no arguments and
returns a boolean, and type UntypedDyadic = procedure (var A, B; var
Self); for a method that requires two untyped memory references.

Just as with a normal procedure call, the compiler will not let us
make an indirect method call with the wrong number or type of
arguments. This is obviously desirable behavior, but it's tempered
with a bit of a caveat: When we make a cast, we are effectively
telling the compiler that we know exactly what we are doing. If we
accidentally use a pointer to a UntypedDyadic method as a Niladic,
the compiler will neither require nor accept the two var parameters
to the UntypedDyadic method but the procedure will probably use them
and the result will not be pretty! Similarly, the compiler will not
complain if you cast a data pointer or the address of a near routine
into a procedural type: it will blithely generate code that will (at
best!) crash your computer.

This answer is based on my [jds] article Three Myths About Procedural
Variables which originally appeared in the Dec/Jan 1993 issue of PC
Techniques.
________________________________________________________________

Windows Sound Programming



6.1: WHERE CAN I FIND DOCUMENTATION ON WINDOWS SOUND PROGRAMMING?



For a start, try MMSYSTEM.HLP, in your \bp\bin directory.
(The BP7 install program creates an icon for this in the
Borland Pascal program group, but many people simply copy the
BPW icon to a working group, and zap the BP group. Then, when
they want to do some sound programming, they find there is no
mention of it in the online help file, and they don't know
where to turn.)

Unfortunately, MMSYSTEM.HLP only contains part of material in the
SDK's Multimedia Programmer's Reference. Piecing together the sequence
of steps to properly open a MIDI or WAV device from the help file can
be tough! I strongly recommend the SDK - or, better, the DevNet CD.
________________________________________________________

Analysis

. . .
It is observed that among his contemporaries, hardly anyone
could grasp his vision. Shivaji always tried to befriend the Hindu
Sardars. However, he could not garner support from the people of his
contemporary generation. All his Contemporary Hindu big shots were
serving Islamic empires and fighting against his Kingdom. They were
seeing a Hindu Kingdom coming into existence. However, they had
nothing to offer except jealousy. The New generation, however, was
heavily influenced by his work and his ideology. The proof for this
statement is that Aurangzeb could not defeat the Marathas in spite of
27-year long warfare.
Repeatedly he entered into treaty with Mughals, Adilshah,
Kutubshah, and Portuguese. However, he was never the first to breach
the treaty with Adilshah OR Kutubshah. His policy towards Mughals and
Portuguese was always that of adversary. He did not harm English and
French and was neutral towards them. His policy towards Adilshah and
Kutubshah was that of potential strategic partners. Adilshah never
accepted alliance of Marathas completely and chose suicidal path.
Kutubshah did and put up a united front against the Mughal onslaught.
Chhatrasaal Bundela was one of the many young men who were inspired
from Shivaji. He went on to liberate his own homeland, Bundel Khand
from Mughals. Sikhs were influenced by Maratha upheaval. Guru
Gobindsinghji came to Deccan for establishing contact with Marathas
but Aurangzeb gruesomely killed him in Nanded. It is unfortunate that
Maratha-Sikh relation could not develop.

Personal traits . . .
He was known to be very vigilant about honor of women; even
Persian documents praise him for this quality. His personal character
was very clean, quite anomalous with respect to his contemporaries.
It is a well-documented fact that he was tolerant towards masses of
all religions and never indulged himself in any of the heinous deeds
that the marauding Muslim and Christian forces had inflicted upon
India. It is proven by Shejvalkar, that although Shivaji was
courageous, he did not use horse as his frequent mode of
transportation. Usually, he used a Palaquin. Seven-Eighth of his
life, he spent on forts. The modus operandi of Shivaji and subsequent
Marathas involved thorough initial planning of the campaign,
accepting no more risks than are necessary, and as far as possible,
rarely indulging in personal adventures.
It is important to understand limitations of Shivaji and to
certain extent, subsequent Marathas. In 17th century, European rulers
had renaissance as their ideological backbone. Shivaji did not have
such ideological pool to derive inspiration. The Bhakti Movement was
one of the probable sources that might have influenced Shivaji in his
formative years. This differentiates Shivaji from Cromwell and
Napoleon. He was not a hedonist, nor a socialist. He never thought of
educating the downtrodden castes and reforming the Hindu society,
eliminating caste system. He never indulged in literacy campaign OR
establish printing press. He always purchased firearms from English
OR Dutch. It does not seem that Shivaji cared for the whereabouts of
white Europeans. Before his birth, Galileo had invented the
telescope, Columbus had discovered America, Magellan had
circumnavigated the globe, Issac Newton was his contemporary. Like
all great men, Shivaji was a product of his own time. His greatness
lies in his understanding of his contemporary time with all its
subtle undercurrents.

How Small Shivaji Was...
The first fact to strike is that he created a kingdom. There
must have been over 500 Dynasties in India. Each had a founder. One
among them was Shivaji. The rest had an opportunity to do so because
of the reigning confusion. Vassals of a weak King would declare
independence with the central power helpless to prevent it. A
powerful general used to dethrone a weak King and raise his own
Kingdom. This had been the usual way of establishing a new dynasty.
The new King inherited the existing Army and the bureaucratic
structure automatically. In Shivaji’s case however, we find out that
he had to raise everything from nothing, who did not have the benefit
of a ready strong army; who, on trying to establish himself, had to
face the might of Great Powers; with neighboring Bijapur and Golconda
powers still on the rise and the Moghul Empire at its zenith. Shivaji
was carving away a niche out of the Bijapur Empire that had
assimilated more than half of Nijamshahi and was on its way to
conquer entire Karnataka. Here is somebody who, from the start, never
had the might to defeat his rivals in a face-to-face battle, who saw
the efforts of 20 years go down the drain in a matter of 4 months;
but still fought on to create an Empire with 29 years of constant
struggle and enterprise. It would be easy to see how small he was
once we find which founder to compare him to in the annals of Indian
history, on this issue. A typical Hindu power had certain
distinguishing traits. It is not that they did not emerge victorious
in a war. Victories - there have been many. However, their victory
did not defeat the adversary completely. The latter’s territory did
not diminish, nor his might attrite. The victory rarely resulted in
expansion of Hindu territory. Even though victorious, Hindus used to
become weaker and stayed so. In short, it is plain that they faced
total destruction in case of defeat and high attrition in case of
Pyrrhic victory.
A new chapter in Hindu history begins with Shivaji wherein
battles are won to expand the borders while strength and will power
is preserved in a defeat. Secondly, the Hindu Rulers used to be
astonishingly ignorant of the happenings in neighboring Kingdoms.
Their enemy would catch them unaware, often intruding considerably
into their territory and only then would they wake up to face the
situation. Whatever be the outcome of the battle, it was their land
which was defiled. The arrival of Shivaji radically changes this
scenario and heralds the beginning of an era of staying alert before
a war and unexpected raids on the enemy. Thirdly, the Hindu Kings
habitually placed blind faith in their adversaries. This saga
terminates with Shivaji performing the treacherous tricks. It was the
turn of the opponents to get stunned. In the ranks of Hindu Kings,
the search is still going on for somebody to compare with Shivaji on
24
this point. . His lifestyle was not simple. Having adopted a choice,
rich lifestyle, he was not lavish. He was gracious to other
religions. On that account, he may be compared with Ashoka, Harsha,
Vikramaditya, and Akbar. However, all of these possessed great
harems. Akbar had the Meenabazaar, Ashoka had the Tishyarakshita.
Shivaji had not given free reign to his lust. Kings, both Hindu and
Muslim, had an overflowing, ever youthful desire for women. That was
lacking in Shivaji. He had neither the money to spend on sculptures,
paintings, music, poetry or monuments nor the inclination. He did not
possess the classical appreciation needed to spend over 20 crores to
build a Taj Mahal as famine was claiming over hundreds of thousands
of lives; nor was he pious enough to erect temple after temple while
the British were systematically consuming India.
He was a sinner; he was a practical man like the rest of us.
Khafi Khan says he went to Hell. He would not have enjoyed the
company of the brave warriors who preferred gallant death to
preservation of their land. It would have ill suited him to live with
the noble Kings who would rather indulge in rituals such as Yadnya
than expand the army. For the Heaven is full of such personalities.
Akbar adopted a generous attitude towards Hindus and has been
praised for that. However, it is an elementary rule that a stable
government is impossible without having a contented majority. Akbar
was courteous to them who, as a community, were raising his kingdom
and stabilizing it for him. The Hindus he treated well were a
majority in his empire and were enriching his treasury through their
taxes. The Hindus had no history of invasions. They had not destroyed
Mosques. They were never indulged in genocides against Muslims. They
had not defiled Muslim women nor were they proselytes, as compared to
Abrahmic fanatics found in Muslims and Christians. These were the
people Akbar was generous to. On the contrary; Muslims were a
minority community in Shivaji’s Empire. They were not the mainstay of
his taxes. They were not chalking out a Kingdom for him. Besides,
there was a danger of an invasion and Aurangzeb was imposing Jiziya
Tax on Hindus. Yet, he treated Muslims well. That was not out of fear
but because of his inborn generosity.
Shivaji's expertise as a General is, of course, undisputed.
However, besides that, he was also an excellent Governor. He believed
that the welfare of the subjects was a responsibility of the ruler.
Even though he fought so many battles, he never laid extra taxes on
his subjects. Even the expenditure for his Coronation was covered by
the taxes on the collectors. In a letter he challenges, "It is true
that I've deceived many of my enemies. Can you show an instance where
I deceived a friend?" This challenge remains unanswered.
25
He funded establishment of new villages, set up tax systems on
the farms, used the forts to store the farm produce, gave loans to
farmers for the purchase of seeds, oxen etc, built new forts, had the
language standardized to facilitate the intra-government
communication, had the astrology revived and revised, encouraged
conversion of people from Islam to Hinduism. He was not a mere
warrior. Moreover, he believed that charity begins at home. His
brother in law, Bajaji Nimbalkar, was forcibly converted to Islam. He
called for a religious council and had him reconverted to Hinduism.
He reconverted many people who were forcibly converted to Abrahmic
faiths, Islam OR Christianity. Even after conversion, when nobody was
ready to make a marital alliance with Bajaji’s son, Mahadaji, Shivaji
gave his own daughter to Bajaji’s Son in marriage, and set an example
in society.
Secondly, and most important of all, to protect his Kingdom, his
subjects fought for over 27 years. After Shivaji's demise, they
fought under Sambhaji. After Aurangzeb killed Sambhaji, they still
fought for over 19 years. In this continued struggle, a minimum of
500,000 Moguls died (Jadunath Sarkar's estimate). Over 200,000
Marathas died. Still in 1707, over 100,000 Marathas were fighting.
They did not have a distinguished leader to look for inspiration.
There was no guarantee of a regular payment. Still, they kept on
fighting. In these 27 years, Aurangzeb did not suffer a defeat. That
was because Marathas simply lacked the force necessary to defeat so
vast an army. Jadunath says, "Alamgir won battle after battle.
Nevertheless, after spending crores of rupees, he accomplished
nothing, apart from weakening his All India Empire and his own death.
He could not defeat Marathas". When the Peshawai ended
(A.D.1818), there was an air of satisfaction that a government of law
would replace a disorderly government. Sweets were distributed when
the British won Bengal in Plassey (A.D.1757). Where ordinary man
fights, armies can do nothing. In long history of India, Kalinga
fought against Ashoka. After Kalinga, Maharashtra fought with Mughals
from grass-root level. The greatness of Shivaji lies here in his
ability to influence generations to fight for a cause.
Why was Shivaji successful in making common man identify with
his kingdom? The first reason is his invention of new hit and run
tactic. He showed people that they can fight Mughals and win. The
insistence was always on survival and maximum attrition of enemy in
his territory and successful retreat. He gave his men the confidence
that if they fight this way, they will not only outlast the Mughals,
but also defeat them. He gave way to traditional notions of chivalry
and valor on battlefield, for which Rajputs were famous. Instead, he
focused on perseverance, attrition, survival at all costs, series of
tactical retreats and then finishing off the foe. His land reforms
26
were revolutionary which further brought his subjects emotionally
closer to him. He took care of their material needs, which is of
utmost importance. He started the system of wages in his army. And
third reason is Hindu Ethos and hatred towards Muslim supremacy
prevalent in masses. In this light, the above facts demonstrate the
excellence of Shivaji as founder of a dynasty, which ended political
supremacy of Islam in India.

Conclusion . . .
Shivaji fits in all the criteria of Chanakya’s ideal King.
Considering the prevalent socio-political scenario, it is fallacious
to try and fit Shivaji in classical Kshatriya values of chivalry and
nobility. Shivaji was religious; but he was not a fanatic. Although
ruthless and stubborn, he was not cruel and sadist. He was
courageous, yet not impulsive. He was practical; but was not without
ambition. He was a dreamer who dreamt lofty aims and had the firm
capacity to convert them into reality.
Shri. Narahar Kurundkar

Epilogue on Coronation Controversy . . .
There have been few controversies existing regarding the
Coronation of Chhatrapati Shivaji Maharaj.
This controversy has been fueled and used to create the famous
Brahmin-Maratha dispute in Maharashtra. I strongly oppose such
mischief mongers and believe that both these communities are pillars
of Maharashtrian society and need to move ahead hand in hand.
While criticizing any historical personality, I think, we must
think from the reference frame existing during that time. Trying to
apply present values and understanding of ethics to the people of
past is a big fallacy and nothing is more misleading and specious
than this.
The controversy arose due to following reasons.
Firstly, according to Hindu theology, in kali-yuga, there are
only 2 varnas; Brahmins and Shudras. There are no Kshtriyas and
Vaishyas. The opposition of Brahmins to recognize Shivaji as a
Kshatriya has the roots in this deep rooted belief. Shivaji proved
his descent by tracing his lineage to Sisodiya Rajputs of Rajasthan.
In fact, this was done by Shahaji itself in 1630's.
The Second issue was- Many Brahmins in past, like Krishnaji
Bhaskar emissary of Afzal Khan, were killed by Shivaji himself. It is
a well known fact that Brahma-Hatya (Murder of Brahmin) is one of the
biggest sins that are described in Hindu theology. No one was
supposed to kill a Brahmin. Since Shivaji had killed Brahmins,
according to theology, it was a crime with no Prayashchitta
(repentance ritual). But, Gaga Bhat being an authority on Vedic
literature argued that there were some repentance rituals which were
described in scriptures which could wash the sin of a man who had to
kill a Brahmin in extreme situations. Also, he reasoned that since
Brahmins that were killed by Shivaji were not practicing Brahmins,
but were just by birth, it is possible to have a repentance ritual
for the killings of Brahmins in such cases.
29
Thirdly, for being a Kshatriya OR Brahmin OR Vaishya, one has to
be a Dwija (twice born). According to Hindu theology, man comes to
birth on second instance when he has performed the thread ceremony OR
Upanayan Sanskar. After that ceremony, man enters Brahmacharya-
Ashram. After this stage, he can marry and enter Grihastha-Ashram.
Shivaji was already married to 8 ladies. So he entered Grihastha-
Ashram without going through Brahmacharya-Ashram and was an immoral
act according to scriptures. This was a technical fault. So thread
ceremony was performed on Shivaji and he formally became a
Brahmachāri. Then he remarried to his wives again and formally became
a Grihastha. Now he was eligible to be Coronated as a King.
After he became a Coronated King, he was conferred the authority
OR the Raja-Danda to punish Brahmin culprits to death as well. No sin
whatsoever, as a Coronated King is considered an incarnation of Lord
Vishnu himself.
Shivaji performed all these ceremonies and rituals of repentance
and others elaborately. There were too many rituals to perform.
Hence, it was a bit costly affair. He recovered the money by looting
Mughal treasury soon after the Coronation. He also levied a surcharge
over the Feudal Lords. He did not levy a single penny extra tax on
the common man.
Today, we may laugh on this ritualistic society. But at that
time, it was the norm of society. Shivaji himself abided to it. Hindu
society had become too rigid and ritualistic. And don't forget, this
was a revolutionary thing happening. It was something that was
unheard of in real life. It was heard only in myths and tales. It
takes time for a Rigid Society to accept this change. But the work of
Shivaji and authority of Gaga Bhat were in favor of this very
aberrant ceremony. Hence it was materialized.
We should not forget the ritualistic society that existed then,
and was at its lowest ebb due to Islamic supremacy.
Maratha movement was a part of overall Hindu revival. Everybody
in this world is motivated by selfish reasons. But, along with the
ambition to establish an Empire, their ambition also was to end the
socio-political Islamic Supremacy in India. Although they lasted for
170 years, from 1645-1818, they succeeded in loosening and throwing
30
the shackles of Islamic supremacy to a very large extent. Sikhs,
Ahoms, Jats, later Rajputs, Bundelas and many others were also an
important part of this overall Hindu Revival.
People from different states refuse to acknowledge this fact. It
is pity that many people from other states feel Mughals were much
closer to them than Marathas. This is partly because of certain illdeeds
of Marathas themselves.
The contribution of Marathas towards nationalistic Hindu Revival
was rarely understood in medieval days. And it is misunderstood in
this era by many people of other states.
I think, we need to polish and present our image in history with
vehemence so that we can give our ancestors due credit...

Shivaji and Navy

. . .
Shivaji started building his own naval forces since 1656, well
before he killed Afzal Khan. This explains the canvass of his vision.
Maratha-Portuguese relations were always strained. The decision of
Shivaji to build a navy was essentially to contain European forces.
Portuguese authorities issued orders to be wary of the Maratha Navy
from 1659. After the great Ramraja Chola of 11th century, no Indian
dynasty gave importance to the Navy. Vijaynagar, Adilshah, Kutubshah,
Nizamshah, Mughals were seeing the increasing Portuguese influence.
However, no one treated Navy as essential component of their armed
forces. The Construction of Naval forts like Sindhu-durga in 1664,
Vijay-durag, and Khanderi-Underi, his naval conquest of Basnoor and
Gokarna in 1665 are of immense importance while trying to grasp the
personality of this man. Portuguese had issued Inquisition in Goa and
were forcibly converting Hindus to Christianity, well before
Shivaji’s birth. He defeated Portuguese for the first time in 1667,
and Sambhaji and later the Peshwas continuously perpetuated his anti-
Portugal policy. The reasons of this policy were not only political,
but theological too. English were not a considerable force at the
time.

Death

. . .
Shivaji’s last days were marred with few internal conflicts
between his council of ministers and his son. The Chief of Army
HambirRao Mohite backed Sambhaji, while the other ministers backed
his wife Soyarabai’s claim that Rajaram be named as successor of
Shivaji. Moreover, at this very time, Shivaji was a patient suffering
from Bloody flukes, and Mughal armies were gathering on the
Frontiers. His cremation was not carried out on all its decorum,
because, the Maratha-Mughal clashes began in that very week. Later,
Sambhaji performed all the rituals with funeral games lasting for 12
days. He died on 3rd April 1680.

The Conquest of South

. . .
He undertook the conquest of south in 1677 and carved a Maratha
empire in Southern Karnataka and Tamil Nadu. This was the pinnacle of
his tactical, strategic, diplomatic and military achievements. In
doing so, he entered into a strategic alliance with Kutubshah. He
also persuaded Adilshah the importance of a United Deccan Front
against impending Mughal invasion, a vision that was long propounded
by his father, Shahaji.

Coronation

. . .
In 1674, Shivaji successfully proved his Kshatriya descent using
the documents that his father had already attested through Adilshahi
government. He performed all sorts of rituals, thread ceremony,
marrying his own wives again. That was the time when religion was
very much influential.
According to Hindu theology, Coronation OR Rajya-Abhishek is a
holy ceremony of immense socio-political importance. King being
incarnation of Vishnu, his land was his wife, and all his subjects
were his children. An authorized OR Coronated King was an incarnation
of Vishnu himself.
By that time, the mentality of a common Hindu in India was that
ruler is always a Muslim. In addition, ruler of Delhi was considered
as Emperor of India. The Bahamani Kingdom, at its zenith, considered
themselves as Vazirs of Delhi Sultanate, who in turn considered
himself as subordinate of Caliph. Since the rulers were Muslims,
Indian Muslim Emperors usually portrayed India as a part of Islamic
Caliphate. Allah-ud-din Khilji had his rule attested from the ruler
of Iran. Aurangzeb had his rule on India attested from the Caliph of
Ottoman Empire in Turkey. Even Adilshahi, Kutubshahi considered ruler
of Delhi as Emperor of India. There were many Rajput Hindu Kings
before Shivaji. However, no one had himself Coronated according to
Vedic tradition. Even the mighty Hindu Vijaynagar Empire did not have
a King that was Coronated according to Vedic Tradition. This very
ancient ritual of Rajya-Abhishek had disappeared from India after
1000 AD. People knew of this ritual only from stories in the Ramayana
and Mahabharata.
Gagabhat resurrected this ritual again after studying Vedic
literature and Coronated Shivaji. This was a revolutionary event,
considering the rigid religious society existing at the time. On one
had, Shivaji was relating himself with Rama, Yudhishthira and
Vikramaditya. On other hand, he was appealing to emotions of all
Hindus in India, stating that they have a Formal Hindu Empire in
India, which was fighting for the cause of Hindus. According to Hindu
Puranas, the lineage of Kshatriya Kings was lost in Kaliyuga. By
performing this ritual, Shivaji was symbolically stating that
Kaliyuga was over and Satya Yuga had begun. He was making a statement
that a new age had begun.

The Revival

Shivaji laid low for 3 years after his escape from Agra.
Meanwhile, he implemented various land reforms in his lands. Shivaji
and his minister Annaji Datto were the main pioneers of the land
reforms introduced. He started the practice of giving regular wages
to soldiers. From 1669 onwards, he unleashed himself on Mughal and
Adilshahi territory in Maharashtra. His revival was further
instigated by growing fanaticism of Aurangzeb shown by his
destruction of Hindu temples like Kashi Vishweshwar and Mathura and
countless others along with imposition of Jiziya Tax on Non-Muslims.
He not only regained the lost territory but also conquered new one.
The expansion of Maratha state was alike in land and sea. Entire
western Maharashtra, parts of Southern Gujarat and Northern Karnataka
were brought under Maratha dominion. Land reforms were introduced
which increased his popularity amongst the masses immensely. At the
time of his coronation in 1674, his influence was substantial enough
for others in India to recognize him as a formidable power.
Especially, his rebellion against Aurangzeb made him a hero amongst
the new generation of Hindus.

Rajput - Mirza Raja Jaisingh

Most of the contemporary chroniclers have taken for granted the
soft corner for Shivaji in Mirza Jaisingh’s heart. There are about 26
letters available, which suggest that Jaisingh was one of the most
trusted generals of Aurangzeb. After defeating Shivaji, it was
Jaisingh’s suggestion that Shivaji be called to Delhi. Aurangzeb
accepted it. It was Jaisingh’s suggestion that Shivaji be kept in
house arrest. Aurangzeb accepted it. It was Jaisingh’s suggestion
again that he must not be harmed, for any injury to his health may
culminate into a rebellion amongst recently subdued Marathas. It was
Jaisingh’s reasoning that Shivaji be kept as captive in Delhi to
blackmail Marathas, but must not be harmed. Aurangzeb accepted this
suggestion too. Later, he has publicly admitted the folly of his of
accepting this particular suggestion of Jaisingh. Aurangzeb was in
favor of killing off Shivaji. Jaisingh shows a complex mixture of
emotions when it comes to Shivaji and Sambhaji. He was seeing a Hindu
state coming into existence in spite of all odds. Nevertheless, he
was a faithful servant of Aurangzeb.
It was not very sensitive of Jaisingh to keep nine-year-old
Sambhaji as captive in his camp until all the terms of the Maratha -
Mughal treaty were implemented. As a politician, Jaisingh was brutal
and ruthless. However, he had an emotional side as well. It is
documented that both Shivaji and Mirza Jaisingh had deployed
mercenary assassins to finish each other. However, both failed.
The clauses of the treaty were also quite harsh on the part of
Marathas. Shivaji had to cede 23 forts and region giving revenue of
400,000 rupees to Mughals. Shivaji was left with 12 forts and region
of 100,000 rupees. Shivaji had to accept supremacy of Aurangzeb and
forced to serve Aurangzeb as an ordinary Jagirdar. Shivaji and
Marathas were practically finished, thanks to the shrewd politics of
Jaisingh and Aurangzeb.

Shaistekhan

This is yet another example of Shivaji’s cunningness. Shivaji
had defeated a few of Shaistekhan’s generals, namely, Kartalab Khan,
and Namdar Khan. However, the pinnacle was the surprise attack on
Shaistekhan in Mughal stronghold, in his bedroom! Shivaji chose the
month of Ramadan to attack Shaistekhan. Shaistekhan was staying at
Lal Mahal, which was childhood home of Shivaji. Therefore, he knew
everything there was to know about the place. Less than 100 men, led
by Shivaji, attacked this palace, which was surrounded by Mughal army
as strong as 150,000 in pitch darkness of 7th night of Ramadan. It
was a total frenzy. In the darkness, Shivaji and his men were killing
anybody who came in their way. About 50 Mughal soldiers, 6 elite
women, 6 common women, many eunuchs, Shaistekhan’s son, his son in
law, some of his wives, and daughter in laws were killed in this
attack. Shaistekhan was attacked in his bedroom and lost his three
fingers. He escaped, however. Shaistekhan was attacked in April 1663.
He stayed in Pune for 6 months and tried to whitewash his failure.
But, to no avail. In December, Aurangzeb transferred Shaistekhan to
Dhaka as governor of Bengal.

Shaistekhan and Surat . . .
It is possible to stun the world around you by doing something
extraordinary. All the magicians do that. However, that was not the
business of Shivaji. The period, for which the world has been
stunned, Shivaji retained his poise and did something extraordinary
which used to, gave him a lasting success. After the defeat of Afzal
Khan, he went on to conquer Konkan, South Maharashtra and forayed up
to the region as deep as Bijapur. After attacking Shaistekhan, he
retook the lost Konkan. It was his political understanding that he
used to attain lasting success by a swift campaign followed by a
stunner. Shaistekhan tried to contain Shivaji for 6 months, but to no
avail. Aurangzeb had no issues with surprises, but what next? This
was his realistic question. Shaistekhan left for Bengal in December
1663, and in January 1664, Shivaji plundered Surat. If Afzal episode
gave Shivaji a pan-Indian popularity, this task of looting Surat made
him an international celebrity where he was discussed in all the
Muslim and a substantial part of the Christian world. With this act
he formally declared war on Aurangzeb.

The escape

Shivaji is one of the most enigmatic person and King in Hindu
history. His friends could not understand him. His enemies could not
understand him too. The only person in those times, who could
understand Shivaji, was Aurangzeb. It was the vision of Aurangzeb
when he predicted the danger that Shivaji can be as early as 1646,
when he was governor of Deccan in his first term. During his second
term as governor of Deccan, Shivaji plundered Mughal territory of
Junnar and Bhivandi in early 1650’s. These forays of Shivaji
coincided with Shahjahan’s ill- health. Hence, Aurangzeb had to
return to North to participate in the battle of succession with his
brother Dara. Nevertheless, he warned Adilshah and Kutubshah about
this upcoming danger of Shivaji. Shivaji again entered a treaty with
Mughals in June 1659, to deal with impending Afzal Invasion. At the
same time, Shaista Khan, maternal uncle of Aurangzeb, was appointed
as governor of Deccan. By that time, in late 1659, Siddhi Jauhar,
Adilshah’s last attempt to control Shivaji, had cornered Shivaji in
Panhalgadh. Taking advantage of this, Shaista Khan invaded the
Maratha state, occupied Pune, and besieged the ground fort of Chakan.
However, Shivaji escaped from Panhalgadh to Vishalgadh in July
1660, due to valiant effort of his 600 men, most of which died in
order to keep Shivaji safe. The hero of the battle was Bajiprabhu
Deshpande, who is immortalized for his sacrifice in the pass of Pavan
Khind. Figuratively, the battle of Pavan Khind can be compared with
the Battle of Thermopylae fought in 480 BC. 300 Greeks and 900 others
under the Spartan King Leonidas defended the pass for 3 days against
large Persian army under Xerxes. Coincidently, even Bajiprabhu had
300 men to defend the pass against 10,000 Adilshahi forces. The
battle of Pavan Khind is excellent example of superior use of terrain
to the benefit of a small but disciplined army. They held on until
the signal of Shivaji’s safety arrived. All of them were slain
thereafter.

Afzal Khan

This is one of the most dramatic moments in Shivaji’s life that
gave him pan-Indian fame. Shivaji began his work in 1645. He defeated
Adilshah in 1648 and after the treaty, Afzal Khan was appointed as
Subhedar of Vai in 1649. Shivaji conquered Jaavli in 1656
nevertheless. Given this background, Afzal was marching to destroy
Shivaji. There is an added perspective to this relation as well.
Shivaji’s elder brother, Sambhaji, was killed in battle due to
treachery of Afzal Khan in early 1650’s. Shivaji had pledged to kill
Afzal Khan as a vengeance. Therefore, there was a personal touch to
this struggle as well.
Afzal Khan was aware of Shivaji’s valor and courage; his record
of deceit, his pledge to kill him for settling the score. Afzal
himself was valiant and master of all deceitful tactics. He had a
record of being ever alert. Yet, it is an enigmatic choice to make on
his part to leave his army behind and meet Shivaji alone. Certain
Persian documents suggest an explanation stating that it was Jijabai,
Shivaji’s mother, who guaranteed safety of Afzal Khan. It was a
notion that his mother heavily influenced Shivaji. No one knows
exactly what happened in that meeting. Shivaji had planned this
strike for almost 4-5 months. Afzal was just an opening move in his
campaign. It was a plan of Shivaji to kill Afzal and establish terror
in the mind of Adilshah. Many Marathi records state that it was Afzal
who struck first. However, this is not definitive, looking at the
depth of planning by Shivaji that preceded it. It was in plans of
Shivaji to finish Afzal Khan. Therefore, who struck first is a matter
of speculation, given Afzal’s infamous and felonious record of
deceit. Shivaji had planned his entire expedition taking death of
Afzal for granted.
Afzal wanted to avoid Jaavli, but Shivaji’s moves forced him to
enter the difficult terrain. In May-June 1659, Adilshah issued orders
to all the local zamindars to help Afzal. However, most of the
deshmukhs in the region backed Shivaji. The main collaborator of this
alliance was Kanhoji Jedhe, a special man of Shahaji. Thus, here
again we see the influence of Shahaji working in favor of Shivaji.
The local Zamindars preferred to fight for Shivaji and refused to
cooperate with Adilshah is itself testimony to this fact. Shivaji’s
stature had not grown so much yet to influence the decision of
masses. The basic outline of Shivaji’s strategy was -
To Kill Afzal Khan at Pratapgarh in the meeting OR in the
battle that would follow.
Destruction of his army stationed at the base of Pratapgarh by
Armies of Silibkar and Bandal.
11
Destruction of Afzal’s troops on Jaavli-Vai road by Netaji
Palkar.
Destruction of Afzal’s armies in the Ghats by Moropanta
Pingle.
Subsequent hot pursuit of fleeing Adilshahi forces.
To capture Panhalgadh and Kolhapur and Konkan, and invade the
territory in Karnataka up to Bijapur as soon as possible.
This entire strategy was planned for 3-4 months. This was a huge
campaign. Shivaji was not a fool to waste all this planning. Shivaji
had planned the killing of Afzal. Who struck first in that meeting is
speculative. Nevertheless, looking at this holistic planning, I think
it did not matter to Shivaji whether Afzal struck first OR not. Afzal
was infamous for many such deceitful killings in his life. Therefore,
given his past record, it is not garrulous to assume that Afzal
struck first. However, nothing definitive is known about it. The
weapon used by Shivaji, according to Marathi resources, was Tiger-
Claw and a curved Dagger, Bichwa. It is possible that even a Sword
was used.
Dutch reports state that while Shivaji was advancing towards
Bijapur after Afzal’s defeat, even his father Shahaji was approaching
Bijapur with huge army simultaneously. Thus, we can see the plan on a
grand scale. However, somewhere, something went wrong. Shivaji’s
forces came as close as 16 miles from Bijapur and waited for three
days. Shahaji’s forces from Karnataka reached 5 days late and
returned from 20 miles. (It is said that) Certain Persian documents
buttress this Dutch claim. Thus, one of the delicately planned
campaigns was not completed to its fullest. This is last reference of
Shahaji in Shivaji’s political life. Hereafter, Shivaji grew without
support OR shadow of his father. Adilshah sent Rustum-e-jaman to
destroy Shivaji. However, for the first time, Shivaji entered into a
classical head-on cavalry charge, and completely out maneuvered and
defeated Adilshahi forces 10,000 strong. Shivaji had 5000 horses at
his command.

A turning point

Jaavli’s conquest is of prime importance, to grasp the vision of
Shivaji. This region was so difficult to conquer that Malik Kafur,
who defeated the Seuna Yadav Dynasty of Devgiri in the 13th century,
lost 3000 men in the attempt. Mahmud Gavan too was defeated while
conquering this region. It was one of the most isolated regions in
entire India, and remained aloof from Muslim dominance throughout
history. Shivaji maintained an amicable relationship with Chandrarao
More of Jaavli. Chandra Rao was a title given to the Ruler of Jaavli.
The real name was Daulat Rao More. After death of Daulat Rao, Shivaji
made Yashwantrao as ruler of Jaavli. These events are of 1647, when
Shivaji was 17. Here again we see the vision of his father working.
Later, in 1649, Afzal Khan was appointed Subhedar of Vai region, to
mitigate the growing influence of Shivaji in Jaavli. Mohammad
Adilshah was ill; Afzal Khan was busy in Karnataka expedition. Taking
advantage of this situation, Shivaji attacked Jaavli in 1656 and
conquered it in one stroke. Yashwantrao fled to Raigadh, which
Shivaji subsequently captured after three months. Yashwantrao was
captured and sentenced to death for his activities against Maratha
State and Shivaji proclaimed assimilation of Jaavli in his Kingdom.
Strategically, this valley is of immense importance as it oversees
the routes into Konkan and Goa.

Sambhaji

Whether Sambhaji consumed alcohol? Was he charged for rape of a
woman? Was he involved in orgies with women? Can his behavior with
Soyarabai, Moropanta, Annaji Datto, be justified? All these questions
are difficult to answer and are muddled in mutually contradictory
dubious claims. The personal qualities are anyways not of any use
while determining the greatness of an individual in politics.
Shivaji arrived at the conclusion that Maratha state will have
to fight a decisive war with Mughals, somewhere in 1660-1664. He knew
that the Shaistekhan campaign was just a beginning. Mughals had
started deploying their armies on the frontiers of Maratha Kingdom in
Maharashtra, Gujarat, and Madhya-Pradesh since 1679. The news that
Aurangzeb himself is coming to invade Deccan reached Maharashtra in
January 1680, just 2-3 months before death of Shivaji. By that time,
Mughals had already deployed 150,000 to 200,000 men. The clashes
began in the very week Shivaji died. Moropant Pingle (the Peshwa),
Hambirrao Mohite (chief of armed forces), Annaji Datto (head of
finance department) were preparing to face this impending invasion.
Since 1678, Shivaji was continuously purchasing weapons, firearms,
and was upgrading his armies, his forts and his navy in anticipation
of this final showdown.
This much-anticipated invasion started in 1681 with 250,000 men,
new king, and opponent Aurangzeb himself with all the might of Mughal
Empire behind him. In spite of this, the continuous warfare from 1681
to 1685 resulted in retreat of Mughals from Maratha territory and
redeployment of troops against Adilshah and Kutubshah. All
capabilities of Sambhaji in his territorial administration, his
strategic understanding, his ability to boost the morale of troops,
his ability to make right moves were at stake and were thoroughly
tested and sharpened. Shivaji never had to face such an enemy in his
entire lifetime like Sambhaji. This feat demands immense patience and
will power. Therefore, given the fight that Sambhaji put forth,
should we give weight age to adjectives like frivolous, incapable,
impatient, and all other jargons used by Marathi chroniclers OR the
adjectives used by Dutch and English as patient, and stubborn warrior
is an individual choice.
The personal character of Sambhaji was not that bad either, as
against that portrayed by some Bakhars. Many a Maratha Sardars were
mildly addicted to alcohol, hemp, opium etc. Rajaram, second son of
Shivaji, was highly addicted to opium.
Aurangzeb himself was addicted to alcohol until his death.
However, that never interfered with politics. Aurangzeb captured and
brutally murdered Sambhaji in 1689. By that time, the result of
warfare was as follows- Sambhaji had conquered three fourth of
Portuguese Empire in Goa and assimilated it into Maratha state. The
region in Karnataka under Maratha rule doubled. The Maratha army
doubled itself in numbers and became better equipped. Five-six forts
in Maharashtra were lost. Gained three-four new ones; Aurangabad,
Burhanpur, Goa, plundered. Dhanaji Jadhav illusively kept the Mughal
army, 75,000 strong, away from Maharashtra in Gujarat. Thus, we can
see Shivaji’s understanding of politics inherited in Sambhaji.

Shahaji

Shahaji was a Sardar in Nizamshah’s court at Ahmednagar.
Nizamshah willingly sacrificed Lakhuji Jadhav for Shahaji. Yet,
Shahaji went to Adilshah in 1624. Despite of valiantly fighting for
Adilshah for two years, he returned to Nizamshah in 1626. He again
changed his loyalties and became Mughal Sardar in 1630. Yet again,
after valiantly fighting for Mughals, he returned to Nizamshah in
1632. In all these transitions, he maintained his Jagir in Pune at
his discretion. He maintained an army that was loyal to him and him
alone, irrespective of the power he was serving. He initiated the
policy of uniting Deccan against North Indian Mughals. Many notable
people like Khavaskhan, Kutubshah, Madanna and Akanna of Golconda,
Murar Jagdev supported this united Deccan policy that Shahaji
initiated. Shivaji repeatedly pronounced this policy. Sambhaji
considered himself as a patron of Adilshah and Kutubshah.
Shahaji appointed Dadoji Kondadev, as his chief administrator of
Pune Jagir. He himself was administrating his Jagir in Bangalore,
Karnataka. It was his vision that he distributed his property between
two sons in 1636. The Karnataka Jagir was for elder son Sambhaji and
Pune Jagir for younger son Shivaji. He made Adilshah to appoint
Dadoji Kondadev as Subhedar of Pune and gave him control of some army
(about 5000 strong) 15-20 forts, and entire administrative personnel
in the form of a Peshwa, an accountant and others. Shivaji took his
oath on Rohireshwar of establishing a Hindavi Swarajya in presence of
Dadoji. The first letter bearing the official seal of Shivaji is
dated 28th January 1646. It is difficult to comprehend that young
Shivaji who was a teenager of 15 years, had all this blueprint of
establishing a Hindu Swaraj along with seals and official letterheads
in his mind. One has to accept the vision and power of Shahaji that
was guiding him, correcting him and shaping him.
Shahaji was carving a kingdom of his own in Karnataka. He was
doing exactly the same thing through Shivaji in Maharashtra as well.
At both places, the administrators, Shahaji in Bangalore and Shivaji
in Pune were calling themselves as Raja, were holding courts, and
issuing letters bearing official seals in Sanskrit. Adilshah was
weary of this and in 1648; two independent projects were undertaken
by Adilshah to eliminate these two growing kingdoms in its territory.
Shivaji defeated Adilshah’s general Fateh Khan in Pune, Maharashtra.
At the same time, his elder brother Sambhaji defeated Adilshah’s
other general Farhad Khan in Bangalore. The modus operandi of Maratha
troops on both the frontiers is similar, again reinstating the
guiding vision of Shahaji. The subsequent treaty that was signed
between two Bhonsale brothers and Adilshah to rescue Shahaji, who was
held captive by Adilshah, marks the first Mughal-Maratha contact. In
8
1648-49, Adilshah captured Shahaji in order to blackmail his two sons
to cede the territory conquered by them and accept Adilshah’s
supremacy. Shivaji wrote a series of letters to Dara Shikoh (Subhedar
of Deccan), pledging to be subservient to Mughals. Mughals recognized
Shivaji as a Mughal Sardar and pressurized Adilshah to release
Shahaji. In return, Shivaji ceded Simhagad, and Sambhaji ceded
Bangalore city and Kandarpi fort in Karnataka.
We can see the coherency in actions of Shivaji and Sambhaji. The
men assisting both the brothers were loyal to Shahaji and were
trained under him. Even though Shivaji was administrative head of
Pune Jagir, many people appealed to Shahaji against Shivaji’s
decisions up to 1655. Up to this point, Shahaji’s word was considered
final in all of the important matters. Until this point, Shivaji was
not at all free to take all the decisions on his will. There was a
higher power that was controlling his activities. Gradually after
1655, this interference went on diminishing, and Shivaji started
emerging more and more independent.
Thus, if we see these three men in a link, Shahaji, Shivaji and
his son Sambhaji, all the actions of Shivaji start making sense. In
this way, we are better able to grasp the greatness of the man,
Shivaji.
Shivaji had himself coronated as a Kshatriya King in 1674.
Shahaji initiated this policy. The Ghorpade clan of Marathas
considered themselves as descendents of Sisodiya Rajputs. Shahaji
attested his claim on the share in Ghorpade’s property from Adilshah
long before 1640. In reality, there is no connection whatsoever
between Sisodiya Rajputs and Bhonsale clan. Nevertheless, Maloji
started calling himself as Srimant Maloji Raje after becoming a
bargir. Shahaji legalized this claim of being a Rajput from Adilshah.
This was of great help to Shivaji at the time of his coronation in
1674. It is interesting to see that even after coronating himself as
a Hindu Emperor, Shivaji continued writing letters to Aurangzeb,
referring him as Emperor of India, and stating that he was a mere
servant of Great Aurangzeb. We can see the basic pragmatic mindset of
Shivaji which was fueled by great dream of establishing Hindu Self
ruling state.

Chhatrapati Shivaji Maharaj - Introduction

The Character of Shivaji is one of the most enigmatic
characters in the history of India. There are people who deify him
and put him on the pedestal of god. Few of them are on the way of
declaring him as an incarnation of Lord Shiva. Many myths are now
associated with him. Many others view that he was a mere local
Maratha chieftain who was rebelling against the Mughal Empire and
completely overlook the role he played in Hindu revival in India.
Many others, who cannot comprehend the pragmatic approach of Shivaji,
which was most practical given his humble beginnings, brand him as a
mere plunderer and looter and equate him with ordinary dacoits.
Between these two poles of emotions, Shivaji, the man, is on the
verge of extinction. This is an attempt to resurrect him.
In the process of understanding Shivaji, few events need to be
understood. In the long list of those events, first one is about his
grandfather, Maloji Bhonsale and his great grandfather Babaji
Bhonsale. Documents suggest that Maloji was a Jagirdar of Pande-
Pedgaon. He inherited substantial part of his jahagir. Shahaji was
born in 1602, Maloji died in 1607 in the battle of Indapur. Shahaji
was 5 years old when this tragedy struck. Maloji, at the time, was a
Bargir serving Lakhuji Jadhav of Sindkhed Raja, a place in central
Maharashtra.
Jijabai gave birth to six children. First four did not survive.
Fifth and sixth were Sambhaji and Shivaji respectively. Shivaji’s own
marital life was not very different from his father. He never gave
importance to any of his queens and rarely entertained their
interference in politics. He performed all the duties as a husband
and kept his wives in as much comfort as possible, but no importance.
To study Shivaji, we need to view him as a part of a chain of
three men constituting his father Shahaji, he himself, and his son,
Sambhaji. Without understanding the other two, one cannot hope to
comprehend Shivaji.

Before Buddha what is the religion of people?

Before Buddha what is the religion of people?

Answer:-- Basically religion is meant for converting vicious-prone man of animal culture into virtuous man. Buddha's Dhamma is complete research of Buddha for the welfare and peace of human beings on the earth.Before Buddha it was rather animal culture in large extent. There was Vedic religion, the religion of superstition, praising of non-existing god, rites, rituals, sacrifices of animals in Yajna, promoting and strengthening of Varna/Caste system. Vedic religion exists now in form of Brahminism/Hinduism . This is no religion, but convenience of Brahmins (Foreigners- Native of Eurasia as confirmed from DNA test reports) to rule over the aboriginal/native people of this country. The religion was not worth for the development/ progress of people.
> >>
> >> Who are the First men and women in the Word and Who create these all?
> >> Answer:- This is the question in purview of science (Biology), anthropology, DNA Science etc. They only can answer better. However, for your information, the first man/woman was born in South Africa and spread their generations subsequently all over the world gradually. Who create them, I don't know, but I reiterate that this question pertains to science and not religion. Religion founders' period was dark age in respect of science and technology. And as such, they did not know a,b,c,d of science and technology. Yet, they made speculative statement i.e. God created men and women. Buddha did not make any statement on creation of universe, men and women, whereas all other religion founders stated that god created universe, men and women. Whereas Buddha was silent on this arbitrary questions. Having been so, Bertrand Russell, the Nobel Prize winner revered Buddha as the greatest religion founder. If you are among the persons believing god has created universe, men and women, it would be a crude and speculative thought having no reasoning. Having knowing nothing about science and answering the question, is mere a part of "Speculative Philosophy" of theistic religions. In order to cure a disease one has to go to doctor. Doctor examines him thoroughly, makes some tests i.e. pathological tests, x-ray, and other such relevant tests by means hi-fi instruments/
equipments and then he prescribes remedial measures i.e. medicine, operation etc. So is the case to know answer of such arbitrary questions of which answers must be sought from relevant scientists/technologist/anthropologists etc. It is totally irrelevant and illogical if we seek answers from god-believer's philosophy i.e. Quran, Geeta or Bible.

> >> As per rebirth concept and the punishment for karma who is doing that process?
> >> Ans:- There is no rebirth. There is no relationship between Karma and punishment. There exists no heaven or hell, but they are the states of mind. "Other world!, there is no other world, if here or no where, is the whole fact of life, for one may believe or not" : Milton. Nobody has ever seen anybody is punished for karma by supernatural thing (God) which never, ever exists. Only law punishes which are ruled by man. Or almighty Nature punishes human being (whether he is virtuous or vicious)if he breaches its physical, chemical and biological law. For instance, if a virtuous and a vicious man fall down from 25th storeyed building, then both will bound to die, because they both breach physical law ie. Law of gravity. Another example is, if a man goes to brothel and sex with prostitute. Subsequently he contracts Aids/STDs. This is the punishment to go against the Nature and its perennial laws. This is also sin in religious point of view. There exists no god, no soul or no anything supernatural in the world. There are three types of world on this world ie. 1) Conscious World - The world of people. 2) Unconscious World - The world of Nature/Material. Man is also a byproduct of Nature. 3) God's World - This world never, ever exists in reality. It is speculative, nonexisting and imaginary world. It is held by world of words/scripts having no relevance. It is mere mental state. Hence, better let us ignore the world in order to open rational thought gates of our minds. "Truth lies beyond. So, let us not afraid to go beyond". "Doubt-mongers having no rational and scientific thinking are as if, going for milking ox instead of cow". "All false religions on the earth are enemies of Nature and Science".: Ruso.

> >> Where is the ending of the human life after death? From where we came?
> >> Answer: -- This is not the question in purview of religion, but science and anthropology, DNA science. Theistic religions have/had been un-necessarily poking their noses in the questions of science and technology, which they don't know a,b,c,d of it. As such, they give rise to speculative philosophies and virus people's mind with irrational and illogical thoughts which lead to blind beliefs.
"Ham log khilauna hai, ek aise khiladi ka,
Jisako abhi sadiyontak yeh khel rachaana hai": Sahir Ludhiyanvi.
i.e. We are the playthings of a player, by whom this game (of life) is to be continued for millennia together. The player is not non-existing/ imaginary God, but it is "NATURE", which has no thinking power at all. Nature is in neutral (it) form. Yet, man is the byproduct of Nature. Nature is almighty and unconscious having no thinking power governed by its perennial laws i.e. Physical, Chemical and Biological laws. "Natural process is the Master/supreme process."
"Every thing acts in conformity of Natural law".
If you are interested I can email you my detailed 36 paged article so that you may get detailed information well adhered to science, law of Nature and human mind.

> >> Who is doing to die and who is giving life?
Answer:-- This is not the question in purview of religion, but science and anthropology, DNA science. Theistic religions have/had been un-necessarily poking their noses in the questions of science and technology, which they don't know a,b,c,d of it. As such, they give rise to speculative philosophies and virus people's mind with irrational and illogical thoughts which lead blind beliefs.
We are living in the age of giant in respect of science and technological developments, jet, hi-fi computer age, but ethically infant age. So, it is better to know the question's nature, whether it pertains to science and technology, anthropology, DNA science and from there only realistic answers to the arbitrary questions can be sought. Mere resorting on answers from Quran or bible or Geeta is not relevant and reliable. Let us keep bias away in order to go to search truths of life."What Newton writes carry no meaning, but what he proves, is all and final".

FOREX CAPITAL MARKET

In the FOREX CAPITAL market, you buy or sell currencies. Placing a trade in the foreign exchange market is simple: the mechanics of a trade are very similar to those found in other markets (like the stock market), so if you have any experience in trading, you should be able to pick it up pretty quickly.

The object of Forex trading is to exchange one currency for another in the expectation that the price will change, so that the currency you bought will increase in value compared to the one you sold.

An exchange rate is simply the ratio of one currency valued against another currency. For example, the USD/CHF exchange rate indicates how many U.S. dollars can purchase one Swiss franc, or how many Swiss francs you need to buy one U.S. dollar.

How to Read an FOREX CAPITAL MARKET Quote

Currencies are always quoted in pairs, such as GBP/USD or USD/JPY. The reason they are quoted in pairs is because in every foreign exchange transaction you are simultaneously buying one currency and selling another. Here is an example of a foreign exchange rate for the British pound versus the U.S. dollar:

GBP/USD = 1.7500

The first listed currency to the left of the slash ("/") is known as the base currency (in this example, the British pound), while the second one on the right is called the counter or quote currency (in this example, the U.S. dollar).

When buying, the exchange rate tells you how much you have to pay in units of the quote currency to buy one unit of the base currency. In the example above, you have to pay 1.7500 U.S. dollar to buy 1 British pound.

When selling, the exchange rate tells you how many units of the quote currency you get for selling one unit of the base currency. In the example above, you will receive 1.7500 U.S. dollars when you sell 1 British pound.

The base currency is the “basis” for the buy or the sell. If you buy EUR/USD this simply means that you are buying the base currency and simultaneously selling the quote currency.

You would buy the pair if you believe the base currency will appreciate (go up) relative to the quote currency. You would sell the pair if you think the base currency will depreciate (go down) relative to the quote currency.

Long/Short

First, you should determine whether you want to buy or sell.

If you want to buy (which actually means buy the base currency and sell the quote currency), you want the base currency to rise in value and then you would sell it back at a higher price. In trader's talk, this is called "going long" or taking a "long position". Just remember: long = buy.

If you want to sell (which actually means sell the base currency and buy the quote currency), you want the base currency to fall in value and then you would buy it back at a lower price. This is called "going short" or taking a "short position". Short = sell.

Bid/Ask Spread

All Forex quotes include a two-way price, the bid and ask. The bid is always lower than the ask price.

The bid is the price in which the dealer is willing to buy the base currency in exchange for the quote currency. This means the bid is the price at which you (as the trader) will sell.

The ask is the price at which the dealer will sell the base currency in exchange for the quote currency. This means the ask is the price at which you will buy.

The difference between the bid and the ask price is popularly known as the spread.

Let's take a look at an example of a price quote taken from a trading platform:

On this GBP/USD quote, the bid price is 1.7445 and the ask price is 1.7449. Look at how this broker makes it so easy for you to trade away your money.

If you want to sell GBP, you click "Sell" and you will sell pounds at 1.7445. If you want to buy GBP, you click "Buy" and you will buy pounds at 1.7449.

In the following examples, we're going to use fundamental analysis to help us decide whether to buy or sell a specific currency pair. If you always fell asleep during your economics class or just flat out skipped economics class, don’t worry! We will cover fundamental analysis in a later lesson. For right now, try to pretend you know what’s going on…