Incrementing text fields in the same label
I have 9 hex numbers in the label below. I would like to be able to enter one hex number starting on the upper left field (18C7 in this case) with a text box and the rest of the text fields to increment by 1 as shown when it is printed. I know how to create the text box for the first number, but how to I reference the first field (18C7) on field 2 and incremented by 1 to get 18C8 and the rest of the numbers. How can I do that?
I am not familiar with VBScript.
-
Ok. I was able to get partial of what I needed to work. When I enter a value for the first field ("WWN1"), I get the rest of the fields to to add in +1 to each number. I did this by entering the following for each object in Transforms/VB Script/OnProcessData. However, now my issue is that the value for WWN1 will be in hex as per my original post and that is not working. How can I read the object in hex and calculate (adding the value) in hex?
Text 2:
If Not IsNumeric(Value) Then Exit Sub
Value = Format.NamedSubStrings("WWN1").Value + 1
Text 3:
If Not IsNumeric(Value) Then Exit Sub
Value = Format.NamedSubStrings("WWN1").Value + 2
Text 4:
If Not IsNumeric(Value) Then Exit Sub
Value = Format.NamedSubStrings("WWN1").Value + 3
...
...
Text 9:
If Not IsNumeric(Value) Then Exit Sub
Value = Format.NamedSubStrings("WWN1").Value + 8
0 -
I have not worked out how to do this with a starting value that is already in hex, but if you convert the starting number to a "normal" number then you could could do something like this, where the starting number string has been named "BaseNumber".
If you are using a Data Entry form to enter the starting value then you would probably need to adjust the VB to an EventControlledScript>OnPostPrompt.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare