Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Chris Kelling
Sorry about that - that message was supposed to be sent in reply to a message 
rhar came in right before one that was for this list.  My Note 4 thought I was 
trying to reply a thread in the Lazarus group.

-Chris

On Jul 27, 2015 7:23 AM, Chris Kelling  wrote:
>
> We have one in Room B. It is Ed Sax's old machine. It is an early model that 
> has the chicklett keyboard. About the only distinction tge PC Jr has is that 
> is was a finacial failure. Both style of keyboards are wireless, but you had 
> to have the keyboard aimed directly at the IR receiver on the PC.
>
> If it has the newer style keyboard, I say we take it. We can put both styles 
> on display to show the difference. Otherwise, we should pass.
>
> -Chris
>
> On Jul 27, 2015 6:06 AM, Mark Morgan Lloyd  
> wrote:
> >
> > Péter Gábor wrote: 
> > > If you use the classname property you can: 
> > > 
> > > case Sender.classname of 
> > >   'TCheckBox': ShowMessage('This is a TCheckBox'); 
> > > end; 
> >
> > Good point. I wonder if that's mode-specific (language manual simply 
> > says "Free Pascal allows"). 
> >
> > -- 
> > Mark Morgan Lloyd 
> > markMLl .AT. telemetry.co .DOT. uk 
> >
> > [Opinions above are the author's, not those of his employers or colleagues] 
> >
> > -- 
> > ___ 
> > Lazarus mailing list 
> > Lazarus@lists.lazarus.freepascal.org 
> > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] how to get Type of Sender or Components[i] in order to Cast?

2015-07-27 Thread Chris Kelling
We have one in Room B. It is Ed Sax's old machine. It is an early model that 
has the chicklett keyboard. About the only distinction tge PC Jr has is that is 
was a finacial failure. Both style of keyboards are wireless, but you had to 
have the keyboard aimed directly at the IR receiver on the PC. 

If it has the newer style keyboard, I say we take it. We can put both styles on 
display to show the difference. Otherwise, we should pass. 

-Chris

On Jul 27, 2015 6:06 AM, Mark Morgan Lloyd  
wrote:
>
> Péter Gábor wrote: 
> > If you use the classname property you can: 
> > 
> > case Sender.classname of 
> >   'TCheckBox': ShowMessage('This is a TCheckBox'); 
> > end; 
>
> Good point. I wonder if that's mode-specific (language manual simply 
> says "Free Pascal allows"). 
>
> -- 
> Mark Morgan Lloyd 
> markMLl .AT. telemetry.co .DOT. uk 
>
> [Opinions above are the author's, not those of his employers or colleagues] 
>
> -- 
> ___ 
> Lazarus mailing list 
> Lazarus@lists.lazarus.freepascal.org 
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] fast mathematical matrix operations

2015-06-08 Thread Chris Kelling
Pascal in general hasn't handled math in an effeceint way. Factorial is a prime 
example. I would assume that even a 2 dimensial matrix bigger than 10x10 would 
choke most processes. 

It sounds like you would need something made for mathmatical processing like 
fortran or even lisp. However, taking advantage of parallel processing may give 
you the speed you are looking for. 

On Jun 8, 2015 5:20 AM, Michael Schnell  wrote:
>
> On 06/08/2015 10:57 AM, Andrea Mauri wrote: 
> > 
> > I need code able to perform typical matrix operations (e.g. matrix 
> > multiplication, inversion, determinant and so on) as fast as possible 
> > since I deal with big matrices (thousands of rows and columns). I need 
> > it for both windows and linux (32/64). 
> > 
>
> For this it's essential to use the multiple cores the hardware provides. 
> So the task needs to be distributed to multiple threads. 
>
> I once drafted a thread pool unit that night be useful for this (but I 
> suppose there are other tools that are much more decently tested than 
> the one I did). 
>
> In the FPC/Lazarus mailing lists there already were multiple discussions 
> on the "parallel loop" issue, but AFAIK, there is no ready-made solution 
> available yet. 
>
> Delphi XE claims to provide such support, though. 
>
> -Michael 
>
> -- 
> ___ 
> Lazarus mailing list 
> Lazarus@lists.lazarus.freepascal.org 
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Wondering about .rpm packages

2015-02-12 Thread Chris Kelling
The latest version I have for Lazarus on my Fedora machines is 1.04 - is there 
anyone making a rpm package or is Ubuntu the only driving factor?

 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle


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


[Lazarus] rpm for version 1.2.x

2014-12-22 Thread Chris Kelling
The latest rpm in the repository is 1.0.8. Is there any plans to get 1.2.x rpm 
out?

 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle


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


Re: [Lazarus] Real number display

2014-12-09 Thread Chris Kelling
RealNumber := 1.5;
FloatToStr(RealNumber:2,RealStr);
DbeditBox.text := RealStr

The ":2" specifies the number of decimal. If you were using WRITE to output to 
the console, it would look like:

RealNumber := 13.3456;
writeln('Number = ',RealNumber:3:2);

Which would output
Number =  13.34

The first number = the number of spaces after the literal (notice the extra 
space after the equals), and the second is the number of decimal places to 
print. NOTE, in both examples, the formatting dies bit change the value (i.e. 
No rounding or trunking happen, just the number of decimal places specified are 
printed). 

Hope that helps. 

-Chris
 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle




> On Dec 9, 2014, at 23:03, Larry Dalton  wrote:
> 
> How do I get a real number to display as a decimal in a dbedit instead of an 
> exponential number?
> 
> Sent from my iPhone
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Error messages: cannot versus can't

2014-10-17 Thread Chris Kelling


> On Oct 17, 2014, at 8:01, Giuliano Colla  wrote:
> 
> 
> Il 17/10/2014 12:52, Reinier Olislagers ha scritto:
>>> On 17/10/2014 12:50, Giuliano Colla wrote:
>>> Il 17/10/2014 12:21, Reinier Olislagers ha scritto:
> On 17/10/2014 12:16, Mattias Gaertner wrote:
> On Fri, 17 Oct 2014 11:58:21 +0200
> Reinier Olislagers  wrote:
> Googling gives lot of pages saying that cannot is more formal than
> can't. And MS Word prefers cannot over can not.
>> 
>> If you have better references, as I said, I'm very interested!
> [edited for brevity] ...
> misinterpreted. Being "can't" very frequent in my e-mails (they usually ask 
> for features which either can't be done for free, or can't be done at all), I 
> draw from my direct experience the conclusion that "can't" does not possibly 
> "slow down comprehension" as Microsoft geniuses claim.
> 
> Giuliano
> 
> 

How about throwing your hands up in exasperation and just use "aint" (which IOS 
wanted to correct to ain't - which isn't [is not] as funny)

Seriously though, in my technical writing class, contractions were discouraged 
as standard fare.   If you had several of the base words (like a lot of cannot, 
should not, I would), the first occurrence would be expanded, and each 
successive one in the paragraph you use the contraction. 

As far as a dialog box for a program, I'd use the expanded base words. 

-Chris

 Everything at or below the line is a signature, not to be confuse with 
the body of the email above. Sorry about the last signature text that seemed to 
have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle


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


[Lazarus] USB communications UPDATE

2014-06-20 Thread Chris Kelling
I misstated to parameters - the devise is expecting serial communications, and 
I have a USB->RS232 adaptor. So the program can look at the port as a RS232 
port (coms 1-4). 

-Chris

 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle


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


[Lazarus] USB communications

2014-06-20 Thread Chris Kelling
I have an idea for a project, and need to access some hardware via the USB 
port. Is there a library or procedure/function to communicate with the port?  
The device is expecting ASCII characters from the computer, and returning 
numbers. 

-Chris

 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle


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


[Lazarus] Handling exceptions with debugger

2014-04-15 Thread Chris Kelling
I installed Lazarus 1.2.0 x64. A project ran fine under 1.0.4 i386 it ran fine. 
Under the new version the {$I-} and {$I+} ioresult coding causes the debugger 
to stop the execution and show an exception with the return code. What I need 
is for the debugger to ignore that and let my code handle the io (i.e. I use it 
for checking files, paths, making directories, etc).

Is there a way to get the debugger to ignore the compiler directives?

-Chris

 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle


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


Re: [Lazarus] Scroll Wheel

2014-04-11 Thread Chris Kelling
I did a search on mouse wheel event delphi - I came up with a lot of articles, 
most mentioning OnMessage event. Then there was this article, which I've not 
read all the way, but you may find useful. I'm not sure if this was ported to 
Lazarus, but I've found referencing Delphi does garner solutions most times. 

http://mc-computing.com/languages/Delphi/ScrollWheel.html

-Chris

 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle




> On Apr 11, 2014, at 13:45, Timothy Groves  wrote:
> 
> I have several TEdit objects in my form, and because they handle only integer 
> data, I'd like to use my scroll wheel to edit their values.  However, there 
> is no OnScrollWheel event that I can see.
> 
> Since scroll wheels are passed as mouse clicks, I thought to examine the 
> OnMouseDown/OnMouseUp events, but nothing is passed to indicate which button 
> is being pressed.
> 
> So either Google has failed me, or I have failed Google, but either way, I 
> can't find the answer on the net after an hour of searching.  Can anyone 
> point me in the right direction?
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] LabelEdit behavior

2014-03-13 Thread Chris Kelling
I noticed when I put bidimode right to left on LabelEdit, the label changes ( 
to ), and puts one instance of leading ( at the right end of the label. This 
happens in the IDE and runtime. 

Am I being obtuse, or should I put something in Bugzilla?

-Chris

 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle


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


Re: [Lazarus] free Pascal versions

2014-03-03 Thread Chris Kelling
Jim,

If you want to use the Lazarus IDE to write code as opposed to the FPC IDE, 
when you open a new project, when asked what type select either "program" or 
"console program" as opposed to "application". 

Chris
 Everything at or below the line is a signature, not to be confused 
with the body of the email above. Sorry about the last signature text that 
seemed to have some people questioning my sanity. 

We are what we repeatedly do. Excellence, then, is not an act, but a habit.

-Aristotle




> From: JIMB [mailto:wand...@ntlworld.com] 
> Sent: 03 March 2014 12:24
> To: lazarus@lists.lazarus.freepascal.org
> Subject: [Lazarus] free Pascal versions
> 
> Hi,
>  
> Not sure if this is the appropriate place to send this enquiry, maybe some 
> one will guide me!
>  
> I used Borland T Pascal for many years and later on Delphi.  Although I have 
> good training in Object oriented design and implementation, I have NOT had 
> many occasions where it was actually needed. Much of my stuff is just number 
> crunching and some graphic output, (7 colour is fine).
>  
> I am struggling to make Lazarus do the stuff I want; a great deal of the 
> Lazarus power just confuses a simple process. Basically I need a replacement 
> for Borland Pascal 7. I do, however, like the Lazarus IDE.
>  
> Any ideas what I which way I should go, and where will I see any replies to 
> this email, if there are any?
>  
> Best wishes,
> Jim
>  
> Jim Barr
>  
> Best is the enemy of good enough
>  
>  
> Barrs law of recurcive futility:-
>  
>   If you're smart enough to use one of these.
>   .you can probably manage without one
>  
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Running from IDE

2013-12-19 Thread Chris Kelling
Trying to run some code from the IDE that has run before. The system pauses on 
line 995 of customform.inc - FFornHandlers[fhtCreate].CallNotifyEvents(Self);

It only started doing this, and I don't know why. Compiling the project and 
running it out of the IDE works fine. Any clues on something U may have screwed 
up?  Or should I just reinstall Lazarus?

Lazarus 1.0.10 w/ FPC 2.6.2

Information in this message is intended for sole use of the recipient unless 
otherwise noted. 
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Debugging Wince shows NO debugger output

2013-11-13 Thread Chris Kelling
As a work around, try using showmessage(variable.field):

That will at least let you see what's in the variable at that point, and 
program execution should stop until you hit OK.  

-Chris

Information in this message is intended for sole use of the recipient unless 
otherwise noted. 

> On Nov 13, 2013, at 15:40, GREP  wrote:
> 
> Hi 
> I could not get the breakpoints to work, I googled a lot, tried all the
> suggestions
> unsuccessfully. 
> After a full day of trial I ended up that now the project does not show 
> anything in the Debugger output window.
> 
> I have this setup
> Windows XP, lazarus 1.0,12, svn 42478
> (installed with the exe provided)
> (sorry for the spanish legends, but regrettably when I installed lazarus 
> I did not find an option for choosing the language, it took it by default
> from geographical origin)
> 
>  
> 
>  
> 
>  
> 
> with Level1 and nothing else checked
> The project build with no apparent problems, except the breakpoints don't
> work
> (there are no blue dots, and when I click on a line to add a breakpoint, it
> shows a
> red circle with a "?" inside)
> Any help please?
> 
> 
> 
> 
> --
> View this message in context: 
> http://free-pascal-lazarus.989080.n3.nabble.com/Debugging-Wince-shows-NO-debugger-output-tp4034315.html
> Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.
> 
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

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


[Lazarus] Loading photos on a form

2013-10-06 Thread Chris Kelling
Hello, list - I am writing a membership roster manager and want to include
the member's photo and a copy of their license.  Using graphics, photos in
particular, is new territory for me.  I've looked at a couple of resources
for both Delphi and Lazarus, but am confused on what control to use (timage,
tbitmap, something else)and what are the steps to get the image to that
control?  From what I've gathered so far, it's something like this:

 

Load from a file using a tpicture object

Use that information and assign it to an timage object's canvas

Free the tpicture object

 

I'm looking to use jpeg and png types at a minimum.

 

 

Thanks,

Chris

 

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


Re: [Lazarus] Environment variable list

2013-08-21 Thread Chris Kelling
I knew there was something for what I needed. Thank you, and no, not blind 
except maybe selectively. 

Information in this message is intended for sole use of the recipient unless 
otherwise noted. 

On Aug 21, 2013, at 13:17, Sven Barth  wrote:

> Stupid question on my side just to check whether I've understood you 
> correctly: *are* you blind?
> 
> Regarding your problem: use GetEnvironmentVariableCount and 
> GetEnvironmentString from unit SysUtils.
> 
> Regards,
> Sven
> 
> On 21.08.2013 18:50, Chris Kelling wrote:
>> This could be a totally stupid question, but I'm trying to do this blind. Is 
>> there a way to get a list if environment variables defined at run time?  
>> There is a get and set, but I don't know the name of the variable I need, so 
>> I want to get a list. This should work cross platform, I think.
> 
> 
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

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


[Lazarus] Environment variable list

2013-08-21 Thread Chris Kelling
This could be a totally stupid question, but I'm trying to do this blind. Is 
there a way to get a list if environment variables defined at run time?  There 
is a get and set, but I don't know the name of the variable I need, so I want 
to get a list. This should work cross platform, I think. 

-Chris

Information in this message is intended for sole use of the recipient unless 
otherwise noted. 
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Request: In Search|Replace|Replace All dialog, show total replacements made

2012-09-20 Thread Chris Kelling
It'll be close to 2:00 or so. 

Sent from my iPhone

On Sep 20, 2012, at 15:23, Ajeandro Gonzalo  wrote:

> This will give us a hint that we may have made a mistake if the total 
> replacements is not in the range expected. This is a typical feature of 
> replace dialogs elsewhere, including in Delphi (I think).  Thank you.
> 
> A. G.
> 
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

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


[Lazarus] interesting quirk

2012-08-02 Thread Chris Kelling
YEAH on 1.0 RC1

I've come across an interesting quirk - on Fedora 16, when a button is clicked, 
the cursor disappears until you move the mouse. Now I believe that might be the 
gnome desktop that's doing that, as Windows doesn't exhibit that problem. I've 
not had a chance to see if it does it on other linux or OS X platforms. Has 
anyone come across this?

-Chris 

Sent from my iPhone
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Filtering on date with TDbf

2012-01-30 Thread Chris Kelling




On Mon, Jan 30, 2012 at 6:25 AM, Koenraad Lelong wrote:


tblTik.Filter:='DATUM>='''+DateToStr(XferStart)+;

I get an error :
Index based on unknown field ">=".


My guess is take a look at the location of your apostrophizes (').  You 
have 3 of them in a row in a couple of cases, which will interpreted as 
"print chr(39)" and not as a text dilimeter.


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


[Lazarus] Intergrating with office suites

2012-01-07 Thread Chris Kelling
I'm trying to integrate a couple of functions that integrate with MS  Office
(and/or Open Office).  One is using an existing Word template for generating
a completed form, and the other is trying to use Outlook to email reports.
Does anyone have a resource that I can use to figure out how to do this?

 

-Chris

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


Re: [Lazarus] LazReport & Database

2012-01-05 Thread Chris Kelling




On Thu, Jan 5, 2012 at 10:09 AM, Koenraad Lelong wrote:

Like always, I put my database-components in a datamodule. Then I 
placed a frReport on a visible form. I started editing the report and 
I tried to place some database-fields on the report. Unfortunately, 
there were no fields available to place.


After experimenting for some time I found I had to place the dataset 
(or query) on the same form as the report. Then I can place 
database-fields on the report.


Is the unit you are defining the data module with in the USES statement 
of your form?



-Chris

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


Re: [Lazarus] FW: Re: more file operation problems

2011-12-15 Thread Chris Kelling




On Thu, Dec 15, 2011 at 7:39 AM, Sergei Gorelkin wrote:


15.12.2011 16:10, Bart пишет:

On 12/12/11, Chris Kelling  wrote:

As I posted in the other thread

(http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-December/069100.html)
I think the problem is in the definition of your record type
stockitem.
It uses strings. Explicitely change that to ShortString.

Exactly so. Managed types cannot be used in typed files. This is 
rejected by Delphi, and by FPC > 2.4.4 as well. See 
http://bugs.freepascal.org/view.php?id=15447


Sergei


It is confirmed - I forgot about ANSISTRING being a pointer type, and 
when I was writing the record out it wrote the address, not the data. 
Of course, when I read it back in, the address was not valid and this 
caused the error (derefrencing the non-existent pointer).


Thanks for helping me work through a stupid rookie mistake.

-Chris

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


Re: [Lazarus] FW: Re: more file operation problems

2011-12-12 Thread Chris Kelling



On Mon, DEC 12, 2011 at 3:22 PM, Sven Bart wrote:


Am 12.12.2011 21:20 Schreiber "Sven Bart" < pascaldra...@googlemail.com 
 

:

Am 12.12.2011 21:05 Schreiber "Chris Feeling" < kelli...@cox.net 
 >:

That worked, but now, later in the code:
 Rowan := 1;  while Rowan <= stgInvOps.Row Count do        begin     
     read(inventory,stock);          stgInvOps.Cels[0,Rowan] := 
into(stockcars);          inc(Rowan);        end;   close 
file(inventory);


Replace the "<=" condition by "<". The row indices go from 0 to Row 
Count-1. And replace the "Rowan := 1" by "Rowan := 0" of course.


Row[0] is my header row and has fixed cells.

I do have more than one column, but I figured get one column working and 
adding the others will be the same.  I do see a math error, though - I 
set the number of row to the number of records in the file, but I forgot 
to add in the header row, stgInvOps.RowCount needs to be one greater 
than the number of records.


That aside, I'm still having trouble getting the system to read from the 
file, and with the math error should get an out of range error not 
access denied or SIGSEGV.   In fact, I replaced 'rowNum <= 
stgInvOps.count' with 'not eof(inventory)', and got the same error.


Thank you for your help thus far.
-Chris
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] FW: Re: more file operation problems

2011-12-12 Thread Chris Kelling




 Begin forwarded message 
Subject: Re: [Lazarus] more file operation problems
Date: 12/12/11 2:35:32 PM
From: "Chris Kelling" 
To: henry.verm...@gmail.com


On Mon, Dec 12, 2011 at 12:17 PM, Henry Vermaak wrote:


On 12/12/11 17:09, Chris Kelling wrote:

I'm trying to assign the number of records to the rowCount of a
stringgrid control. See the following code fragment:

var
stock : stockitem;
rowNum : integer;
{inventory is defined as a file of stockitem in another unit}

begin
assignfile(inventory,'Ops');
reset(inventory);
stgInvOps.RowCount:= filesize(inventory);


It's using the wrong function, try System.FileSize?


That worked, but now, later in the code:

  rowNum := 1;
  while rowNum <= stgInvOps.RowCount do
begin
  read(inventory,stock);
  stgInvOps.Cells[0,rowNum] := inttostr(stock.ClassNumber);
  inc(rowNum);
end;
   closefile(inventory);

when I try to read from the file, in the IDE I get an exception:

Project Spares raised an exception class: 'External: SIGSEGV'

Running the exe outside the IDE, I get:
Access Violation

Press OK to ignore and risk data corruption.
Press Cancel to kill the program.

This is really getting frustrating.

-Chris

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


[Lazarus] more file operation problems

2011-12-12 Thread Chris Kelling
I'm trying to assign the number of records to the rowCount of a 
stringgrid control.  See the following code fragment:


var
  stock  : stockitem;
  rowNum : integer;
  {inventory is defined as a file of stockitem in another unit}

begin
  assignfile(inventory,'Ops');
  reset(inventory);
  stgInvOps.RowCount:= filesize(inventory);

When I compile the program, I get:

dashboard.pas(115,42) Error: Incompatible type for arg no. 1: Got "File 
Of StockItem", expected "AnsiString" with 'inventory' highlighted

on the line "stgInvOps.RowCount:= filesize(inventory);"

What am I doing wrong?

-Chris

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


[Lazarus] Trying to troubleshoot error

2011-12-05 Thread Chris Kelling
I'm trying to read from a file and populate a stringgrid, and keep 
getting 'Project spares.exe raised an exception class 'External error: 
SIGSEGV' when trying to convert an integer to string.  Running the 
application gets the dialog: Access Violation Press OK to ignore and 
risk data corruption or cancel to kill the program.  Clicking OK brings 
the grid up with the header row populated, and the first field in the 
first non-fixed row (Cells[0,1]) with the proper value, but the rest of 
the table is blank.  I put a try...finally block in and now the IDE 
breaks at the read statement.  Any suggestions?  The code snippet 
follows.


procedure TfrmDashBoard.GetInvExecute(Sender: TObject;
   DB : string);
var
  {stockItem type is a record with the following structure:
recordID: longint;
ClassNumber : integer;
PartNumber  : string;
Make: String;
TypeofEqip  : string;
Model   : string;
Description : string;
quantity: integer;
location: string;
price   : real;}

   workspace : Stockitem;
   row   : longint;

begin
 assignfile(inventory,db);
 try
 reset(inventory);
 row := 0;
 while not eof(inventory) do
   begin
   read(inventory,workspace);
   inc(row);
   if db = 'Ops' then
 with stgInvOps do
  begin
   Cells[0,row] := 
inttostr(workspace.ClassNumber);

   Cells[1,row] := workspace.PartNumber;
   Cells[2,row] := workspace.Make;
   Cells[3,row] := workspace.TypeofEqip;
   Cells[4,row] := workspace.Model;
   Cells[5,row] := workspace.Description;
   Cells[6,row] := 
inttostr(workspace.quantity);

   Cells[7,row] := workspace.location;
   Cells[8,row] := floattostr(workspace.price);
  end
   else

thanks.
windows7 32bit, SP1
Lazarus 0.90.30
FPC: 2.4.2
-Chris

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


Re: [Lazarus] read single char from STDIN

2011-11-18 Thread Chris Kelling

On Fri, Nov 18, 2011 at 11:48 AM, William Oliveira Ferreira wrote:


i´ve always used
c := ReadKey;

William de Oliveira Ferreira
Bacharel em Sistemas de Informação


to expand on that, use the boolean function keypressed.  Remember on IBM 
compatibles that function keys send 2 scan codes.  The first, #0, to 
indicate a function key and not a normal key, and then the scan code for 
the actual keypress.  This includes the edit keys (insert, delete, home, 
end, pgup, pgdn, and arrow keys).


Here is a code fragment for an example:

if keypressed then
  begin
c := readkey;
if c = #0 then
begin
  c := readkey;
  case c of
 #132 : doSomething;
.
.
.
  end; {case c}
end {if #0 is true}
   else
  begin
case c of
   #132 : doSomethingElse;
.
.
.
end; {case c}
  end; {if #0 is false}
  end; {if keypressed}

This is a Turbo Pascal convention (and FPC), not a standard or UCSD 
Pascal convention.  Remember that strings are not a standard type, 
either.



2011/11/18 Henry Vermaak 


On 18/11/11 16:18, Chris Kirkpatrick wrote:

It really needs get(c) but this function, together with put(c), 
which
were defined in Jensen & Wirth and all standard Pascals, has long 
been
missing from Turbo Pascal, and all its deriviatives such as 
Freepascal.




How does get(c) differ from read(c)?  The problem here is with the
terminal buffering the characters until return is pressed, hence the 
need
for re-configuring the terminal so that each key press is sent 
immediately.


Henry


--
__**_
Lazarus mailing list

Lazarus@lists.lazarus.**freepascal.org

http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus




 --

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


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


[Lazarus] automating downloads

2011-08-23 Thread Chris Kelling
I'm working on a project that imports a group of text files downloaded 
from a website.  Currently, the user needs to download them manually, 
but I'd like to automate the process.  Is there a way I can get Lazarus 
to get the files rather than having the user log on to the site, 
download them and remember which directory to put the files?  LDAP is 
not an option.


-Chris

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


Re: [Lazarus] RE : Determining OS

2011-07-31 Thread Chris Kelling
I am looking to distribute my software to pc, linux, unix, and mac users.
I'm using the registry in Windows, and was going to use systemd for linux.
>From what I'm gathering, it would be best to just do a simple config or ini
file in the root directory of the program.  I'm thinking that when creating
the installer, I will ask where the program will reside, and provide a
default that is platform independent.  That way all I need to do is provide
the deb or rpm for linux, the msi for windows, and what ever unix and apple
require (OS X is a flavor of Darwin, thus the debain packager maybe?)

 

  _  

From: ik [mailto:ido...@gmail.com] 
Sent: Sunday, July 31, 2011 14:13
To: Lazarus mailing list
Subject: Re: [Lazarus] RE : Determining OS

 

 

[edited for brevity]

 

But the original person that asked the question should explain better what
he is looking for. It might not require to detect the distro itself for
example, or to allow the package builder to tweak things, or at the first
run to ask the distro from a list of supported distro and save it in
configuration files.

It's all depends on what he requires to do.

 

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


Re: [Lazarus] Determining OS

2011-07-31 Thread Chris Kelling
Thank you for the suggestions so far - 

 

$ lsb_release seems to give good information, my Fedora 15 machine returns

LSB Version: :core-4.0-ia32:core-4,0-noarch

 

In addition, I did a ls of the /etc directory and found a file called
system-release-cpe,  Looking in it says cpe:/o:fedoraproject:fedora:15

Now, this may be unique to fedora (isn't open source wonderful?), but if all
distros have that file, I think that may be the solution,  I've got an
ubuntu machine running, too - I should look to see what it has.

 

Say what you will about the windows registry, but at least there's a common
place to look for and put information.  And no, I don't want to start a war
over the merits of one OS over another, just trying to make my program
portable to the most machines with the least effort for the end user.

 

  _  

From: ik [mailto:ido...@gmail.com] 
Sent: Sunday, July 31, 2011 10:55
To: Lazarus mailing list
Subject: Re: [Lazarus] Determining OS

 

 

On Sun, Jul 31, 2011 at 17:43, Graeme Geldenhuys 
wrote:

2011/7/31 ik :

> Please note that system.d is Fedora implementation (v15) so for Linux you
> need to detect also the Linux distro, and that's a bit more complicated.

Any distro worth using should support the LSB standards. With that
being said, you can use the 'lsb_release' command to find out exactly
what distribution and version is being used.


I'm using Arch Linux and that is my output:


$ lsb_release 
LSB Version:n/a

$ 
-

But I have the following file:
/etc/arch-release


I think that looking for /etc/*release is more reliable at the moment for
distros. 

BTW The TRegistry class is cross platform. On Windows it uses Registry, and
on other OS, it uses INI files.
 



--
$ lsb_release --help
Usage: lsb_release [options]

Options:
 -h, --help show this help message and exit
 -v, --version  show LSB modules this system supports
 -i, --id   show distributor ID
 -d, --description  show description of this distribution
 -r, --release  show release number of this distribution
 -c, --codename show code name of this distribution
 -a, --all  show all of the above information
 -s, --shortshow all of the above information in short format

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 8.04.4 LTS
Release:8.04
Codename:   hardy

--


--
Regards,
  - Graeme -



Ido
 



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


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

 

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


[Lazarus] Determining OS

2011-07-31 Thread Chris Kelling
I'm writing a generic installer for a project, and want to set up things
like the registry or system.d depending on the OS type.  Is there an
environment string, or a function to report what OS the system being hosted
on, or do I need to write different versions specifically for the OS?

 

-Chris

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