Posts by Junior Moreira • 7,299 points
217 posts
- 
		3 votes1 answer32 viewsA: Error E2033 Types of current and formal var Parameters must be identical. How To Troubleshoot?In the procedure statement you used var TipoMsg: Integer Therefore, Delphi identifies the TipoMsg as a pointer/reference in memory. This enables you to rewrite the contents of the parameter within… 
- 
		2 votes1 answer72 viewsA: How to create a complex Tjsonobject/Tjsonarray with XE2Here the objects are passed as reference, so be careful when destroying. Come on. The process is simple, here it is like the XML Nodes, we have Father and Son. In this world, if you destroy a Father… 
- 
		1 votes2 answers38 viewsA: How to stretch a form only the width?You can program a limiter in the event 'Onresize', think of something like: if Self.Height <> 400 then Self.Height := 400; And this would suit any form style. In this example we are limiting… 
- 
		0 votes1 answer62 viewsA: How can I get all data stored in an arrayYou have a logic problem here: FDQueryClient.ParamByName('vId_client').Value := matriz[i]; matrix[i] has a result only because you are accessing a specific position. The ideal would be to use WHERE… 
- 
		0 votes2 answers133 viewsA: How to copy a. txt encoded file to another decoded file using Assignfile?You have a clear indentation problem. Note this part of your code: while not Eof(arq) do begin Readln(arq, linha); s := Pos(Encode64('Bitmap_'), linha); nome := Copy(linha, 1, s-1); Delete(linha, 1,… 
- 
		1 votes1 answer234 viewsA: Data registration in a dynamic array returning EaccesviolationChange the approach, where this using: tamanho:= Length(Pedidos)+ 1; SetLength(Pedidos,tamanho); with pedido do begin id:= StrToInt(Ed3Num1.Text); nome:= Ed3Text1.Text; valor:=… 
- 
		0 votes3 answers50 viewsA: Sintax error at or near "Select"The correct thing is to clear the list before trying to add a new query. The estate SQL is probably derived from a TList, so use the command Clear. untDMPrincipal.DMPrincipal.UniQuery2.Close;… 
- 
		2 votes3 answers920 viewsA: Scroll through all json nodesIn the more modern versions of Delphi it is very simple to work with Json, but in smaller versions than XE8 it is complicated, a lot of gambiarra is necessary for a simple native use. Native we can… 
- 
		0 votes1 answer68 viewsA: Link in Statusbar bar Delphi 10The code is correct, but to trigger the event OnDrawPanel needs to set the style property panel as psOwnerDraw. This can be done either in design or via code. I think of something in Create do form,… delphianswered Junior Moreira 7,299
- 
		2 votes1 answer138 viewsA: How to Know if the Form that is the son of a Tpanel is openPress Alt+P+V delete the form it includes automatically, it should look something like: Application.CreateForm(TForm2, Form2); This logical test: if not(Assigned(Form2)) then In the documentation it… 
- 
		1 votes1 answer50 viewsA: Should I use First after using Open in Firedac?It makes no sense to use the first, just perform any query and observe the property RecNo will always be on the first record, ie after the command Open the cursor will always be in the first record.… 
- 
		0 votes1 answer503 viewsA: Delphi - Join PDF filesYou can use a third party component for this purpose, here we use the Gnostice Pdftoolkit To merge is something like... var vArquivos: TStringList; begin vArquivos := TStringList.Create;… 
- 
		0 votes1 answer876 viewsA: Capture values of an input in Delphi (Tchromium)Create a js function that can be triggered by a click on a button or any other medium. In Delphi you need to register an extension in the Browser. Ex. type TCustomRenderProcessHandler =… 
- 
		0 votes1 answer150 viewsA: Url Image Locking Delphi Mobile ApplicationAnd if you change the concept? Instead of creating a thread to do EVERYTHING, create a thread for each need? Something like: for i := 0 to Pred(lResult.Count) do begin TThread.CreateAnonymousThread(… 
- 
		1 votes2 answers318 viewsA: Filter in Delphi does not work with accentIn this case, you only need to modify the collation of the database. Something like: ALTER DATABASE "nome_banco_dados" CHARSET = Latin1 COLLATE = latin1_swedish_ci; latin1_general_ci: No distinction… delphianswered Junior Moreira 7,299
- 
		1 votes3 answers858 viewsA: Windows service does not start automaticallyAdd to the event OnCreate the instruction: Self.StartType := stBoot; In this way the service will be installed and set as "Automatic", from a start in it make its tests if the service is running. I… 
- 
		3 votes2 answers70 viewsA: Inputado value does not appearLet’s go to the problem itself. The logical test is wrong, because there are two variables with the same name of the components. And in the pascal it will give priority to the local variables. You… 
- 
		1 votes3 answers623 viewsA: Wait Thread Finish to continue code - DelphiWhen one creates ThreadSql of the kind CreateAnonymousThread and from a start, they will be executed immediately, however, the Result will be triggered immediately also, ie, the cursor will scroll… 
- 
		0 votes1 answer56 viewsA: Access Violation variable type TxsdateIf it is a TXSDateTime you cannot assign directly. Something like... uses Soap.XSBuiltIns; ... var vDataTxs: TXSDateTime; begin vDataTxs := TXSDateTime.Create;… delphianswered Junior Moreira 7,299
- 
		0 votes1 answer41 viewsA: Run Thread SerializedIf the intention is just not to lock the application. Try as follows: var vTarefa: TThread; begin vTarefa := TThread.CreateAnonymousThread( procedure begin ... // Faça todo procedimento aqui end);… 
- 
		3 votes1 answer208 viewsA: How to Shuffle Characters from a String in DelphiPosting not to go unanswered as suggested by the author of the question. Source: Jefferson Rudolf (users/34982) function EmbaralharString(const aString: string): string; var i: integer; vPosicao:… 
- 
		0 votes1 answer745 viewsA: DDL Indy forcing TLS requests 1.2If endpoint is an https it is no use just setting the properties and adding the DLL. It is necessary to inform the component responsible for managing SSL. Necessary to inform the property IOHandler… 
- 
		0 votes1 answer59 viewsQ: PIVOT - Difficulty with ColumnsConsidering the table: CREATE TABLE [dbo].[VENDAS]( [VENCIMENTO] [datetime] NULL, [VENCIDO] [decimal](18, 0) NULL, [RECEBIDO] [decimal](18, 0) NULL ) ON [PRIMARY] INSERT INTO VENDAS… sql-serverasked Junior Moreira 7,299
- 
		2 votes1 answer155 viewsA: Run Oncalcfield only when pressing [Enter]I suggest you modify the field from Calculated to Date. Schedule in the event KeyDown of DbGrid something like begin if Key = VK_RETURN then begin Nome_Tabela.Edit; Nome_TabelaQTD.AsInteger :=… 
- 
		1 votes1 answer305 viewsA: How to define an empty XML tag with Delphi?Suggestion for immediate troubleshooting is not to use the Delphi component to generate xml. And your problem is not only the version of Delphi, here we use the latest version and the same problem… 
- 
		2 votes2 answers283 viewsA: SQL Firebird search for last names by initial letterYou’re already in the way, you SUBSTRING almost meets, missed to put it to perform. Ex: SELECT C.NOME, SUBSTRING(C.NOME FROM POSITION(' ', C.NOME) + 1 FOR CHAR_LENGTH(C.NOME)) FROM CLIENTES C WHERE… 
- 
		3 votes1 answer2143 viewsA: Update - Firebird with Inner JoinIn Firebird you cannot accomplish this feat. The syntax of his update is: update NOME_TABELA set NOME_CAMPO = VALOR where xyz = xyz The JOIN will have to be with sub-select after the WHERE Source… 
- 
		0 votes2 answers5456 viewsA: Remove space between words in ExcelTo remove spacing use the SUBSTITUIR if the installation is available. Ex: =SUBSTITUIR(E7;" ";"") The ARRUMAR is only for spaces before and after, between words it does not process.… excelanswered Junior Moreira 7,299
- 
		1 votes1 answer458 viewsA: How to get id values at the click of the button (html) in Tchromium Cef4delphi?Create a js function that can be triggered by a click on a button or any other medium. In Delphi you need to register an extension in the Browser. Ex. type TCustomRenderProcessHandler =… 
- 
		1 votes1 answer595 viewsA: Unknown error in integration with Webservice RESTUse as follows:: RESTClient.BaseURL := MINHA_URL; Requisicao.Method := TRESTRequestMethod.rmPOST; Requisicao.Resource := '/REQUISICAO_QUALQUER'; Requisicao.Params.AddItem('username', aUsuario,… 
- 
		2 votes1 answer345 viewsA: How to pass a string as parameter to a C#DLLPass Delphi parameter to DLL(any language, mainly VB) to use WideString or AnsiString. AnsiString: string composed of ASCII characters. String: in the newer versions of Delphi (2007 onwards),… 
- 
		0 votes1 answer434 viewsA: Client and Server socket with IndyI prefer to use the standard socket component, but to TIndy I’ve used it as follows: Considering that the server writes line by line, just inform in the first line the number of lines being sent.… 
- 
		2 votes1 answer114 viewsA: Create a Password CalculatorYou can perform simple math calculation for this, what you need is to decode the current date to extract the required data. In the System.DateUtils there is a function for this. Ex to the first… delphianswered Junior Moreira 7,299
- 
		2 votes1 answer676 viewsA: Delphi - Access Violation in login formThis problem occurs because dtm.fdquery_Login was not created, does not exist, is equal to nil. In Delphi objects must be instantiated before being used. if dtm = nil then dtm := Tdtm.Create(Self);… 
- 
		2 votes1 answer37 viewsA: Aid with update performanceCreate a list of updates and run them at once, something like: EXECUTE BLOCK AS BEGIN UPDATE tabela WHERE ID = X; UPDATE tabela WHERE ID = X; UPDATE tabela WHERE ID = X; ... END; Very easy and fast.… 
- 
		1 votes1 answer91 viewsA: problem when running select on more than one table in Delphi and FirebirdThe problem may be in assigning the date parameter. In Firebird the default date is mm/dd/yyyy then... IBQuery2.ParamByName('Data_Inicial').Value:= FormatDateTime('mm/dd/yyyy',… 
- 
		1 votes1 answer661 viewsA: save in txt the result of the sql query in Firebird using DelphiThis part needs an adjustment: while not IBQuery2.eof do begin WriteLn(arquivo); IBQuery2.Next; end; for: while not IBQuery2.eof do begin vTexto := IBQuery2.FieldByName('NOME_CAMPO_1').AsString +… 
- 
		4 votes1 answer178 viewsA: Adding items dynamically in ClientdatasetYou can use the String helper for this, declare in the uses a System.StrUtils. This way you have access to various help functions. For the case presented you would use: CDS.Insert; CDSCod.AsString… delphianswered Junior Moreira 7,299
- 
		0 votes2 answers2179 viewsA: How to submit information to a json api in Delphi 7, Please help meUse the Indy library, Very simple, look at: var HTTP: TIdHTTP; vJsonAEnviar: TStringStream; begin HTTP:= TIdHTTP.Create; HTTP.Request.UserAgent := 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0)… delphianswered Junior Moreira 7,299
- 
		1 votes2 answers251 viewsA: Fdquery what risks to use variable instead of ParameterWe use Firebird here too, and I assure you that there is no risk, because everything is pure string that only later will be processed by the database. FDconsult.SQL.Clear;{Dependendo do componente é… 
- 
		1 votes2 answers118 viewsA: How to improve the performance of an xls file generator in my Delphi 4 + SQL Server 2000 application?The delay is seeming confusion of logic, for each RECORD of the dataset it runs through ALL Fields. Assuming you have 50 records and each record has 25 columns: while not DataSet.EOF do begin for i… 
- 
		1 votes2 answers195 viewsA: Delphi Seattle Problems with SocketsThe library is not installed by default, but is available in Delphi fonts. For this just install the bplequivalent to the version you are using, usually in the bin folder. In the Tokyo version the… 
- 
		2 votes2 answers143 viewsA: Error comparing strings in DelphiGenerally FieldValues['NOME_FIELD'] results is a Variant, without a suitable Typecast can result in errors exactly like this one. The correct is you enter the field name and type, follow example.… delphianswered Junior Moreira 7,299
- 
		0 votes5 answers1444 viewsA: Query pass null parameterYou will need to make some adaptations to achieve, in the current format you want is NOT possible, because: select * from tb_teste where tb_teste.data_hora FALTA_OPERADOR :PARAMETRO; The operator is… 
- 
		3 votes2 answers139 viewsA: What are the consequences of leaving the system without closing the tables?On the current system I am working on, end user license is done through transactional control between the application and the database Firebird. That is, in this model, we know how many connections… delphianswered Junior Moreira 7,299
- 
		3 votes1 answer54 viewsA: Duplicate resource fileGo to the project source, (Project-> View Source menu) and check the directive {$R *.res} was not defined. If all files are defined .res will be added automatically, without the need to declare… delphianswered Junior Moreira 7,299
- 
		2 votes1 answer142 viewsA: Error compiling in Delphi: expected BEGIN but Received UNITFirst, at Delphi, all string to be written as follows: const Caracteres = 'seu conteudo aqui'; Note that starts/ends with single quotes, if concatenating, the operator must be used + each new set… delphianswered Junior Moreira 7,299
- 
		1 votes1 answer200 viewsA: Get Tjsonstring value from Firemonkey (Delphi)It would be something like: var vJson: String; vObjeto: TJSONObject; begin vObjeto := TJSONObject.ParseJSONValue(JSONValue_AQUI) as TJSONObject; vJson := vObjeto.Get(0).JsonValue.ToString;… 
- 
		0 votes1 answer74 viewsA: How to use the Tbitmap32 (Delphi) type in a DLL called in C++?Apparently this using a third party public, at that point it is difficult to help, but in theory was created based on Timage pattern. If this is the case the creation is with error and the problem… 
- 
		0 votes2 answers775 viewsA: Edge on a TeditThe component itself has an edge, you can control bsSingle edge style for bsNone. But for this I should put all the Tedit with the style bsNone, if this is not the case you can also use a Tshape.… delphianswered Junior Moreira 7,299