Kamis, 11 September 2008

Demo Program Akuntansi ( GL)

Download GL Demo

Membuat Form Jadi Transparan (Visual Foxpro)

* Penulisanya
* 1. Ketik Di Form procedure - init
* : transparent(thisform.HWnd, thisform.BackColor)
* 2. buat background formnya : RGB(255,0,255)
* 3. ShowWindow=2
* 4. Ketik di Form procedure - unload
* CLEAR DLLS GetWindowLong,SetWindowLong,SetLayeredWindowAttributes
*------------------------------------------------------------------------
PROCEDURE transparenci
LPARAMETERS nHWND, nColor
DECLARE INTEGER GetWindowLong IN user32.DLL INTEGER hWnd, ;
INTEGER nIndex
DECLARE INTEGER SetWindowLong IN user32.DLL INTEGER hWnd, ;
INTEGER nIndex, ;
INTEGER dwNewLong
DECLARE INTEGER SetLayeredWindowAttributes IN WIN32API INTEGER HWND, ;
INTEGER crKey, ;
INTEGER bAlpha,;
INTEGER dwFlags
*********************************************************************************************
#DEFINE LWA_TRANSPARENT 1
#DEFINE GWL_EXSTYLE -20
#DEFINE WS_EX_LAYERED 0x00080000

LOCAL lnFlags
*********************************************************************************************
lnFlags = GetWindowLong(nHWND, GWL_EXSTYLE) && Gets the existing flags from the window
lnFlags = BITOR(lnFlags, WS_EX_LAYERED) && Appends the Layered flag to the existing ones
SetWindowLong(nHWND, GWL_EXSTYLE, lnFlags) && Sets the new flags to the window
SetLayeredWindowAttributes(nHWND, nColor, 0, LWA_TRANSPARENT)
ENDPROC
* HexToStr
*******************************************
Function HexToStr(cBytes)
Local cReturn,n
cReturn=""
For n=Len(cBytes)/2 to 1 step -1
nChr=eval("0x"+SubStr(cBytes,(n-1)*2+1,2))
cReturn=cReturn+chr(nChr)
endfor
Return cReturn
EndFunc

Get Default Printer (Visual Foxpro)

* Penulisannya
* =GetdefaPrn()
*----------------------------------------------------------------------------
PROCEDURE getdefaprn
DECLARE INTEGER GetDefaultPrinter IN winspool.drv;
STRING @ pszBuffer,;
INTEGER @ pcchBuffer

* returns default printer name (WinNT)
nBufsize = 250
cPrinter = REPLICATE(Chr(0), nBufsize)

= GetDefaultPrinter(@cPrinter, @nBufsize)
cPrinter = SUBSTR(cPrinter, 1, AT(Chr(0),cPrinter)-1)
RETURN cPrinter
ENDPROC

Sinkronisasi Jam Local dengan Jam Server (Visual Foxpro)

* sinkronisasi jam dengan server
* =timeserver(cNamesvr)
*-------------------------------------
FUNCTION timeserver
PARAMETERS cNmsvr
myServerName=cNmsvr
lcCmd = GETENV("ComSpec") + " /C NET TIME \\"+ ;
myServerName+" /SET /YES"
loShell = CREATEOBJECT("wscript.shell")
loShell.Run(lcCmd,0,.t.)
ENDFUNC

Dapatkan nomor transaksi terakhir (Visual Foxpro)

FUNCTION getnum
PARAMETERS lcalias,lddate,lckey,fld,cPP
PRIVATE lcoldalias,bd,BL
lcoldalias = Alias()
bl=bulan(lddate)
bd=SUBSTR(lckey,1,3)+SUBSTR(DTOC(lddate),9,2)+bl
BLN=MONTH(lddate)
THN=YEAR(lddate)
*------------------------------------------------------
lup="Select * from &lcalias where !DELETED() and MONTH(tgltrn)="+TRANSFORM(MONTH(lddate),'99')+"AND YEAR(tgltrn)="+TRANSFORM(YEAR(lddate),'9999')

ll=SQLEXEC(lnHandle,lup,'temnum')
SELECT temnum
CALCULATE MAX(&fld) FOR SUBSTR(&fld,1,6)=BD TO MCT
MCT=VAL(RIGHT(MCT,5))+1
lcreturn=bd+ALLTRIM(NtoC(mct,5))
SELECT(lcoldalias)
Return lcreturn
ENDFUNC

FUNCTION ntoc
PARAMETER NVAR, NLEN
IF PARAMETERS()=1
NLEN = 10
ENDIF
RETURN STRTRAN(STR(NVAR, NLEN), ' ', '0')
ENDFUNC

Open Database & Langsung open table (Visual Foxpro)

*------------------------------------------------
* Open Database & table dbf
* used =opendbc("c:\datadbc\esoft.dbc")
*------------------------------------------------
FUNCTION opendbc
PARAMETERS cdbc
OPEN DATABASE &cdbc
local laTABLES[1], lnTABLES, lnI
lnTABLES = adbobjects(laTABLES, 'Table')
for lnI = 1 to lnTABLES
use (laTABLES[lnI]) in 0
next lnI
return .T.

Compile prg to exe (Visual Foxpro)

*--------------------------
* Cara penulisannya
* =prg2exe("c:\test.prg")
*---------------------------
FUNCTION PRG2EXE
LPARAMETERS srcPrg
* Add some error checking...
CREATE PROJECT Autoexe SAVE NOWAIT noshow
cp=application.Projects['Autoexe.pjx']
cp.files.Add(srcPrg+'.prg')
cp.SetMain(srcPrg)
rv=cp.Build(srcPrg,3)
IF rv && Built! Notify or not at your leisure
endif
cp.close
ERASE autoexe.pj?
RETURN rv

Repair Table Dbf ( Visual Foxpro)

*--------------------------------
* cara penulisannya
* =DbRepair('c:\esoft\gltran.dbf')
*--------------------------------
FUNCTION DbRepair &&repairs in a table's head the number of records
LPARAMETERS fn &&full name with path and extension for .DBF file

* from FoxPro.h
#DEFINE MB_OK 0 && OK button only
#DEFINE MB_YESNO 4 && Yes and No buttons
#DEFINE MB_ICONQUESTION 32 && Warning query
#DEFINE MB_ICONEXCLAMATION 48 && Warning message
#DEFINE MB_DEFBUTTON1 0 && First button is default
#DEFINE IDYES 6 && Yes button pressed

LOCAL nf, nRecordsInHead, nHeadLength, nRecordLength

nf= FOPEN(fn,2)
IF nf<=0
=MESSAGEBOX("Can not open "+fn+"!",MB_OK+MB_ICONEXCLAMATION)
RETURN .F.
ENDIF

=FSEEK(nf,04,0)
nRecordsInHead= ASCN(FREAD(nf,4))

=FSEEK(nf,08,0)
nHeadLength= ASCN(FREAD(nf,2))

=FSEEK(nf,10,0)
nRecordLength= ASCN(FREAD(nf,2))

IF nHeadLength=0 .or. nRecordLength=0
=MESSAGEBOX(fn+" has a wrong structure!",MB_OK+MB_ICONEXCLAMATION)
=FCLOSE(nf)
RETURN .F.
ENDIF

nRecordsInFact= FSEEK(nf,0,2) &&file length
nRecordsInFact= int((nRecordsInFact-nHeadLength)/nRecordLength) &&real number of records

IF nRecordsInFact=nRecordsInHead &&it's Ok
=FCLOSE(nf)
RETURN .T.
ENDIF

IF IDYES#MESSAGEBOX(fn+" has:";
+CHR(13);
+CHR(13)+STR(nRecordsInHead)+" - number of records in the head";
+CHR(13)+STR(nRecordsInFact)+" - actual number of records";
+CHR(13)+STR(nRecordsInHead-nRecordsInFact)+" - records are lost";
+CHR(13);
+CHR(13)+"Do you want to repair this table?";
,MB_YESNO+MB_ICONQUESTION+MB_DEFBUTTON1)

=FCLOSE(nf)
RETURN .F.
ENDIF

=FSEEK(nf,04,0)
=FWRITE(nf,CHRN(nRecordsInFact,4),4) &&repair the head
=FCLOSE(nf)

IF !FILE(FORCEEXT(fn,"CDX"))
RETURN .T.
ENDIF

IF IDYES#MESSAGEBOX("Do you want to start REINDEX?";
,MB_YESNO+MB_ICONQUESTION+MB_DEFBUTTON1)
RETURN .T.
ENDIF

DEFINE WINDOW DbfRepairMsg FROM 08,10 to 40,89
ACTIVATE WINDOW DbfRepairMsg

SET CPDIALOG OFF
SET STATUS BAR OFF
SET TALK ON

SELECT 0
USE (fn) INDEX (FORCEEXT(fn,"CDX")) EXCLUSIVE
REINDEX
USE
SET TALK OFF
SET STATUS BAR ON

DEACTIVATE WINDOW DbfRepairMsg
RELEASE WINDOW DbfRepairMsg
RETURN .T.

*-------------------------------
FUNCTION ASCN &&converts binary string to numeric
LPARAMETERS s &&string, bytes go from tail to head

LOCAL i, n
n= 0
FOR i=LEN(s) TO 1 STEP -1
n=n*256+ASC(SUBSTR(s,i,1))
ENDFOR
RETURN n

*-------------------------------
FUNCTION CHRN &&converts numeric value to binary string,
&&bytes go from tail to head
LPARAMETERS n, ln &&the numeric value and output string length
LOCAL i, s, sc
s= ""
sc= n
FOR i=1 TO ln
s= s+CHR(sc%256)
sc= INT(sc/256)
ENDFOR
RETURN s

Hecking Frx ( Visual FoxPro)

PROCEDURE setfrx
LOCAL cRptFile, i, p
FOR p = 1 TO application.Projects.Count
FOR i = 1 TO application.Projects(p).Files.Count
cRptFile = application.Projects(p).Files(i).NAME
IF UPPER(JUSTEXT(cRptFile)) = "FRX"
WAIT WINDOW cRptFile NOWAIT &&if desired
USE (cRptFile)
LOCATE
REPLACE Expr WITH ;
MLINE(Expr,ATLINE("ORIENTATION",Expr)), ;
Tag WITH "", Tag2 WITH ""
USE
ENDIF
ENDFOR
ENDFOR
RETURN

Dasar Cisco

Dasar-Dasar Konfigurasi Router Cisco

1. Setelah Router boot up, pertama kali kita akan berada pada mode user EXEC. Sebelumnya mungkin kita akan menjumpai initial setup untuk router yang belum disimpan konfigurasinya ke dalam NVRAM.

Router>
2. Menampilkan informasi flash.

Router> show flash
3. Menampilkan versi IOS dan informasi penting lainnya.

Router> show version
4. Menampilkan informasi konfigurasi yang tersimpan di RAM.

Router> show running-config
5. Menampilkan informasi konfigurasi yang tersimpan di NVRAM.

Router> show startup-config
6. Selanjutnya untuk masuk ke mode Privileged EXEC.

Router> enable
Router#
7. Masuk ke mode Global Configuration.

Router# configure terminal
Router(config)#
8. Mengganti/Merubah nama Router.

Router(config)# hostname Jogja
Jogja(config)#
9. Melakukan konfigurasi password Console (Line Console).

Jogja(config)# line console 0
Jogja(config-line)# password cisco
Jogja(config-line)# login
Jogja(config-line)# exit
Jogja(config)#
10. Melakukan konfigurasi password Virtual Terminal Line (Telnet).

Jogja(config)# line vty 0
Jogja(config-line)# password cisco
Jogja(config-line)# login
Jogja(config-line)# exit
Jogja(config)#
11. Melihat password yang belum dienkripsi.

Jogja# show running-config
line con 0
password cisco
login
line aux 0
line vty 0 4
password cisco
login
12. Melakukan konfigurasi password untuk masuk ke mode Privileged EXEC.

Jogja(config)# enable password ccna
13. Melakukan enkripsi password untuk Console dan Virtual Terminal Line (Telnet) dengan password-encryption.

Jogja(config)# service password-encryption
14. Melakukan enkripsi password untuk mode Privileged EXEC dengan md5.

Jogja(config)# enable secret class

Mengenai Saya

Foto saya
Bekasi, Jawa Barat, Indonesia
eSoft Software product : - Dental Clinic system - General Ledger (Accounting System) - Manufacturing System - Trading system