Jump to content
Fivewin Brasil

substituir compilador clipper


edutraini

Recommended Posts

KAPIABA NA HORA DE COMPILAR APARECE ESSE ERRO

VC SABE ME DIZER SE PRECISO MUDAR ALGUMA COISA OU ADICIONAR ALGUMA COISA
urbo Incremental Link 5.00 Copyright © 1997, 2000 Borland
Error: Unresolved external '_HB_PCREPOS_LIBRARY' referenced from C:\XHARBOUR\LIB\RTL.LIB|regex
Error: Unresolved external 'AlphaBlend' referenced from C:\FWH\LIB\FIVEHC.LIB|BRUSHES
Link to comment
Share on other sites

KAPI CRIEI UM PROJETO NO XDEV

CONFIGUREI A OPCAO HARBOUR 32 BITS & BCC

INCLUI OS DOIS PROGRAMAS XHARBOUR E BCC55

FIZ UM PROGRAMA BEM SIMPLES

CONF ABAIXO ELE COMPILA APARECE UMA TELA PRETA DO PROMPT DO DOS MAS NAO APARECE NADA

PODERIA ME DAR ALGUMA DICA

* -----------------------------------------------------------------------------
Function Main()
* -----------------------------------------------------------------------------
dDay := Date()
@ 2, 2 SAY "Date:"
@ 2, 8 GET dDay ;
VALID !Empty( dDay )
READ
retur nil
Link to comment
Share on other sites


@Echo Off

SET CLIPPER=
SET LIB=
SET INCLUDE=

set include=c:\bcc55\include

Cls
Echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
Echo ³ xHarbour development power ³Ü
Echo ³ for Microsoft Windows 95/98/NT/2000/ME and XP ³Û
Echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
Echo ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

SET CLIPPER=
Set hdir=C:\xHarbour
Set bcdir=C:\BCC55

@If Exist TESTE.Exe Del TESTE.EXE
@If Exist *.Bak Del *.Bak
@If Exist *.Obj Del *.Obj
@If Exist *.Log Del *.Log
@If Exist *.Ppo Del *.Ppo
@If Exist *.C Del *.C
@If Exist *.MAP Del *.MAP

%hdir%\bin\harbour TESTE /M /N /i%hdir%\include;%bcdir%\include /W0 /P TESTE.C > CLIP.LOG

echo -O2 -eTESTE.exe -I%hdir%\include;%bcdir%\include TESTE.c > b32.bc

%bcdir%\bin\bcc32 -M -c -v @b32.bc

:ENDCOMPILE

echo \BCC55\lib\c0w32.obj + > b32.bc
echo TESTE.obj, + >> b32.bc
echo TESTE.exe, + >> b32.bc
echo TESTE.map, + >> b32.bc
echo %hdir%\lib\rtl.lib + >> b32.bc
echo %hdir%\lib\vm.lib + >> b32.bc
echo %hdir%\lib\gtwin.lib + >> b32.bc
echo %hdir%\lib\lang.lib + >> b32.bc
echo %hdir%\lib\macro.lib + >> b32.bc
echo %hdir%\lib\rdd.lib + >> b32.bc
echo %hdir%\lib\dbfntx.lib + >> b32.bc
echo %hdir%\lib\dbfcdx.lib + >> b32.bc
echo %hdir%\lib\dbffpt.lib + >> b32.bc
echo %hdir%\lib\hbsix.lib + >> b32.bc
echo %hdir%\lib\debug.lib + >> b32.bc
echo %hdir%\lib\common.lib + >> b32.bc
echo %hdir%\lib\pp.lib + >> b32.bc
echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib >> b32.bc

%bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc

IF ERRORLEVEL 1 GOTO LINKERROR
Echo * Application successfully built


Goto Exit
Echo

:LINKERROR
rem if exist meminfo.txt notepad meminfo.txt
Pause * Linking errors *
Goto Exit

:Exit


Link to comment
Share on other sites


/*
* $Id: testdbf.prg 9279 2011-02-14 18:06:32Z druzus $
*/

function main()

local nI, aStruct := { { "CHARACTER", "C", 25, 0 }, ;
{ "NUMERIC", "N", 8, 0 }, ;
{ "DOUBLE", "N", 8, 2 }, ;
{ "DATE", "D", 8, 0 }, ;
{ "LOGICAL", "L", 1, 0 }, ;
{ "MEMO1", "M", 10, 0 }, ;
{ "MEMO2", "M", 10, 0 } }

CLS

REQUEST DBFCDX

dbCreate( "testdbf", aStruct, "DBFCDX", .t., "MYALIAS" )

? "[" + MYALIAS->MEMO1 + "]"
? "[" + MYALIAS->MEMO2 + "]"
? "-"
MYALIAS->( dbAppend() )
MYALIAS->MEMO1 := "Hello world!"
MYALIAS->MEMO2 := "Harbour power"
? "[" + MYALIAS->MEMO1 + "]"
? "[" + MYALIAS->MEMO2 + "]"
MYALIAS->( dbAppend() )
MYALIAS->MEMO1 := "This is a test for field MEMO1."
MYALIAS->MEMO2 := "This is a test for field MEMO2."
? "[" + MYALIAS->MEMO1 + "]"
? "[" + MYALIAS->MEMO2 + "]"
MYALIAS->NUMERIC := 90
MYALIAS->DOUBLE := 120.138
? "[" + Str( MYALIAS->DOUBLE ) + "]"
? "[" + Str( MYALIAS->NUMERIC ) + "]"

? ""
? "Press any key..."
InKey( 0 )

? ""
? "Append 50 records with memos..."
for nI := 1 to 50
MYALIAS->( dbAppend() )
MYALIAS->MEMO1 := "This is a very long string. " + ;
"This may seem silly however strings like this are still " + ;
"used. Not by good programmers though, but I've seen " + ;
"stuff like this used for Copyright messages and other " + ;
"long text. What is the point to all of this you'd say. " + ;
"Well I am coming to the point right now, the constant " + ;
"string is limited to 256 characters and this string is " + ;
"a lot bigger. Do you get my drift ? If there is somebody " + ;
"who has read this line upto the very end: Esto es un " + ;
"sombrero grande rid¡culo." + Chr( 13 ) + Chr( 10 ) + ;
"/" + Chr( 13 ) + Chr( 10 ) + "[;-)" + Chr( 13 ) + Chr( 10 )+ ;
"\"
next
MYALIAS->( dbCommit() )

? "Records before ZAP:", MYALIAS->( LastRec() )
? "Size of files (data and memo):", Directory( "testdbf.dbf" )[1][2], ;
Directory( "testdbf.fpt" )[1][2]
MYALIAS->( __dbZap() )
MYALIAS->( dbCommit() )
? "Records after ZAP:", MYALIAS->( LastRec() )
? "Size of files (data and memo):", Directory( "testdbf.dbf" )[1][2], ;
Directory( "testdbf.fpt" )[1][2]
? "Value of fields MEMO1, MEMO2, DOUBLE and NUMERIC:"
? "[" + MYALIAS->MEMO1 + "]"
? "[" + MYALIAS->MEMO2 + "]"
? "[" + Str( MYALIAS->DOUBLE ) + "]"
? "[" + Str( MYALIAS->NUMERIC ) + "]"
? "Press any key..."
InKey( 0 )
dbCloseAll()

dbCreate( "testdbf", aStruct,, .t., "MYALIAS" )

for nI := 1 to 10
MYALIAS->( dbAppend() )
MYALIAS->NUMERIC := nI
? "Adding a record", nI
if nI == 3 .or. nI == 7
MYALIAS->( dbDelete() )
? "Deleting record", nI
endif
next
MYALIAS->( dbCommit() )

? ""
? "With SET DELETED OFF"
? "Press any key..."
InKey( 0 )

MYALIAS->( dbGoTop() )
do while !MYALIAS->( Eof() )
? MYALIAS->NUMERIC
MYALIAS->( dbSkip() )
enddo

SET DELETED ON
? ""
? "With SET DELETED ON"
? "Press any key..."
InKey( 0 )

MYALIAS->( dbGoTop() )
do while !MYALIAS->( Eof() )
? MYALIAS->NUMERIC
MYALIAS->( dbSkip() )
enddo

? ""
? "With SET DELETED ON"
? "and SET FILTER TO MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8"
? "Press any key..."
InKey( 0 )

MYALIAS->( dbSetFilter( { || MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8 }, ;
"MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8" ) )
MYALIAS->( dbGoTop() )
do while !MYALIAS->( Eof() )
? MYALIAS->NUMERIC
MYALIAS->( dbSkip() )
enddo

SET DELETED OFF
? ""
? "With SET DELETED OFF"
? "and SET FILTER TO MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8"
? "Press any key..."
InKey( 0 )

MYALIAS->( dbSetFilter( { || MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8 }, ;
"MYALIAS->NUMERIC > 2 .AND. MYALIAS->NUMERIC < 8" ) )
MYALIAS->( dbGoTop() )
do while !MYALIAS->( Eof() )
? MYALIAS->NUMERIC
MYALIAS->( dbSkip() )
enddo

? "dbFilter() => " + dbFilter()
? ""

? "Testing __dbPack()"
? "Records before PACK:", MYALIAS->( LastRec() )
? "Size of files (data and memo):", Directory( "testdbf.dbf" )[1][2], ;
Directory( "testdbf.dbt" )[1][2]
SET FILTER TO
MYALIAS->( __dbPack() )
MYALIAS->( dbCommit() )
? "Records after PACK:", MYALIAS->( LastRec() )
? "Size of files (data and memo):", Directory( "testdbf.dbf" )[1][2], ;
Directory( "testdbf.dbt" )[1][2]
? "Press any key..."
InKey( 0 )
? "Value of fields:"
MYALIAS->( dbGoTop() )
do while !MYALIAS->( Eof() )
? MYALIAS->NUMERIC
MYALIAS->( dbSkip() )
enddo
? ""

? "Open test.dbf and LOCATE FOR TESTDBF->SALARY > 145000"
? "Press any key..."
InKey( 0 )
dbUseArea( ,, "test", "TESTDBF" )
locate for TESTDBF->SALARY > 145000
do while TESTDBF->( Found() )
? TESTDBF->FIRST, TESTDBF->LAST, TESTDBF->SALARY
continue
enddo
? ""
? "LOCATE FOR TESTDBF->MARRIED .AND. TESTDBF->FIRST > 'S'"
? "Press any key..."
InKey( 0 )
dbUseArea( ,, "test", "TESTDBF" )
locate for TESTDBF->MARRIED .AND. TESTDBF->FIRST > 'S'
do while TESTDBF->( Found() )
? TESTDBF->FIRST, TESTDBF->LAST, TESTDBF->MARRIED
continue
enddo

return nil


Link to comment
Share on other sites


/**
====================================================================================================
MAPEANDO TODOS OS JOGOS DA LOTO-FÁCIL
----------------------------------------------------------------------------------------------------
PROGRAMADOR: YUGI
====================================================================================================
*/
function main()
LOCAL ct:=0, lista:="S"
PUBLIC vet1:=array(6), vet2:=array(6), vet3:=array(6), vet4:=array(6), vet5:=array(6)
PUBLIC jog1:={}, jog2:={}, jog3:={}, jog4:={}, jog5:={}, numeroPersonalizado := {}

inicializa() // Preenchendo os vetores de inicialização
calcularJogadas() // calculando todas as jogadas possíveis por blocos

set confirm on

cls
@ 00,01 say "JOGOS DA LOTOFACIL"
@ 01,01 say "Gerar lista Completa, Personalizada ou Sair? [C/P/S]..: " get lista pict "!" valid lista $ "CPScps"
Read

lista := upper(lista)

do case
case lista = "C"
@ 02,01 say "Aguarde, mapeando todos os jogos..."
? time()
criarArquivo("a.txt")
calcularJogo() // calcular todos os jogos possíveis para lotofacil
fecharArquivo()
? time()
case lista = "S"
quit
case lista = "P"
num = space(60)
@ 02,01 say "Digite os numeros que voce quer que aparecam no seu jogo, separe por virgulas!!! "
@ 03,01 say "Os numeros devem estar entre 1 e 25."
@ 04,01 say "Sua lista pode conter um numero, 2, 3 ou ate 14 numeros."
@ 05,01 say "Ex: 2, 5, 24, 13"
@ 06,01 say "Numeros para o jogo...: " get num picture "@s50"
Read

num = alltrim(num)
num = strtran(num," ","")

do while.t.
tmp := ""
for ct:= 1 to len(num)
if isDigit(substr(num,ct,1))
tmp = tmp + substr(num,ct,1)
else
exit
endif
next

num = substr(num,ct+1)
if !empty(tmp)
if (val(tmp) >= 1 .and. val(tmp) <= 25)
if !contemJogada(numeroPersonalizado,strzero(val(tmp),2,0))
aadd( numeroPersonalizado, strzero(val(tmp),2,0))
endif
else
@ 07, 01 say "Os numeros devem estar entre 1 e 25!!!"
quit
endif
endif

if len(num)=0
exit
endif
enddo

Asort(numeroPersonalizado)
jogoPersonalizado := ""

if len(numeroPersonalizado) > 14 .or. len(numeroPersonalizado) < 1
@ 07,01 say "Quantidade de numero invalida!!! Deve estar entre 1 e 14!!!"
quit
endif

for ct:= 1 to len( numeroPersonalizado)
jogoPersonalizado += numeroPersonalizado[ct] + " "
next

jogoPersonalizado = alltrim(jogoPersonalizado)

@ 07,01 say "Numeros escolhidos: " + jogoPersonalizado
@ 08,01 say "Aguarde, calculando jogo personalizado..."
? time()
criarArquivo("a.txt")
calcularJogoPersonalizado(numeroPersonalizado) // calcular jogo personalizado...
fecharArquivo()
? time()

endcase

return

/**
====================================================================================================
Cria um arquivo texto permitindo escrever nele como se estivesse mostrando informações na tela
do computador
====================================================================================================
*/
function criarArquivo(wArq)
set printer on
set device to printer
set console off
set printer to &wArq
return

/**
====================================================================================================
Fecha um arquivo Texto e retorna o direcionamento para a tela
====================================================================================================
*/
function fecharArquivo()
set printer off
set device to screen
set console on
set printer to
return

/**
====================================================================================================
Preenche os vetores de inicialização para calcular todas as jogadas
====================================================================================================
*/
function inicializa()
LOCAL ct:=0

vet1[1] = ""
for ct:= 2 to 6
vet1[ct] = strzero(ct-1,2,0)
next

vet2[1] = ""
for ct:= 2 to 6
vet2[ct] = strzero(5 + val(vet1[ct]),2,0)
next

vet3[1] = ""
for ct:= 2 to 6
vet3[ct] = strzero(10 + val(vet1[ct]),2,0)
next

vet4[1] = ""
for ct:= 2 to 6
vet4[ct] = strzero(15 + val(vet1[ct]),2,0)
next

vet5[1] = ""
for ct:= 2 to 6
vet5[ct] = strzero(20 + val(vet1[ct]),2,0)
next

return

/**
====================================================================================================
Calcula todas as jogadas para cada um dos 5 grupos
====================================================================================================
*/
function calcularJogadas()
LOCAL ct:=0, vetorTmp := {}, contador:={1,1,1,1,1,1}, cStr:="", modelo := {1,2,3,4,5}

do while .t.
cStr = vet1[contador[1]] + vet1[contador[2]] + vet1[contador[3]] + vet1[contador[4]] + vet1[contador[5]] + vet1[contador[6]]

++ contador[1]

if (contador[1]>6)
contador[1] = 1
++ contador[2]
endif

if (contador[2]>6)
contador[2] = 1
++ contador[3]
endif

if (contador[3]>6)
contador[3] = 1
++ contador[4]
endif

if (contador[4]>6)
contador[4] = 1
++ contador[5]
endif

if (contador[5]>6)
contador[5] = 1
++ contador[6]
endif

if (contador[6]>6)
exit
endif

if jogadaValida(cStr)
cStr = ordenaJogada(cStr)
if !contemJogada(vetorTmp,formata(cStr))
aadd(vetorTmp, formata(cStr))
endif
endif
enddo

jog1 = vetorTmp

// calculando as outras jogadas

tam := len(jog1)

valor = 5
for ct:= 1 to tam
cstr = jog1[ct]
for ct2:= 1 to 5
cstr = strtran(cStr,strzero(modelo[ct2],2,0),strzero(modelo[ct2]+valor,2,0))
next
aadd(jog2,cStr)
next

valor = 10
for ct:= 1 to tam
cstr = jog1[ct]
for ct2:= 1 to 5
cstr = strtran(cStr,strzero(modelo[ct2],2,0),strzero(modelo[ct2]+valor,2,0))
next
aadd(jog3,cStr)
next

valor = 15
for ct:= 1 to tam
cstr = jog1[ct]
for ct2:= 1 to 5
cstr = strtran(cStr,strzero(modelo[ct2],2,0),strzero(modelo[ct2]+valor,2,0))
next
aadd(jog4,cStr)
next

valor = 20
for ct:= 1 to tam
cstr = jog1[ct]
for ct2:= 1 to 5
cstr = strtran(cStr,strzero(modelo[ct2],2,0),strzero(modelo[ct2]+valor,2,0))
next
aadd(jog5,cStr)
next

return

/**
====================================================================================================
formata a jogada colocando espaços entre os números
====================================================================================================
*/
function formata(jogada)
local ret := ""

do case
case len(jogada) = 10
ret = substr(jogada,1,2) + " " + substr(jogada,3,2) + " " + substr(jogada,5,2) + " " + substr(jogada,7,2) + " " + ;
substr(jogada,9,2)
case len(jogada) = 8
ret = substr(jogada,1,2) + " " + substr(jogada,3,2) + " " + substr(jogada,5,2) + " " + substr(jogada,7,2)
case len(jogada) = 6
ret = substr(jogada,1,2) + " " + substr(jogada,3,2) + " " + substr(jogada,5,2)
case len(jogada) = 4
ret = substr(jogada,1,2) + " " + substr(jogada,3,2)
case len(jogada) = 2
ret = jogada
endcase

return ret

/**
====================================================================================================
Verifica se a jogada é valida
====================================================================================================
*/
function jogadaValida(jogada)
local ct:=0, valida := "0102030405", verifica:= 1, tam:= 0

if len(jogada) <= 2
return .T.
endif

if len(jogada) > 10
return .F.
endif

if len(jogada) = 2
if (substr(jogada,1,2) == substr(jogada,3,2))
return .F.
else
return .T.
endif
endif

tam = len(jogada)
for ct:= 1 to tam step 2
if substr(jogada,ct,2) $ valida
valida = strtran(valida,substr(jogada,ct,2),"")
else
verifica = 0
exit
endif
next

if verifica == 1
return .T.
endif

return .F.

/**
====================================================================================================
Verifica se a jogada já foi adicionada ao vetor
====================================================================================================
*/
function contemJogada(vetor,jogada)
LOCAL tam:= 0

tam := len(vetor)

for ct:= 1 to tam
if (jogada == vetor[ct])
return .T.
endif
next

return .F.

/**
====================================================================================================
Ordena uma jogada de forma ascendente
====================================================================================================
*/
function ordenaJogada(cStr)
local ret := "", vet := {}

if len(cStr) <= 2
return cStr
endif

for ct:= 1 to len(cStr) step 2
aadd(vet,val(substr(cStr,ct,2)))
next

asort(vet)
ret := ""

for ct:= 1 to len(vet)
ret := ret + strzero(vet[ct],2,0)
next

return ret

/**
====================================================================================================
Verifica se uma jogada completa é valida
====================================================================================================
*/
function verificaJogada(cStr)
local ct:= 0, tam := 0, valida := "01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25"

cStr := strtran(cStr," ","")
tam := len(cStr)

if tam <> 30
return .F.
endif

for ct:= 1 to tam step 2
if substr(cStr,ct,2) $ valida
valida = strtran(valida,substr(cStr,ct,2),"")
else
return .F.
endif
next

return .T.

/**
====================================================================================================
Calcular Jogo
====================================================================================================
*/
function calcularJogo()
local contador:={1,1,1,1,1}, limite:= len(jog1), ct:= 1

do while.t.
cStr := jog1[contador[1]] + " " + jog2[contador[2]] + " " + jog3[contador[3]] + " " + jog4[contador[4]] + " " + jog5[contador[5]]

if verificaJogada(cStr)
if ct = 1
?? strzero(ct,7) + ": " + Alltrim(strtran(cStr," "," "))
else
? strzero(ct,7) + ": " + Alltrim(strtran(cStr," "," "))
endif
++ ct
endif

++ contador[1]

if (contador[1]>limite)
contador[1] = 1
++ contador[2]
endif

if (contador[2]>limite)
contador[2] = 1
++ contador[3]
endif

if (contador[3]>limite)
contador[3] = 1
++ contador[4]
endif

if (contador[4]>limite)
contador[4] = 1
++ contador[5]
endif

if (contador[5]>limite)
exit
endif

enddo

return

/**
====================================================================================================
Calcular Jogo Personalizado
====================================================================================================
*/
function calcularJogoPersonalizado(wJogo)
local contador:={1,1,1,1,1}, limite:= len(jog1), ct:= 1

do while.t.
cStr := jog1[contador[1]] + " " + jog2[contador[2]] + " " + jog3[contador[3]] + " " + jog4[contador[4]] + " " + jog5[contador[5]]

if verificaJogada(cStr)
if contemJogadaPersonalizada(wJogo, cStr)
if ct = 1
?? strzero(ct,7) + ": " + Alltrim(strtran(cStr," "," "))
else
? strzero(ct,7) + ": " + Alltrim(strtran(cStr," "," "))
endif
++ ct
endif
endif

++ contador[1]

if (contador[1]>limite)
contador[1] = 1
++ contador[2]
endif

if (contador[2]>limite)
contador[2] = 1
++ contador[3]
endif

if (contador[3]>limite)
contador[3] = 1
++ contador[4]
endif

if (contador[4]>limite)
contador[4] = 1
++ contador[5]
endif

if (contador[5]>limite)
exit
endif

enddo

return

/**
====================================================================================================
Verifica se a jogada contém os números selecionados
====================================================================================================
*/
function contemJogadaPersonalizada(vetor,jogo)
LOCAL tam:= 0

tam := len(vetor)

for ct:= 1 to tam
if !(vetor[ct] $ jogo)
return .F.
endif
next

return .T.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...