Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Converting VB.NET to Visual Cobol

$
0
0

...and to answer the original question, the syntax:

    declare a() as binary-char unsigned occurs any = type Encoding::UTF8::GetBytes(SourceText)

...is not quite right.  Should be:

    declare a as binary-char unsigned occurs any = type Encoding::UTF8::GetBytes(SourceText)

(i.e. same thing without the parentheses following 'a').

In fact, for this and similar declare statements it is not necessary to define the type explicitly as the compiler is able to infer the type from the value expression, so the following is equally good:

    declare a = type Encoding::UTF8::GetBytes(SourceText)

This is similar to the use of 'var' in C# and it is of course a matter of opinion as to whether it's better to state the type explicitly.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>