Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

Guten Tag,

ich versuche einen String zu vergleichen mit der STRCMP Funktion und dies dann als Argument einer IF Abfrage zu nutzen. Allerdings gibt die Funktion ja eine 0 aus, wenn die Strings gleich sind. Leider schaffe ich es nicht die STRCMP zu negieren. Sowohl ein Vergleich (<1, ==0 etc) als auch ein negieren (!, NOT) liefert einen Fehler (AER960RET_INVALID_MATH_LIST). Gibt es eine Alternative, die ich nicht gesehen habe?

Solution

Hier ist ein Beispielprogramm zum Gebrauch von STRCMP-Funktionen. Here is an example program using the STRCMP function.

Panel
bgColor#fff

DVAR $String1
DVAR $String2

MSGCLEAR -1

$Strglob[5] = "Hello"
$Strglob[6] = "Name"

$Global[10] = STRCMP ("Hello", "Hello", 1)

$Global[11] = STRCMP ($strglob[5], $strglob[6], 1)

MSGDISPLAY 1, "Stringvergleich 1: ", $global[10]
MSGDISPLAY 2, "Stringverlgeich 2: ", $global[11]

If $global[10] == 0 Then
$global[10] = 1
end if

if $global[11] == 1 Then
$global[11] = 0
End if

MSGDISPLAY 1, "Stringvergleich korrigiert 1: ", $global[10]
MSGDISPLAY 2, "Stringverlgeich korrigiert 2: ", $global[11]

...

Content by Label
showLabelsfalse
max5
spacesAKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kblegacy-how-troubleshootingto-article" and type = "page" and space = "AKB"
labelskb-troubleshooting-article

...