How to change the variable content?


#1

dear,

if my type “2016/17” in my input dialog, and it will replace text in my word file. However, what expression should I put if I want to show “2015/16” or “2017/18” based on my input dialog? thanks~


#2

maybe someone has a better idea but the way i see is to use some variables to store each number:

var year = CInt(“2016/17”.split("/")(0))
var month = CInt(“2016/17”.split("/")(1))

then to write upwards / downwards values you would use:

newText = (year - 1).toString + “/” + (month - 1).toString


#3

dear,

thanks for your reply. however, when I input your CInt expression, it shows blue !!. and what I would do is to extract string variable from OCR PDF and then convert string “2016/17” to your expression. thank you~


#4

hi,

try this:

CInt(“2016/17”.split("/“c)(0)).ToString
CInt(“2016/17”.split(”/"c)(1)).ToString


#5

Hello!

Here’s my solution. (Download the xaml file).

changeVariableContent.xaml (7.1 KB)

Regards,