goto doit
[buckdata]
Argentina(Pesos)=1.01
Australia(Dollars)=0.7145
Austria(Shilling)=0.0808
Belgium(Franc)=0.02755
Brazil(Cruzeiro Real)=0.002
England(Pound)=1.4825
Canada(Dollar)=0.7439
France(Franc)=0.16764
German(Mark)=0.5682
HongKong(Dollar)=0.12932
Italy(Lira)=0.0005894
Japan(Yen)=0.009195
Mexico(Peso)=0.322165
Netherlands(Guilder)=0.5072
NewZealand(Dollar)=0.573
Norway(Krone)=0.1325
Singapore(Dollar)=0.6288
SouthAfrica(Rand)=0.22
Spain(Peseta)=0.007033
Sweden(Krona)=0.1253
Switzerland(Franc)=0.6803
Taiwan(Dollar)=0.037836


[dummy]
; NOTE:  This is an example of a self-referencing WBT file that CANNOT BE COMPILED
; with the WinBatch Compiler.  To be able to compile something like this, the currency
; exchange table must be moved to another file.
:doit
Message("Currency Converter","This file converts between US and International Currencies.%@CRLF%It is only as accurate as the table embedded in the WBT file.%@CRLF%Review table and update from time to time from your local newspaper.")

Decimals(2)
tab=num2char(9)
OrigDir=DirGet()
IniFile=strcat(OrigDir,"Intl Money Conversions.wbt")
if WinMetrics(-4)<4 then IniFile=strcat(Origdir,"DOLLARS.WBT")
MucksFormat=`WWWDLGED,5.0`

MucksCaption=`Buck Basher`
MucksX=67
MucksY=66
MucksWidth=247
MucksHeight=130
MucksNumControls=8

Mucks01=`4,2,90,122,ITEMBOX,Countries,DEFAULT`
Mucks02=`170,10,64,DEFAULT,EDITBOX,Bucks,""`
Mucks03=`110,10,60,DEFAULT,STATICTEXT,DEFAULT,"Enter Amount"`
Mucks04=`100,108,124,DEFAULT,PUSHBUTTON,DEFAULT,"&Quit",0`
Mucks05=`100,90,124,DEFAULT,PUSHBUTTON,DEFAULT,"Foreign currency to US $",2`
Mucks06=`100,72,124,DEFAULT,PUSHBUTTON,DEFAULT,"US $ to Foreign currency",1`
Mucks07=`100,32,130,DEFAULT,VARYTEXT,stat1,"Da France money is worth"`
Mucks08=`100,46,132,DEFAULT,VARYTEXT,stat2,"us buck two 95"`

BigList=IniItemizePvt("buckdata",IniFile)
stat1=""
stat2=""

:top

Countries=BigList


ButtonPushed=Dialog("Mucks")
;i=strtrim(ItemCount("Countries",tab))
where=ItemExtract(1,Countries,tab)
if where==""
    Message("Bucks","Must just choose one country at a time")
    goto top
endif

if !IsNumber(Bucks)             
     Message("Bucks","No value entered")
     goto top
endif

DaRate=IniReadPvt("buckdata",where,99999,IniFile)

switch ButtonPushed
    case 1     ;US$ to foreign
       Ducks=Bucks/DaRate          
       stat1="US$ %Bucks% is worth"
       stat2="%Ducks% in %where%"  
       break                       
    case 2     ; Foreign to US$
       Ducks=Bucks*DaRate
       stat1="%where% %Bucks% is worth"
       stat2="%Ducks% in US Dollars"
       break
endswitch       
goto top
