IBM i Access Client Solutions

 View Only
  • 1.  Carriage returns in HAScript prompt windows?

    Posted Thu June 20, 2024 04:53 PM
      |   view attached

    I'm working on a way to quickly enter repetitive text into the terminal window. It'd really help if when I make a prompt pop up if the text in the window, or as it's called the "prompt name" could have multiple lines of text. So far everything I've tried to put in the string or concatenate into the string has failed. For example I've tried using character codes like 
 and formatting codes like \n, but I've had no luck. This is mostly just a side project I do on my breaks but any input would be appreciated. I've included a shot of what I've started. Where it says the 2 kinds of commodities is where I'd like to break it up.



    ------------------------------
    Christopher Verdon
    ------------------------------


  • 2.  RE: Carriage returns in HAScript prompt windows?

    Posted Fri June 21, 2024 02:13 AM

    Dear Christopher 

    Please try  <1st line Text> & chr(10) & <2nd line Text>  to see if it works or not.  If not, try chr(13).  



    ------------------------------
    Satid S
    ------------------------------



  • 3.  RE: Carriage returns in HAScript prompt windows?

    Posted Fri June 21, 2024 03:10 PM

    Thanks, Satid. Hasn't worked yet but maybe I'm doing it wrong. I'll show you more of what I'm working with. Here's the code in the code editor

    <prompt name="&apos;1 - Novelty Deodorants 2 - Light Bulbs&apos;" description="" row="0" col="0" len="2" default="" clearfield="false" encrypted="false" movecursor="true" xlatehostkeys="true" assigntovar="$commodity1$" varupdateonly="true" required="false" title="&apos;Select the commodity&apos;" />
    

    and here's the same prompt in the macro editor window



    ------------------------------
    Christopher Verdon
    ------------------------------



  • 4.  RE: Carriage returns in HAScript prompt windows?

    Posted Tue August 13, 2024 03:04 PM

    Luckily there's plenty to keep me busy at work but I'd still like to complete this project. If anyone thinks they can help, please chime in!



    ------------------------------
    Christopher Verdon
    ------------------------------



  • 5.  RE: Carriage returns in HAScript prompt windows?

    Posted Wed August 14, 2024 01:16 AM

    Did you try with CDATA, in Code Editor?



    ------------------------------
    Sylvain Manceau
    ------------------------------



  • 6.  RE: Carriage returns in HAScript prompt windows?

    Posted Wed August 14, 2024 03:15 PM
    Edited by Christopher Verdon Wed August 14, 2024 03:44 PM

    CDATA isn't even mentioned in the macro handbook so I hadn't tried it. Once again, I may be doing it wrong so please correct me. Here's the code that I tried. I got the following error window when I executed it and the craziest part is the code within CDATA was removed from the code editor when I went back to change it.

        <vars>
          <create name="$commodity1$" type="string" value="" />
          <create name="$doExit$" type="boolean" value="false" />
          /* <![CDATA[ */
          <create name="$promptName1$" type="string" value="&apos;1-Novelty Deodorants&apos;+chr(10)+&apos;2-Light Bulbs&apos;" />
          /* ]]> */
        </vars>
    an error window I received after trying this new method


    EDIT: I forgot the trailing greater than in that last tag. I tried it again after correcting it and got the same problem. I believe I don't need those comment indicators either so I tried it this way, but the results were the same.

        <vars>
          <create name="$commodity1$" type="string" value="" />
          <create name="$doExit$" type="boolean" value="false" />
          <![CDATA[
          <create name="$promptName1$" type="string" value="&apos;1-Novelty Deodorants&apos;+chr(10)+&apos;2-Light Bulbs&apos;" />
          ]]>
        </vars>


    ------------------------------
    Christopher Verdon
    ------------------------------



  • 7.  RE: Carriage returns in HAScript prompt windows?

    Posted 9 days ago

    Hi, I have the same problem here with a message box, already tried to fix it with chr(10), chr(13), CDATA, unicode &#10;, &'x0A;,\n, \r\n, ASCII +char(10), HTML <br>.... nothing worked so far



    ------------------------------
    Sabine Rein
    ------------------------------