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

RE: How make a text with variables

$
0
0

Another approach is to use the String::Format method with replacement variable numbers instead.

working-storage section.

01 mytext    string  value"This is booking: {0} checkin on {1} and checkout on {2}".

01 resnum    pic 9(4) value 2748.

01 checkin   pic x(10) value "05/20/2016".

01 checkout  pic x(10) value "05/25/2016".

procedure division.

     set mytext to type String::Format(mytext, resnum, checkin, checkout)

     display mytext


Viewing all articles
Browse latest Browse all 4356

Trending Articles



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