Re: [fpc-pascal] Re: StrUtils.RomanToInt oddities

2013-09-23 Thread Alberto Narduzzi
Premise: I didn't go through your entire implementation, thou' at first sight looks much better than the current one. I know roman numerals since I was 8 or 9 yo, that makes a quick and dirt result of about 35 years. Thing is: 1. in the roman numerals, not all the digits can be subtracted

Re: [fpc-pascal] Re: StrUtils.RomanToInt oddities

2013-09-23 Thread Alberto Narduzzi
Ooops, I also forgot to mention that only I, X, C and M can appear up to three times in a row. V, L and D does not; they can only once. Cheers again, A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Re: StrUtils.RomanToInt oddities

2013-09-23 Thread Alberto Narduzzi
What about making an option of it? If it accepts, then it should apply the subtraction rule: only the (one) numeral left to the other (bigger one) can be subtracted. So IIIM would be III + IM = 3 + 1000-1 = 1002 (and not 1000-3 = 997) There should be no ambiguity there, it's only a pain to

Re: [fpc-pascal] Re: StrUtils.RomanToInt oddities

2013-09-23 Thread Alberto Narduzzi
What about making an option of it? Anyhow, if the function accepts invalid combinations, what should it return? For some, the answer would be obvious (), but some combinations are indeed ambiguous (M) So that we maybe could accept unambiguous invalid combinations, but I don't see how to

Re: [fpc-pascal] Re: StrUtils.RomanToInt oddities

2013-09-23 Thread Alberto Narduzzi
Are you sure regarding M considering there is no symbol for 5000? Or didn't Romans count to more than 5000 - 1? yes I am. as 5000 - 1 would need to be written CMXCIX, which has the 4-M-in-a-row, that is invalid, as a maximum of three is allowed. Yes, probably ancient Romans had no need

Re: [fpc-pascal] Re: StrUtils.RomanToInt oddities

2013-09-23 Thread Alberto Narduzzi
So the question is, what does or should do RomanToInt for invalid input? It is NOT called CheckValidRoman, so it could be that the result for invalid input is simply undefined. If it is, then all is ok. so, what does 10AT (or $10AT for tht matter) return for HexToDec??? maybe NaN, if there is

Re: [fpc-pascal] PostgreSQL: ERROR: operator does not exists: uuid = text

2013-09-04 Thread Alberto Narduzzi
I am not an expert of PostGres but maybe you are missing the doubled quotes? q.Params.ParamByName('id').AsString := ''71d6776e-1564-11e3-ad65-5349928f15b0''; Cheers, A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-17 Thread Alberto Narduzzi
On 17/07/13 00:56, vfclists . wrote: I completely disagree. It is the code that is the primary expression of intent not the comments. This is mainly accomplished through sensible identifier naming. I perfectly agree, a well formed name is worth a thousand words, in this context.

Re: [fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-17 Thread Alberto Narduzzi
On 17/07/13 00:56, vfclists . wrote: It is hardly for the end users sake unless the enduser is a programmer. we're talking about programming languages here, so that... whoever else shall an end user of a development tool/library be?!?!?!? X_X ___

Re: [fpc-pascal] Re: Declaration of arrays

2013-06-18 Thread Alberto Narduzzi
On 18/06/13 18:42, leledumbo wrote: well, to be honest, int hahaha[10] - hahaha: array[0..9] of integer; it is not just adding 0.. anyway, a change in the converter should be more adequate, IMHO, that by default translates [X] into [0 .. X-1] just my 2c I think this was requested a

Re: [fpc-pascal] Best way to transfer data between applications?

2012-10-30 Thread Alberto Narduzzi
I am familiar with the basic underlying methods available for transferring data between processes on Windows and Unix, i.e. Pipes, Shared memory, and TCP/IP - but what I am not familiar with is any higher level functionality that may be available on FPC. If I'd do something in this scope,

Re: [fpc-pascal] Problems with assigning pointers

2012-04-10 Thread Alberto Narduzzi
But pointer are always a source of errors. Only use them when it's unavoidable. If you can do the same without pointers then don't use them. ;-) Of course, if you just use pointers because others do, indeed they might be... No comment. A. ___

Re: [fpc-pascal] Re: Variant vs Pointer

2012-03-03 Thread Alberto Narduzzi
The reason for using a buffer in tdataset is that a record's data normally is located in one continuous buffer, from which a value is picked from the right spot (including strings) You can't have that with variants. Hm... right. So, if I will have a class like a TParam, that have FValue:

Re: [fpc-pascal] Re: FPC with case insensitive file system under Linux

2012-02-27 Thread Alberto Narduzzi
If there problems with capitalization of certain characters exist then these problems should be solved or if that's not possible for some reason such characters should not be allowed in file systems. But giving it all over to the user and tell him We did not know how to handle this mess, just

Re: [fpc-pascal] fphttpclient get an url with colon

2012-02-17 Thread Alberto Narduzzi
The fact it appends a slash at the end is probably because it thinks it's a path... But, just out of curiosity... isn't it a malformed *http* url if it contains a colon? Cheer, A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] fphttpclient get an url with colon

2012-02-17 Thread Alberto Narduzzi
I doubt that mediawiki uses malformed urls. And any browser and http client uses it without warning. as I said, it was out of curiosity. Googling around anyway, shows that there are some special characters out there (obviously), which are meant to compose the url itself: colon, slash, dot,

Re: [fpc-pascal] fphttpclient get an url with colon

2012-02-17 Thread Alberto Narduzzi
No. This does not work with mediawiki. Of course not... that was just an example. A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] using functions from units main programme

2011-11-18 Thread Alberto Narduzzi
Thanks for the fix, but it makes the code a bit more complicated than I'd hoped/thought based on my (over simple?) impression that local fns are used in place of those in units. John this would be true if you declared another function fnb locally, so that calling fnb could eventually override

Re: [fpc-pascal] March 2025? :o

2011-11-03 Thread Alberto Narduzzi
That's what happens when someone sends a mail while their system clock is set such a date in the future. shouldn't it be better if the mail messages were registered with the server's date and time? This is just a guess... ;-) Cheers, A. ___

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Alberto Narduzzi
anonimous types, thrice, generic array concatenation, interpreting Pascal, anonymous functions... I'm guessing what language you come from. Then, the second question arises: why Pascal, now. Anyway, I think that immersing yourself in some classes and pointer logic could help you find some

Re: [fpc-pascal] More Filter Madness

2011-10-16 Thread Alberto Narduzzi
Well, I would advice only to use it if you *know* the maximum nesting depth. Otherwise it can crash easily. I was not focusing on the problems that could arise using recursion, my point simply was that in this case, use of recursion was a no-need. Of course when using recursion you _MUST_

Re: [fpc-pascal] More Filter Madness

2011-10-15 Thread Alberto Narduzzi
the nesting. Just my 2c Cheers, A. -- Alberto Narduzzi ANSware Ltd. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Text scan in text files - (was: Full text scan - PDF files)

2010-11-01 Thread Alberto Narduzzi
Somebody can help me please? I need to search strings in Text files using just FPC. how about reading every line and then using Pos() to see if some string is there? HTH ;-) Cheers, A. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Text scan in text files - (was: Full text scan - PDF files)

2010-11-01 Thread Alberto Narduzzi
Sorry, I agree. But as I search for text within PDF files? I assumed true the following statement of yours... [Somebody can help me please? I need to search strings in Text files using just FPC.] so I suggested the fast-enough (in my opinion) use of the Pos function. If _now_ you want to

Re: [fpc-pascal] Local procedures as actual procedure parameter in macpas mode

2010-08-24 Thread Alberto Narduzzi
also suggest you do Type TMyProc Procedure(var y:myObject); (*) in case of an object method, I think you must add Of Object at the end of its declaration. it makes all more readable on first instance. Just my 2c Cheers, A. -- Alberto Narduzzi ANSware Ltd

Re: [fpc-pascal] Local procedures as actual procedure parameter in macpas mode

2010-08-24 Thread Alberto Narduzzi
procedures as parameters, so from the error message I just assumed they weren't allowed. Cheers, A. -- Alberto Narduzzi ANSware Ltd. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] methods of an object to create others objects

2010-07-06 Thread Alberto Narduzzi
Andrew Brunner wrote: It most certainly is not safe. LOL. Free calls destroy.. Destroy may contain other frees and routines... You cannot guarantee that free will even return. the point was to call .Free on an object that might not have been initialized, not what Free ( or destroy, for the

Re: [fpc-pascal] stuck with untyped pointer

2010-05-28 Thread Alberto Narduzzi
i := self.names.indexOf(name); val := Struct(self.values[i]); raises got untyped expected Struct. Sure, that's why I'm trying to cast... Without casting to Struct, the compiler indeed throws got pointer expected Struct. I'm very surprised since I already did this. in first place, you

Re: [fpc-pascal] stuck with untyped pointer

2010-05-28 Thread Alberto Narduzzi
ok, now the code fragments look more clear. I have no more suggestions but the one about deriving your TStruct from TObject, as almost everything in the LCL (and/or VCL, I guess I name them right) is a descendant of it. Again. maybe it's not the best thing you'll like to do, but this way IMHO

Re: [fpc-pascal] stuck with untyped pointer

2010-05-28 Thread Alberto Narduzzi
Hi, Struct is declared as class so it inherits from TObject if not other class is especified. is that true? I don't mean not to trust you, but is the compiler assuming that, or is it a FPC rule? IMO a class is a class, and doesn't inherit from anything else. Unless specified. BTW, From who

Re: [fpc-pascal] stuck with untyped pointer

2010-05-28 Thread Alberto Narduzzi
TObject is the base class, it inherits from nobody. To make the whole weel run a base class must exists which provide basic functionality like Create/Destroy and other methods/events like ClassName, InheritsFrom; so if no class is specified it automatically inherits from TObject. I see, and I

Re: [fpc-pascal] newbie questions

2010-04-19 Thread Alberto Narduzzi
Thank you. Does this mean that to be able to define a literal value like byteset := [0, 3, 101] for a set (and probably for an array) I must have defined a custom type for it; correct? (It's the only difference I see with my trials: numbers in my code is not of a custom type but simply a var

Re: [fpc-pascal] Comedi hardware support

2010-03-31 Thread Alberto Narduzzi
Hi, But I have really no idea how to translate the c headerfile with its structures to freepascal. Is there anybody out who can help me to translate the header file into a unit ? Can you pass over the .h file? Maybe I can help. Please, check the rules of the ML, as I can't tell you for sure