std.signals: Why emit() not extist?

2021-12-30 Thread Marcone via Digitalmars-d-learn
I get this error: Error: undefined identifier `emit`, did you mean function `exit`?

Re: Why can't the DMD compiler accept files or directories with white spaces even delimited by quotes?

2021-09-04 Thread Marcone via Digitalmars-d-learn
On Sunday, 5 September 2021 at 00:00:33 UTC, jfondren wrote: On Saturday, 4 September 2021 at 23:50:33 UTC, Marcone wrote: Example: dmd "hello world.d" ``` $ cat hello\ world.d module helloworld; void main() { import std.stdio : writeln; writeln("without the explicit 'module', this

Why can't the DMD compiler accept files or directories with white spaces even delimited by quotes?

2021-09-04 Thread Marcone via Digitalmars-d-learn
Example: dmd "hello world.d"

Re: how to import .lib library

2021-08-15 Thread Marcone via Digitalmars-d-learn
On Sunday, 15 August 2021 at 10:12:17 UTC, Timofeyka wrote: Thank you for your reply! I wanted to link to my project another project without source code. This tutorial can help you create yours libs: https://wiki.dlang.org/Win32_DLLs_in_D

Re: how to import .lib library

2021-08-15 Thread Marcone via Digitalmars-d-learn
On Sunday, 15 August 2021 at 09:49:39 UTC, Timofeyka wrote: Hello! I may have a very stupid question, but still. How do I include a .lib library? How to use it in your code? Inside the source code you can use pragma. Example: pragma(lib, "gdi32.lib"); In DMD command line you can use -L flag

Re: How to extend the string class to return this inside the square bracket?

2021-08-14 Thread Marcone via Digitalmars-d-learn
On Saturday, 14 August 2021 at 08:24:41 UTC, user1234 wrote: On Friday, 13 August 2021 at 23:33:05 UTC, Paul Backus wrote: On Friday, 13 August 2021 at 23:23:55 UTC, Marcone wrote: writeln("Hello World!"[x.indexOf("e")..x.indexOf("r")]); indexOf()is just a simple example, not the goal. I

Re: How to extend the string class to return this inside the square bracket?

2021-08-13 Thread Marcone via Digitalmars-d-learn
On Friday, 13 August 2021 at 23:21:42 UTC, Ali Çehreli wrote: On 8/13/21 4:08 PM, jfondren wrote: On Friday, 13 August 2021 at 22:09:59 UTC, Marcone wrote: Isn't there some unario operator template that I can use with lambda to handle a string literal? So, something other than an exact

Re: How to extend the string class to return this inside the square bracket?

2021-08-13 Thread Marcone via Digitalmars-d-learn
On Friday, 13 August 2021 at 23:08:07 UTC, jfondren wrote: On Friday, 13 August 2021 at 22:09:59 UTC, Marcone wrote: Isn't there some unario operator template that I can use with lambda to handle a string literal? So, something other than an exact "lit"[0..this.xx(..)] syntax is fine?

Re: How to extend the string class to return this inside the square bracket?

2021-08-13 Thread Marcone via Digitalmars-d-learn
On Friday, 13 August 2021 at 21:47:22 UTC, Steven Schveighoffer wrote: On 8/13/21 5:05 PM, Marcone wrote: How to extend the string class to return this inside the square bracket the same way opDollar $ returns the length of the string? Thank you.     import std;     void main(){    

Re: How to extend the string class to return this inside the square bracket?

2021-08-13 Thread Marcone via Digitalmars-d-learn
On Friday, 13 August 2021 at 21:14:29 UTC, user1234 wrote: On Friday, 13 August 2021 at 21:05:22 UTC, Marcone wrote: How to extend the string class to return this inside the square bracket the same way opDollar $ returns the length of the string? Thank you. import std; void main(){

How to extend the string class to return this inside the square bracket?

2021-08-13 Thread Marcone via Digitalmars-d-learn
How to extend the string class to return this inside the square bracket the same way opDollar $ returns the length of the string? Thank you. import std; void main(){ writeln("Hello World!"[0..this.indexOf("o")]); }

Re: -L/SUBSYSTEM:windows Error when using -m64

2021-08-10 Thread Marcone via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 19:01:42 UTC, Adam D Ruppe wrote: On Tuesday, 10 August 2021 at 18:59:33 UTC, Marcone wrote: Using -Lgdi32.lib -Luser32.lib? Same error. The part after that: If you want the Windows subsystem too, use -L/subsystem:windows -L/entry:mainCRTStartup. Pass BOTH

Re: -L/SUBSYSTEM:windows Error when using -m64

2021-08-10 Thread Marcone via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 18:51:28 UTC, Adam D Ruppe wrote: On Tuesday, 10 August 2021 at 18:45:35 UTC, Marcone wrote: Hi, do you have some other solution without arsd.simpledisplay? I want only dmd feature. Did you read the paragraph under the link? That IS a dmd switch. Or a ldc

Re: -L/SUBSYSTEM:windows Error when using -m64

2021-08-10 Thread Marcone via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 18:36:27 UTC, Adam D Ruppe wrote: On Tuesday, 10 August 2021 at 18:34:03 UTC, Marcone wrote: How can I hide console using -m64? http://dpldocs.info/experimental-docs/arsd.simpledisplay.html#installation-instructions Hi, do you have some other solution without

-L/SUBSYSTEM:windows Error when using -m64

2021-08-10 Thread Marcone via Digitalmars-d-learn
How use -L/SUBSYSTEM:windows for hide console in x64 prograns? Becouse if I use -L/SUBSYSTEM:windows and -m64 I get this error: lld-link: error: undefined symbol: WinMain referenced by msvcrt120.lib(msvcrt_stub2.obj):($LN5) Error: linker exited with status 1 If I delete -L/SUBSYSTEM:windows

Re: Error when compile with DMD using -m64?

2021-08-10 Thread Marcone via Digitalmars-d-learn
On Tuesday, 10 August 2021 at 15:55:42 UTC, Bastiaan Veelo wrote: On Tuesday, 10 August 2021 at 01:29:04 UTC, Marcone wrote: Solved converting long and int. Use `size_t` and `ptrdiff_t` instead to make your program compile in both 32 bit and 64 bit modes.

Re: Error when compile with DMD using -m64?

2021-08-09 Thread Marcone via Digitalmars-d-learn
On Monday, 9 August 2021 at 19:58:03 UTC, novice2 wrote: On Monday, 9 August 2021 at 19:53:48 UTC, Marcone wrote: program not run. compilation errors? runtime errors? Solved converting long and int.

Error when compile with DMD using -m64?

2021-08-09 Thread Marcone via Digitalmars-d-learn
When I compile program in Ly Windows x64 using dmd flag -m64 the program not run. How fix it?

Re: How Add Local modules mymodule.d using DUB?

2021-08-09 Thread Marcone via Digitalmars-d-learn
On Monday, 9 August 2021 at 16:37:10 UTC, Steven Schveighoffer wrote: On 8/9/21 12:32 PM, Marcone wrote: My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you. You mean how to add a local project (that isn't on code.dlang.org)? `dub

Re: How Add Local modules mymodule.d using DUB?

2021-08-09 Thread Marcone via Digitalmars-d-learn
On Monday, 9 August 2021 at 16:37:10 UTC, Steven Schveighoffer wrote: On 8/9/21 12:32 PM, Marcone wrote: My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you. You mean how to add a local project (that isn't on code.dlang.org)? `dub

How Add Local modules mymodule.d using DUB?

2021-08-09 Thread Marcone via Digitalmars-d-learn
My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you.

Re: How to divide by space keeping words with spaces inside quotes?

2021-08-09 Thread Marcone via Digitalmars-d-learn
Thank you very much! With your helps I created this function that works fine: // Function splitcommas() string[] splitcommas(string text) nothrow { try { return text.splitter!(Yes.keepSeparators)(regex("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'")).array.map!(x => x.replace("\"",

How to divide by space keeping words with spaces inside quotes?

2021-08-08 Thread Marcone via Digitalmars-d-learn
How to divide by space keeping words with spaces inside quotes? Exanple: string text = "Duck Cat \"Carl Rivers\" Dog"; I want split to: ["Duck", "Cat", "Carl Rivers", "Dog"] ATENTION: I DON'T WANT: ["Duck", "Cat", "Carl", "Rivers", "Dog"] How can I get it in Dlang?

Re: How suppress (Hide) prompt command console in DMC? Like -mwindows in C++?

2021-08-07 Thread Marcone via Digitalmars-d-learn
On Sunday, 8 August 2021 at 00:23:55 UTC, Adam D Ruppe wrote: On Sunday, 8 August 2021 at 00:02:18 UTC, Marcone wrote: I create a gui program using DMC. I want to know how suppress (Hide) prompt command console in DMC? Like -mwindows in C++. Thank you. use /subsystem:windows a few more

How suppress (Hide) prompt command console in DMC? Like -mwindows in C++?

2021-08-07 Thread Marcone via Digitalmars-d-learn
I create a gui program using DMC. I want to know how suppress (Hide) prompt command console in DMC? Like -mwindows in C++. Thank you.

DMC Error: comctl32.lib Error 43: Not a Valid Library File

2021-08-07 Thread Marcone via Digitalmars-d-learn
Using DMC to compile .cpp using gdi32.lib as dmc compile parameter. I get this error: OPTLINK (R) for Win32 Release 8.00.16 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html comctl32.lib Error 43: Not a Valid Library

Re: DMC Error: comctl32.lib Error 43: Not a Valid Library File

2021-08-07 Thread Marcone via Digitalmars-d-learn
I added gdi32.lib user32.lib kernel32.lib comctl32.lib as dmc parameters. But don't work.

There are some Feed RSS or mail alert for new Dlang compiler update?

2021-06-13 Thread Marcone via Digitalmars-d-learn
Thank you very much guys.

There are some Feed RSS or mail alert for new Dlang compiler update?

2021-06-12 Thread Marcone via Digitalmars-d-learn
Becouse I can not find it.

How use lineSplitter with KeepTerminator flag?

2021-06-09 Thread Marcone via Digitalmars-d-learn
I want add Yes.keepTerminator flag on lineSplitter.

Re: Why std.file.append() new lind "\n" not work in Windows?

2021-06-09 Thread Marcone via Digitalmars-d-learn
std.file.append(file, "\nApple"); std.file.append(file, "\nBanana"); Result: AppleBanana

Why std.file.append() new lind "\n" not work in Windows?

2021-06-09 Thread Marcone via Digitalmars-d-learn
std.file.append("file; \nApple"); std.file.append("file; \nBanana"); Result: AppleBanana

Re: Why std.file.append() new lind "\n" not work in Windows?

2021-06-09 Thread Marcone via Digitalmars-d-learn
std.file.append(file; "\nApple"); std.file.append(file; "\nBanana"); Result: AppleBanana

foreach: How start a foreach count with specific number?

2021-06-02 Thread Marcone via Digitalmars-d-learn
Example: // --args "C:\Users\Usuario\Downloads\dist\Programa.exe" import modulo; void main(string[] args){ if (args.length >= 2) { string exePrincipal = args[1]; chdir(exePrincipal.dirName); foreach(n, i;

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread Marcone via Digitalmars-d-learn
On Friday, 28 May 2021 at 17:04:15 UTC, Vinod K Chandran wrote: On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: I am learning D by writing a Windows only GUI library. It is taking too much time for me since, I am writing some stuff and then happen to learn some new things about it

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-28 Thread Marcone via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. Requirements: [...] Win32Api. You can use resEdit to create your resource GUI. Work only for Windows. Here is my program created with Dlang and Win32Api GUI:

Re: DMC + Win32Api: Error: undefined identifier 'SetDCBrushColor'

2021-05-17 Thread Marcone via Digitalmars-d-learn
Why gdi32.lib in dmc is not a Valid Library File?

Re: DMC + Win32Api: Error: undefined identifier 'SetDCBrushColor'

2021-05-16 Thread Marcone via Digitalmars-d-learn
On Sunday, 16 May 2021 at 15:43:51 UTC, Adam D. Ruppe wrote: On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote: Error: undefined identifier 'SetDCBrushColor' Did you include gdi32.lib on the command line? I got this error: C:\Users\Usuario\Arquivos\dm\lib\gdi32.lib Error 43: Not a

Re: DMC + Win32Api: Error: undefined identifier 'SetDCBrushColor'

2021-05-16 Thread Marcone via Digitalmars-d-learn
On Sunday, 16 May 2021 at 18:06:40 UTC, Jack wrote: On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote: Well, I program in D as a hobby for just over a year, and I like to learn and explore this wonderful programming language. Now I found the DMC compiler that compiles C ++ code. So I

Re: DMC + Win32Api: Error: undefined identifier 'SetDCBrushColor'

2021-05-16 Thread Marcone via Digitalmars-d-learn
On Sunday, 16 May 2021 at 15:43:51 UTC, Adam D. Ruppe wrote: On Sunday, 16 May 2021 at 14:51:56 UTC, Marcone wrote: Error: undefined identifier 'SetDCBrushColor' Did you include gdi32.lib on the command line? Yes, I did it. But not work. I get this error: Error: undefined identifier

DMC + Win32Api: Error: undefined identifier 'SetDCBrushColor'

2021-05-16 Thread Marcone via Digitalmars-d-learn
Well, I program in D as a hobby for just over a year, and I like to learn and explore this wonderful programming language. Now I found the DMC compiler that compiles C ++ code. So I decided to test it. Creating a program with a win32api graphical interface I run into this error: Error:

Re: How use Predicate (alias pred = "a*b")?

2021-05-13 Thread Marcone via Digitalmars-d-learn
On Thursday, 13 May 2021 at 21:38:25 UTC, Adam D. Ruppe wrote: On Thursday, 13 May 2021 at 21:30:43 UTC, Marcone wrote: template foo(alias pred = "a*b"){ void foo(int x, int y){ writeln(x.unaryFun!pred); First, you really shouldn't use these at all. instead of a

Re: How use Predicate (alias pred = "a*b")?

2021-05-13 Thread Marcone via Digitalmars-d-learn
On Thursday, 13 May 2021 at 21:38:25 UTC, Adam D. Ruppe wrote: On Thursday, 13 May 2021 at 21:30:43 UTC, Marcone wrote: template foo(alias pred = "a*b"){ void foo(int x, int y){ writeln(x.unaryFun!pred); First, you really shouldn't use these at all. instead of a

How use Predicate (alias pred = "a*b")?

2021-05-13 Thread Marcone via Digitalmars-d-learn
import std; template foo(alias pred = "a*b"){ void foo(int x, int y){ writeln(x.unaryFun!pred); } } void main(){ foo(5, 4); } "a" works, but "b" not work. I get this error: Error: undefined identifier `b`

Re: Can the DMC completely replace the C or C ++ compiler?

2021-05-06 Thread Marcone via Digitalmars-d-learn
On Thursday, 6 May 2021 at 20:10:29 UTC, Adam D. Ruppe wrote: On Thursday, 6 May 2021 at 19:59:01 UTC, Marcone wrote: Well, I am writing a C++ program and compiling with DMC Digital Mars, and the program is running normally. Can the DMC completely replace the C or C ++ compiler? It IS a C

Can the DMC completely replace the C or C ++ compiler?

2021-05-06 Thread Marcone via Digitalmars-d-learn
Well, I am writing a C++ program and compiling with DMC Digital Mars, and the program is running normally. Can the DMC completely replace the C or C ++ compiler?

Re: How suppress DMC File name and path showing after compile?

2021-05-06 Thread Marcone via Digitalmars-d-learn
On Thursday, 6 May 2021 at 16:00:03 UTC, Paul Backus wrote: On Thursday, 6 May 2021 at 15:55:07 UTC, Marcone wrote: dmc Programa.cpp && Programa.exe is showing this, but I want show only "Hello World!" C:\Users\Usuario\Arquivos\Estudando\C\Programa.cpp: <--- I don't want DMC show this.

How suppress DMC File name and path showing after compile?

2021-05-06 Thread Marcone via Digitalmars-d-learn
dmc Programa.cpp && Programa.exe is showing this, but I want show only "Hello World!" C:\Users\Usuario\Arquivos\Estudando\C\Programa.cpp: <--- I don't want DMC show this. Hello World! [Finished in 0.2s]

Re: win64 DLL stdout printing after main process completes

2021-04-20 Thread Marcone via Digitalmars-d-learn
On Monday, 19 April 2021 at 14:55:03 UTC, cc wrote: I'm not sure if this is something unique to D or not, but I've having a minor issue where stdout output from a DLL (either via printf or phobos std.stdio write) is not displayed until after the main process has completed. I'm making a

Re: How send parameters to DMD when using DUB

2021-04-19 Thread Marcone via Digitalmars-d-learn
/+ dub.sdl: dependency "telega" version="~>0.2.0" lflags "C:\\Users\\Usuario\\Arquivos\\Sublime Text Build 3211\\Data\\Packages\\resources.res" platform="dmd" +/ Solved replaceing dflags to lflags

Re: How send parameters to DMD when using DUB

2021-04-19 Thread Marcone via Digitalmars-d-learn
I'm trying this code but do not work. /+ dub.sdl: dependency "telega" version="~>0.2.0" dflags "C:\\Users\\Usuario\\Arquivos\\Sublime Text Build 3211\\Data\\Packages\\resources.res" platform="dmd" +/

How send parameters to DMD when using DUB

2021-04-19 Thread Marcone via Digitalmars-d-learn
I need add resources. But how can I make it using DUB?

Re: DUB Error with packcage dformlib

2021-04-18 Thread Marcone via Digitalmars-d-learn
On Sunday, 18 April 2021 at 07:31:12 UTC, Imperatorn wrote: On Sunday, 18 April 2021 at 01:37:14 UTC, Marcone wrote: I have this message when try build dub. How solve it? Unresolvable dependencies to package dformlib app ~master depends on dformlib ~0.2.2> Just a comment, dforms is millions

DUB Error with packcage dformlib

2021-04-17 Thread Marcone via Digitalmars-d-learn
I have this message when try build dub. How solve it? Unresolvable dependencies to package dformlib app ~master depends on dformlib ~0.2.2>

Why DUB do not import local D modules dependencies?

2021-04-09 Thread Marcone via Digitalmars-d-learn
How make dub import local D modules (mymodule.d) dependencies?

How Add DUB packages path to Dlang Linter to avoid Errors?

2021-04-07 Thread Marcone via Digitalmars-d-learn
When I import modules from dub im my SublimeText, D Linter show as errors. Example: 7:8 error dmd:Error module `core` is in file 'vibe\core\core.d' which cannot be read How solve it?

How use WinUI with Dlang?

2021-03-31 Thread Marcone via Digitalmars-d-learn
There is a way for create modern windows GUI with WinUI and Dlang?

Re: Why I need DUB? Will never DMD don't just use import for import packages?

2021-03-29 Thread Marcone via Digitalmars-d-learn
On Monday, 29 March 2021 at 19:14:41 UTC, Andre Pany wrote: On Monday, 29 March 2021 at 19:06:33 UTC, Marcone wrote: Why can't I just use: import vibe.vibe; for import packages like Nim or Python? Why I still use DUB? In python you also have pip. It is possible to use vibe.d (any dub

Re: Why I need DUB? Will never DMD don't just use import for import packages?

2021-03-29 Thread Marcone via Digitalmars-d-learn
On Monday, 29 March 2021 at 19:14:41 UTC, Andre Pany wrote: On Monday, 29 March 2021 at 19:06:33 UTC, Marcone wrote: Why can't I just use: import vibe.vibe; for import packages like Nim or Python? Why I still use DUB? In python you also have pip. It is possible to use vibe.d (any dub

Re: Why I need DUB? Will never DMD don't just use import for import packages?

2021-03-29 Thread Marcone via Digitalmars-d-learn
On Monday, 29 March 2021 at 19:14:41 UTC, Andre Pany wrote: On Monday, 29 March 2021 at 19:06:33 UTC, Marcone wrote: Why can't I just use: import vibe.vibe; for import packages like Nim or Python? Why I still use DUB? In python you also have pip. It is possible to use vibe.d (any dub

Why I need DUB? Will never DMD don't just use import for import packages?

2021-03-29 Thread Marcone via Digitalmars-d-learn
Why can't I just use: import vibe.vibe; for import packages like Nim or Python? Why I still use DUB?

Re: How add png image to zip file using std.zip?

2021-02-22 Thread Marcone via Digitalmars-d-learn
On Sunday, 21 February 2021 at 18:10:43 UTC, JN wrote: On Sunday, 21 February 2021 at 17:17:56 UTC, Marcone wrote: ZipArchive zip = new ZipArchive(); std.file.write("foo.zip", zip.build()); ArchiveMember f = new ArchiveMember(); f.name = "Wallpaper_001.png";

How add png image to zip file using std.zip?

2021-02-21 Thread Marcone via Digitalmars-d-learn
ZipArchive zip = new ZipArchive(); std.file.write("foo.zip", zip.build()); ArchiveMember f = new ArchiveMember(); f.name = "Wallpaper_001.png"; zip.addMember(f); std.file.write("foo.zip", zip.build()); File is added with file size 0. How

Re: How can I check if template variable parameter is iterable before handle it?

2021-02-21 Thread Marcone via Digitalmars-d-learn
On Sunday, 21 February 2021 at 12:47:46 UTC, Boris Carvajal wrote: On Sunday, 21 February 2021 at 11:58:11 UTC, Marcone wrote: import std; void foo(T)(T bar){ static if (bar.isiterable()) // Need Somethin to check if bar is iterable. { // Execute it if bar is

How can I check if template variable parameter is iterable before handle it?

2021-02-21 Thread Marcone via Digitalmars-d-learn
import std; void foo(T)(T bar){ static if (bar.isiterable()) // Need Somethin to check if bar is iterable. { // Execute it if bar is iterable. foreach (i; bar) { } } else { // Execute it

My simple internet client made in Dlang.

2021-02-03 Thread Marcone via Digitalmars-d-learn
I study Dlang for just over a year only and have already risked creating a program even with a graphical interface and distribute it on the internet. Here is a part of that program, just the code without a graphical interface. It is a program for modifying http headers. You connect your

Re: How do I get the output of the time bash command?

2021-01-27 Thread Marcone via Digitalmars-d-learn
On Wednesday, 27 January 2021 at 09:35:21 UTC, Anthony wrote: I'm trying to read the timed output of a pipeShell command but it only results in empty output. Does anyone know why this is? ``` auto p = pipeShell("time ls"); foreach(str; p.stdout.byLine) {

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-24 Thread Marcone via Digitalmars-d-learn
On Saturday, 23 January 2021 at 21:26:28 UTC, James Blachly wrote: On 1/20/21 6:50 AM, Marcone wrote: On Tuesday, 19 January 2021 at 14:20:06 UTC, Imperatorn wrote: On Tuesday, 19 January 2021 at 11:10:25 UTC, Marcone wrote: On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-24 Thread Marcone via Digitalmars-d-learn
On Sunday, 24 January 2021 at 02:34:15 UTC, Jack wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable file application using Dlang? What are the dependencies that you would like to merge into executable? dlls? resources? Qt5 Dll's

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-20 Thread Marcone via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 14:20:06 UTC, Imperatorn wrote: On Tuesday, 19 January 2021 at 11:10:25 UTC, Marcone wrote: On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-19 Thread Marcone via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable file application using Dlang? Could you describe what you mean with "Bundle portable file application"? All dependencies

How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-18 Thread Marcone via Digitalmars-d-learn
How can I create a Standalone Bundle Portable file application using Dlang?

How define accepted types in a template parameter?

2021-01-16 Thread Marcone via Digitalmars-d-learn
For example, I want my function template to only accept integer or string;

Why many programmers don't like GC?

2021-01-13 Thread Marcone via Digitalmars-d-learn
I've always heard programmers complain about Garbage Collector GC. But I never understood why they complain. What's bad about GC?

Why D functions paramter can not implicit infer type of Variant?

2021-01-13 Thread Marcone via Digitalmars-d-learn
import std; void a(int b){ } void main() { Variant c = 10; a(c); // Error } Need more sugar.

How build DCD on Windows?

2021-01-11 Thread Marcone via Digitalmars-d-learn
Hi, Someone can Help me build exe dcd server and client on WIndows? Step by step? Becouse the informations disponible is very hard to undestand.

Re: How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
On Monday, 11 January 2021 at 21:01:57 UTC, Paul Backus wrote: On Monday, 11 January 2021 at 15:45:51 UTC, Marcone wrote: I can reffer length of literal string using $. "Hello World"[0..$] But I want make like it witout use variable name. "Hello World"[0..?.indexOf("o")] The exact syntax

Re: How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
On Monday, 11 January 2021 at 16:41:03 UTC, oddp wrote: On 11.01.21 16:45, Marcone via Digitalmars-d-learn wrote: "Hello World"[0..?.indexOf("o")] Does until [1] do the trick? "Hello World".until("o") // => "Hell" [1] https://dlang.or

How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I can reffer length of literal string using $. "Hello World"[0..$] But I want make like it witout use variable name. "Hello World"[0..?.indexOf("o")]

Re: How can I directly reffer literal element itself inside [] slice?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I am using it: // Tipo Nulo. class None {} // Função slice() auto slice(T1, T2, T3 = None)(T1 conteudo, T2 inicio, T3 fim = T3.init) { int start, end, startlen; static if (is(T2 == int)) {inicio = inicio < 0 ? conteudo.length + inicio : inicio;} static if (is(T3 == int)) {fim =

How can I use file from resource .res without copy it to hard disc?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I want use file direct from resource .res without copy it to hard disc. How can I make it?

Parameter with indetermined tuple elements type?

2021-01-11 Thread Marcone via Digitalmars-d-learn
I want to create a function that receive a tuple (need be a tuple) with indetermined length and indetermined elements type without template. The argument need be a tuple, but length and elements types indetermineds. How can I make it?

Re: Can alias compose! receive more than one argument?

2021-01-07 Thread Marcone via Digitalmars-d-learn
My mistake: alias a = compose!((x,y) => x*y);

Can alias compose! receive more than one argument?

2021-01-07 Thread Marcone via Digitalmars-d-learn
I get this eror: Example: alias a = compose!(x,y => x*y); writeln(a(2,5)); // Error: onlineapp.d(4): Error: undefined identifier x

Re: DConf talk : Exceptions will disappear in the future?

2021-01-05 Thread Marcone via Digitalmars-d-learn
Bye bye nothrow functions in Dlang.

What is the difference between "delegate()" and "lazy delegate()" ?

2021-01-02 Thread Marcone via Digitalmars-d-learn
Why "lazy delegate()" need two parentheses to execute function?

Why there is no support for Dlang to convert Qt Creator .ui file to Dlang .d for use with QtE5?

2021-01-01 Thread Marcone via Digitalmars-d-learn
I have a GUI created using Qt Creator and save it to .ui file. I can convert .ui file to .cpp or .py (C++ or Python), but I can not convert .ui to .d for use with Dlang and QtE5.

Re: UFCS functions with both pointers and refs

2020-12-18 Thread Marcone via Digitalmars-d-learn
Two differents types; Foo type and pointer type. Need function overload foe each or just use ref and avoid pointer.

CMD && comand not work

2020-12-10 Thread Marcone via Digitalmars-d-learn
In this very generic example && not work to finalize the instruct and start a new instruct. Yes, I know dmd can build and run without it, but this is only a example. execute(["cmd", "/c", "dmd test.d", "&&", "start test.exe"]); How can I substitute && ?

Re: My first application in Dlang

2020-12-02 Thread Marcone via Digitalmars-d-learn
On Thursday, 3 December 2020 at 02:44:40 UTC, Ali Çehreli wrote: On 12/2/20 5:46 PM, Marcone wrote: Hello, my name is Marcone, I live in Brazil, and I have been studying Dlang for a year. I finished my first application in Dlang with a graphical interface in Win32api and made it available on

My first application in Dlang

2020-12-02 Thread Marcone via Digitalmars-d-learn
Hello, my name is Marcone, I live in Brazil, and I have been studying Dlang for a year. I finished my first application in Dlang with a graphical interface in Win32api and made it available on the internet for anyone who wants to download it. Here is the program link. As a beginner in the D

Re: How make Optional pre determined parameter type without overload function?

2020-12-02 Thread Marcone via Digitalmars-d-learn
Now my slice works fine. // Tipo Nulo. class None {} // Função slice() auto slice(T1, T2, T3 = None)(T1 conteudo, T2 inicio, T3 fim = T3.init) { int start, end, startlen; static if (is(T2 == int)) {inicio = inicio < 0 ? conteudo.length + inicio : inicio;} static if (is(T3 == int))

Re: How make Optional pre determined parameter type without overload function?

2020-11-28 Thread Marcone via Digitalmars-d-learn
On Sunday, 29 November 2020 at 02:55:02 UTC, Ali Çehreli wrote: On 11/28/20 6:40 PM, Marcone wrote: void a(T1, T2)(T1 b, T2 c){ // I need parameter "c" optional, but only (String or int). How can I make it without overload function? } Since it's optional, T2 must have a default type. I

How make Optional pre determined parameter type without overload function?

2020-11-28 Thread Marcone via Digitalmars-d-learn
void a(T1, T2)(T1 b, T2 c){ // I need parameter "c" optional, but only (String or int). How can I make it without overload function? }

Re: How can I convert Hexadecimal to RGB Color and vice-versa?

2020-11-23 Thread Marcone via Digitalmars-d-learn
// Função hex2rgb() uint hex2rgb(string hexcolor) nothrow { try { uint value; hexcolor.stripLeft("#").formattedRead!"%x"(value); return value; } catch(Throwable){return 0;} } // Função rgb2hex() string rgb2hex(uint rgbcolor)

How Performance down slow it is using UFCS friendly function?

2020-11-20 Thread Marcone via Digitalmars-d-learn
// Função receive() char[] receive(Socket socket, int size = 8192) nothrow { try { char[] buffer; buffer.length = size; int rq = socket.receive(buffer); return buffer[0..rq]; } catch(Throwable){return null;} } s =

Re: Function Pointer Not Working

2020-11-19 Thread Marcone via Digitalmars-d-learn
I will wait with this code. WaitForSingleObject(threading, INFINITE);

Re: Function Pointer Not Working

2020-11-19 Thread Marcone via Digitalmars-d-learn
On Thursday, 19 November 2020 at 15:51:09 UTC, Kagamin wrote: The delegate is stored on the stack of the calling thread, the created thread loads it from there, but the calling thread doesn't wait for that and clobbers the stack right away. If you were lucky your code would crash. The thread

Re: Function Pointer Not Working

2020-11-19 Thread Marcone via Digitalmars-d-learn
Solved replacing this line: CreateThread(null, 0, &_fun, , 0, null); to this code: task!({CreateThread(null, 0, &_fun, , 0, null);}).executeInNewThread();

Function Pointer Not Working

2020-11-18 Thread Marcone via Digitalmars-d-learn
// Function threadingw() void threadingw(HWND hwn, void delegate() fun) nothrow { try { // Function _fun() extern(Windows) uint _fun(void * arg){ (*(cast(void delegate()*) arg))(); // Do not show "Hello World!" :(

  1   2   3   >