• How to Report/Display a File Name in VHDL?

    From A@21:1/5 to All on Thu Feb 10 10:10:48 2022
    I'd like to open a file and then display the name of the file that I just opened. Tried the following but get a syntax Error.

    FILE Fnew : Text;
    FILE_OPEN(Fnew, "wfile", WRITE_MODE);
    report "FILE NAME = ", & Fnew; --Syntax Error

    Thanks for your help.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From KJ@21:1/5 to ashokm...@gmail.com on Fri Feb 11 03:33:27 2022
    On Thursday, February 10, 2022 at 1:10:50 PM UTC-5, ashokm...@gmail.com wrote:
    I'd like to open a file and then display the name of the file that I just opened. Tried the following but get a syntax Error.

    FILE Fnew : Text;
    FILE_OPEN(Fnew, "wfile", WRITE_MODE);
    report "FILE NAME = ", & Fnew; --Syntax Error

    Thanks for your help.
    The file name in your example is "wfile", not &Fnew.

    So it should be
    report "FILE NAME = " & "wfile";

    Alternatively, define a string constant and pass that string to the file_open procedure as well as using it in the report statement.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From A@21:1/5 to All on Fri Feb 11 08:44:16 2022
    On Friday, February 11, 2022 at 3:33:30 AM UTC-8, KJ wrote:
    On Thursday, February 10, 2022 at 1:10:50 PM UTC-5, ashokm...@gmail.com wrote:
    I'd like to open a file and then display the name of the file that I just opened. Tried the following but get a syntax Error.

    FILE Fnew : Text;
    FILE_OPEN(Fnew, "wfile", WRITE_MODE);
    report "FILE NAME = ", & Fnew; --Syntax Error

    Thanks for your help.
    The file name in your example is "wfile", not &Fnew.

    So it should be
    report "FILE NAME = " & "wfile";

    Alternatively, define a string constant and pass that string to the file_open procedure as well as using it in the report statement.

    Thanks but I still get a syntax error with your solution. Also, defined a string constant and passed that to the file_open and report statements. Still syntax Error.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From KJ@21:1/5 to ashokm...@gmail.com on Fri Feb 11 16:53:51 2022
    On Friday, February 11, 2022 at 11:44:18 AM UTC-5, ashokm...@gmail.com wrote:
    On Friday, February 11, 2022 at 3:33:30 AM UTC-8, KJ wrote:
    On Thursday, February 10, 2022 at 1:10:50 PM UTC-5, ashokm...@gmail.com wrote:
    I'd like to open a file and then display the name of the file that I just opened. Tried the following but get a syntax Error.

    FILE Fnew : Text;
    FILE_OPEN(Fnew, "wfile", WRITE_MODE);
    report "FILE NAME = ", & Fnew; --Syntax Error

    Thanks for your help.
    The file name in your example is "wfile", not &Fnew.

    So it should be
    report "FILE NAME = " & "wfile";

    Alternatively, define a string constant and pass that string to the file_open procedure as well as using it in the report statement.
    Thanks but I still get a syntax error with your solution. Also, defined a string constant and passed that to the file_open and report statements. Still syntax Error.

    What I posted works for me: report "FILE NAME = " & "wfile";

    Since you've provided no actual code or what the actual error is, I'm not going to guess. Good luck.

    Kevin Jennings

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas Matringe@21:1/5 to All on Sat Feb 12 10:58:29 2022
    On 2/11/22 17:44, A wrote:
    On Friday, February 11, 2022 at 3:33:30 AM UTC-8, KJ wrote:
    On Thursday, February 10, 2022 at 1:10:50 PM UTC-5, ashokm...@gmail.com wrote:
    I'd like to open a file and then display the name of the file that I just opened. Tried the following but get a syntax Error.

    FILE Fnew : Text;
    FILE_OPEN(Fnew, "wfile", WRITE_MODE);
    report "FILE NAME = ", & Fnew; --Syntax Error
    [...]
    The file name in your example is "wfile", not &Fnew.

    So it should be
    report "FILE NAME = " & "wfile";
    [...]> Thanks but I still get a syntax error with your solution. Also,
    defined a string constant and passed that to the file_open and report statements. Still syntax Error.

    Hello
    The problem is probably with the comma before the concatenation operator &

    Nicolas

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)