?
Solved

Strptr Example

Posted on 1998-08-09
1
Medium Priority
?
561 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 80 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

800 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