Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-11

CustomFormEditor : Problem #2 HELP!

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Florian Klaempfl
to Shane Miller: Can someone pull the latest from CVS and tell me why my GetPropValue throws an error…
you wrote 17 lines
Can someone pull the latest from CVS and tell me why my GetPropValue throws an error when compiling on line 244. I pass the procedure an untyped value Function GetPropValue(index : Intger; var Value) : Boolean; In the procedure I call if something then Value := GetEnumName(PropType,J) //returns a string else Value := J; //returns an integer which returns a string. This throws an error because it's expection type FORMAL????? I know there's something I have to do to get this to work with untyped parameters but I don't know it off hand.

You can't assign directly to a formal var parameter, use a move instead:

var
    s : string;
...
temp:=GetEnumName(PropType,J);
move(temp,value,<length>);

Reply by email

Shane Miller

Can I do this?

String(Value) := GetEnumName(PropType,J);

??

I thought of that after sending the message. It compiles but I haven't tested it.

Shane

>> 11/20/00 11:53AM >>>
you wrote 17 lines
Can someone pull the latest from CVS and tell me why my GetPropValue throws an error when compiling on line 244. I pass the procedure an untyped value Function GetPropValue(index : Intger; var Value) : Boolean; In the procedure I call if something then Value := GetEnumName(PropType,J) //returns a string else Value := J; //returns an integer which returns a string. This throws an error because it's expection type FORMAL????? I know there's something I have to do to get this to work with untyped parameters but I don't know it off hand.

You can't assign directly to a formal var parameter, use a move instead:

var
    s : string;
...
temp:=GetEnumName(PropType,J);
move(temp,value,<length>);

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Can someone pull the latest from CVS and tell me why my GetPropValue throws an error when compiling on line 244.

I pass the procedure an untyped value
Function GetPropValue(index : Intger; var Value) : Boolean;

In the procedure I call

if something then
Value := GetEnumName(PropType,J)  //returns a string
else
Value := J;  //returns an integer

which returns a string. This throws an error because it's expection type FORMAL????? I know there's something I have to do to get this to work with untyped parameters but I don't know it off hand.

Thanks
Shane

Reply by email