<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — dlgrequesttext problem]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=802&amp;type=atom" />
	<updated>2021-03-10T18:38:59Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=802</id>
		<entry>
			<title type="html"><![CDATA[Re: dlgrequesttext problem]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3701#p3701" />
			<content type="html"><![CDATA[<p>Thank you Jeff. I suspected there were &quot;hidden&quot; extra characters that were throwing things off. I had solved the problem using the same idea that you suggested.</p>]]></content>
			<author>
				<name><![CDATA[tun_day]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3696</uri>
			</author>
			<updated>2021-03-10T18:38:59Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3701#p3701</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dlgrequesttext problem]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3699#p3699" />
			<content type="html"><![CDATA[<p>I would try to make the text longer.&nbsp; Because AppGraphics is interacting with Windows API calls, all strings will have a null character appended to them whether setting or retrieving.&nbsp; We strip away this null character when passing back results, but it does take up memory (one of your two character spaces).&nbsp; You probably need to make it a longer string variable.</p><p>You can look at the <a href="https://forums.approximatrix.com/help.php?section=bbcode">BBCode guide</a> on how to italicize or bold text in your posts.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2021-03-07T16:00:16Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3699#p3699</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dlgrequesttext problem]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3698#p3698" />
			<content type="html"><![CDATA[<p>I expected the same result as your code. My caller to the get_text subroutine calls it almost exactly as your main. Except that you declared the variable txt to be length 100 in your main whereas I declared my the equivalent variable in my caller to be length to be length 2. I expected it to be no longer than that because it represents only 1-digit number. </p><p>When I ran your code as is, I got expected results. But when I changed your declaration to txt(2) I got the same problem as my version. On the other hand when I changed my variable to be at least length 3 in my code, I got expected results. I can&#039;t find anything in the documentation of dlgrequesttext that says the string length should be at least 3. Also nothing in my Fortran manual that says so.</p><p>By the&nbsp; way, is there a way to bold or italicize texts in composing this message?</p><p>Thanks!</p>]]></content>
			<author>
				<name><![CDATA[tun_day]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3696</uri>
			</author>
			<updated>2021-03-04T16:25:39Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3698#p3698</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dlgrequesttext problem]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3697#p3697" />
			<content type="html"><![CDATA[<p>I&#039;m not sure exactly what you&#039;re saying here.&nbsp; In my code, when I call your routine <em>get_text</em>, a text box pops up, and the user enters text.&nbsp; If the user clicks &quot;Ok,&quot; that text is copied into the variable <em>text</em> in the subroutine <em>get_text</em> as expected.&nbsp; My program simply displays the contents of the variable <em>text</em> after this operation, which appears to be correct. </p><p>Are you seeing something different if you run the code I provided as-is?</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2021-03-03T13:30:33Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3697#p3697</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dlgrequesttext problem]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3696#p3696" />
			<content type="html"><![CDATA[<p>The subroutine get_text properly displays a dialog with the correct input text and prompt to the user but the text typed in by the user does not change the input text in the message box as I understand the documentation to say. As you can see I hardcoded a text (&#039;4&#039;) for now.</p>]]></content>
			<author>
				<name><![CDATA[tun_day]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3696</uri>
			</author>
			<updated>2021-03-02T21:58:04Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3696#p3696</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: dlgrequesttext problem]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3695#p3695" />
			<content type="html"><![CDATA[<p>I just tested your subroutine, and it seems to work fine.&nbsp; Here&#039;s my working code:</p><div class="codebox"><pre><code>program main
use appgraphics
implicit none

    integer::myscreen
    character(100)::txt
    
    myscreen = initwindow(800, 600, closeflag=.TRUE.)
    
    txt = &#039; &#039;
    call get_text(&quot;Please Provide Text&quot;, txt)
    
    call dlgmessage(DIALOG_INFO, txt)
    
    call loop()
    
    call closewindow(myscreen)

contains

    subroutine get_text(prompt, text)
    use appgraphics

    implicit none

        integer i2
        character :: prompt*(*), text*(*), title*5
        logical ok

        title = &#039;title&#039;
        ok = dlgrequesttext (text, title, prompt)
        i2 = len(text)
        ! text = &#039;4&#039;
    end subroutine get_text

end program main</code></pre></div><p>What exactly do you mean that it &quot;does not output user text input&quot; in your message?</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2021-03-01T12:36:12Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3695#p3695</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[dlgrequesttext problem]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3694#p3694" />
			<content type="html"><![CDATA[<p>dlgrequesttext does not output user text input in the following subroutine. Is it me (most likely) or a bug?</p><p>subroutine get_text(prompt, text)<br />use appgraphics</p><p>implicit none</p><p>integer i2<br />character :: prompt*(*), text*(*), title*5<br />logical ok</p><p>title = &#039;title&#039;<br />ok = dlgrequesttext (text, title, prompt)<br />i2 = len(text)<br />! text = &#039;4&#039;<br />end subroutine get_text</p>]]></content>
			<author>
				<name><![CDATA[tun_day]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3696</uri>
			</author>
			<updated>2021-02-28T20:59:23Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3694#p3694</id>
		</entry>
</feed>
