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 4 of 7 Topic 723 of 811
Post > Topic >>

Re: ShortString to PChar

by Wolf Behrenhoff <NoSpamPleaseButThisIsValid3@[EMAIL PROTECTED] > Feb 26, 2007 at 11:56 PM

Dennis-Bendert Schramm schrieb:
> Well, I wanted to do the following:
> 
> var menustring:array[0..9]of string;
> 
> begin
> 	menustring[0]:='String A';
>     	menustring[1]:='String B';
> 	menustring[2]:='String C';
>     	menustring[3]:='String D';
>     	menustring[4]:='String E';
>     	menustring[5]:='String F';

er....
Are you sure it is a good idea to initialize this way?

> 	...
> 	mvprintw(1,1,menustring[0],[]);
> 	mvprintw(2,1,menustring[1],[]);
> 	...

You don't want a loop here?

> end.
> 
> When I compile with -Sh I get an error message:
> 
> Incompatible type for arg no. 2: Got "AnsiString", expected "PChar"

Of course! You have to typecast! Use PChar(MyAnsiStringHere)
The difference is that you can simply typecast AnsiString to PChar.

Wolf
 




 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 0:54:17 CDT 2008.