473,399 Members | 2,774 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,399 software developers and data experts.

a two dimensional array question

Hi all,
I have a strange question which I cannot figure that out myself.
I tried to escape some apostrophe in the name string.
Function PrepCustomerDatatoArray(iTotNumCustomer)
dim CustInfoArr(50, 5)
....
for i=1 to iTotNumCustomer

If InStr(FName, "'") <0 Then
CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If
Response.Write CustInfoArr(i-1, 0) & "<br>" ' It displayed B''etty
If MInit<"" Then
CustInfoArr(i-1, 1)=MInit
End If
If InStr(LName, "'") <0 Then
CustInfoArr(i-1, 2)=EscStrApostrophe(LName)
Else
CustInfoArr(i-1, 2)=LName
End If
Response.Write CustInfoArr(i-1, 2) & "<br>" ' It displayed O''neal if
customer enter O'neal as last name
CustInfoArr(i-1, 3)=BDate

Next
'but here it what strange thing happened
'the fname and lname in array with apostrophe will become empty here
'but it display MInit and BirthDate OK
'if fields don't have apostrophe, it will be displayed fine
'what is going on the array is in the scope since mInit and bDate are fine
and if
'no apostrophe, everything is fine?
For i=1 to iTotNumInsured
Response.Write CustInfoArr(i-1, 0) & " " & CustInfoArr(i-1, 1) & " " &
CustInfoArr(i-1, 2) & " " & CustInfoArr(i-1, 3)
Next
End Function
--
Betty
Feb 3 '07 #1
4 1950
Hi Betty,

Would you please also post the code in EscStrApostrophe() here? This may
help us find the problem. Also, I suggest you may test with this: Replace
following code:

If InStr(FName, "'") <0 Then
CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If

With

CustInfoArr(i-1, 0)=FName

This won't call EscStrApostrophe() so we can check if this is the problem.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 5 '07 #2
Hi Luke,
Here is the function:

Function EscStrApostrophe(ByVal Str)
dim NameArr
dim NameStr
NameStr=""
NameArr=Split(Str, "'", -1)
For i=0 to UBound(NameArr)
NameStr=NameStr & NameArr(i) & "''"
Next
EscStrApostrophe=Left(NameStr, Len(NameStr)-2)
End Function
--
Betty
"Luke Zhang [MSFT]" wrote:
Hi Betty,

Would you please also post the code in EscStrApostrophe() here? This may
help us find the problem. Also, I suggest you may test with this: Replace
following code:

If InStr(FName, "'") <0 Then
CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If

With

CustInfoArr(i-1, 0)=FName

This won't call EscStrApostrophe() so we can check if this is the problem.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 5 '07 #3
Hi Betty,

Thank you for the code. I tested it and didn't find any issues with it.
Anyway, I suggets you may try following code instead:

CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If

with

CustInfoArr(i-1, 0)=replace(FName,"'","''")

The replace method can help us replace ' with ".

And, I also suggest you may debug in these code in Visua Interdev to see if
the passed parameters are empty, since we get no output, and the code is
correct.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 6 '07 #4
Luke,
Thank you for that. It should works. I appreciated
--
Betty
"Luke Zhang [MSFT]" wrote:
Hi Betty,

Thank you for the code. I tested it and didn't find any issues with it.
Anyway, I suggets you may try following code instead:

CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If

with

CustInfoArr(i-1, 0)=replace(FName,"'","''")

The replace method can help us replace ' with ".

And, I also suggest you may debug in these code in Visua Interdev to see if
the passed parameters are empty, since we get no output, and the code is
correct.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: smurf | last post by:
Seems a simple question, but I can't find a simple answer: I have created a two dimensional array. I wish to send the data, a row at a time to a graph plotting routine which is expected a one...
4
by: Todd | last post by:
I'm new to c++ and was wondering how to sort a 2 dimensional array. I'm using a select sort for 1 dimensional arrays but it is not working for a 2 dimensional array. The 2 dimensional array are...
2
by: ip4ram | last post by:
I used to work with C and have a set of libraries which allocate multi-dimensional arrays(2 and 3) with single malloc call. data_type **myarray =...
6
by: Ruben | last post by:
I'm trying to pass an array of string to a function without knowing how many strings I have beforehand. I've defined one functions as char * insert(char table,int cols, char values); out of...
4
by: Balaskas Evaggelos | last post by:
Hi, does anyone know how i can sort a multi-dimensional array by a specific field ? for example i want to sort arr where n=2, but i need the data of every array to follow that order. ...
6
by: fniles | last post by:
I need to store information in a 2 dimensional array. I understand ArrayList only works for a single dimensional array, is that correct ? So, I use the 2 dimensional array like in VB6. I pass the...
8
by: per9000 | last post by:
Hi all, I have a two-dimensional array of data, f.x int's. We can imagine that the array is "really large". Now I want the data in it and store this in a one-dimensional array. The obvious...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
5
by: nelly0 | last post by:
developing a program that will manipulate noise levels (measured in decibels) that is collected by car manufacturers. These noise levels are produced at seven different speeds by a maximum of six...
152
by: vippstar | last post by:
The subject might be misleading. Regardless, is this code valid: #include <stdio.h> void f(double *p, size_t size) { while(size--) printf("%f\n", *p++); } int main(void) { double array = { {...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.