473,408 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Moving from a string into an array and from an array in a string?

3
Hi
I must have a move from a string field into an array
and back from an array into a string...
But How?

Here is the Code:

Expand|Select|Wrap|Line Numbers
  1. Imports System.Runtime.InteropServices
  2. Public Class Class1
  3.     Public WPFFunktion As String
  4.     Public WPFFeld1 As String
  5.     Public WPFFeld2 As String
  6.     Public WPFFeld3 As String
  7.     Public WPFFeld4 As String
  8.     Public WPFFeld5 As String
  9.     Public WPFInfo As String
  10.  
  11.     <StructLayout(LayoutKind.Sequential)> Public Structure MYTabelle1
  12.         <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public TABFelder As String
  13.     End Structure
  14.  
  15.     <StructLayout(LayoutKind.Sequential)> Public Structure MYSATZ
  16.         <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public FUNKTION As String
  17.         <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public MyArray() As MYTabelle1
  18.         <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public Info As String
  19.     End Structure
  20.  
  21.     Declare Function CALLMYFUNKTION Lib "CALLMY" (ByRef VARIADATEN As MYSATZ) As Integer
  22.  
  23.     Public Sub MyCallProg()
  24.  
  25.  
  26.         Dim CblStatus As Integer
  27.  
  28.         Dim MYSATZSATZ001 = New MYSATZ
  29.  
  30.         MYSATZSATZ001.FUNKTION = WPFFunktion
  31.         MYSATZSATZ001.MyArray(0).TABFelder = WPFFeld1
  32.         MYSATZSATZ001.MyArray(1).TABFelder = WPFFeld2
  33.         MYSATZSATZ001.MyArray(2).TABFelder = WPFFeld3
  34.         MYSATZSATZ001.MyArray(3).TABFelder = WPFFeld4
  35.         MYSATZSATZ001.MyArray(4).TABFelder = WPFFeld5
  36.         MYSATZSATZ001.Info = WPFInfo
  37.  
  38.         CblStatus = CALLMYFUNKTION(MYSATZSATZ001)
  39.  
  40.         WPFFunktion = MYSATZSATZ001.FUNKTION.Trim(" ")
  41.         WPFFeld1 = MYSATZSATZ001.MyArray(0).TABFelder.Trim(" ")
  42.         WPFFeld2 = MYSATZSATZ001.MyArray(1).TABFelder.Trim(" ")
  43.         WPFFeld3 = MYSATZSATZ001.MyArray(2).TABFelder.Trim(" ")
  44.         WPFFeld4 = MYSATZSATZ001.MyArray(3).TABFelder.Trim(" ")
  45.         WPFFeld5 = MYSATZSATZ001.MyArray(4).TABFelder.Trim(" ")
  46.         WPFInfo = MYSATZSATZ001.Info.Trim(" ")
  47.  
  48.     End Sub
  49.  
  50. End Class
This lines are wrong:

Expand|Select|Wrap|Line Numbers
  1. MYSATZSATZ001.MyArray(0).TABFelder = WPFFeld1
  2. ...
  3.  
  4. WPFFeld1 = MYSATZSATZ001.MyArray(0).TABFelder.Trim(" ")
  5. ...
But why?
Feb 21 '12 #1
0 876

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Sam Collett | last post by:
How do I remove an item with a specified value from an array? i.e. array values 1,2,2,5,7,12,15,21 remove 2 from array would return 1,5,7,12,15,21 (12 and 21 are NOT removed, duplicates are...
1
by: Sam | last post by:
Hello all I have a two dimensional array (the dimensions are not known) that needs to be passed to fortran from c++, allocate the dimensions of the array in fortran code, do some filling up of...
2
by: Rick | last post by:
I have a situation where I have a method that I need to call. One of the parameters of this method is a string. There are potentially several string arrays that I could pass. Based on other...
1
by: Paul Steckler | last post by:
I'm using a managed C++ class that wants an unsigned char __gc as input. Is there a way to easily populate that array from a string constant (or wide string constant, etc.)? I'd like to do...
1
by: Wild Wind | last post by:
Hello, I have the following methods I've written to convert from String* to std::string and back: static void ConvertFromStdString(std::string& inStr, System:String* outStr) { outStr = new...
6
by: moondaddy | last post by:
I'm writing an app in vb.net 1.1 and need to convert a byte array into a string, and then from a string back to a byte array. for example Private mByte() as New Byte(4){11,22,33,44} Now how...
9
by: Mike | last post by:
Hello, How do I send an array from a form to another php page?I want to bundle up some data from form fields in an array and send them together like that. I must be missing something? Thanks Mike
14
by: Shhnwz.a | last post by:
Hi, I am in confusion regarding jargons. When it is technically correct to say.. String or Character Array.in c. just give me your perspectives in this issue. Thanx in Advance.
5
dlite922
by: dlite922 | last post by:
I can't believe I haven't come across this in all of my PHP programming (or my brain is currently locked)...I need to delete an array from an array that i'm traversing through with a foreach. ...
0
by: Marek Dohojda | last post by:
I need to split an output from a bash script and populate an array with it. So I can manipulate and print that later. Unfortunately I can not find a way to do that. so what I have thus far is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.