* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
I want to:

1) Create several processes that run independently, giving each a unique name
2) Store each one in an TObjectList
3) As the processes complete, I want them to free themselves and remove themselves from the TObjectList

This will allow me to do a search by name in the TObjectList to see if the are present.  If they are, they are still running.  If not present, the thing they were executing is finished.

How can I accomplish this?
2
Networking and Web Programming / Apache 2.4 Modules
« Last post by ahiggins on February 18, 2018, 11:06:50 pm »
Just looking for general advice/guidance around creating Apache 2.4 modules, i have not been able to get any of the examples I've found on-line to work.

I'm using Debian 9, Apache 2.4, FPC 3.0.4 and Lazarus 1.8.0
3
One can always use Pas2JS for this to keep using the same language.  ;)
Ah cool, i did not realize that pas2js has matured so much already :thumbsup:
It has matured so much that TMS is using it for their new Web Core suite ;) (look especially at the demos at the bottom)
4
General / Re: Scan subdirectories and count files in each.
« Last post by TomTom on February 18, 2018, 09:24:26 pm »
@Bart
I checked your program and if I understood it correctly, we thought about the same but my way was unnecessarily complicated. What you have written is better and faster than what I was planning to do. Hahaha, unfortunately, I have a tendency to do everything in an unnecessarily complicated way, from the wrong side. Sometimes it works: P Although not this time hahaha. At the same time, my English is not the best, so I could write incomprehensibly what I mean. Sorry about that.
Unfortunately, I'm also not the best in programming, so it will take some time to adapt your code to what I've already written, my program is already quite extensive (as per my standards) and I would prefer not to change the entire original code because of one small thing. I'm afraid that everything will get mixed up and I will be discouraged in the end. But it's not important now. Thank you all for hints and help! I will definitely use the code from the program you shared here.
5
General / Re: Error in conditionals - Lazarus 1.8.0 Win32
« Last post by rvk on February 18, 2018, 09:02:06 pm »
Quote
I do see your problem. It has to do with using variants in the char() function.
imho char is a type and char() is a typecasting (some purists write Char rather).
Ah, yes, you are correct. Char() is a type and not a function. Chr() would be better.

Although Integer() is also a type and this works correctly:
Code: Pascal  [Select]
  1. Showmessage(integer(xNum + 55).tostring + ' is the same as ' + integer(27 + 55).tostring);
But that's probably because some typecasts do convert correctly (like string() cast etc).

I do see now where the result is coming from:
Code: Pascal  [Select]
  1. var
  2.   xTmp ,xNum: variant;
  3. begin
  4.   xNum := 27;
  5.   xNum := xNum + 55;
  6.   xTmp := char(xNum); // <-- xNum is 82 here so char(xNum) will be 8
  7.   Showmessage(xTmp { 8 } + ' is different from ' + char(27 + 55) { R });

So xNum + 55 is 82. Because this is a variant it is both integer 82 and string 82. But when casting string 82 to a char you'll get the 8 (which is the result of the function).

I do understand why topicstarter got in trouble here (although I wouldn't have used variants at all for this).
6
General / Re: Error in conditionals - Lazarus 1.8.0 Win32
« Last post by WooBean on February 18, 2018, 08:49:06 pm »
@rvk
Quote
I do see your problem. It has to do with using variants in the char() function.

imho char is a type and char() is a typecasting (some purists write Char rather).
What do you expect doing typecasting char(variant_variable)?

Code below works as spirit of Pascal (language) comanded.

Code: Pascal  [Select]
  1.   var
  2.     xTmp ,xNum: variant;
  3.   begin
  4.     xNum := 27;
  5.     xTmp := chr(xNum + 55); //chr() but not char()!!!
  6.     //Showmessage(xTmp + ' is different from ' + char(27 + 55)); //
  7.     writeln(xTmp + ' is NOT different from ' + chr(27 + 55));
  8.     readln;
  9.   end.
  10.  
Output of this console application is: R is NOT different from R


Anyway, I find once more that "simple" or "stupid" question can teach us a lot.
7
Graphics / Re: Copying images from a Lazarus application
« Last post by HeavyUser on February 18, 2018, 07:47:08 pm »
I always thought of bitmaps as rows and columns of pixels an pixel/m etc. was something for WYSIWYG applications and the printer.
But you always learn something.
H
so where do you group an office application then if not in WYSIWYG?
8
Networking and Web Programming / crawler - relative to absolute path
« Last post by BubikolRamios on February 18, 2018, 07:41:05 pm »
Have start HTML page read, parsed, href-s extracted.

if start page is like:
Quote
http://www.foo.com/foo1/foo2/

and what I got from href is like

Quote
/foo3/foo4.html

Ok, I know this is absolute:http://www.foo.com/foo3/foo4.html
but how to make this absolute path  programaticaly ? Including all possible stuff like ../../.. and alike

so far using: httpsend, sax_html, dom_html, dom
9
Graphics / Re: Copying images from a Lazarus application
« Last post by hakelm on February 18, 2018, 06:35:39 pm »
I always thought of bitmaps as rows and columns of pixels an pixel/m etc. was something for WYSIWYG applications and the printer.
But you always learn something.
H
10
General / Re: How to build pas2js
« Last post by molly on February 18, 2018, 06:09:29 pm »
Thanks, but what is the "trunk checkout"?
Trunk is located here. for checkout, see wikipedia version control common vocabulary.

In short using version control tool to 'download' the most up to date sources from trunk (version 3.1.1 atm)

Quote
Here's what comes up when I do "locate pas2js" on my system:
Those are not up to date sources from trunk, rather those from FPC 3.0.4 release.

See also here in FPC/Lazarus wiki.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus