Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 2 out of 5     Rate this Document

How Do I Concatenate Strings in Visual Basic?

Primary Software: Measurement Studio>>Visual Basic Support
Primary Software Version: 7.0
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-488.2
Hardware: GPIB

Problem:
I am writing a GPIB application in Visual Basic and I would like to be able to build message strings on the fly. How do I concatenate strings in Visual Basic?

Solution:
If you have several strings or variables mixed with the strings, and you want to combine them, you can use concatenation (the ampersand character, &). Here is an example:

String1 = "Sample1"
String2 = "Sample2"
Variable1 = FREQ


The concatenation of the strings would be: "Sample1" & FREQ & "Sample2".

In a simple ibwrt command you would write this as:

CALL ibwrt (ud%, "Sample 1" & FREQ & "Sample"$);

Related Links:
Developer Zone Tutorial: GPIB Language Interfaces
Product Manuals: Using Your NI-488 and NI-488.2 Subroutines for Visual Basic for Windows

Attachments:





Report Date: 02/13/1998
Last Updated: 02/01/2008
Document ID: 16CA674S

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit