4

How can I add a number and string into a character variable on Progress4GL like the following (it's just an example to show the idea).

a = 'Code'
b = 1

c = a+b

So c's value is "Code1"

How can I do it on progress4GL?

Any help is appreciated.

Yuri Solodkin
  • 530
  • 8
  • 26
Kyle
  • 1,568
  • 2
  • 20
  • 46

1 Answers1

5

You can use STRING() function to convert integer into character.

With your exemple:

DEFINE VARIABLE a AS CHARACTER  NO-UNDO.
DEFINE VARIABLE b AS INTEGER    NO-UNDO.
DEFINE VARIABLE c AS CHARACTER  NO-UNDO.
a = 'Code'.
b = 1.

c = a + STRING(b).
doydoy44
  • 5,720
  • 4
  • 29
  • 45
  • Thank you so much, I tried it and it was so close to yours except I didn't set `NO-UNDO`, what does it do exactly? – Kyle Sep 14 '15 at 13:44
  • You're welcome. The `NO-UNDO`, allows not memorize the variable to undo if needed. – doydoy44 Sep 14 '15 at 13:48
  • 5
    You should use the NO-UNDO option on every variable and temp-table definition unless you need to support backing the values out on a transaction undo (rollback). Otherwise Progress will keep track of value changes during transactions that will cause extra overhead. A small performance gain but it adds up over time and volume. – TheMadDBA Sep 14 '15 at 14:45
  • @TheMadDBA Thank you so much for telling me that +1, I'm still new to progress4gl – Kyle Sep 14 '15 at 17:31