[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gm2] Returning a string constant
From: |
Scott Robinson |
Subject: |
[Gm2] Returning a string constant |
Date: |
Sun, 26 Oct 2008 08:52:39 -0500 |
Hello all,
I was wondering if the Modula-2 code below is supposed to be illegal?
MODULE test1;
FROM InOut IMPORT WriteString, WriteLn;
TYPE
testresult = ARRAY [0..9] OF CHAR;
PROCEDURE test() : testresult;
BEGIN
(* Is this legal? *)
RETURN "test";
END test;
BEGIN
WriteString('Test results = "');
WriteString(test());
WriteString('"');
WriteLn;
END test1.
The Modula-2 compiler is giving me this:
#gm2 -c -g test1.mod
test1.mod: In function ‘test’:
test1.mod:11: error: conversion to non-scalar type requested
Thanks,
Scott
- [Gm2] Returning a string constant,
Scott Robinson <=
- Re: [Gm2] Returning a string constant, Andreas Fischlin, 2008/10/26
- Re: [Gm2] Returning a string constant, Iztok Kobal, 2008/10/27
- RE: [Gm2] Returning a string constant, Breeden, Thomas (tmb), 2008/10/27
- Re: [Gm2] Returning a string constant, Gaius Mulley, 2008/10/27
- RE: [Gm2] Returning a string constant, Breeden, Thomas (tmb), 2008/10/27
- Re: [Gm2] Returning a string constant, Gaius Mulley, 2008/10/27
- Re: [Gm2] Returning a string constant, Andreas Fischlin, 2008/10/28
- Re: [Gm2] Returning a string constant, Iztok Kobal, 2008/10/30
- Re: [Gm2] Returning a string constant, Christian Maurer, 2008/10/28