Fw:Re: [fpc-pascal] I have some qustions about free pascal

2010-02-10 Thread
-- Original --
From:  "Tomas Hajny";
Date:  Wed, Jan 13, 2010 01:06 AM
To:  "FPC-Pascal users discussions"; 
Cc:  "彘"<799945...@qq.com>; 
Subject:  Re: [fpc-pascal] I have some qustions about free pascal

Do you refer to using the unit source file (*.pas) or the compiled files
(*.tpu/*.tpp/*.tpw)? The compiled unit files cannot be used with FPC for
various reasons.
 

>>   Can you send me the help files of Free pascal?
>
> There are here for download or consulting the html version:
>
> http://www.freepascal.org/docs.var
>
>>  Third,I can't input Chinese in my program compiled by Free pascal.
>> Can you give me some advices ?
>
> Could you explain what kind of user interface you are developing and
> in which operating system?
>
> I think chinese input should work in Lazarus programs:
> http://www.lazarus.freepascal.org/

Considering the references to TP 7.0, I'd suspect that the poster referred
to console programs. Information about the target platform is obviously
still very important, of course, and a sample program showing which
particular functions/units are used for data entry together with
description of the observed behaviour / problem is important.

Tomas
 
 
 
I am using Free pascal in Windows XP
I was trying to use compiled unit files
I want to know how to using assmblely language in Free Pascal 
 Can you tell me some way to learn Assembly Language??
I am referred to console programs
 but I also want to learn how to make GUI program___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: Fw:Re: [fpc-pascal] I have some qustions about free pascal

2010-02-10 Thread Tomas Hajny
On Wed, February 10, 2010 11:51, åé wrote:
> -- Original --
> From:  "Tomas Hajny";
> Date:  Wed, Jan 13, 2010 01:06 AM
> To:  "FPC-Pascal users discussions";
> Cc:  "åé"<799945...@qq.com>;
> Subject:  Re: [fpc-pascal] I have some qustions about free pascal
>
> Do you refer to using the unit source file (*.pas) or the compiled files
> (*.tpu/*.tpp/*.tpw)? The compiled unit files cannot be used with FPC for
> various reasons.
>
>
>>>   Can you send me the help files of Free pascal?
>>
>> There are here for download or consulting the html version:
>>
>> http://www.freepascal.org/docs.var
>>
>>>  Third,I can't input Chinese in my program compiled by Free pascal.
>>> Can you give me some advices ?
>>
>> Could you explain what kind of user interface you are developing and
>> in which operating system?
>>
>> I think chinese input should work in Lazarus programs:
>> http://www.lazarus.freepascal.org/
>
> Considering the references to TP 7.0, I'd suspect that the poster
> referred
> to console programs. Information about the target platform is obviously
> still very important, of course, and a sample program showing which
> particular functions/units are used for data entry together with
> description of the observed behaviour / problem is important.
>
> Tomas
>
>
>
> I am using Free pascal in Windows XP

OK.


> I was trying to use compiled unit files

That is indeed not possible.


> I want to know how to using assmblely language in Free Pascal
>  Can you tell me some way to learn Assembly Language??

These two are obviously separate topics. Free Pascal documentation (see
the URL provided in one of the previous responses in this thread or our
WWW pages) provides information on how to use assembly language in FPC.

Learning how to program in assembly language is matter of various
documents and tutorials including those available freely on Internet
(obviously always specific to a particular CPU type). However, you should
consider whether this is really necessary and appropriate depending on the
task you want to achieve. Many tasks formerly achieved with use of
assembly in the old DOS days with TP/BP need to be done differently
nowadays using the APIs provided by the respective target platform (e.g.
Win32 or Win64 in your case of WinXP) and use of assembly is usually not
necessary for those tasks any longer. Assembly language may be still
useful / appropriate for some very specific performance critical tasks
(but for successfully tackling those one already needs to understand
assembly and various performance implications for the different CPUs very
well, otherwise the result may easily get worse than when writing your
code in a higher level programming language like Pascal and relying on a
good compiler for translating your code into optimized assembly), or for
some low-level programming (e.g. special access to hardware like when
programming drivers, but even that has rather special implications
depending on the chosen platform).


> I am referred to console programs

As mentioned previously, please, provide a small compilable program and a
description of what doesn't work for you according to your expectations.
Creation of a bug report in our bug repository may be appropriate there.


>  but I also want to learn how to make GUI
> program

There are different approaches to this, using Lazarus may be one of them,
but which one is appropriate for you depends on your needs and
expectations and I'm clearly not the right person for providing advices on
this topic.

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] String buffer

2010-02-10 Thread Honza
On Tue, 9 Feb 2010 10:45:55 -0300, Fl?vio Etrusco wrote:

> Some (hopefully constructive) commentaries (and then I would suggest
> to add to LCL or FCL):
> 1) It could be called really TStringBuffer;
> 2) The 'W' methods could be called 'Append';
> 3) The GetS method could truncate the string to avoid the copy, as I
> think the common use will not be Append+Read+Append+Read, but
> Append+Append+...+Read...

I agree in all points, even while having some more ideas on the
naming. If it will be considered for FCL, then let the dev team pick
identifiers of their choice and any other changes/improvements - I'll
be happy to implement them if needed.

On Wed, 10 Feb 2010 09:49:30 +0200 Graeme Geldenhuys wrote:

> Could you explain what the advantages are of
> that string buffer object compared to a standard string types like
> AnsiString or TStringList?

I guess some memory and/or time could be saved in certain usage
patterns compared to TSTringList and String. There is now a dumb
benchmark on the blog, but nobody should trust other's benchmarks :)

http://freepascal-bits.blogspot.com/2010/02/string-buffer-performance.html

-bflm
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] String buffer

2010-02-10 Thread Marco van de Voort
In our previous episode, Honza said:
> > Append+Append+...+Read...
> 
> I agree in all points, even while having some more ideas on the
> naming. If it will be considered for FCL, then let the dev team pick
> identifiers of their choice and any other changes/improvements - I'll
> be happy to implement them if needed.

Afaik later delphi versions add a stringbuilder like class. It might be
worthwhile to see if something compatible can be crafted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] String buffer

2010-02-10 Thread Graeme Geldenhuys
Honza wrote:
> 
> I guess some memory and/or time could be saved in certain usage
> patterns compared to TSTringList and String. There is now a dumb
> benchmark on the blog, but nobody should trust other's benchmarks :)

Thanks. Good news is that it looks consistently faster than both String and
StringList. :)



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] values for ThreadSetPriority

2010-02-10 Thread Seth Grover
After reading the online docs, and searching this list, I'm still
confused. Hopefully someone can straighten me out.

http://www.hu.freepascal.org/docs-html/rtl/system/threadsetpriority.html
says that it takes for a priority values from -15 to 15. The comment
to the right of the declaration says that "0" is normal. Are these
numbers like nice's, where negative numbers are more favorable (higher
priority) and positive numbers are less favorable (lower priority)?

Also, to further confuse my mind, I found this:
http://community.freepascal.org:1/docs-html/rtl/classes/tthreadpriority.html
which has some enumerations. How do those come into play? Are those
just for TThread descendents?

I'm just trying to find the correct cross-platform approach for
changing thread priority of threads started with BeginThread.

Thanks,

-SG

--
This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover
sethdgrover[at]gmail[dot]com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] values for ThreadSetPriority

2010-02-10 Thread Graeme Geldenhuys
Seth Grover wrote:
> http://www.hu.freepascal.org/docs-html/rtl/system/threadsetpriority.html
> says that it takes for a priority values from -15 to 15. The comment


I always thought I knew the answer, but then when I searched for the
answers in the source code, it started getting really confusing! :-(

In classesh.inc we have:

  TThreadPriority = (tpIdle, tpLowest, tpLower, tpNormal, tpHigher, tpHighest,
tpTimeCritical);


Then in unix/thread.inc we have:

  // stupid, considering its not even implemented...
  Priorities: array [TThreadPriority] of Integer =
   (-20,-19,-10,0,9,18,19);

This already conflicts with the documentation which says the range is -15
to 15. Go figure!

Then we also have in linux/pthread.inc

  const
 THREAD_PRIORITY_IDLE   = 1;
 THREAD_PRIORITY_LOWEST = 15;
 THREAD_PRIORITY_BELOW_NORMAL   = 30;
 THREAD_PRIORITY_NORMAL = 50;
 THREAD_PRIORITY_ABOVE_NORMAL   = 70;
 THREAD_PRIORITY_HIGHEST= 80;
 THREAD_PRIORITY_TIME_CRITICAL  = 99;


So there you go!  I'm not just as confused as you are. ;-)


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal