Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Misc > Re: ShortString...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 7 Topic 723 of 811
Post > Topic >>

Re: ShortString to PChar

by Marco van de Voort <marcov@[EMAIL PROTECTED] > Feb 26, 2007 at 09:29 PM

On 2007-02-26, Dennis-Bendert Schramm <dennisschramm@[EMAIL PROTECTED]
> wrote:
> how do I convert a ShortString into PChar? I just tried 
> pchar([ShortStringPutHere]) but that gave me an error message.
>
> I'm developing an ncurses based app and I need to convert ShortString 
> strings to Pchar to use them with the mvwaddstr and mvprintw functions.

Best is to avoid the shortstring all together, and use ansistrings.

But if you have your reasons, then append #0 and pass a ptr to the first
character.

so 

  s:=s+#0;
  pass(@[EMAIL PROTECTED]
);

If you pass windows MBCS using functions, you might need to add two #0's,
so on
Windows better use

  s:=s+#0#0;
  pass(@[EMAIL PROTECTED]
);
 




 7 Posts in Topic:
ShortString to PChar
Dennis-Bendert Schramm &l  2007-02-26 22:26:13 
Re: ShortString to PChar
Marco van de Voort <ma  2007-02-26 21:29:16 
Re: ShortString to PChar
Dennis-Bendert Schramm &l  2007-02-26 23:45:19 
Re: ShortString to PChar
Wolf Behrenhoff <NoSpa  2007-02-26 23:56:02 
Re: ShortString to PChar
Marco van de Voort <ma  2007-02-27 08:46:02 
Re: ShortString to PChar
Dennis-Bendert Schramm &l  2007-02-27 23:29:07 
Re: ShortString to PChar
"Richard Engebretson  2007-02-27 05:01:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:44:48 CDT 2008.