[prev in list] [next in list] [prev in thread] [next in thread] 

List:       midware
Subject:    Re: [midware] Midware changes
From:       "Francois PIETTE" <francois.piette () overbyte ! be>
Date:       2002-12-10 18:58:29
[Download RAW message or body]

A cast doesn't truncate anything ! It even doesn't change data value, it
makes just the compiler consider the datatype not as the original (untyped
pointer here) but as the casted type (here PChar). Pascal (Delphi) is a
strongly typed language and the compiler would refuse any data handling not
conforming to the data type. A cast is just a way to say to the compiler:
hey I know what I'm doing, just do it !

--
francois.piette@overbyte.be
http://www.overbyte.be

----- Original Message -----
From: "Del Texley" <dtexley@lipa.net>
To: <midware@elists.org>
Sent: Tuesday, December 10, 2002 7:14 PM
Subject: Re: [midware] Midware changes


> I ran into a problem doing this in the past finding that doing the
> Pchar(cmdbuf) often truncated the buffer to 255 characters.  The
> situation might have been slightly different, and I will try simply
casting
> the buffer.
>
> Thanks.
>
>
> > This was caused by an incompatibility found in Delphi 7. But don't
> > worry, do'nt change your code, just add a cast to make the argument
> > behave exactly the same as before. The argument value is just the
> > same, being a PChar or a Pointer. To use CmdBuf as PChar, just write
> >   PChar(CmdBuf)
> > And if you want to avoid repeating the cast everywhere, you can
> > introduce a local variable like this: var
> >     MyCmdBuf : PChar;
> > begin
> >     MyCmdBuf := PChar(CmdBuf);
> >     // Then use MyCmdBuf as you have done before...
> > end;
> > --
> > francois.piette@overbyte.be
> > http://www.overbyte.be
> >
> > ----- Original Message -----
> > From: "Del Texley" <dtexley@lipa.net>
> > To: <midware@elists.org>
> > Sent: Monday, December 09, 2002 11:21 PM
> > Subject: [midware] Midware changes
> >
> >
> > >
> > > I just installed the latest version of Midware and discovered (to my
> > > personal dismay) that serveral event handlers have new syntax,
> > > specifically the CmdBuf parameter has changed from a PChar to a
> > > Pointer.  Anybody have tutorials on how to use Pointers???  I have
> > > quite a bit of code in the eventhandlers for encrypting/decrypting
> > > information and it was all predicated on the PChar type.
> > >
> > >
> > > Del Texley
> > > LIPA Information Systems
> > > (541) 484 6430
> > >
> > >
> > > _______________________________________________
> > > Midware mailing list
> > > [http://www.elists.org/mailman/listinfo/midware] Visit our website
> > > at: http://www.overbyte.be
> >
> >
> > _______________________________________________
> > Midware mailing list [http://www.elists.org/mailman/listinfo/midware]
> > Visit our website at: http://www.overbyte.be
> >
>
>
> Del Texley
> LIPA Information Systems
> (541) 484 6430
>
>
> _______________________________________________
> Midware mailing list [http://www.elists.org/mailman/listinfo/midware]
> Visit our website at: http://www.overbyte.be


_______________________________________________
Midware mailing list [http://www.elists.org/mailman/listinfo/midware]
Visit our website at: http://www.overbyte.be

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic