Re: [Lazarus] Windows and german Umlauts: why do i have to PWideChar(UTF8Decode(String)) and not UTF8ToAnsi(String)

2016-10-18 Thread Bart via Lazarus
On 10/18/16, Landmesser John via Lazarus  wrote:

> But  UTF8ToAnsi(String) fails.

Maybe Utf8ToWinCP(AString) helps?
It's in unit LazUtf8.

Bart
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Jürgen Hestermann via Lazarus

Am 2016-10-18 um 16:47 schrieb Michael Schnell via Lazarus:
> If you start with complex stuff that does not yield immediate success (i.e. a 
working program that does something that might be useful) The students will loose 
interest and run away, unless they are nerds like ourselves.

Yes, therefore start with simple procedural (console)
programs that let them have immediate success with
all the elementary things that a program consists of
(variables/types, loops, commands, etc.).
If that is understood you can switch to GUI applications.

If you do it the other way round you only delay the date
of frustration but you do not avoid it.


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Michael Schnell via Lazarus

On 18.10.2016 15:23, Jürgen Hestermann via Lazarus wrote:


IMO the order is extremly important!
If you start with the fundamental informations
(how does the processor work in general,
how are variables stored (stack/heap/etc.),
what does the processor do in loops, etc.)
then this information is remembered very well
because everybody can imagine what goes on in general.
You can *predict* what will (should) happen in your program.

IMO the order is extremely important!

If you start with complex stuff that does not yield immediate success 
(i.e. a working program that does something that might be useful) The 
students will loose interest and run away, unless they are nerds like 
ourselves.


-Michael
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Mehmet Erol Sanliturk via Lazarus
On Tue, Oct 18, 2016 at 6:23 AM, Jürgen Hestermann via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> Am 2016-10-18 um 12:53 schrieb Mehmet Erol Sanliturk via Lazarus:
> > Order of teaching is not so critical : As you say , write a GUI program
> for events : Say : "Now it is necessary to define what will be done for the
> events ? ... Its way is the following : Write your program parts in that
> way ..."
>
> IMO the order is extremly important!
> If you start with the fundamental informations
> (how does the processor work in general,
> how are variables stored (stack/heap/etc.),
> what does the processor do in loops, etc.)
> then this information is remembered very well
> because everybody can imagine what goes on in general.
> You can *predict* what will (should) happen in your program.
>
> If you just start with clicking you do not know *why* it works
> (if it works) nor do you know *why* it does not work (if it does not do
> so).
> They would always need someone at hand with exprience to tell them how
> to continue. This can be very frustrating for studends.
>
> Therefore I would always present at least a rough overview about procedural
> programming before starting with objects and events. In the end, the latter
> is still processed in a procedural manner which every programmer should
> know.
>
>
> > My application was like the following ( as a very simple example ) :
> > Pose a problem "Display your name ."
> > After this is done :
> > "Display your name 10 times ."
> > The students were not able to write their programs . Then , solution was
> > "You should use a loop ."
> > "A loop is defined in the following ways : ... "
> > Such an approach is used frequently in Mathematics text books :
> > Subject text .
> > Problems ..
> > Last problems were "Unsolvable" with the above text .
> > Solution :
> > "Read the next chapter ..."
> > Such approaches are "the Art of Teaching" ...
>
> IMO this "approach" has a severe drawback:
> The students do not get an overall picture of what
> *can* be done and *how* it can be done.
> If they do not know about loops how should they
> know that they exist? They would need to read *everything*
> that is available and hope to find something helpful.
> That is very frustrating and can lead to suboptimal solutions
> because they get tired of reading yet another chapter and
> instead use something else (like copying the code in the editor 10 times).
>
> --
> ___
>

I have said that

"the Art of Teaching"  ...


Assume that a course is designed by a department , and you are the
instructor .


For example : Course X : Programming using Lazarus

Course outline is the Lazarus components .

What can you do ?


"I am resigning because this course is not well designed ."
or

"I am changing the course outline as I want ." ( which you do not have
authority to do that ) .

or

"Lazarus is this ...  The following parts are necessary to learn to use
when you click ... ( here you will teach what is required which yo
described above ... ) "


Please select an appropriate one .


If you are the designer of the courses you are right what to do .

Problem arises when you are not course designer but an instructor of it .
Then you need to use "the Art of Teaching" with your "the Science of
Teaching" .



Mehmet Erol Sanliturk
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] ActiveX, TOLEControl

2016-10-18 Thread LacaK via Lazarus

Hi *,

I need help with OCX component (not visual I guess), which I need use in 
Lazarus application (to control another application, which supplies this 
OCX control).
I have imported type library using importtl.exe (new unit was created 
successfully)


Then in program I have created instance:
  v := CreateOleObject('SCAPS.ScSamlightClientCtrl');
or
  intf := CreateComObject(CLASS_ScSamlightClientCtrl) as 
_DSamlight_client_ctrl_ocx;


But all next attampts using any interface method fail with EOleSysError 
"Catastrophic failure" (ErrorCode=-2147418113)


In Delphi it works, but only when I use TOLEControl descendant created 
by Delphi's import of ActiveX (into _TLB unit)

In Delphi I have :

TScSamlightClientCtrl = class(TOleControl)
...

but in Lazarus I have no equivalent? (When I Delphi I do same as in 
Lazarus I get same error also in Delphi)


I do not know exacly what to ask here ?
What is purpose of TOleControl and what TOleControl did more than I can 
do in Lazarus ?

Can I somehow workaround it in Lazarus ?

In short what I have imported from type lib in Lazarus is interface:
 _DSamlight_client_ctrl_ocx = dispinterface
   ['{05D31AA6-1306-4DA0-9AE2-A8771FF6FA94}']
   function ScIsRunning:Integer;dispid 1;
  ... etc.
end;

and CoClass:
  Class Function CoScSamlightClientCtrl.Create: _DSamlight_client_ctrl_ocx;
  begin
Result := CreateComObject(CLASS_ScSamlightClientCtrl) as 
_DSamlight_client_ctrl_ocx;

  end;

I can create instance calling CoScSamlightClientCtrl.Create, but as I 
wrote I can not use any method ...


Can somebody give any help ?

Thanks

-Laco.


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Jürgen Hestermann via Lazarus

Am 2016-10-18 um 12:53 schrieb Mehmet Erol Sanliturk via Lazarus:
> Order of teaching is not so critical : As you say , write a GUI program for events : 
Say : "Now it is necessary to define what will be done for the events ? ... Its way is 
the following : Write your program parts in that way ..."

IMO the order is extremly important!
If you start with the fundamental informations
(how does the processor work in general,
how are variables stored (stack/heap/etc.),
what does the processor do in loops, etc.)
then this information is remembered very well
because everybody can imagine what goes on in general.
You can *predict* what will (should) happen in your program.

If you just start with clicking you do not know *why* it works
(if it works) nor do you know *why* it does not work (if it does not do so).
They would always need someone at hand with exprience to tell them how
to continue. This can be very frustrating for studends.

Therefore I would always present at least a rough overview about procedural
programming before starting with objects and events. In the end, the latter
is still processed in a procedural manner which every programmer should know.


> My application was like the following ( as a very simple example ) :
> Pose a problem "Display your name ."
> After this is done :
> "Display your name 10 times ."
> The students were not able to write their programs . Then , solution was
> "You should use a loop ."
> "A loop is defined in the following ways : ... "
> Such an approach is used frequently in Mathematics text books :
> Subject text .
> Problems ..
> Last problems were "Unsolvable" with the above text .
> Solution :
> "Read the next chapter ..."
> Such approaches are "the Art of Teaching" ...

IMO this "approach" has a severe drawback:
The students do not get an overall picture of what
*can* be done and *how* it can be done.
If they do not know about loops how should they
know that they exist? They would need to read *everything*
that is available and hope to find something helpful.
That is very frustrating and can lead to suboptimal solutions
because they get tired of reading yet another chapter and
instead use something else (like copying the code in the editor 10 times).

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Trunk - Index Out Of Bounds error

2016-10-18 Thread Graeme Geldenhuys via Lazarus
Hi,

I've just upgraded to Lazarus Trunk. If I now add a package dependency
to my project I get an index out of bounds error. I don't see the
package add - in the Project Inspector window either, but apparently it
is there. If I quit and restart Lazarus IDE, then the package dependency
magically appears.

I'm using Lazarus 1.7 r53133 FPC 2.6.4 x86_64-freebsd-gtk 2

Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Creating a component Guide ?

2016-10-18 Thread Vojtěch Čihák via Lazarus

Yes, see:
 
http://wiki.freepascal.org/How_To_Write_Lazarus_Component
 
V.
__

Od: Josh via Lazarus 
Komu: "Lazarus mailing list" 
Datum: 18.10.2016 12:12
Předmět: [Lazarus] Creating a component Guide ?


Hi

Is there a guide to creating my own component ( s ), I am thinking of creating 
a knob / slide bar component that uses an imagelist as its animation.

Is there such a guide? Thanks
JoshThis email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify i...@voiceliveeditor.com. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

Voiceliveeditor.com accepts no liability for the content of this email, or for 
the consequences of any actions taken on the basis of the information provided.


--

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus 


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] ANN: Procedure List enhancement

2016-10-18 Thread Graeme Geldenhuys via Lazarus
Hi,

I thought I would mention that Markus implemented an enhanced search
feature in the Procedure List dialog. This became available at the end
of July in Lazarus Trunk. I've used it extensively since then, and it is
super handy. So kudos to Markus for than very nice addition.

So what is the new enhancement? Before, you could only search and match
against method/procedure names, and use the Objects combobox to limit
the search to a specific class. The new enhancement allows you to search
against any class names as well as method/procedure names. All from the
same search edit text box.

Search Syntax:
--
1.  Simply typing some text will match against the method/procedure
name as it has always done.

2.  A . (dot) in the filter word is used to separate class name and
function name.


Search Samples:
---

class/method name   | filter | match
=
TForm1.TestProc | test   | true
TForm1.TestProc | form   | true
TForm1.TestProc | .tes   | true (the filter is only applied to
 the method names)
TestProc2   | .tes   | false (because this is a procedure,
  not a method of a class)
TForm1.TestProc | for.pro | true (class contains "for", method
  contains "pro")



So if you have very large units, this extra search functionality really
comes into play, and hugely improves the speed at which you can find a
method of a specific class, even though there are stacks of classes and
methods defined in that unit.

Anyway, I just thought I would share this very useful feature with you all.


Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Mehmet Erol Sanliturk via Lazarus
On Tue, Oct 18, 2016 at 1:11 AM, Michael Schnell via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> On 17.10.2016 21:05, Lars via Lazarus wrote:
>
>> The big issue with teaching using a RAD tool, is welding the program logic
>> into the onclick events, instead of decoupling the logic in separate
>> procedures that can be reused elsewhere.
>>
> As you point out in the text this is as well a pro (easy fast solving of
> small unitary tasks) as a con (bad reusability, bad code when doing big
> projects).
>
> But as Learning of course starts with doing small unitary tasks RAD
> obviously is a great help to fight the FUD and prejudice the students might
> have regarding programming.
>
> Of course it's great to dedicate a (later) lesson to un-RAD-ing your code
> in order to be prepared for bigger tasks.
>
> -Michael
>
> --
> ___
>




Order of teaching is not so critical : As you say , write a GUI program for
events : Say : "Now it is necessary to define what will be done for the
events ? ... Its way is the following : Write your program parts in that
way ..."


My application was like the following ( as a very simple example ) :

Pose a problem "Display your name ."
After this is done :

"Display your name 10 times ."

The students were not able to write their programs . Then , solution was
"You should use a loop ."
"A loop is defined in the following ways : ... "


Such an approach is used frequently in Mathematics text books :


Subject text .

Problems ..

Last problems were "Unsolvable" with the above text .

Solution :
"Read the next chapter ..."


.


Such approaches are "the Art of Teaching" ...



Mehmet Erol Sanliturk
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Mehmet Erol Sanliturk via Lazarus
On Tue, Oct 18, 2016 at 12:48 AM, Travis Ayres  wrote:

> I'm all for this effort, and hope it leads to new and modern tutorials,
> books or notes that would be useful for others that use FreePascal/Lazarus
> to convey graphical system interactions. If there's any need to proofread
> such materials, I'll gladly help out!
>
>
To test a large program , I want to use Petri Nets to drive the testing
steps in an information processing , let's say network , to simulate a
business environment :


https://en.wikipedia.org/wiki/Petri_net
(  Petri net  )

https://en.wikipedia.org/wiki/Category:Petri_nets
Category:Petri nets

( My work on this is "Perhaps" now ... )


One unfortunate situation is that there is not much Pascal software for
Petri Nets processing , except the following ( which its license is very
ambiguous means not usable ) and may be considered very old with respect to
new Pascal language level :


http://staff.um.edu.mt/jskl1/petrisim/
PetriSim - Discrete Simulation Environment


There are others , perhaps , but again , not usable very well .


Petri Nets are a vast subject now . There are some Petri Nets processing
software but their licenses being copy left are not friendly for commercial
environment .


For event driven systems , Petri Nets are very important .


My opinion is that a "good" , "permissively" licensed , as much as general
purpose Petri Nets simulation software may be a very useful tool for the
students to simulate their event driven system definition , and , then
write its special purpose Pascal program by using Lazarus easily .


Actually , it is not compulsory to use Pascal , but Pascal will supply the
Pascal programming language learners a very good example , its license will
permit them to use some of its parts whatever they want to do without any
hostile restriction in any environment .


In such a tool , only it is necessary to describe the nodes , information
flow between nodes , etc. .
( Please see above link about PetriSim . )



Mehmet Erol Sanliturk




> On Oct 17, 2016 6:32 PM, "Mehmet Erol Sanliturk via Lazarus" <
> lazarus@lists.lazarus-ide.org> wrote:
>
>
>
> On Mon, Oct 17, 2016 at 12:05 PM, Lars via Lazarus <
> lazarus@lists.lazarus-ide.org> wrote:
>
>> > On 14/10/16 08:30, Michael Schnell via Lazarus wrote:
>> >
>> >
>> > Of course there are decent drawbacks regarding relying too much on RAD
>> > and about not really understanding the fundamentals behind it. But in
>> the
>> > end the addressees are non-computer engineers.
>>
>> The big issue with teaching using a RAD tool, is welding the program logic
>> into the onclick events, instead of decoupling the logic in separate
>> procedures that can be reused elsewhere.  RAD tools are superior at
>> prototyping... I can't believe how awesome they are at that. They are
>> inferior, however, when it comes to bad habits being brought on.  With
>> this warning, RAD tools can still be very useful for writing solid
>> programs, as long as one knows this warning ahead of time.
>>
>> When I first learned delphi I made the mistake of putting code in the
>> onClick events and similar, and then when you expand your app later you
>> realize all that code is welded in place and cannot be reused outside of
>> the events.
>>
>> Of course decoupling the logic from the GUI leads to more layers of code.
>>
>>
> -
>
>
>
>
>> How I got rid of my bad habits when I first learned delphi: I started
>> writing console apps with no object oriented programming, no events, and
>> learned that not everything is a click event in computer programming.
>>
>>
>
> -
>
>
> My opinion is that the above ideas are really very good to be applied
> during teaching :
> First , teach language on , let's say , "atomic" problems . Then , use
> these "atomic" concepts in further problems either embedded in a GUI or
> console program .
>
> One obvious point is that an "event" driven programming knowledge is a
> must to become a competent programmer . The problem is how this can be
> learned . Without knowing how to program an algorithm when a related event
> is occurred , will bring any one to nothing means ( not to a success ) .
>
> -
>
>
>
>> People late in the game (learned programming when GUI's were available)
>> and have no experience with console mode apps will earn some bad habits
>> because of the GUI oriented programming. Those with experience in other
>> areas of programming such as old Dos programs, web programs (basically
>> like a dos or unix console program) will learn different ways of
>> organizing code without everything being tied to a GUI event driven code.
>>
>> I suppose even doing a plain Win32 API app with no delphi code (pure win
>> api) would help someone learn how to organize code from a second opinion
>> view, without being forced to use the event driven system you were given
>> by the RAD tool.
>>
>>
>
> -
>
>
>
>> Of course, also learning other programming languages helps (although, IMO

Re: [Lazarus] Windows and german Umlauts: why do i have to PWideChar(UTF8Decode(String)) and not UTF8ToAnsi(String)

2016-10-18 Thread Landmesser John via Lazarus
Thanks guys for your effort ... i stay with 
PWideChar(UTF8Decode(String)) that works for me :-))


At the moment there is no need to know the details of character encoding 
history in computer science.



--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazmint

2016-10-18 Thread Michael Schnell via Lazarus

On 18.10.2016 12:01, Graeme Geldenhuys via Lazarus wrote:


That should probably read 'x86_64', not 'x64_64'.

Works !

I could successfully compile and run as well fpc 3.1.1 (from svn) as 
Lazarus.


Thanks,
-Michael (aka docu beta tester)
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Creating a component Guide ?

2016-10-18 Thread Josh via Lazarus
Hi

Is there a guide to creating my own component ( s ), I am thinking of creating 
a knob / slide bar component that uses an imagelist as its animation.

Is there such a guide?

Thanks
Josh



This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify 
i...@voiceliveeditor.com. This message contains confidential information and is 
intended only for the individual named. If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail. Please notify the 
sender immediately by e-mail if you have received this e-mail by mistake and 
delete this e-mail from your system. If you are not the intended recipient you 
are notified that disclosing, copying, distributing or taking any action in 
reliance on the contents of this information is strictly prohibited.
Voiceliveeditor.com accepts no liability for the content of this email, or for 
the consequences of any actions taken on the basis of the information provided.



-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazmint

2016-10-18 Thread Mattias Gaertner via Lazarus
On Tue, 18 Oct 2016 10:19:50 +0200
Michael Schnell via Lazarus  wrote:

> This Document
> 
> http://www.freepascal.org/~michael/articles/lazmint/lazmint.pdf
> 
> Wants to show that "This is not as scary or difficult as it may seem".
> 
> Unfortunately the step
> 
> wget $BASEURL/x84_64-linux/fpc-3.0.0.x64_64-linux.tar

The pdf has two typos. It should be
wget $BASEURL/x86_64-linux/fpc-3.0.0.x86_64-linux.tar


> Anyway: is 3.0.0. the decent version to use right now ?

Yes.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazmint

2016-10-18 Thread Graeme Geldenhuys via Lazarus
On 2016-10-18 09:19, Michael Schnell via Lazarus wrote:
> wget $BASEURL/x84_64-linux/fpc-3.0.0.x64_64-linux.tar

   ^^^
That should probably read 'x86_64', not 'x64_64'.

Regards,
  Graeme

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

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazmint

2016-10-18 Thread Michael Schnell via Lazarus

So I fetched the current fpc from svn.

Trying to make same I get a similar error:

Linking fpmake
fpmake.pp(47,1) Warning: "crti.o" not found, this will probably cause a 
linking failure
fpmake.pp(47,1) Warning: "crtn.o" not found, this will probably cause a 
linking failure
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o when searching for 
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o

/usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lc
fpmake.pp(47,1) Error: Error while linking

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Windows and german Umlauts: why do i have to PWideChar(UTF8Decode(String)) and not UTF8ToAnsi(String)

2016-10-18 Thread Jürgen Hestermann via Lazarus

Am 2016-10-18 um 11:31 schrieb Mattias Gaertner via Lazarus:
> Did you start the csv file with the UTF8 BOM, so that Excel knows that
> the file is UTF-8 encoded?
> UTF8BOM = #$EF#$BB#$BF

In

https://en.wikipedia.org/wiki/Comma-separated_values

it says:

"Also, many regional versions of Excel will not be able to deal with Unicode in 
CSV."

and

"One simple solution when encountering such difficulties
is to change the filename extension from .csv to .txt;
then opening the file from an already running Excel instance
with the "Open" command, where the user can manually specify
the delimiters, encoding, format of columns, etc."

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Windows and german Umlauts: why do i have to PWideChar(UTF8Decode(String)) and not UTF8ToAnsi(String)

2016-10-18 Thread Mattias Gaertner via Lazarus
On Tue, 18 Oct 2016 10:46:59 +0200
Landmesser John via Lazarus  wrote:

> Am 18.10.2016 um 09:36 schrieb Mattias Gaertner via Lazarus:
> > That is NOT the same as PWideChar(UTF8Decode(String))?
> > Obviously, because one produces an 8-bit string and the other a 16-bit
> > string. How do you compare the result?  
> 
> I compare the results by open the *.csv file in Excel 2003 and see no 
> correct "Grünberg"
> Note: my Editor "TextPad" shows  "PC UTF8" as file encoding if i use 
> UTF8ToAnsi.

Did you start the csv file with the UTF8 BOM, so that Excel knows that
the file is UTF-8 encoded?

UTF8BOM = #$EF#$BB#$BF

 
> > What compiler version?  
> 
> Sorry,  forgot  that:
> 
> Lazarus 1.7 latest trunk FPC 3.0.0 i386-win32-win32/win64
> 
> Windows XP
> 
> > Are you using LazUTF8?  
> 
> Where to look for that?

LazUTF8 is a unit, that sets the global variable
DefaultSystemCodePage to CP_UTF8. DefaultSystemCodePage defines
the default encoding of AnsiString, so UTF8ToAnsi creates UTF-8.
LazUTF8 is used by LCL applications.
If unsure use writeln or use the debugger to find out the value of
DefaultSystemCodePage.


> "Alle Dateien haben bereits die richtige Kodierung" -> UTF8
> 
> >   What is your DefaultSystemCodePage?
> >
> > Mattias  
> 
> in Systemsettings language its: "Automatisch ( oder Englisch)"
> 
> 
> So the answer seems to be:
> "one produces an 8-bit string and the other a 16-bit "

And PWideChar is a pointer, while UT8ToAnsi creates a String.

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Lazmint

2016-10-18 Thread Michael Schnell via Lazarus
Seemingly "make bigide" on a 64 Bit Mint does not work this simply with 
the 32 bit fpc:


/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o when searching for 
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o

/usr/bin/ld: cannot find /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lc
Error: Error while linking

-Michael
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Windows and german Umlauts: why do i have to PWideChar(UTF8Decode(String)) and not UTF8ToAnsi(String)

2016-10-18 Thread Landmesser John via Lazarus



Am 18.10.2016 um 09:36 schrieb Mattias Gaertner via Lazarus:

That is NOT the same as PWideChar(UTF8Decode(String))?
Obviously, because one produces an 8-bit string and the other a 16-bit
string. How do you compare the result?


I compare the results by open the *.csv file in Excel 2003 and see no 
correct "Grünberg"
Note: my Editor "TextPad" shows  "PC UTF8" as file encoding if i use 
UTF8ToAnsi.



What compiler version?


Sorry,  forgot  that:

Lazarus 1.7 latest trunk FPC 3.0.0 i386-win32-win32/win64

Windows XP


Are you using LazUTF8?


Where to look for that?
"Alle Dateien haben bereits die richtige Kodierung" -> UTF8


  What is your DefaultSystemCodePage?

Mattias


in Systemsettings language its: "Automatisch ( oder Englisch)"


So the answer seems to be:
"one produces an 8-bit string and the other a 16-bit "


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Lazmint

2016-10-18 Thread Michael Schnell via Lazarus

This Document

http://www.freepascal.org/~michael/articles/lazmint/lazmint.pdf

Wants to show that "This is not as scary or difficult as it may seem".

Unfortunately the step

wget $BASEURL/x84_64-linux/fpc-3.0.0.x64_64-linux.tar

does not work (file not found).


By

wget $BASEURL/i386-linux/fpc-3.0.0.i386-linux.tar

it is possible to install the 32 Bit version of fpc 3.0.0.


Anyway: is 3.0.0. the decent version to use right now ?

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Michael Schnell via Lazarus

On 17.10.2016 21:05, Lars via Lazarus wrote:

The big issue with teaching using a RAD tool, is welding the program logic
into the onclick events, instead of decoupling the logic in separate
procedures that can be reused elsewhere.
As you point out in the text this is as well a pro (easy fast solving of 
small unitary tasks) as a con (bad reusability, bad code when doing big 
projects).


But as Learning of course starts with doing small unitary tasks RAD 
obviously is a great help to fight the FUD and prejudice the students 
might have regarding programming.


Of course it's great to dedicate a (later) lesson to un-RAD-ing your 
code in order to be prepared for bigger tasks.


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-18 Thread Travis Ayres via Lazarus
I'm all for this effort, and hope it leads to new and modern tutorials,
books or notes that would be useful for others that use FreePascal/Lazarus
to convey graphical system interactions. If there's any need to proofread
such materials, I'll gladly help out!

On Oct 17, 2016 6:32 PM, "Mehmet Erol Sanliturk via Lazarus" <
lazarus@lists.lazarus-ide.org> wrote:



On Mon, Oct 17, 2016 at 12:05 PM, Lars via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> > On 14/10/16 08:30, Michael Schnell via Lazarus wrote:
> >
> >
> > Of course there are decent drawbacks regarding relying too much on RAD
> > and about not really understanding the fundamentals behind it. But in the
> > end the addressees are non-computer engineers.
>
> The big issue with teaching using a RAD tool, is welding the program logic
> into the onclick events, instead of decoupling the logic in separate
> procedures that can be reused elsewhere.  RAD tools are superior at
> prototyping... I can't believe how awesome they are at that. They are
> inferior, however, when it comes to bad habits being brought on.  With
> this warning, RAD tools can still be very useful for writing solid
> programs, as long as one knows this warning ahead of time.
>
> When I first learned delphi I made the mistake of putting code in the
> onClick events and similar, and then when you expand your app later you
> realize all that code is welded in place and cannot be reused outside of
> the events.
>
> Of course decoupling the logic from the GUI leads to more layers of code.
>
>
-




> How I got rid of my bad habits when I first learned delphi: I started
> writing console apps with no object oriented programming, no events, and
> learned that not everything is a click event in computer programming.
>
>

-


My opinion is that the above ideas are really very good to be applied
during teaching :
First , teach language on , let's say , "atomic" problems . Then , use
these "atomic" concepts in further problems either embedded in a GUI or
console program .

One obvious point is that an "event" driven programming knowledge is a must
to become a competent programmer . The problem is how this can be learned .
Without knowing how to program an algorithm when a related event is
occurred , will bring any one to nothing means ( not to a success ) .

-



> People late in the game (learned programming when GUI's were available)
> and have no experience with console mode apps will earn some bad habits
> because of the GUI oriented programming. Those with experience in other
> areas of programming such as old Dos programs, web programs (basically
> like a dos or unix console program) will learn different ways of
> organizing code without everything being tied to a GUI event driven code.
>
> I suppose even doing a plain Win32 API app with no delphi code (pure win
> api) would help someone learn how to organize code from a second opinion
> view, without being forced to use the event driven system you were given
> by the RAD tool.
>
>

-



> Of course, also learning other programming languages helps (although, IMO
> learning too many brain dead languages and hip cool ones will not help, as
> much as others claim... Basic programmers from the 80's or 70's still
> think in GOTO's and line numbers)
> --
>


-



With respect to researches ( I am not able to supply links now because this
view is based on old times readings , but I am sure that such research
findings can be found ) ,

people ( mostly ) uses a "primary" language for her/his profession and a
"secondary" language for some her/his works as an additional tool .

This shows that during teaching , this feature should be taken into
consideration : Guide the students to discover which language she/he will
prefer to use in much of her/his works , and attempt to teach that language
in a "best" way to be used by the students in their profession .

A similar approach should also be used for a "secondary" language .

If a language is taught just for fun or whatever else other than being a
possible candidate for "primary" or "secondary" is likely that , if it not
a necessity for the learner , is only a waste of everything is involved .



Mehmet Erol Sanliturk



--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Windows and german Umlauts: why do i have to PWideChar(UTF8Decode(String)) and not UTF8ToAnsi(String)

2016-10-18 Thread Mattias Gaertner via Lazarus
On Tue, 18 Oct 2016 09:15:15 +0200
Landmesser John via Lazarus  wrote:

> I know how to deal with german Umlauts but I would like to understand.
> 
> Think of a  *.csv file that contains strings like "Grünberg" and that 
> has to be opened in Excel ( Office 2003 ).
> 
> It works if i use PWideChar(UTF8Decode(String)). Got this tipp here in 
> the mailinglist!
> 
> But  UTF8ToAnsi(String) fails.
> 
> Why is UTF8ToAnsi(String) not enough?
> 
> LHelp tells me about  UTF8ToAnsi():
> "Utf8ToAnsi converts an utf8-encode unicode string to an ansistring. It 
> converts the string to a widestring and then converts the widestring to 
> an ansistring."
> 
> That is NOT  the same as  PWideChar(UTF8Decode(String))?

Obviously, because one produces an 8-bit string and the other a 16-bit
string. How do you compare the result?

What compiler version?
Are you using LazUTF8? What is your DefaultSystemCodePage?

Mattias
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Windows and german Umlauts: why do i have to PWideChar(UTF8Decode(String)) and not UTF8ToAnsi(String)

2016-10-18 Thread Landmesser John via Lazarus

I know how to deal with german Umlauts but I would like to understand.

Think of a  *.csv file that contains strings like "Grünberg" and that 
has to be opened in Excel ( Office 2003 ).


It works if i use PWideChar(UTF8Decode(String)). Got this tipp here in 
the mailinglist!


But  UTF8ToAnsi(String) fails.

Why is UTF8ToAnsi(String) not enough?

LHelp tells me about  UTF8ToAnsi():
"Utf8ToAnsi converts an utf8-encode unicode string to an ansistring. It 
converts the string to a widestring and then converts the widestring to 
an ansistring."


That is NOT  the same as  PWideChar(UTF8Decode(String))?

Tipps are welcome.

Thank you!!
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus