2 * This program converts a generic Win32 resource file into a version-specific
6 * Output: output rc file with version numbers
7 * Version: in x.x format
8 * Assumptions: input file exists and in correct format
9 * output file is writeable
11 Parse Arg input output
version verdate
12 verdate
= Strip( verdate
, 'B', '"' )
14 num_dots
= Countstr( '.', verdot
)
16 When num_dots
= 1 Then
21 When num_dots
= 2 Then
26 Otherwise Say 'Invalid verdot format:' verdot
'. Must be x.x or x.x.x'
28 vercomma
= Changestr( '.', version, ',' )
29 veryear
= Left( Date( 'S' ), 4 )
30 Call Stream input
, 'C', 'OPEN READ'
31 Call Stream output
, 'C', 'OPEN WRITE REPLACE'
32 Do While Lines( input
) > 0
33 line = Linein( input
)
34 line = Changestr( qm_ver
, line, verdot
)
35 line = Changestr( qm_vercomma
, line, vercomma
)
36 line = Changestr( '????????', line, verdate
)
37 line = Changestr( '????', line, veryear
)
38 Call Lineout output
, line
40 Call Stream input
, 'C', 'CLOSE'
41 Call Stream output
, 'C', 'CLOSE'