if value is empty

Status
Niet open voor verdere reacties.

Mann

Gebruiker
Lid geworden
17 feb 2017
Berichten
26
Hallo,

Ben bezig met een script schrijven voor een programma, nou is de eerste value van mijn topiclist altijd default en die is standaard leeg.
Nou wil ik het er zo in zetten dat hij de default regel overslaat en de volgende selecteert waar wel waardes in zitten.

Dit is mijn script tot nu toe, dit script werkt:

Code:
{
 Objective: Pop***ate the Topic List and Topic Name text controls
  - check if the Topic List is null 
  - check if the Topic Name is valid
  - truncate the line if it is too long
  - hide/show DDE panel depending on communication protocol
}

Dim TopicList as string;
Dim TopicNameStr as string;
Dim TopicArray[100] as string;	'array to contains topic names
Dim MatchTopicList as boolean;	'result for the condition if the topic name is valid
Dim s as string;				'temp variable in the for each statement

'Topic List: obtain the value
if ScanGroupList <> NULL then
  TopicList = ScanGroupList;
else
  TopicList = "";
endif;

'Topic Name: check for Null Reference
if TopicName <> NULL and TopicList <> "" then
  TopicNameStr = TopicName;

  'check for invalid and empty topic name
  if StringLen(TopicNameStr) > 0 then
    TopicArray = TopicList.split(System.Char.Parse(","));
    MatchTopicList = false;

    for each s in TopicArray[] 

      if System.String.Compare( TopicNameStr, s, true ) == 0 then
        'found matching topic in the list (case-insensitive comparison)
        MatchTopicList = true; 
        exit for;
      endif;
    next;

    if Not MatchTopicList then
      'Invalid topic name
      TopicNameStr = "(Invalid) " + TopicNameStr; 
    endif;
  else
    'blank topic name
    TopicNameStr = "<Blank topic name>"; 
  endif;
endif;
 
Laatst bewerkt:
Plaats het geheel even tussen codetags het is niet te lezen zo.
Gaat het wel om VBA?
 
Sorry, aangepast.
Het programma gebruikt een basic vb
 
Laatst bewerkt:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan