What's the fastest way to figure out whether a given letter is upper-case or not in ABL?
I want to turn something like OpenEdge.Net.DataObject.DataObjectHandler into a string like
It has to be as fast as possible so , um, creative code will be considered .
Perhaps, you would need to make the variable case-sensitive.
define variable vChar as character case-sensitive no-undo.
vChar = "A".
/* Test if string is lowercase */
if LC(vChar) = vChar then
message "Not equal".
Peter, I have noticed that you used for every literal the ":u" attribute. Has this attribute a huge performance impact?
DEFINE VARIABLE cClassName AS CHARACTER NO-UNDO CASE-SENSITIVE.
DEFINE VARIABLE cBeforeTrim AS CHARACTER NO-UNDO CASE-SENSITIVE.
DEFINE VARIABLE cAfterTrim AS CHARACTER NO-UNDO CASE-SENSITIVE.
DEFINE VARIABLE cResult AS CHARACTER NO-UNDO.
DEFINE VARIABLE iLength AS INTEGER NO-UNDO.
DEFINE VARIABLE iCount AS INTEGER NO-UNDO.
cClassName = "OpenEdge.Net.DataObject.DataObjectHandler"
iLength = LENGTH(cClassName) iCount = 1
DO WHILE TRUE:
IF iCount >= iLength THEN
cBeforeTrim = SUBSTRING(cClassName, iCount)
cAfterTrim = LEFT-TRIM(cBeforeTrim, "abcdefghijklmnopqrstuvwxyz")
iCount = iCount + LENGTH(cBeforeTrim) - LENGTH(cAfterTrim) + 1
cResult = cResult + SUBSTRING(cAfterTrim, 1, 1)
END./* cResult = OE.N.DO.DOH - ASSIGN Statement: 12times called 0.000075 avg. per call 0.000006 */
Architect of the SmartComponent Library and WinKit
:U marks the string as not-translatable - this has the compile time-effect of enabling the compiler to concatenate a series of strings together. Without :U, the string is considered translatable which means it can't be concatenated at compile time.
"string1":U + "string2":U <- concatenated once at compile time
"string1" + "string2" <- concatenated at run time each time this line of code is executed
:U marks the string as not-translatable - this has the compile time-effect of enabling the compiler to concatenate a series of strings together. Without :U, the string is considered translatable
which means it can't be concatenated at compile time.
You received this notification because you subscribed to the forum. To unsubscribe from only this thread,
post as spam/abuse.