Solved

Strptr Example

Posted on 1998-08-09
1
540 Views
Last Modified: 2008-02-01
How can I access each character in string, I see a undocumented feature called strptr in VB 5.0.  How about a good example.
0
Comment
Question by:wesjon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
percosolator earned 20 total points
ID: 1468379
Didn't know about the StrPtr.  Looks to be that that function returns a memory address for the string.

You want to use a string function called "Mid$"

Example:
-----------------------------------

Sub LoopStr(S as String)

   Dim I as Integer

   For I = 1 To Len(S)

      MsgBox Mid$(S, I, 1)

   Next I

End Sub
-------------------------------

This routine iterates through each character in the string, and MsgBox's it to you, one at a time.

If you need more clarification, let me know.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question