[Gambas-user] using 'output to' and error to'

Bruce adamnt42 at gmail.com
Wed Jul 15 03:28:17 CEST 2020


At a guess, File.Out is always stdout, regardless of redirection. That 
way you can ensure that you will print on the console.
Maybe, maybe not.
b

On 15/7/20 10:20 am, Bruce wrote:
> Public Sub Main()
> 
>    Dim mfile As File
> 
>    mfile = Open Temp() For Write Create
>    Output To mfile
> 
>    Print "hello standard"
> 
>    Print #mfile, "Hello file.out"
> '       ======
> 
> End
> 
> On 14/7/20 12:03 am, Brian G wrote:
>> When using output to or error to
>>
>> It seems that it only changes the destination for print "this string 
>> and error "this string"
>>
>> but when using #print file.out, "this string" or print #file.err, 
>> "this string" the output is not redirected
>>
>> Is this deliberate?
>>
>> example:
>>
>> Public Sub Main()
>> Dim mfile As File
>> mfile = Open Temp() For Write Create
>> Output To mfile
>> Print "hello standard"
>> Print #File.out, "Hello file.out"
>> End
>>
>> Always put the second print to the console, and the first to the file.
>> The same happens for Error to
>> Error "Hello standard"
>> print #file.err,"Hello file.err"
>>
>>
>> Thank You
>> Brian G
>>
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>


More information about the User mailing list