Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Preserving original value of modified variable
#1
Anyone with any thoughts on how to do the following most elegantly in QM?

If I want to modify a string and also preserve the original string value, I can't do something like this:

Code:
Copy      Help
str OriginalString = "AbCd"
str AllUpperCaseVersion = OriginalString.ucase
out OriginalString
out AllUpperCaseVersion

because it will modify the OriginalString the same way. So instead I do it this way:

Code:
Copy      Help
str OriginalString = "AbCd"
str AllUpperCaseVersion = OriginalString
AllUpperCaseVersion.ucase
out OriginalString
out AllUpperCaseVersion

It seems like this requires an extra step. Is there a more elegant way of doing this?

S
#2
Macro Macro
Code:
Copy      Help
str OriginalString = "AbCd"
str AllUpperCaseVersion.ucase(OriginalString)

out OriginalString
;out AllUpperCaseVersion
#3
oh my...I feel so silly!!! :oops:
Thanks......QM ~is~ elegant!!!!!
S
#4
np! happens sometimes.


Forum Jump:


Users browsing this thread: 1 Guest(s)