[Coco] PRINT vs PRINT USING

Bill Gunshannon bill.gunshannon at hotmail.com
Tue Mar 31 17:52:55 EDT 2020


On 3/31/20 5:14 PM, coco at jechar.ca wrote:
> On 2020-03-31 16:14, Bill Gunshannon wrote:
>> On 3/31/20 3:56 PM, coco at jechar.ca wrote:
>>>
>>>   If I want to print "HELLO" to the screen in a basic09 program
>>>   I would use.
>>>
>>>   PRINT "HELLO"
>>>
>>>   If instead I to print "HELLO" to a file I can use.
>>>
>>>   PRINT #pathno,"HELLO"
>>>
>>>   Is there any way to send the output of "PRINT USING" to
>>>   a file?
>>>
>>>   Charlie
>>>
>>
>> According to the manual it is simply:
>>
>> PRINT #<int exp>, USING <str expr>, <output list>
>>
>> bill
> 
> When I try the syntax you suggest I get a compile error.
> 
> 
>     OPEN #pathno,saveat$:WRITE
> 
>     PRINT #pathno,"TEST"
> 
>     FOR y=1 TO 19
>         FOR x=1 TO 21
>             PRINT #pathno," ";
>             PRINT #pathno, USING "H", quilt(x,y);
>         NEXT x
>         PRINT #pathno
> 
>     NEXT y
> 
>     CLOSE #pathno
> 
>     Everything worked before I tryed to send it to a file.
>     Also It works if except for the "PRINT USING" line.
>     So it is not an issue with the pathno or saveat$ varibles.
> 
>     Which are of type BYTE and STRING.
> 
>     PS THE COMPILE  ERROR POINTER POINTS TO JUST BEFORE "USING"

There may be a problem but it may not be where you think it is.
According to the manual, "pathno" should be an INTEGER not a BYTE.
Try changing that and let us know what happens.

bill




More information about the Coco mailing list