CorN_Sk8
-
Total de itens
89 -
Registro em
-
Última visita
Posts postados por CorN_Sk8
-
-
para agilizar ainda mais o sistema utilize expressão regular,
usando a função: int preg_match(string pattern, string subject, array [matches]);
ficaria mais ou menos assim o código:
<? $text = "http://www.google.com.br"; if (preg_match("(?i)(FTP|HTTP[S])://([_a-z\d\-]+(\.[_a-z\d\-]+)+)((/[ _a-z\d\-\\\.]+)+)*", $text, $matchs)){ for($x = 0; $x < $count($matchs); $x++){ echo $match[$x][0] . "<br>"; } } ?>
a expressão pode ser (?i)((FTP|HTTP)://)?([_a-z\d\-]+(\.[_a-z\d\-]+)+)((/[ _a-z\d\-\\\.]+)+)*
para poder pegar urls sem http:// ou ftp:// ou https:// mas não acho recomendável...
espero ter ajudado... flws
-
var Canvas: TCanvas; begin Canvas := TCanvas.Create; Canvas.Handle := GetWindowDc(0); // faça o que quiser Canvas.Free; end;
com esse código você manipula o que está sendo mostrado no vídeo, não captura apenas uma janela ou outra, você desenha na onde quiser e ele vai ficar por cima.
-
porque voce não usa if TryStrToInt(N) ?
Obs:
Você pode usar o Try de outra forma:
try except on E: Exception do begin ShowMessage(E.Message); end; end;
-
-
procedure TF_Cad_Orc.BitBtn9Click(Sender: TObject); begin with dados.Q_Kit do begin close; sql.clear; sql.add ('SELECT SUM (Kit_Total_Fin) AS TOTAL FROM TBL_Kit WHERE ID_ORCA = '+QuotedStr(dbedit60.text)); ShowMessage(SQL.TEXT); open;
vai aparecer uma mensagem com a query veja se está tudo OK
-
se for o que eu to pensando, vai ficar enorme mesmo, o tamanho é proporcial a resolução, a melhor solução é desenvolver softwares para 800x600 que quando voce mudar para 1024x768 fica normal ...
um botao de 25x25 em 1024x768 não é nada mais em 800x600 ele vira um botaozaooo justamente porque a tela tem menos pixels
-
eu desenvolvi uma funcao para calculos aritimeticos mas não esta totalmente pronta, se voce quiser tentar termina-la
http://www.delphix.br2.net/forums/index.ph...findpost&p=3590
-
floattostrf(valor, 18,2)
formatfloat('###.###.###,##0', valor)
format("%m", [valor])
-
$sexo = strtoupper($user["iam"]); if($sexo == "MAN") || ($sexo == "HOMEM") $gender = Male else if ($sexo == "WOMAN") || ($sexo == "MULHER") $gender = Female;
-
você tem que ligar elas, relacionar, exemplo:
Tabela Clientes------------------
Codigo
Nome
Tabela Produtos------------------
Codigo
Nome
Preço
Tabela Vendas------------------
Codigo
CodCliente
CodProduto
Quantidade
ai sua query vai ficar assim:
Select * from Clientes C, Produtos P, Vendas V where V.CodCliente = C.Codigo and V.CodProduto = P.Codigo
legal né ?
-
pronto, terminei.
Unit1.pas
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Image1: TImage; Button1: TButton; procedure Button1Click(Sender: TObject); procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormCreate(Sender: TObject); private procedure Load; { Private declarations } public { Public declarations } end; var Form1: TForm1; BMP: TBitmap; P: TPoint; P_Clicked: TPoint; Clicked: Boolean = false; implementation {$R *.dfm} procedure TForm1.Load; var MyRect, MyOther: TRect; X, Y: Integer; begin if Image1.Width > BMP.Width then X := (Image1.Width - BMP.Width) div 2 else X := 0; if Image1.Height > BMP.Height then Y := (Image1.Height - BMP.Height) div 2 else Y := 0; MyRect := Rect(P.X, P.Y, P.X + Image1.Width, P.Y + Image1.Height); MyOther := Rect(X,Y,Image1.Width, Image1.Height); Image1.Canvas.CopyRect(MyOther,BMP.Canvas,MyRect); end; procedure TForm1.Button1Click(Sender: TObject); begin P.X := 0; P.Y := 0; BMP := TBitmap.Create; BMP.LoadFromFile('C:\teste.bmp'); Load; end; procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if BMP = nil then exit; P_Clicked.X := X; P_Clicked.Y := Y; Clicked := True; end; procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if Clicked = false then exit; P.X := P.X + (X - P_Clicked.X); P.Y := P.Y + (Y - P_Clicked.Y); if P.X < 0 then P.X := 0 else if P.X > BMP.Width - Image1.Width then P.X := BMP.Width - Image1.Width; if P.Y < 0 then P.Y := 0 else if P.Y > BMP.Height - Image1.Height then P.Y := BMP.Height - Image1.Height; if Image1.Width > BMP.Width then P.X := 0; if Image1.Height > BMP.Height then P.Y := 0; P_Clicked.X := X; P_Clicked.Y := Y; Load; end; procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Clicked := False; end; procedure TForm1.FormCreate(Sender: TObject); begin DoubleBuffered := True; end; end.
-
hum meu caro irei criar um código melhor para você e posto ainda hoje
-
algo do tipo
$acao = $_GET['COMBO'];
if ($acao == "Telefonia")
include('atuacao.php')
else if ...
-
de uma olhada nesse tópico
http://scriptbrasil.com.br/forum/index.php...topic=75847&hl=
-
é só usar um poco de lógica ...
$total_paginas = $total_registros / $registros_por_pagina; for($x = 1; $x < $total_paginas+1; $x++) echo "<a href=\"fotos.php?id=" . $x . "\">" . $x . "</a> ";
-
com ó codigo é bem mais facil ajuda
Writes to a text file and adds an end-of-line markerUnit
System
Category
text file routines
procedure Writeln([ var F: Text; ] P1 [, P2, ...,Pn ] );
Description
Writeln is an extension to the Write procedure, as it is defined for text files.
After executing Write, Writeln writes an end-of-line marker (carriage return/line feed) to the file. Writeln(F) with no parameters writes an end-of-line marker to the file. (Writeln with no parameter list corresponds to Writeln(Output).)
The file must be open for output.
Note: When an application is compiled as a console application (using the Generate console application checkbox on the Linker page of the Project|Options dialog, or a -cc command line switch with the command-line compiler), Delphi automatically associates the Input and Output files with the application's console window. For non-console applications, any attempt to read from Input or write to Output will generate an I/O error.
-
cade o código ?
-
Unit1.pas
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Image1: TImage; Button1: TButton; procedure Button1Click(Sender: TObject); procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormCreate(Sender: TObject); private procedure Load; { Private declarations } public { Public declarations } end; var Form1: TForm1; BMP: TBitmap; P: TPoint; P_Clicked: TPoint; Clicked: Boolean = false; implementation {$R *.dfm} procedure TForm1.Load; var MyRect, MyOther: TRect; begin MyRect := Rect(P.X, P.Y, P.X + Image1.Width, P.Y + Image1.Height); MyOther := Rect(0,0,Image1.Width, Image1.Height); Image1.Canvas.CopyRect(MyOther,BMP.Canvas,MyRect); end; procedure TForm1.Button1Click(Sender: TObject); begin P.X := 0; P.Y := 0; BMP := TBitmap.Create; BMP.LoadFromFile('C:\teste.bmp'); Load; end; procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin P_Clicked.X := X; P_Clicked.Y := Y; Clicked := True; end; procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if Clicked = false then exit; P.X := P.X + (X - P_Clicked.X); P.Y := P.Y + (Y - P_Clicked.Y); if P.X < 0 then P.X := 0 else if P.X > BMP.Width - Image1.Width then P.X := BMP.Width - Image1.Width; if P.Y < 0 then P.Y := 0 else if P.Y > BMP.Height - Image1.Height then P.Y := BMP.Height - Image1.Height; P_Clicked.X := X; P_Clicked.Y := Y; Load; end; procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Clicked := False; end; procedure TForm1.FormCreate(Sender: TObject); begin DoubleBuffered := True; end; end.
Unit1.dfmobject Form1: TForm1 Left = 192 Top = 107 Width = 696 Height = 480 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 object Image1: TImage Left = 8 Top = 8 Width = 521 Height = 433 Cursor = crHandPoint OnMouseDown = Image1MouseDown OnMouseMove = Image1MouseMove OnMouseUp = Image1MouseUp end object Button1: TButton Left = 536 Top = 40 Width = 75 Height = 25 Caption = 'Abrir' TabOrder = 0 OnClick = Button1Click end end
-
-
procedure TfrmInsereCliente.btnInsereClick(Sender: TObject); begin if ncadastro.Text = '' then begin showmessage('Favor colocar o nome'); end else if fcadastro.Text = '' then begin showmessage('Favor colocar o telefone'); end else datamodule1.AdoQuery.Close; datamodule1.AdoQuery.SQL.Clear; datamodule1.AdoQuery.SQL.Add('Insert Into Clientes(idCliente,Nome,Fone)'); datamodule1.AdoQuery.SQL.Add('Values('+inttostr(id)+','+quotedstr(ncadastro)+','+quotedstr(fcadastro)); // Aqui dá o erro datamodule1.AdoQuery.Open; end; end.
-
qryAniversario.FieldByName('campo').AsString
-
que delphi você usa ? eu usava delphi7 e não tive problema algum ao migrar ... você tem q instalar q nem no delphi7, axa o arquivo DCLSOCKETS10.bpl eu axo q era esse o nome e instala ele, isso é em componentes install packages ...
-
ou assim
<? echo "<select name=\"categoria\">"; $conexao = mysql_connect("localhost", "root", ""); mysql_select_db("biblio", $conexao); $sql="SELECT nome FROM aux_categoria"; $result = mysql_query($sql,$conexao) or die(mysql_error()); while ($s = mysql_fetch_array($result)) { echo "<option value=\"" . $s['nome'] "\">" . $ver . "</option>"; } echo "</select>"; ?>
-
bom vou tentar fazer uma coisa mais mastigada para você
function SubtrairTemp($tmpFinal, $tmpInicial){ //Calcular Final - Inicial, formato HH:NN:SS $tmpFinal = explode(":", $tmpFinal); $ss_fn = ($tmpFinal[0] * 3600) + ($tmpFinal[1] * 60) + ($tmpFinal[2]); $tmpInicial = explode(":", $tmpInicial); $ss_in = ($tmpInicial[0] * 3600) + ($tmpInicial[1] * 60) + ($tmpInicial[2]); $ss_rs = $ss_fn - $ss_in; // Agora formata novamente a data ... $nn_rs = 0; $hr_rs = 0; while($ss_rs > 59){ $ss_rs = $ss_rs - 60; $nn_rs = $nn_rs + 1; if($nn_rs>=60){ $nn_rs = 0; $hr_rs = $hr_rs + 1; } } return $hr_rs . ":" . $nn_rs . ":" . $ss_rs }
na verdade fuii fazendo aqui nem testei, mas axo q ta certo
Web Update
em Delphi, Kylix
Postado
cara esse código que seis passaram ai tá muito ruim.... sem zuera...
por exemplo
isso poderia ser substituido por simplesmente isso StringReplace(Data.Caption, '/', '', [rfReplaceAll]) ou até mesmo FomatDateTime('DDMMYY', StrToDate(Data.Caption)); sem falar de outras formas que tambem dariam certo, em apenas 1 linha...
Sugiro que antes que façam um atualizar do seu prog, estudem um pouco de lógica de prog., desculpe o modo de falar meu, parece um pouco ignorância...
outro ponto, não utilizar o UrlMon.... use componentes como TIDHTTPClient da palheta indy, ou HttpClient da palheta ICS (www.overbyte.be)....