Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
29
Task/Copy-a-string/Simula/copy-a-string.simula
Normal file
29
Task/Copy-a-string/Simula/copy-a-string.simula
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
BEGIN
|
||||
TEXT ORIGINAL, REFERENCE, COPY1;
|
||||
|
||||
ORIGINAL :- "THIS IS CONSTANT TEXT";
|
||||
ORIGINAL.SETPOS(1);
|
||||
REFERENCE :- ORIGINAL;
|
||||
|
||||
! RUN TIME ERROR:
|
||||
! ORIGINAL.PUTCHAR('X');
|
||||
! "copy-a-string.sim", line 9: ./copy-a-string: Putchar: Constant text object
|
||||
;
|
||||
|
||||
OUTTEXT(ORIGINAL);
|
||||
OUTIMAGE;
|
||||
|
||||
! CONTENT EQUAL? => T ;
|
||||
OUTTEXT(IF ORIGINAL = REFERENCE THEN "T" ELSE "F");
|
||||
OUTIMAGE;
|
||||
|
||||
! SAME TEXT OBJECT? => T ;
|
||||
OUTTEXT(IF ORIGINAL == REFERENCE THEN "T" ELSE "F");
|
||||
OUTIMAGE;
|
||||
|
||||
COPY1 :- COPY(ORIGINAL);
|
||||
COPY1.SETPOS(1);
|
||||
COPY1.PUTCHAR('X');
|
||||
OUTTEXT(COPY1);
|
||||
OUTIMAGE;
|
||||
END;
|
||||
Loading…
Add table
Add a link
Reference in a new issue