<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to The GetText function</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8f2fc2e158/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8f2fc2e158/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8f2fc2e158/</id><updated>2020-02-27T19:39:04.818000Z</updated><subtitle>Recent posts to The GetText function</subtitle><entry><title>The GetText function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8f2fc2e158/?limit=25#9d71" rel="alternate"/><published>2020-02-27T19:39:04.818000Z</published><updated>2020-02-27T19:39:04.818000Z</updated><author><name>swtroelofs</name><uri>https://forge.codesys.com/u/swtroelofs/</uri></author><id>https://forge.codesys.comc32be24ee875e7845b2548477916b1ef28d31f35</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'll try once more to upload the screenshot...&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Clipboard02.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=187"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>The GetText function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8f2fc2e158/?limit=25#ecb7" rel="alternate"/><published>2020-02-27T19:39:03.563000Z</published><updated>2020-02-27T19:39:03.563000Z</updated><author><name>swtroelofs</name><uri>https://forge.codesys.com/u/swtroelofs/</uri></author><id>https://forge.codesys.com65213abfeadcc31778a0cfbd8629beaf5c7da852</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for your reply!&lt;/p&gt;
&lt;p&gt;Unfortunately it didn't work. The dereferenced pointer to the string stays empty. Please look at the attached picture.&lt;/p&gt;
&lt;p&gt;Do you have any more ideas? Who would know this?&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Clipboard01.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=186"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>The GetText function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8f2fc2e158/?limit=25#0b26" rel="alternate"/><published>2020-02-27T19:38:59.989000Z</published><updated>2020-02-27T19:38:59.989000Z</updated><author><name>Romuald</name><uri>https://forge.codesys.com/u/romuald/</uri></author><id>https://forge.codesys.combf825b8cbffb1964570e254ba663e0cfd903be70</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;swtroelofs hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Nobody knows?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Try this&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;MyPointer&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;POINTER&lt;/span&gt; &lt;span class="n"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;UINT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;pString&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;POINTER&lt;/span&gt; &lt;span class="n"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;MyString&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;GetUnicodeText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyPointer&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Button'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;pString&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyPointer&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;MyString&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;pString&lt;/span&gt;&lt;span class="o"&gt;^;&lt;/span&gt; 
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>The GetText function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8f2fc2e158/?limit=25#375c" rel="alternate"/><published>2020-02-27T19:38:58.732000Z</published><updated>2020-02-27T19:38:58.732000Z</updated><author><name>swtroelofs</name><uri>https://forge.codesys.com/u/swtroelofs/</uri></author><id>https://forge.codesys.coma315237a229e814e2b9e682856f0592d340bd7f9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Nobody knows?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>The GetText function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8f2fc2e158/?limit=25#7fca" rel="alternate"/><published>2020-02-27T19:38:55.195000Z</published><updated>2020-02-27T19:38:55.195000Z</updated><author><name>swtroelofs</name><uri>https://forge.codesys.com/u/swtroelofs/</uri></author><id>https://forge.codesys.com0f3b415f83e6dde7fce7cd5e6bfea693cfb0141e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Sorry, I don't quite understand.&lt;/p&gt;
&lt;p&gt;You mean something like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;MyPointer&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;POINTER&lt;/span&gt; &lt;span class="n"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;UINT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;MyString&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;GetUnicodeText&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyPointer&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Button'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;MyString&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;MyPointer&lt;/span&gt;&lt;span class="o"&gt;^;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It returns a type casting error:&lt;/p&gt;
&lt;p&gt;Type mismatch: Cannot convert 'ARRAY &lt;span&gt;[0..10000]&lt;/span&gt; OF UINT' to 'STRING(80)'.&lt;/p&gt;
&lt;p&gt;This also fails to compile:&lt;/p&gt;
&lt;p&gt;MyString := UINT_TO_STRING(MyPointer^);&lt;/p&gt;
&lt;p&gt;PS&lt;/p&gt;
&lt;p&gt;Shooter, I think I saw you at the Dutch Codesys Users Conference  Thanks for your help.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>The GetText function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8f2fc2e158/?limit=25#1fcd" rel="alternate"/><published>2020-02-27T19:38:53.926000Z</published><updated>2020-02-27T19:38:53.926000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com3f619df00e0d970961fced11758ee4e268b3034a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;use the ^symbol&lt;/p&gt;
&lt;p&gt;it is above the 6&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>The GetText function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8f2fc2e158/?limit=25#02ea" rel="alternate"/><published>2020-02-27T19:38:50.292000Z</published><updated>2020-02-27T19:38:50.292000Z</updated><author><name>swtroelofs</name><uri>https://forge.codesys.com/u/swtroelofs/</uri></author><id>https://forge.codesys.com679ae00dbd33697cb5a2412ea1f860f360c80fdf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Goodmorning all,&lt;/p&gt;
&lt;p&gt;Here's the question:&lt;/p&gt;
&lt;p&gt;From the library: SysLibTargetVisu_v10.lib I use the following function to get translations from a dynamic text list.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;GetText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nResultLength&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stPrefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dwID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This works perfectly. The string variable stResult now has the correct translation. &lt;br/&gt;
However, now we have a Russian customer so I have to load Cyrillic characters (unicode).&lt;br/&gt;
I will have to use the following function:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;GetUnicodeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nResultLength&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stPrefix&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dwID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;As you can see this function does not return a string, but a pointer instead. the variable pResult is of the type: POINTER TO ARRAY &lt;span&gt;[0..10000]&lt;/span&gt; OF UINT.&lt;/p&gt;
&lt;p&gt;Does someone have an idea how to use this pointer? How do I generate a string from this array of UINT?&lt;/p&gt;
&lt;p&gt;Help would be much appreciated &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Stefan&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>