We need this to be OK...
type
Somevariable = type Word;If we do it in FPC we get
Error: Illegal expression
Can this be added somewhat soon? It would help a ton for compatability...
Thanks
Shane

Mailing lists / lazarus / 1999-10
27 messages · 7 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
We need this to be OK...
type
Somevariable = type Word;If we do it in FPC we get
Error: Illegal expression
Can this be added somewhat soon? It would help a ton for compatability...
Thanks
Shane
Another request.
Classesh.inc should contain 4 const values.
scShift = $2000
scCtrl = $4000;
scAlt = $8000
scNone = 0;These are used to defiune the TShortCut returned in Menus.pp
Thanks
Shane
Also, default values for a property or variable in a class is needed.
Property Items[index: integer]: TMark read Get write Put; default;and
Property Number : Integer read Get write Put; default 0;have to be accepted.
Shane
To get around the menu problem (it is a class of TWinControl) I created a TPopupMenu type in Controls.pp and set it to a word so I could still have all the code that deals with TPopupMenu's.
This is a very temporary fix until the menus are fixxed. If you have code that assigns a TPopupmenu or calls it's Create or sets it to NIL then it won't compile because it's not a class, it's a word value.
TMenu class needs to be fixxed.
Shane
Defining a TYPE as TSomeType = Type Word; creates a type that is not associated with a…
OK, i'll add support for it as soon as i've finished the linker part rewritting.
Peter
Another request. Classesh.inc should contain 4 const values. scShift = $2000 scCtrl =…
Done, nevertheless I don't like this solution of TShortCut, I think it would be better a record but this isn't VCL compatible
Thanks Peter.
------------------------------------------------------------ Shane Miller
Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870
Home page : http://www.lakefield.net/~smiller
Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip
Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard
Lazarus : http://www.miraclec.com/lazarus
----------------------------------------------------------
We need this to be OK... type Somevariable = type Word; If we do it in FPC we get Error:…
I agree with this. I have hit this problem a few times. Normally, I just change it to
type
Somevariable = Word;and that seems to work just fine (as far as I can tell with my minimal testing). But it should really be changed in the compiler to be compatible.
Curtis
----------------------------------
Curtis White
Curtis White
http://www.teleport.com/~osiriz/
----------------------------------
If someone can explain what it needs to do, including an example to test it.
Peter
Defining a TYPE as
TSomeType = Type Word;creates a type that is not associated with a Word. For example, if you define some types as
type
T1 = Word;
T2 = Word;
TSomeType = type Word;then T1 and T2 are identical to words, but TSomeType is actually a NEW type. Delphi uses this to override the normal property editor in their IDE. If they defined a published property as a T1 and selected it in the object inspector, they would edit it like they would edit a WORD value.
If they defined a published property as a TSomeType and tried to edit it in the object inspector, you could create your own property editor for that type. It's NOT associated with a word and therefore can be edited differently.
I think for now, you simply need to allow the declaration, and we can work on the other parts of that later.
Shane
If someone can explain what it needs to do, including an example to test it.
Peter
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
Nope. I have a liune like this
Property Items[index: integer]: TMark read Get write Put; default;and I get
Error: Only one default property is allowed, found inherited default property in class TList;So, I guess defaults work, but not exactly right yet.
Shane
>> Florian Klaempfl 10/20/99 01:42PM >>>
Should be possible already !!!
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
Also, default values for a property or variable in a class is needed. Property…
Should be possible already !!!
Here's another one. When assigning a TNotifyEvent to a procedure like OnCLick :=…
This is only true if you use -S2. If you use -Sd, it should accept the
OnCLick := Button1Click;
form also. Or, if you use the directives, you should do a
{$mode delphi}instead of
{$mode objfpc}Michael.
Another thing....
In mwedit, Lines is defined as a TSTRINGS.
They can reference each string by doing this
Result := Lines[4];but FPC throws an error. The way to fix it is to do this:
Result := Lines.Strings[4];Any reason why this doesn't work? Does it have to do with the "default" declaration that doesn't work that tells the compiler that the property with just a "default" after it's declaration in he class is the default property you would reference when no reference is given?
Understand that?
Shane
Hi!
Yes. Only one array property can be declared as the default property in Delphi.
Martin
Oh, another thing.
FPC doesn't allow just
inherited;You seem to require the procedure name and parameters after the reserved word inherited. This should work without anything but
inherited;on the line. If you try it, you get an error
identifies no member INHERITED
or something like that.
Shane
Here's another one. When assigning a TNotifyEvent to a procedure like
OnCLick := Button1Click;FPC returns an error
Wrong Amout of parameters specified.
The way you fix it is to do a
OnCLick := @Button1Click;Can you change it so that it allows the first type of assignment? Delphi allows it and it's really making a mess out of the code if I can't do it that way.
thanks
Shane
P.S. - Sorry for being a pest. I hate all the IFDEF's I would have to use otherwise...
I tried -Sd instead of -S2 and it still didn't work. I sent my code in an email (mwedit code) so take a
You'll have to remove one of the {$IFDEF MWE_FPC} to make it fail.
I do a
ppc386 -S2 mwcustomedit.pas
or a
ppc386 -Sd mwcustomedit.pas
and get the same error.
Somewhere around line 896 is a {$IFDEF} you can remove..
Shane
>> 10/22/99 03:11PM >>>
This is only true if you use -S2. If you use -Sd, it should accept the
OnCLick := Button1Click;
form also. Or, if you use the directives, you should do a
{$mode delphi}instead of
{$mode objfpc}Michael.
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
Oh, another thing. FPC doesn't allow just inherited; You seem to require the procedure…
What are the rules for paramter passing?
Another request: Delphi allows you to assign a Pointer variable to a TObject by doing the…
No problem here!
Hmmm, I don't know if this should done! It seems to be dangerous. If someone wants to assign a pointer to tobject, he should know what he do and type cast it!
Oh, another thing. FPC doesn't allow just inherited; You seem to require the procedure…
I think this should work only in message handlers, but even there it doesn't work.
Oh, another thing. FPC doesn't allow just inherited; You seem to require the procedure…
Florian Klaempfl wroteMarc Weustink wrote: > > At 21:01 23-10-99 +0200, Florian Klaempfl wrote: > >Shane Miller schrieb:
[Single inherited usage in overidden methods]
> > > >I think this should work only in message handlers, but even there it
doesn't
If you have something like:
MyClass = class
public
procedure MyMethod(Param1, Param2: Integer); virtual;
end;
MyOtherClass = class(MyClass)
public
procedure MyMethod(Param1, Param2: Integer); override;
end;you can use inherited like:
procedure MyOtherClass.MyMethod(Param1, Param2: Integer);
begin
inherited;
end;or like:
procedure MyOtherClass.MyMethod(Param1, Param2: Integer);
begin
inherited MyMethod(Param1, Param2);
end;Both are the same. Delphi nows that MyClass.MyMethod needs 2 params, and passes them to the inherited method.
Marc
I request that because Delphi allows it..
Shane
>> Florian Klaempfl 10/25/99 03:04PM >>>
No problem here!
Hmmm, I don't know if this should done! It seems to be dangerous. If someone wants to assign a pointer to tobject, he should know what he do and type cast it!
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
Actually, this DOES compiler in Delphi, but not FPC.
Shane
>> Martin Waldenburg 10/23/99 02:12AM >>>
Hi!
Yes. Only one array property can be declared as the default property in Delphi.
Martin
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
Oh, another thing. FPC doesn't allow just inherited; You seem to require the procedure…
In delphi it works in every overidden method
Marc
I must say that the 2 requests I really need fixed is to allow the statement
inherited;to compile and 2nd would be why this compiles in Delphi but not FPC
var
Something : TStrings
Str := Something[I];
Why do I have to do this under linux
Str := Something.Strings[I];??????
Shane
>> "Shane Miller" 10/25/99 01:40PM >>>
Another request:
Delphi allows you to assign a Pointer variable to a TObject by doing the conversion for you, so you don't need to typecast it. For example
Var
P: Pointer;
T: TObject;
Begin
P := T;
End;FPC makes you typecast T as a Pointer.
Also, the other way around should work too.
T := P;so I don't need to typecast P as a TObject.
Could this be done?
Shane
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
Another request:
Delphi allows you to assign a Pointer variable to a TObject by doing the conversion for you, so you don't need to typecast it. For example
Var
P: Pointer;
T: TObject;
Begin
P := T;
End;FPC makes you typecast T as a Pointer.
Also, the other way around should work too.
T := P;so I don't need to typecast P as a TObject.
Could this be done?
Shane